David Tiw Minjie
← All work

02 · Web3 application

ERC-20 Contracts

Solidity contracts with a clear split between public entry points and private logic, settling value as ERC-20 transfers.

SolidityERC-20EVMReact

Overview

A Web3 application built on Solidity smart contracts. Execution is split between functions the world can call and functions only the contract can reach, and value moves as ERC-20 token transfers.

Contract design

Public surface. The public and external functions are the contract's API. They validate the caller and inputs, then hand off.

Private execution. State changes live in internal and private functions, which can't be invoked directly. That keeps every mutation behind a checked entry point.

  1. CallerWallet or dApp
  2. externalChecks & guards
  3. privateState transition
  4. ERC-20transfer / transferFrom
  5. EventTransfer log

The grid

The 16×16 square above is 256 bits. It settles on keccak256("Transfer(address,address,uint256)"), the topic every ERC-20 Transfer event is logged under:

0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef