Skip to Content
EVMPointers Deep Dive

Pointers Deep Dive

The Pointer and PointerView precompiles bridge Cosmos assets and identities into Sei’s EVM. This guide covers the write/read split, typical mapping patterns, and operational safeguards before you dive into the individual ABI docs.

When to use Pointer vs PointerView

Mapping patterns

Use Pointer for ownership/actions; use PointerView for safe queries. Contracts should never rely on off-chain caches for ownership truth.

Identifiers

ERC721 ↔ CW721tokenId ↔ cw_token_id
ERC1155 ↔ CW1155id ↔ cw_token_id
OwnerEVM address ↔ bech32 address

Examples

Register a CW20 token for EVM access

pragma solidity ^0.8.20; interface IPointer { function addCW20Pointer(string calldata cwToken, address evmToken) external; } contract CW20Registrar { IPointer public immutable pointer; constructor(address pointerAddr) { pointer = IPointer(pointerAddr); } function register(string calldata cwToken, address evmToken) external { pointer.addCW20Pointer(cwToken, evmToken); } }

Resolve ownership via PointerView

pragma solidity ^0.8.20; interface IPointerView { function getCW721Pointer(string calldata cwCollection) external view returns (address); } contract OwnershipLens { IPointerView public immutable viewContract; constructor(address pointerView) { viewContract = IPointerView(pointerView); } function ownerContract(string calldata cwCollection) external view returns (address) { return viewContract.getCW721Pointer(cwCollection); } }

Operational checklist

Audit CW contractsEnsure token identifiers are immutable before registering pointers.
Gate writesRoute pointer mutations through trusted admin/governance contracts.
BackupsExport pointer tables periodically—they are critical state.
IndexersConsume Pointer events and reconcile with PointerView reads to detect drift.

Troubleshooting

ErrorCauseFix
Pointer already existsMapping previously created for the same CW contract/token id.Verify intended target; rotate with dedicated migration scripts if needed.
Pointer not found in PointerViewLookup is hitting the wrong namespace or stale deployment.Use the correct getter (getCW20Pointer, getCW721Pointer, etc.) and check network aliases.
Events missingPointerRegistered log not captured by indexer.Replay from the registration block or rebuild mappings directly from PointerView.
Unauthorized pointer writeWrite exposed to untrusted accounts.Restrict add*Pointer to admin modules and monitor for rogue transactions.
Last updated on