Using Remix
Remix is an open-source, web-based development environment tailored for EVM smart contract development. It offers developers a comprehensive suite of tools for writing, deploying, and testing smart contracts in Solidity. For more information, visit Remix.
Add the Flow Network to MetaMask​
Navigate to the Using EVM page to find the button to add the Flow network information to your metamask.
Fund Your Flow Account​
Navigate to the Flow Previewnet Faucet to obtain FLOW tokens necessary for deploying a smart contract.
Deploying a Smart Contract Using Remix​
HelloWorld Smart Contract​
Steps to Deploy the HelloWorld Smart Contract​
- Create a file named
HelloWorld.sol
. - Select Solidity Compiler and compile
HelloWorld.sol
. - Select Deploy & Run Transactions.
- Make sure to select
Injected Provider - Metamask
in Environment dropdown. - Deploy the
HelloWorld
smart contract.
Calling the Deployed Smart Contract​
Using Ethers.js to Call the HelloWorld Smart Contract​
- Create a new
get-greeting.js
file underscripts
. - Paste in the JavaScript code below.
- Click on green play button to run.
- Verify the greeting is "Hello World!".
Follow the steps below to change the greeting and retrieve the new greeting.
Updating the Deployed Smart Contract​
- Select the
HelloWorld.sol
file. - Select the
Deploy and Run Transaction
page. - Make sure to select
Injected Provider - Metamask
in Environment dropdown. - Type a new greeting in the text input next to orange
changeGreeting
button. - Click on the orange
changeGreeting
button. - Sign the Metamask transaction.
- Verify the greeting has changed by re-running
get-greeting.js
script above.