Deploy Smart Contract
Last updated
Last updated
There is no need for any local environment settings for deploying solidity smart contracts on ONLY using the Remix IDE.
All you require is a browser-based Web3 wallet (e.g. MetaMask) to interact with the ONLY Testnet and deployed contracts. If you are already using MetaMask, it is recommended to create a new account for testing with Replit. You can do this from the account menu, which appears when you click on the account avatar in the top right corner of MetaMask interface.
You must set up all of the following Pre-requisites to be able to deploy your solidity smart contract on ONLY:
Create a new file, name it test.sol
, and copy the contract code given below
// SPDX-License-Identifier: MIT pragma solidity ^0.8.15; contract HelloWorld { function sayHelloWorld() public pure returns (string memory) { return "Hello World"; } }
The first line, pragma solidity ^0.8.15
specifies that the source code is for a Solidity version greater than 0.8.15. are common instructions for compilers about how to treat the source code (e.g., pragma once).
Step1: Click button to switch to compile page.
Step2: Select the appropriate compiler version, 0.8.15 in our case.
Step3: Enable "Auto compile" and "Optimization" from Advanced Configurations,
Step4: Select "HelloWorld" from the contract drop-down menu.
Step5: Click "ABI" to copy the contract ABI and save it.
Step1: Navigate to the Deployment Page.
Step2: Select Injected Provider in the Environment dropdown
Step3: Confirm the Connection Request on the MetaMask notification.
Step4: Once Metamask is connected to Remix, click on the "Deploy" button which would generate another metamask popup that requires transaction confirmation.