visit
With the advent of the Ethereum blockchain and the possibility of creating smart contracts, several years ago, the Ethereum blockchain became, over time, the starting point for developers and projects to create new platforms and experiences previously unthinkable, such as video games, decentralized finance (DeFi) and more. At first, it seemed that Ethereum was the best blockchain to do everything, but little by little, and with the increasing number of projects and transactions, its technical limitations of it came to light, spurring doubts about its sustainability in the long term.
During the period between 2016 and 2017, as the limitations of Bitcoin became apparent, several individuals and projects started exploring alternative ideas for more efficient blockchains. This was similar to the situation when Ethereum emerged as a platform for building decentralized applications (dApps). In this context, one of the notable developments was the creation of the EOS blockchain.
Other projects, instead of completely innovating, put the Ethereum structure at the base by modifying other parameters, making them a theoretically faster and cheaper version of Ethereum.
As mentioned earlier, this type of blockchain allows you to use the same code created on Ethereum, which in this particular case is represented by a language created specifically called Solidity, where the file containing the instructions of the smart contract is in ".sol" format.
So for programmers, it was enough to use the same file, without even modifying it, to be able to use it on these EVM-compatible blockchains, and this has proved to be over time an essential function and characteristic to attract developers and also applications to the new blockchain.
The EOS blockchain, not natively compatible with Ethereum and the EVM, had to develop a technically challenging solution to emulate the EVM within its ecosystem. Emulating the EVM on EOS required significant effort due to the differing architectures and consensus mechanisms of the two blockchains.
But despite everything, with the help of skilled engineers on EOS, the EOS EVM was born, launched in mid-April, demonstrating all its technical power also in comparison with other EVMs on other blockchains, and to do so the data that was chosen was precisely the "swap per second", surpassing by 4 times an EVM that until then was considered the fastest, namely the EVM on Solana.
Now that we have seen a bit of the history and functioning of the EVMs, it is time to get our hands dirty with the code and see how to migrate the code that we created for Ethereum, or another EVM blockchain, to the EOS EVM.
To deploy the smart contract, i.e. load the code onto the blockchain, we basically have 2 methods:
A quick method within everyone's reach is to use Remix, and from here we will deploy our smart contract.
First of all make sure that our MetaMask wallet is active on the EOS EVM, testnet, or mainnet, then connect to the Remix web interface, here, and create a new file giving it a name and the .sol extension:
At this point, select the relative .sol file that we want to upload to the blockchain, and we move to the "Solidity Compiler" menu:
Deploy with Hardhat
In case we developed our dApp using Hardhat, it will be enough to add the following networks to the "hardhat.config.js" configuration file:
Below is the video to illustrate the various steps: