Skip to main content

Remix Smart Contract Tutorial ERC20

Prerequisites: MetaMask Wallet

Set Up MetaMask

  1. Download MetaMask here if you don't already have it installed.

Note Make a dev wallet for development purposes. This will reduce risk in short and long term.

Step 1: Set up Network configuration

You can setup Telos Mainnet or Testnet at Chainlist or Teloscan (testnet) by clicking "Connect Wallet". The network settings in Metamask can be added manually as seen here:

Metamask Network Config

Telos Mainnet Settings:

Telos Testnet Settings:

Telos Websockets:

  • Testnet : wss://testnet.telos.net/evm
  • Mainnet: wss://mainnet.telos.net/evm

Step 2: Funding your Telos Testnet Account address

Using Test Network Faucet

You can use the Test Network Faucet to acquire funds for the test network Go to Testnet Faucet

Testnet Faucet

Paste your address from Metamask in the space above the SEND TESTNET EVM TLOS button. Once completed, you will receive testnet funds to work with and write data to the blockchain.

Step 3: Connect MetaMask and deploy a smart contract using Remix

Open Remix

  1. Load or create the smart contracts you want to compile and deploy using Remix file explorer. Click the contracts tab and create a file named MyEpicToken.sol.

  2. For this example, we will deploy this ERC20 contract from Open Zeppelin

  3. Copy and Paste the smart contract from Open Zeppelin under the contracts folder into MyEpicToken.sol file. ERC20 Token Pic

  4. Change network to Web3Injected to integrate Telos Testnet Through MetaMask Click on Ethereum Deploy Logo on the side

web3injected pic Then MetaMask will pop up, Click Next & allow the wallet to connect to Remix

  1. The next step is to compile the contract into byte code so the Telos EVM can read the state changes being made from our Solidity program. Note the compile version at the top. Always match it to the compiler you program. It will declare with Pragma. Once complete, the byte code will be ready to compile.

compile pic

  1. Time for Deployment.
  • Click on the contract you have created called GLD Token that inherits the ERC20 standards
  • Under Deploy, insert initial supply that will be passed to the constructor
  • Transact

transact

  1. Call data from the blockchain to test view methods from ERC20 contract inherited. View the contract address where ERC20 is located.

calldata

You can now go to Open Zeppelin and other Open Source sites to copy and paste contracts and easily interact with them on the Telos blockchain Network.