← Back

ERC-20 Deploy

Deploy your own ERC-20 token on Base

Deploy Instructions

  1. Open smart-contract/ directory
  2. Run npx hardhat run scripts/deploy.js --network baseSepolia
  3. Follow the prompts for name, symbol, supply
  4. Confirm the deployment transaction in your wallet

Contract Code

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract MyToken is ERC20 {
    constructor(string memory name, string memory sym, uint256 initialSupply)
        ERC20(name, sym) {
        _mint(msg.sender, initialSupply * 10 ** decimals());
    }
}