Remix is a web IDE (integrated development environment) for creating, running, and debugging smart contracts in the browser. It is developed and maintained by the Ethereum foundation. Remix allows Solidity developers to write smart contracts without a development machine since everything required is included in the web interface. It allows for a simplified method of interacting with deployed contracts, without the need for a command line interface.
Create and deploy your first contract.
- Navigate to Remix: https://remix.ethereum.org
- Remix opens up with an empty interface, or possible with a default contract
- Click the gist label on the left side menu and click on ATestnetConsumer.sol
Start to compilein the upper right-hand corner of Remix.
If you get errors after compiling, make sure your compiler is set to one of the 0.4.24 compilers. If you used the link to Remix within this guide above, this would have been set for you.
- Now select the
Runtab in the upper right-hand corner of Remix.
- Change your Environment to
Injected Web3(if it is not already set) then click on
- MetaMask will pop-up to confirm the transaction. Click on Confirm.
Metamask doesn’t pop up?
If Metamask does not prompt you and instead displays the error below, you will need to disable “Privacy Mode” in Metamask. You can do this by clicking on your unique account icon at the top-right, then go to the Settings. Privacy Mode will be a switch near the bottom.
Send transaction failed: invalid address . if you use an injected provider, please check it is properly unlocked.
- A transaction link will be displayed at the bottom of Remix that displays deployment status.
It will take a few moments for the contract to be deployed. The Remix UI will update upon completion.
- On the right side panel there is a section that displays the title of the contract (example
ATestnetConsumer at 0x123...890 (blockchain)).
- You can click on it to interact with your contract.
Red labels are buttons which indicate the calling function will cost gas. Blue labels are buttons which simply read the state of the contract, and do not cost gas to call.
- You can’t do anything to this contract except read its state until you send LINK to it.