Neon EVM 🛠How to scale Ethereum dApps on Solana using Neon EVM
ETHGlobal·Wed, Oct 9, 2024, 12:00 AM
Join Sukanya Parashar of Neon EVM for a workshop where you'll learn: - How Ethereum-like transactions are getting executed and finalized on Solana; - What are precompiles and how they can be used to interact natively with Solana; - How to deploy ERC20forSPL and ERC20forSPLMintable tokens on Neon EVM; - How you can add logic on top of SPLToken As new users flock to web3, critical infrastructure advancements are needed to scale. Join us April 5th-26th for three weeks of hacking and summits around shaping the future of Ethereum. ----------------- Follow us: https://x.com/ETHGlobal?s=20 Check us out: https://ethglobal.com/ Email us at: hello@ethglobal.com
Transcript
[Music] hello everyone I am Suk senior integration engineer from neon evm this video will walk you through what neon evm is and how you can take all the advantages of Solana's Network by deploying your etherium based decentralized applications on neon evm so basically let's see what neon evm is so neon evm is a fully compatible ethereum environment solution that is built on the Solana blockchain the platform allows developers to deploy ethereum based decentralized applications without undertaking any reconfiguration in their code base so what basically neon evm is a smart contract which can understand and execute evm bite codes inside Solana's virtual machine and also neon evm allows all the solidity and Viper based decentralized applications to take the advantages of Solana's uh networks uh like low fees uh High transaction speed and parallel transaction execution uh which makes a neon evm the first first paralyzed evm on Solana the developers also can use any development framework like hardhead Foundry U remix and uh any other framework that is uh available on the ethereum environment so let's let's first see how we can get the end points um RPC end points for neon so we need to go to the chain list site then search for neon EV VM since we'll be working with Dev net so we will include include test Nets and as you can see you will get this Neon evm devet so this is the RPC you need to add to your metamask account you can add it from here so this is basically my account which is already added Neon evm devet so yeah after that we have a faucet which you can use for development it gives like 100 tokens uh at a time so we can just send tokens to the connected metamask wallet and and as you can see my balance changed to like more more 100 accounts now added to it this is what neon faucet is then let's see by transferring some tokens from one one account to another account so this is my neon account and this is my another neon account which has zero Neons so let's transfer some Neons from this account to the second account let's send 100 Neons let's wait for the confirmation yep it says it's confirmed you can check it on the neon scan website that your transaction has been confirmed yeah so you can see 100 Neons has been transferred from this account to this account and we can verify it here now you can see the count has 100 Neons so this is how the transfer works so now let's see we have a native Bridge from neon to Solana and vice versa so this uh bridge is basically for all the native Solana tokens which can be also used as an erc20 for SPL to token wrapper on neon evm so we need to connect metam mask wallet you can see the metamask wallet has been connected for Solana you need to have any of your Solana wallets like Phantom or Soul flare so I have have Phantom installed so I will use Phantom connect my account so this is my Phantom account which is 10 Solana now we will transfer some Neons from from neon evm to the Solana Network Let's uh transfer 20 Neons to Solana this will be the transaction fee because we are using this account for the first time on transaction so the transaction fees will be a little bit more because there will be an account cre creation on the Solana side for the ethereum wallet so this is why the first time transaction fee is a bit more so let's transfer yeah the transfer has been complete and we can see in the Explorer this is the 20 neon so we can check it in the Phantom wallet yes this is the neon token which has transferred from etherium wallet to the Phantom wallet on Solana so this is how Neon works now let's uh show you a very quick example of how we can deploy an erc20 for SPL token on uh neon evm and uh we need to know two things for this so the factory contracts with which we can uh create create an erc2 for SPL token it have two variants one is erc2 for SPL and another is erc20 for SPL mint table so these two Factory contracts offers uh erc20 interface for SPL tokens on Solana and allows to access the SPL tokens on Solana from neon evm so erc2 for SPL Factory basically allows you to deploy an erc20 rapper token of an already existing SPL token so the SPL token which is already existing on the Solana network if you want to access that token from neon evm you need to create a rapper token on neon evm through the erc2 for SPL interface the another one which is neon evm uh variant another variant for erc2 for SPL is erc2 for SPL mint table which allows you to deploy an erc20 rapper token as well as its corresponding SPL token on Solana means you can create a SPL token from the erc20 interface which will be a new SPL token on Solana so basically it is an extended version of erc2 for SPL which has a couple of more functions like minting of SPL tokens from neon evm so this is basically the factory contract which you can see on the screen so this is the S ERC 24 SPL contract so here you will find a very interesting thing so you can see these two lines line eight and line nine these are basically pre compiles so neon evm has pre compiles that can interact natively with Solana s program and metap metaplex program so basically what is what it does is that these are pre compiles which can read SPL token data from the Solana account and from the metaplex accounts respectively this is the erc20 for SPL contract where you can see we have wrapped all the erc20 based functions with the pre compiles and we have another variant which is the erc2 for SPL minable which will allow you to Mint a new SPL token from neon evm this minan function is responsible for this so these are the basic Ally two Factory contracts for deployment of rc24 SPL we have this hardhead config file where we have the neon devet and neon main net configurations here you can see we have a private key owner which will be the deployer account and the deployer account is mentioned the private key is mentioned in the environment file here so you you can add your own private key to this environment where file and then import this private key from the environment file in the harded config then we have a deploy script this deploy script is basically deploying the factory contract you can see here we can display the deployer address then we will get the factory contract then we will deploy it our token's name is hack token symbol is htk decimals is N9 and with the deployer address so after that we will get the contract address erc20 contract address or the token on neon evm then we will mint 100 heck tokens to the deployer account with the mint function so this will also mint this token 100 amounts of token to the SPL token which will the hack token on Solana Network and we can find this Solana hack token address with this find Mint account function so let's deploy the contract with the hardhead command script is deploy script is under the scripts folder and we will mention the network as neon devet which is basically this already configured in the harded let's run this yeah so here you can see we have the contract address which is the token contract address on neon evm 100 tokens has been minted to the deployer address and the minted token Solana account address is mentioned here so so let's check all these things in the Explorers so let's take this contract address and this is the neon scan the Explorer let's go to devet and then search for this account as you can see we can found this contract address you can see this token's name is hack token the contract has been created as you can see here we we can check the token we can see the token here and we can see the transfer so this is the transaction hash we have transferred 100 tokens to the deployer address and this is and this is the fee for the transaction so let's now check the same thing on SOL scan so let's copy Cy this address and check on S scan so this is for the Solana Explorer you just set the blockchain to devet and search for this contract address see we can see this is the token contract which is the hack token this is the authority which is the the deployer address contract so let's go here and check so as I have mentioned that the ethereum account from which we transferred the tokens uh for that particular account there will be a corresponding Solana account creation so when we were trans transferring the 100 tokens to the deployer account so the deployer account has this corresponding Solana account on the Solana blockchain and we can see we have 100 tokens here you can check the token balance which is 100 this is basically how uh you can mint uh SPL token from the neon uh from neon evm using the SPL uh erc20 for SPL minable interface so now for the hackathon we have two use cases so you can use like uh you can create a decentralized application that can utilize like micro microtransactions uh that utilizes cheap transaction cost and also like uh you can create a dab with some EX existing D5 Primitives like Unis swap uh or any other D5 primitive you like uh which will be uh which will be deployed on neon natively uh with any unique features any Innovative features you want to and another one is the neon uh using the neon transfer SDK so basically you have to deploy an erc2 for SPL token uh which will be a minable token on the Solana blockchain like you will have to use the erc20 for minable uh and also write a script or develop a tool which can transfers the token from neon evm to Solana and vice versa like what neon pass does so it will be a similar thing and you will have to write the script or tool for it and all the required links and all the required documentation links are mentioned in this page which you can go through and you can build your app so yeah uh have fun building with neon evm see you guys later on thank you [Music]
Automatic transcript — names and jargon may be misspelled.