Testing your contract with Remix
In this recipe, you will learn how to test your smart contract using the Remix IDE. Remix is a browser-based IDE that enables users to write Ethereum contracts in the solidity language and debug transactions. Remix has an inbuilt JavaScript-based solidity compiler and EVM to compile and run smart contracts.
How to do it...
- Open Remix (https://remix.ethereum.org) in yourdesktopbrowser.
- Copy your smart contract to Remix and it will automatically compile your code. Warnings and errors, if any, will be displayed in the right panel.
- Remix has an inbuilt JavaScript VM for testing smart contracts. Ensure that you have selected JavaScript VM as the default environment under
Run
:

- Select an account from which the contract will be deployed. You can select an account from the list of default accounts provided by Remix. Each account is loaded with enough Ether for testing.
- The gas limit specifies the maximum amount of gas (unit for calculating the execution cost) that has...