Deploying smart contracts
As an EVM-compatible chain, Etherlink runs Solidity contracts. You can deploy Solidity smart contracts in any way that you would deploy them to an EVM-compatible chain.
Etherlink supports Solidity versions up to and including 0.8.24.
You can use any of the toolkits in Development toolkits to deploy to Etherlink, as well as standard tools such as the Remix Ethereum IDE.
Deploying with Remix
The Remix online IDE lets you code, compile, and deploy contracts to EVM chains, including Etherlink
-
Connect your wallet to Etherlink testnet as described in Using your wallet.
-
Get some Etherlink tokens as described in Getting testnet tokens.
-
Open the Remix IDE at https://remix.ethereum.org.
-
In the contracts section of the IDE, create a contract. For example, you can create a contract named
4_HelloEtherlink.sol
and use this contract from the Solidity by Example:// SPDX-License-Identifier: MIT
// compiler version must be greater than or equal to 0.8.24 and less than 0.9.0
pragma solidity ^0.8.24;
contract HelloEtherlink {
string public greet = "Hello Etherlink!";
}The IDE looks like this, with your contract in the file explorer:
-
On the Compiler tab, select compiler version 0.8.24, as shown in this picture:
-
Compile the contract.
-
On the Deploy and Run Transactions tab, in the Environment list, select Injected Provider - MetaMask. Your MetaMask wallet opens to confirm the network connection.
-
In MetaMask, confirm the connection and select the account to use.
-
In the IDE, verify that the Account field shows your account and the tokens in it, as in this picture:
-
Click Deploy and confirm the transaction in MetaMask.
-
Call the contract by clicking the button for its entrypoint in the Deployed/Unpinned Contracts section. If you used the example contract above, you can call the
greet
entrypoint and see the result underneath the button:
Now the contract is deployed on Etherlink. You can look it up on the Testnet block explorer.