Remix
Intro
Remix is a web-based Integrated Development Environment (IDE) designed for developing, testing, and deploying smart contracts on the Ethereum Network. This guide will show you how to use Remix in conjunction with MetaMask on the Sapphire Network.
For comprehensive details about Remix's features, consult the Remix documentation.
Prerequisites
- Install the MetaMask browser extension
- Configure your networks:
- Add Sapphire Mainnet or Testnet to MetaMask using the
Add to MetaMask
button on our network page - (Optional) Configure local network settings if you're using the Sapphire localnet
- Add Sapphire Mainnet or Testnet to MetaMask using the
Getting Started
When you first launch Remix, it creates a default project structure.
Navigate to the contracts
folder and open 1_Storage.sol
to begin.
Contract Compilation
-
Navigate to the Solidity Compiler tab
-
Configure the compiler settings:
- Compiler version:
0.8.24
- EVM version:
paris
(found under Advanced Configuration)
- Compiler version:
-
Click
Compile 1_Storage.sol
The Sapphire uses the Rust Ethereum EVM. This implementation is compatible with Solidity versions up to 0.8.24. However, it does not yet support some transaction types introduced in Solidity 0.8.25, such as those mentioned in rust-ethereum/evm#277, pending release of the next version.
EVM versions after paris (shanghai and upwards) include the PUSH0 opcode which isn't supported on Sapphire.
Contract Deployment
- Open the Deploy and Run Transactions tab.
- Select
Injected Web3
as environment. - Accept in MetaMask the account connection to Remix.
- Click
Deploy
. - Review and confirm the transaction in MetaMask.
If everything goes well, your transaction will be deployed using the selected account in the MetaMask and the corresponding Sapphire Network.
Working with Confidential Features
Note that Remix operates without a Sapphire client, meaning transactions and queries are unencrypted and unsigned by default. To make use of Sapphire's confidential features, refer to our Quickstart Tutorial.
Should you have any questions, do not hesitate to share them with us on the #dev-central Discord channel.