ANS Docs, but make it clean + usable
Everything you need to integrate Abstract Name Service. Straightforward, minimal, and made for builders who ship fast.
Overview
ANS is a naming layer on Abstract Chain. Each .abs name is an ERC‑721 token, and name resolution is built directly into the contract. Names are case‑insensitive and normalized to lowercase.
Upgradeable
UUPS proxy pattern
Ownership
ERC‑721 tokenized
Resolution
On‑chain records
Validation
a‑z, 0‑9, hyphen
Status
- Core contract and name registration are live.
- MetaMask Snap is in progress and not available yet.
- Coupons, discounts, and migration flows are supported.
Quickstart
Register a name
Payable call. Checks availability and validity, then mints an NFT.
register(name)Register with a coupon
Applies a coupon discount (if active and not expired).
registerWithCoupon(name, couponCode)Set a record
Attach an address or string record to your name.
setRecord(name, record)Resolve a name
Returns the owner address for a name.
getAddress(name)Get a record
Returns the stored record for a name.
getRecord(name)Transfer a name
Transfers the domain (and NFT ownership).
transferDomain(name, to)Integration Guide
ANS resolution is fully on‑chain. The contract stores ownership, records, and reverse lookups. Use these read methods to integrate into your dApp.
Resolve Name to Address
getAddress(name)Returns the owner address of a name.
Resolve Name to Record
getRecord(name)Returns the stored record (address or string).
Reverse Lookup
getNameByAddress(address)Returns the name that has the address as its record.
Name Validation
valid(name)True for a‑z, 0‑9, and hyphen only. Names are normalized to lowercase.
Name Rules
- Length must be 1+ characters.
- Allowed characters: a‑z, 0‑9, and hyphen (-).
- Names are normalized to lowercase (case‑insensitive).
- Trying to register an existing name reverts.
Pricing
Price scales by length. Shorter names are premium. Holding a qualifying NFT cuts the price by 50%.
Records + Reverse Lookup
Records are stored per name. If a record is a valid address, it is normalized and tracked for reverse lookup so a wallet can map back to a name.
Resolve Address
getAddress(name)Reverse Lookup
getNameByAddress(address)Coupons + Discounts
Coupons can be created by the contract owner and have a discount percentage, max uses, and expiry. Registration checks coupon validity on‑chain.
- createCoupon(code, discount, maxUses, validityDays)
- deactivateCoupon(code)
- applyDiscount(price, code)
Migration
Users can migrate from a previous ANS contract by burning their old token to the dead address and minting a new name of equal length.
migrateFromOldContract(oldTokenId, newName)Events
For integration, index these events to keep your app synced with on‑chain changes.