Deploy your first contract
Introducing Remix
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
- If you open remix for the first time, you should chose the Environments to Solidity
- Click the gist label on the left side menu and click on ATestnetConsumer.sol
- Click the
Solidity Compiler
button in the left side bar, it will show compile tab page.
- Click
Compile ATestnetConsumer.sol
button in the upper left-hand of Remix.
If you get errors after compiling, make sure your compiler is set to one of the 0.6.0 compilers. If you used the link to Remix within this guide above, this would have been set for you.
- Now select the
Deploy & run transactions
tab in the left-hand of Remix. - Change your Environment to
Injected Web3
(if it is not already set) then click onDeploy
.
- 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. The error: 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 left 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.
- You can't do anything to this contract except read its state until you send LINK to it.