Creating and Deploying a Contract
Last updated
Last updated
In the File Explorer, create a new file by clicking on the new file icon, and name it.
Write the sample code
Compile the contract:
The Deployment Module in Q-Remix IDE enables developers to deploy, interact, and manage smart contracts efficiently, both locally and on-chain. This module is crucial for testing contract behavior and pushing production-ready contracts to the blockchain.
You can access this module by clicking the deploy icon on the far-left sidebar.
There are three main sections in the deploy & run section
Environment
Account
Contract
Make sure MetaMask is unlocked and the correct network is selected before proceeding.
For now Q-Remix IDE supports the first two options
Q-Remix VM: Uses Hardhat to generate 10 test addresses with 10,000 ETHs in each address. The user can switch the addresses anytime and test or deploy with them. The states of each of the contracts remain the same even after refreshing the entire page. This ensures that no progress made is lost during the session. However, if the session is closed all the accounts are reset to have the original 10,000 ETHs.
Injected Provider MetaMask: This connects the wallet metamask with the remix IDE allowing teh contracts to be deployed either Mainnet or in the Testnet.
After giving your MetaMask password, the selected address or account will be reflected in the Account section of the Deploy & Run
You can choose any available account for deploying or interacting with contracts.
For deploying the selected contract one can use any of the accounts. In the above example one contract has been deployed using the first account.
Always review your code and verify constructor arguments before deploying on a live network.
One must review the code or understand the code before completely deploying it on the chain.
Once the contracts has been selected, clicking on the deploy button would deploy the contract on the said chain or network. The details of the deployment including the contract address would be shown on the terminal