Product EAV20 = an ERC-20-compatible contract on EAVM: official factory, decimals 6, Minimal and Managed flavours. Native TOKEN_* types still exist but are legacy — do not use TOKEN_CREATE to “create EAV20”.
TOKEN_CREATE / TOKEN_TRANSFER in chain state are not the EAV20 standard. They remain for fixtures and internal use. Apps and wallets should target the contract (factory → 0x).
You need EAVM contracts enabled and GB/energy for factory deploy or createMinimal.
EAVM_CALL (or eth_sendRawTransaction) against the factory. Emits TokenCreated(token, owner, symbol, kind).
| Field | Rule |
|---|---|
name | string — ERC20 name. |
symbol | string — display symbol; verified uniqueness is a product/explorer rule, not bytecode. |
decimals | uint8 — product default 6 (align EAV7); 18 only when porting Eth ERC20s. |
totalSupply | uint256 — initial supply credited to recipient. |
mintable | Managed only (owner mint). Minimal is immutable after deploy. |
Official path. The sample below uses EAVM_DEPLOY / EAVM_CALL; MetaMask hits the same factory over JSON-RPC.
Deploy EAV20Factory once, or call createMinimal/createManaged if it is already live. Token address comes from TokenCreated.
// 1) EAVM_DEPLOY do bytecode em contracts/artifacts/EAV20Factory.bin
// 2) EAVM_CALL createMinimal(name, symbol, decimals, supply, recipient)
// selector = keccak256("createMinimal(string,string,uint8,uint256,address)")[:4]
// 3) leia TokenCreated.topics[1] → endereço 0x do token
//
// Teste de referência: rust/tests/eav20_contract.rs
// eav20_factory_create_minimal_e_transferTokenCreated topic[1] (or call return). Explorer indexes by 0x, not TOKEN_* ids.
# evento TokenCreated — topic[1] = token (address)
# explorador / eth_getLogs filtrando o endereço da factory
curl -s https://eavscan.com/eavm/logs?address=0xFACTORY… \
| jq '.[] | select(.topics[0] | startswith("0x")) | .topics[1]'transfer(address,uint256) on the contract — same selectors and events as Ethereum.
// ERC20 transfer(address,uint256) — selector 0xa9059cbb
let input = encode_transfer("0x2222…2222", 250_000_000); // 250 tokens @ 6 decimals
cliente.executar("EAVM_CALL", 0, move |s| {
s.com_dados(JsonValue::map([
("to".into(), JsonValue::str("0xTOKEN…")),
("input".into(), JsonValue::str(&input)),
]))
})?;balanceOf / totalSupply / allowance on-chain; explorer aggregates Transfer for holders.
# on-chain: balanceOf / totalSupply / allowance (eth_call) # explorador: holders derivados de Transfer
Deploy and createMinimal burn weighted GB (Assinatura Livre), not the legacy FEES.TOKEN_CREATE flat fee.
10 000 000 e7 · 10 EAV7Legacy TOKEN_CREATE (10 EAV7) — not the product EAV20 path.20 000 e7ERC20 transfer on EAVM — CALL GB cost.10 · 210× deploy, 5× call (useful bytes × factor).Managed flavour only. Minimal has no admin, pause, or blacklist.
| Capability | Effect |
|---|---|
TOKEN_MINT | mint(to, value) — owner only. |
TOKEN_BURN | burn(value) — any non-blacklisted holder. |
TOKEN_APPROVE | approve / permit (EIP-2612) on Managed. |
TOKEN_TRANSFER_FROM | standard ERC20 transferFrom. |
TOKEN_PAUSE | setPaused — freezes transfer/mint/burn. |
TOKEN_BLACKLIST | setBlacklist — blocks an address on both ends. |
TOKEN_FREEZE | Not in Managed MVP; use blacklist/pause if needed. |