Neo Standards Auto-Detection
Back to Standards and Contracts
The neo-solc compiler analyzes your contract's public methods and events to automatically detect which NEP standards it implements. Detection results populate the manifest's supportedstandards array.
NEP-17 Detection
All 5 methods must be present as public/external functions:
symbol, decimals, totalSupply, balanceOf, transferAdditional rules:
ownerOfmust not be present (its presence signals NEP-11 instead)- A
Transferevent with 3 parameters is expected - The
transfermethod should have 4 parameters(from, to, amount, data) - Near-miss warning: if 3+ of 5 methods are present but not all, the compiler emits a warning listing the missing methods
NEP-11 Detection
Core requirement:
balanceOfandownerOfmust both be present
Plus at least one of:
transfertransferFromtokensOf
Additional checks:
- A
Transferevent with 4 parameters is expected - The
transfermethod should have 3 parameters(to, tokenId, data) - Near-miss warnings:
ownerOfwithout a transfer mechanism, orownerOf+ transfer withoutbalanceOf
NEP-24 Detection
Either of these methods triggers detection:
tokenUriroyaltyInfo
Additional NEP Detection
The compiler also auto-detects these contract-lifecycle and callback standards:
NEP-22:update(nefFile, manifest, data)NEP-26:onNEP11Payment(from, amount, tokenId, data)NEP-27:onNEP17Payment(from, amount, data)NEP-29:_deploy(data, update)NEP-30:verify(...) -> boolNEP-31:destroy()
Checking Detection Results
After compilation, inspect the manifest to verify detected standards:
bash
neo-solc MyToken.sol -I devpack -O2 -o build/MyToken
cat build/MyToken/MyToken.manifest.json | jq '.supportedstandards'
# Expected: ["NEP-17"]