Deploying ERC-20 on Buburuza

Buburuza, built on Arbitrum's Layer 3 architecture, offers a scalable and cost-effective environment for deploying smart contracts. By following the steps below, you can deploy your ERC-20 token using Solidity.

1. Write Your ERC-20 Token Contract

Begin by drafting your ERC-20 token contract in Solidity. Here's a basic example:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract BubToken is ERC20 {
    constructor(uint256 initialSupply) ERC20("BubToken", "BUB") {
        _mint(msg.sender, initialSupply);
    }
}

This contract uses OpenZeppelin's ERC20 implementation to create a token named "BubToken" with the symbol "BUB". The constructor mints an initial supply to the deployer's address.

2. Set Up Your Development Environment

To compile and deploy your contract, you'll need:

  • Remix IDE: An online Solidity IDE.

  • MetaMask: A browser extension for managing your Ethereum accounts.

  • Arbitrum Sepolia Testnet: A test network for deploying contracts on Arbitrum.

Ensure your MetaMask wallet is connected to the Arbitrum Sepolia testnet. You can obtain test ETH from a faucet to cover deployment costs.

3. Compile the Contract

In Remix IDE:

  • Navigate to the "Solidity Compiler" tab.

  • Select the appropriate compiler version (e.g., 0.8.9).

  • Click "Compile BubToken.sol".

4. Deploy the Contract

In Remix IDE:

  • Go to the "Deploy & Run Transactions" tab.

  • Set the "Environment" to "Injected Web3" to use MetaMask.

  • Ensure your MetaMask is connected to the Arbitrum Sepolia testnet.

  • In the "Deploy" section, input the initial supply (e.g., 1000000 for 1 million tokens).

  • Click "Deploy" and confirm the transaction in MetaMask.

Once deployed, Remix will display the contract address. You can interact with your contract directly from Remix or use a blockchain explorer like Arbiscan to view transaction details.

5. Verify and Interact with the Contract

To verify your contract on Arbiscan:

  • Navigate to Arbiscan.

  • Search for your contract address.

  • Click on the contract address to view details.

  • Under the "Contract" tab, click "Verify and Publish".

  • Fill in the required details and submit.

After verification, you can interact with your contract through the "Write Contract" and "Read Contract" tabs on Arbiscan.

Last updated