Back to Videos

Deploy an ERC-20-for-SPL token on Neon EVM and test on Solana

Tuesday, May 6, 2025

Neon Dev Bootcamp – Week 1: Deploy an ERC-20-for-SPL token on Neon EVM and test on Solana

Welcome to this hands-on tutorial where you'll learn how to deploy an ERC-20-for-SPL Mintable token using Neon EVM and test composability between Ethereum and Solana.

Lesson Outline

  1. What is Neon EVM and why use it?
  2. What is an ERC-20-for-SPL token?
  3. Setting up your dev environment
  4. Deploying the ERC-20-for-SPL token contract
  5. Sending a composability request to Solana

1. What is Neon EVM?

Neon EVM is a fully Ethereum-compatible execution environment built on Solana. It lets you deploy Solidity smart contracts to interact with programs on Solana without rewriting your contracts in Rust.

Why Neon?

  • Use existing Ethereum tools (Solidity, Hardhat, ethers.js)
  • Composability: generate Solana-specific instructions from Solidity contracts to resolve the differences in the logic between Solana’s account model and Ethereum’s contract model
  • Speed: Solana’s parallel execution and lower fees
  • Interoperability: create & deploy EVM dApps and interact with Solana programs

Neon resolves the architectural discrepancies between the EVM and Solana with the help of composability feature. For example, while Ethereum tracks balances in contract storage, Solana uses separate accounts, which Neon’s composability abstracts away for you via precompiles and helper libraries.

2. What is an ERC-20-for-SPL Token?

ERC-20-for-SPL tokens are hybrid tokens unique to Neon EVM. They offer an ERC-20 interface for Solana SPL tokens, enabling Solana-native tokens to be accessed using Ethereum tools.

There are two types:

  • Standard ERC-20-for-SPL: Wraps an existing SPL token
  • Mintable ERC-20-for-SPL (what we'll use): Creates a new SPL token and wraps it with an ERC-20 interface

Key difference: Instead of writing an ERC-20 contract from scratch, you'll use Neon’s pre-deployed Factory Contract to mint a new SPL token and generate a connected ERC-20 interface.

The ERC20forSPL standard allows Solidity contracts to:

  • Check balances of SPL tokens
  • Transfer tokens
  • Set allowances

As a crucial part of Neon’s composability feature, ERC20ForSPL exposes an ERC-20-compatible Solidity interface, allowing Ethereum-based smart contracts and user interfaces to interact with SPL tokens using familiar function signatures such as transfer(address,uint256), transferFrom(address,address,uint256), and balanceOf(address).

Underlying Solana account operations remain entirely abstracted from the Solidity developer’s perspective with composability helper libraries and precompiled contracts.

Deep dive into composability feature: https://neonevm.org/blog/unveiling-composability-whitepaper-a-unified-framework-for-ethereum–solana-interaction

3. Setting Up Your Environment

1. Configure MetaMask for Neon Devnet:

  • RPC URL: https://devnet.neonevm.org
  • Chain ID: 245022926
  • Currency Symbol: NEON
  • Explorer: https://neon-devnet.blockscout.com/

2. Get Devnet Tokens:

3. Set Up Hardhat Project:

npm install --save-dev @nomicfoundation/hardhat-toolbox
npm install --save @solana/web3.js @solana/spl-token bs58 dotenv

Update your hardhat.config.js to include:


networks: {
 neondevnet: {
   url: "<https://devnet.neonevm.org>",
   chainId: 245022926,
   accounts: [process.env.PRIVATE_KEY_OWNER],
 },
}

For full setup, check:

4. Deploying a Mintable ERC-20-for-SPL Token

Instead of coding a custom ERC-20, you’ll use Neon’s Factory Contract to generate a Mintable ERC-20-for-SPL token.

This process will:

  1. Mint a new SPL token on Solana
  2. Wrap it in an ERC-20 interface for EVM tools
  3. Assign mint authority to your EVM wallet (MetaMask)

Define Token Parameters:

  • Name: e.g., "MyNeonToken"
  • Symbol: e.g., "NEONFT"
  • Decimals: Usually 6 or 9 (we’ll use 9 for max precision)
  • Mint Authority: Your wallet (the deployer) specified in env file (see below at Final step: run the script)

   //Example code to Deploy ERC20ForSplMintable contract
   tx = await ERC20ForSplFactory.createErc20ForSplMintable("devBOOTCAMP TOKEN " + Date.now().toString(), "DBT", 9, user1.address);
   await tx.wait(1);

Deploy via Factory

  • Use the Neon factory at its devnet address (0xF6b17787154C418d5773Ea22Afc87A95CAA3e957)
  • Call the factory method (e.g., createERC20ForSplMintable(name, symbol, decimals, mintAuthority

All ERC-20 functions like transfer, balanceOf, etc., are provided by Neon’s precompiled contracts, no need to implement them manually.

5. Send a Composability Request to Solana

You’ll test EVM-to-Solana interaction using a helper contract: TestDevBootcamp.sol.

This includes:

Here’s how balances work under the hood:

  • Balances are not stored in contract storage like Ethereum.
  • They live in Solana token accounts controlled by the Neon EVM program.
  • You interact with these accounts using precompiles and building Solana instructions with helper libraries created by Neon EVM.

Final Step: Run the Script

Clone the tutorial repo and run the script (link to the script):


git clone git@github.com:neonlabsorg/neon-tutorials.git
cd neon-tutorials
git checkout -b dev-bootcamp-video
npm install
cp .env.example .env

Edit your .env file:

  • PRIVATE_KEY_OWNER: Your MetaMask private key (get NEON tokens first!)
  • PRIVATE_KEY_SOLANA: Your Solana keypair in base58 (get SOL from faucet)
  • USER1_KEY: Can be a random dummy key for now

Run the deployment:


npx hardhat run scripts/TestCallSolana/TestDevBootcamp.js --network neondevnet

You’ll see:

  • ERC-20-for-SPL contract deployed
  • SPL token minted
  • Tokens transferred using a composability request

Summary

By the end of this tutorial, you’ll have:

  • Created a mintable ERC-20-for-SPL token using Neon EVM factory
  • Understood how Neon connects EVM and Solana using composability feature
  • Performed a composable transfer from your Solidity contract

Practice Exercise

Beginner task: Deploy an ERC-20-for-SPL Mintable token using Neon EVM factory contract

Intermediate task: Replicate the same transfer composability request

Advanced task: Write your own composability request by using precompiled contracts

Back to Videos