Create, deploy and interact with your Smart Contract using REMIX IDE.
Select the default workspace.
Select default workspace
In the contract folder, you find the sample contracts that can be deployed. You can choose to write a new one from scratch or import one. For this tutorial, we import the
Greeter.solcontract used in the Hardhat example.
Select the contract you want to deploy, go to the compilation tab (third from the top), choose the compiler version and click compile.
Compile the smart contract
Go to the deployment page (fourth from the top) and select Injected web3 from the environment tab.
Open the deployment page
Then, Metamask asks for the connection with the account you want to use for the deployment.
Metamask account connection
Add the parameter "hello world" from the deployment page for the Greeter.sol contract and click the deploy button.
Confirm the transaction from Metamask and wait for confirmation.
Once the transaction is confirmed, the transaction ID can be retrieved from the "Copy Transaction ID" button.
Retrive transaction ID
The transaction details are also prompted in the REMIX terminal.
Transaction detail from REMIX
The "Deployed Contracts" tab in the bottom left corner shows the deployed contracts list. From this tab, it is possible to interact with the smart contract.
Interact with a deployed contract
For example, to change the greeting returned from the smart contract, enter the new greet into the setGreenting method and then push the setGreeting button. Another transaction will be required to be approved, and then after the confirmation, the new value can be checked from the Greet button.
That's it! The interaction is successful