Sign Message with ethers.js
Sign and recover messages for authentication using ethers.js.
Annotated, copy-pasteable blockchain code examples in Solidity, Vyper, Rust, and JavaScript.
18 snippets
Sign and recover messages for authentication using ethers.js.
Read token prices from Chainlink price feeds in a Solidity contract.
An ERC-721 with Enumerable extension, allowing on-chain iteration of all minted tokens.
Build a Merkle tree and verify proofs in Python for whitelist verification.
Compute Keccak-256 hashes in Python, matching Solidity's keccak256 function.
Monitor current gas prices and EIP-1559 fee suggestions using web3.py.
Encode and decode ABI-calldata in Python for contract interaction.
Listen to and decode smart contract events using web3.py.
A linear token vesting contract that releases tokens over time with a cliff.
A minimal constant-product AMM (x*y=k) swap function, like Uniswap V2.
Sign and verify EIP-712 typed structured data for secure off-chain signatures.
Derive hierarchical deterministic (HD) wallet addresses from a mnemonic using BIP-32/BIP-44 in Python.
Implement ERC-2981 royalty standard to inform marketplaces of creator royalties.
Send a UserOp through an ERC-4337 bundler using viem and permissionless.
Generate a Merkle tree for whitelist verification and verify proofs on-chain.
Upload metadata or images to IPFS via Pinata's API for NFT metadata.
Estimate gas for contract interactions and check balance before sending.
A Solana counter program using the Anchor framework with PDA-based state storage.