Write ERC-20 Contract | WEMIX3.0 (2024)

It is possible to proceed an ERC-20 contract deployment test using Remix.

Caution

Once deployed contracts cannot be modified or deleted. Please write and deploy the necessary information in the code.

Let's proceed with the contract deployment process in the order below.

  • Step 1 : Access the Remix and Create a file

  • Step 2 : Write ERC-20 Contract

  • Step 3 : Move to SOLIDITY COMPILER tap, Set the version, and Compile

  • Step 4 : Set DEPLOY & RUN TRANSACTIONS

  • Step 5 : Set Gas fee and Sign at MetaMask

Step 1 : Access the Remix and Create a file

Go to https://remix.ethereum.org.

Storage.sol, Owner.sol, and Ballot.sol are shown in the contracts directory. To create a new smart contract, select them to erase it and create a new file.

The figure below shows an example of creating WEMIX_ERC20.sol file in the contracts directory.

Step 2 : Write ERC-20 Contract

You can create the following ERC-20 contracts:

// SPDX-License-Identifier: MITpragma solidity ^0.8.19;import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol";contract MyToken is ERC20 { constructor(string memory name, string memory symbol) ERC20(name, symbol) { // Mint 100 tokens to msg.sender // Similar to how // 1 dollar = 100 cents // 1 token = 1 * (10 ** decimals) _mint(msg.sender, 99999999 * 10**uint(decimals())); }}

The figure below is an example of the above code in the WEMIX_ERC20.sol.

Step 3 : Move to SOLIDITY COMPILER tap, Set Version, and Compile

Once the code is written, compile after selecting the correct compiler version on the Solidity Compiler screen.

The compiler version of the example code provided is 0.8.19.

Step 4 : Set DEPLOY & RUN TRANSACTIONS

On the Deploy & Run Transactions screen, select the environment to deploy smart contracts to test.

The figure below shows an example of deploying to WEMIX3.0 Testnet using the 'Injected Provider - Metamask' provided by Remix.

If ENVIRONEMNT is selected as 'Injected Provider - MetaMask', it is connected to MetaMask, which requires the network to be 'WEMIX_Testnet' connection.For more information about MetaMask connection, see Use MetaMask.

In CONTRACT, find MyToken and type the name and symbol you want in 'string name' and 'string symbol' in the input field next to Deploy.

The figure below is an example of designating 'WTOKEN', 'WT'.

Step 5 : Set Gas Fee and Sign at MetaMask

After setting on the Deploy & Run Transactions, if you select 'deploy' button, the MetaMask pop-up appears. The screen showing 'Gas Fee' based on Ethereum will be displayed as shown below.

WEMIX has a different fee policy than Ethereum, so press the 'Site suggested' button to change t the Gas Fee.

Selecting 'Advanced' on the screen below allows the user to set 'Max priority fee (GWEI)' and 'Max fee (GWEI)' manually.

Currently, WEMIX is using a fixed 'Max priority fee (GWEI)' and the value is 100.

Max fee is a user-defined value and the minimum value is MaxPriorityFee+BASE_FEE.

BASE_FEE in WEMIX is variable according to EIP-1559. Therefore, for a transaction to be successfully created, it is recommended to set it as follows.

  1. Max base fee (GWEI) = 101

  2. Max priority fee (GWEI) = 100

Complete the Fee setup in the figure above and select 'Save' to be ready for deployment as shown below.

Select 'Confirm' in the figure above to proceed with the contract deployment.

If a green check mark appears at the bottom of the Remix screen as shown below, the deployment is completed normally.

Write ERC-20 Contract | WEMIX3.0 (2024)

FAQs

How to write an ERC20 smart contract? ›

0 Testnet.
  1. Step 1 : Access the Remix and Create a file. Go to https://remix.ethereum.org. ...
  2. Step 2 : Write ERC-20 Contract. You can create the following ERC-20 contracts: ...
  3. Step 3 : Move to SOLIDITY COMPILER tap, Set Version, and Compile. ...
  4. Step 4 : Set DEPLOY & RUN TRANSACTIONS. ...
  5. Step 5 : Set Gas Fee and Sign at MetaMask.

How do I create my own ERC20 token? ›

How to Create an ERC-20 Token
  1. Set Up your Developer Environment. First, create an Alchemy account, and set up Metamask, HardHat, and Solidity for this project. ...
  2. Write ERC-20 Token Smart Contract. ...
  3. Write a Deployment Script for your ERC-20 Token. ...
  4. Deploy your ERC-20 Token to Goerli. ...
  5. Step 4: Send Some Tokens!

What is the standard ERC20 contract? ›

ERC20 is a community-proposed standard for smart contracts and tokens associated with them. The standard allows users to transfer tokens and be re-used by any other Ethereum application. It also makes it easier for them to be approved because the standardized elements must all be present.

How to create a token smart contract? ›

Creating Ethereum ERC20 Smart Contract
  1. Step 1: Decide what you want your Token to be.
  2. Step 2: Code the Contract.
  3. Step 3: Test the Token on the TestNet.
  4. Watch the Custom Token.
  5. Verify the Source Code.

What is the programming language for Ethereum smart contract? ›

Solidity is the most popular blockchain programming language of the Ethereum Virtual Machine (EVM), also widely used across a range of EVM-compatible blockchains.

Where do I write a smart contract? ›

To begin, you'll need an environment in which to write your contract, such as an integrated development environment (IDE). Remix is an example of a great IDE starting place for developing a smart contract. It's an open-source application that works on your desktop and as a web application.

What is the ERC20 format? ›

ERC-20 is the acronym used to refer to Ethereum Request for Comment number 20. It is a standard for creating interoperable tokens on the Ethereum Virtual Machine.

How to create an ERC20 wallet address? ›

To create a ERC20 wallet, simply download the Noone wallet app from App Store or Google Play, follow the setup instructions, and choose to create a new ERC20 wallet.

Why is it so expensive to send ERC20? ›

When you make a transaction, it competes with other transactions to get to the next block and send it to the network for verification. So if the network is congested and your competitors may pay extra to push deals ahead of everyone else. This increases gas costs.

What is the difference between a smart contract and a token? ›

Smart contracts can be used to create, manage, or serve as the description of tokens. A token is a digital representation of an asset that can include artwork, cryptocurrency, carbon credits, etc.

How much does it cost to create an ERC20 token? ›

On average, the cost to create ERC20 token lies between $5000 to $10,000, depending on the type of token developed and business requirements.

Can I create my own token? ›

Create your own cryptocurrency token through coding

As a blockchain developer, you can code your token as you like, without any restrictions. Creating your own blockchain for your own token is the best option, especially if you are a token creator with big innovative plans.

How do I deploy an ERC20 smart contract? ›

For deployment, use the Injected Provider option under the Environment. Before the deployment, ensure that your MetaMask is set to the Sepolia testnet, and MyToken contract is the selected contract to be deployed. Finally, click on the Deploy button to deploy your contract.

What is the format for ERC20 address? ›

The exchange will make it clear what type of chain they are using; however, one easy way to differentiate between these two is by the way the address is structured. An ERC20 Address only starts with '0' and 'x'. For example: 0xbc6e. A TRC20 Address only begins with a capital 'T'.

How do you create a smart contract on Ethereum? ›

Create and Deploy your Smart Contract
  1. Step 1: Connect to the Ethereum network. ...
  2. Step 2: Create your app (and API key) ...
  3. Step 3: Create an Ethereum account (address) ...
  4. Step 4: Add ether from a Faucet. ...
  5. Step 5: Check your Balance. ...
  6. Step 6: Initialize our project. ...
  7. Step 7: Download Hardhat. ...
  8. Step 8: Create Hardhat project.

Top Articles
Is There a Dark Side to ESG?
The anti-ESG backlash is not just an American phenomenon as Europe waters down its sustainability agenda
Hometown Pizza Sheridan Menu
Jail Inquiry | Polk County Sheriff's Office
Melson Funeral Services Obituaries
Asian Feels Login
Devotion Showtimes Near Mjr Universal Grand Cinema 16
Tx Rrc Drilling Permit Query
Nieuwe en jong gebruikte campers
R Tiktoksweets
Conduent Connect Feps Login
18443168434
Trini Sandwich Crossword Clue
Washington Poe en Tilly Bradshaw 1 - Brandoffer, M.W. Craven | 9789024594917 | Boeken | bol
180 Best Persuasive Essay Topics Ideas For Students in 2024
Truck Trader Pennsylvania
Char-Em Isd
Aldi Süd Prospekt ᐅ Aktuelle Angebote online blättern
Inside the life of 17-year-old Charli D'Amelio, the most popular TikTok star in the world who now has her own TV show and clothing line
Nail Salon Goodman Plaza
De beste uitvaartdiensten die goede rituele diensten aanbieden voor de laatste rituelen
Hermitcraft Texture Pack
Best Mechanics Near You - Brake Masters Auto Repair Shops
Puss In Boots: The Last Wish Showtimes Near Cinépolis Vista
Brazos Valley Busted Newspaper
UMvC3 OTT: Welcome to 2013!
Elite Dangerous How To Scan Nav Beacon
Urban Dictionary Fov
Wat is een hickmann?
Gma' Deals & Steals Today
Speechwire Login
Riverstock Apartments Photos
031515 828
ATM, 3813 N Woodlawn Blvd, Wichita, KS 67220, US - MapQuest
Craig Woolard Net Worth
The Hoplite Revolution and the Rise of the Polis
Max 80 Orl
Grapes And Hops Festival Jamestown Ny
Craigslist Georgia Homes For Sale By Owner
Top 25 E-Commerce Companies Using FedEx
Craigs List Palm Springs
Sour OG is a chill recreational strain -- just have healthy snacks nearby (cannabis review)
Gas Buddy Il
Wgu Admissions Login
Paperlessemployee/Dollartree
Actress Zazie Crossword Clue
Latina Webcam Lesbian
Phunextra
Erica Mena Net Worth Forbes
Rocket Bot Royale Unblocked Games 66
Convert Celsius to Kelvin
Famous Dave's BBQ Catering, BBQ Catering Packages, Handcrafted Catering, Famous Dave's | Famous Dave's BBQ Restaurant
Latest Posts
Article information

Author: Fr. Dewey Fisher

Last Updated:

Views: 5684

Rating: 4.1 / 5 (42 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Fr. Dewey Fisher

Birthday: 1993-03-26

Address: 917 Hyun Views, Rogahnmouth, KY 91013-8827

Phone: +5938540192553

Job: Administration Developer

Hobby: Embroidery, Horseback riding, Juggling, Urban exploration, Skiing, Cycling, Handball

Introduction: My name is Fr. Dewey Fisher, I am a powerful, open, faithful, combative, spotless, faithful, fair person who loves writing and wants to share my knowledge and understanding with you.