For the complete documentation index, see llms.txt. This page is also available as Markdown.

EIP-712 typed data

Every signed operation in Sail is EIP-712 typed data. This page lists the exact type strings the kernel verifies (from SailKernel), plus the template Configure type from BaseSharedPermission. All type hashes are keccak256 of the type string shown.

Domain

EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)
  name              = "SailKernel"
  version           = "1"
  chainId           = <the chain>
  verifyingContract = <the SailKernel address>

kernel.hashTypedDataV4(structHash) applies this domain on-chain; equivalently keccak256("\x19\x01" ++ domainSeparator ++ structHash).

Manager operations (signed by manager)

Dispatch(address account,address permission,address target,uint256 value,bytes32 dataHash,uint256 nonce,uint256 deadline)
DispatchBatch(address account,address permission,bytes32 callsHash,uint256 nonce,uint256 deadline)
  • dataHash = keccak256(data); nonce = managerNonces[account].

  • callsHash = keccak256(abi.encode(calls)); nonce = batchNonces[account].

Permission-signer operations (signed by permissionSigner)

All use nonce = signerNonces[account].

Template configuration (signed by permissionSigner, verified by the template)

  • paramsHash = keccak256(params); nonce = template.configNonces(account).

  • Verified against the EIP-712 domain of the template (each shared template is its own EIP712 domain, e.g. name = "SharedBoundedSwapPermission", version = "1"), not the kernel.

Encoding address[]

For RegisterPermissions / RevokePermissions / ReplacePermissions, an address[] field is encoded per EIP-712 §4 as the keccak256 of the ABI-encoded, zero-padded addresses:

(The kernel's _hashAddressArray builds a bytes32[] of zero-padded addresses and hashes the packed result.)

Building a digest (example: Dispatch)

Signatures are verified with _recoverOrERC1271: ECDSA first, then ERC-1271 fallback for contract signers — so managers and permission signers may be EOAs, multisigs, or smart accounts.

Last updated