
What will you find here?
In here you will find many ERC functions ready to be used, either to read the blockchain or to write to it
Philosophy
This module aims to be an un-opinionated representation of the defined:
Currently supports
Want to see one added?
Please, if this is the case, ask for it in an issue
Want to generate them yourself?
That said, you can generate your own functions (ready to be used) if you provide a valid ABI in .json format. Check the CLI package
Modules
Table of contents
API
Executing ERC20 method
import { transfer } from "@ethernauta/erc/20";
import { writer, SEPOLIA_CHAIN_ID } from "./writer";
const writable = transfer([
"0x636c0fcd6da2207abfa80427b556695a4ad0af94",
number_to_hex(1),
])
const hash = await writable(
writer(SEPOLIA_CHAIN_ID),
)
Executing ERC721 method
import { approve } from "@ethernauta/erc/721";
import { writer, SEPOLIA_CHAIN_ID } from "./writer";
const writable = approve([
"0x636c0fcd6da2207abfa80427b556695a4ad0af94",
"57896044618658097711785492504343953926634992332820282019728792003956564819967",
])
const hash = await writable(
writer(SEPOLIA_CHAIN_ID),
)