Configure a shared template
Sailor can register a shared template — a permission deployed once and configured per account — instead of authoring a permission from scratch.
The seven shared templates
Section titled “The seven shared templates”Sail Protocol’s seven shared permission templates are deployed today — multi-tenant singletons at the same CREATE2 address on all 12 supported chains, registered as knownTemplates in the SDK deployment registry. You don’t deploy them; you register one on your SMA and configure your own bounds:
| Template | Bounds |
|---|---|
SwapPermission | DEX swaps: router + token allowlists, per-tx cap, mandatory oracle slippage band |
SwapPermissionNoOracle | Swaps for tokens without an oracle: allowlists + cap + live-pool sanity band |
BorrowPermission | Borrowing: protocol + asset allowlist, cap, on-chain LTV check |
DepositPermission | Deposits into ERC-4626 vaults / Aave: target + token bounds, cap |
WithdrawPermission | Bounded position exits — ERC-4626 vault withdraw/redeem and Aave v2/v3 pool withdraw — with proceeds paid only to the account itself (target allowlist + per-tx cap) |
TransferPermission | Moves ERC-20 tokens the SMA already holds out to a pinned recipient: token + recipient allowlists, per-transfer caps |
ApproveAndCallBatchPermission | Atomic approve → call → reset-to-zero batches |
See what’s live on your chain:
sailor mandate templates # deployed template addresses + how to author your ownsailor capabilities # chains, kernel model, mandate templates, strategy primitives (read-only)Their addresses are in the Protocol → Deployment addresses, and each template has a dedicated skill that carries its exact parameter schema and the safe order of operations.
Register, then configure
Section titled “Register, then configure”sailor mandate register only registers a template — you must also configure the per-account bounds:
# 1. Register (owner signs an EIP-712 RegisterPermission in the browser):sailor mandate register --address <templateAddress> --sma <yourSMA>
# 2. Configure your bounds (tokens, caps, venues) for that template:sailor mandate configure --address <templateAddress> \ --template SwapPermission --args-file swap-config.jsonThe sailor-template-* skills drive this conversationally with the correct schema per template. --simulate-only on configure gives a gas-free preflight.
Always simulate first
Section titled “Always simulate first”Prove the configured template accepts and rejects the right calls before authorizing:
sailor mandate simulate --address <templateAddress> --sma <yourSMA> --calls ./samples.jsonSee Simulate before going live. Then register/confirm exactly as in Build & register a mandate.
WithdrawPermission vs TransferPermission — which one?
Section titled “WithdrawPermission vs TransferPermission — which one?”These two are easy to confuse; they do opposite things:
WithdrawPermissionexits a position — it redeems from an ERC-4626 vault or an Aave v2/v3 pool, and the proceeds land in the SMA itself. It cannot send funds to any other address.TransferPermissionmoves tokens out — it sends ERC-20 tokens the SMA already holds to a pinned external recipient.
So: “exit this vault position” → WithdrawPermission. “get my money out of the SMA” / “send held tokens to my wallet” → TransferPermission (with a one-entry recipient allowlist). An exit and a payout are two permissions, not one.
WithdrawPermission carries a few non-obvious rules — the redeem cap counts shares, not assets; the token allowlist binds only the Aave path; and Compound / Aave v4 are deliberately unsupported. The sailor-template-withdraw skill has the exact schema.