Token Standards
A token standard implemented as a smart contract deploys on Base as it does on Ethereum. That includes ERC-20, ERC-721, ERC-1155, ERC-4626 vaults, and permissioned-token designs such as ERC-3643 and the ERC-1400 security token proposal. You or your provider deploy and maintain these contracts, and upgrade them if the implementation is upgradeable. The Base node does not implement them as native precompiles; they run as ordinary contract bytecode on the EVM. B20 is Base’s native token standard. It is implemented by precompiles in the node. It keeps selector and behavior parity with the core ERC-20 methods and events, so tools that use those methods and events work with B20 tokens. B20 method and event signatures are part of the chain’s consensus surface, and B20 changes ship at network upgrade boundaries. Existing selectors do not change and new functionality ships by addition, but an upgrade can include breaking behavior changes. Check the B20 changelog for the changes in each upgrade.How Base Differs
Base adds native precompiles at fixed addresses that extend the EVM with functionality built into the node itself, such as the B20 token standard, the PolicyRegistry, and the B20 Factory. These addresses hold no contract bytecode, so a local EVM that does not implement them reverts when a contract calls them. Foundry v1.8.4 and later implement Base’s precompiles inforge, cast, anvil, and chisel. Enable them by setting a Base hardfork, as shown below.
Set Up Your Environment
- Create a new project directory
Terminal
- Install Foundry v1.8.4 or later
Terminal
forge --version to confirm the version.
- Initialize a new Solidity project
Terminal
- Enable Base’s precompiles for local tests by adding a Base hardfork to the
[profile.default]section offoundry.toml:
foundry.toml
Counter contract in src/Counter.sol, which you can replace with your own contracts.
Configure a Node Connection and Deployer Key
- Create a
.envfile in your project root and add the Base RPC URLs
.env
- Load the variables
Terminal
- Store your deployer private key in Foundry’s secure keystore
Terminal
~/.foundry/keystores, which is not tracked by git.
Deploy a Contract
- (Optional) Dry-run the deployment to confirm your configuration:
Terminal
- Deploy by adding the
--broadcastflag:
Terminal
<contract-path>:<contract-name>.
- On success you’ll see the deployed address:
Example Output
Verify Your Deployment
- Check the transaction on Sepolia Basescan using the transaction hash.
- Read the contract’s state from the command line:
Terminal
Counter contract’s number variable, 0.
Next Steps
B20 Token Standard
Launch Base’s native token standard, built in at the precompile level.
Connect to Base
Network details, RPC endpoints, and wallet configuration.