I have deployed a smart contract using the remix editor. I need to know that if I have to have the hardhat extension as well. I want a user to be able to set up their profile using the UI with some info like availability, profile picture hourly rate etc. In remix I have been able to achieve this by adding a new instance after deploying the smart contract. I am not too sure how I(or someone else) would be able to interact with the smart contract using the UI. I am intending use Moralis and the Web3uikit I also want the pictures to be uploaded to IPFS aswell.
2
There are 2 best solutions below
0
Ogubuike Alexandra
On
You do not need hardhat.
If you want to interact with a smart contract from your UI, you will need to connect a wallet like metamask from the application's UI. Using JS libraries like etherJs or web3JS you can connect and interact with the smart contract.
For example using etherjs:
async function payUser (amount){
//connect to metamask
const { ethereum } = window;
//if ethereum is not found, it means that a user does not
//have metamask installed on their browser
if (!ethereum) {
return;
}
//Get wallet provider and signer
const provider = new ethers.providers.Web3Provider(ethereum);
const signer = provider.getSigner();
//contract initialization: create an instance of the //contract
const contractInstance = new ethers.Contract(contractAddress, abi, signer);
//Interact with the contract using appropriate methods
const transaction = await
contractInstance.pay(ethers.utils.parseEther(amount))
}
Related Questions in SOLIDITY
- Solidity based blockchain not getting account and networkId
- unexpected keyword or identifier .ts(1434)
- Gas estimation failed | Returned error: gas required exceeds allowance (16966)
- This is the solidity code to list nft in marketplace after minting but while calling makeItem function Error is showing that Faliled to estimate gas
- My question is regarding installation of a package in VS code but im getting an error in installing it
- unsupported addressable value (argument="target", value=null, code=INVALID_ARGUMENT, version=6.11.1
- Error when deploying contract using ethers v6
- Error when fetching pending voters from smart contract using ethers.js
- IERC20 token.transfer always fails when called from within smart contract
- Solidity: How can I get an array of owners of my ERC20 and make a smart contract that uses that without exceeding the gas limit?
- Solidity call pancakeswap v3 contract exception
- Merkle Tree that should handle both odd and even numbers of leaves
- Uniswap v3 flashloan remainging balance not correct after paying off the loan
- connecting trust wallet mobile to my dapp
- Solidity Smart Contract & Hedera Hashgraph Javascript SDK Integration
Related Questions in IPFS
- WebTransportError in firefox
- Can I build a dynamic Web3 site using IPFS?
- In IPFS, will same content produce the same CID on 2 different peers?
- My NFT token Metadata is not opened by Opensea
- How to pin an object (as opposed to a file) to and IPFS node?
- How do I include an already existing web3 directory in a new directory without reuploading it
- I am trying to implement a python3 library to create IPFS-Merkle DAGs but I have been unable to figure out the correct way to specify links?
- Hugo generated site is not deploying correctly, what am I doing wrong?
- NextAuth and IPFS error when hosting on app.fleek.co
- How to setup ipfs on node or in anular app using aws ec2 instance kubo setup
- IPFS not announcing CIDs on indirect peers and unable to get through cmd as CID is not propagated using DHT
- IPFS RPC API : ipfs routing findprovs provides an unreadable response
- WebSocket connection Failed when using Helia IPFS in react app
- IPNS, ENS, content hash records
- ipfs - I just cannot get it working reliably
Related Questions in REMIX
- Use Tailwind-Merge or Tailwind-Variants On Oxygen Runtime
- solidity get contract address issue
- The remix serve port is getting changed after changes in any file
- How to paste ETH price feeds as rate in my crowdsale.sol
- Metaobject updating with Shopify Matrix
- Deploy Shopify app on Alma Linux server using cpanel
- Remix solidity compiler is not compiling properly offline, why?
- React remix middleware and database connection
- Getting error when executing "addPrescription" function in solidity smart contract
- Remix defer() not working as expected with the most basic example. It awaits all promises before transmitting data
- Unable to connect to the test node by using External Http Provider in Remix
- Fetching coupons from Shopify
- No API request not called when closed tab restored
- useLoaderData not returning data from closest route
- React remix api route
Related Questions in HARDHAT
- Hardhat permission denied
- Error when fetching pending voters from smart contract using ethers.js
- Can I swap with 1inch swap apis with forked hardhart?
- Uniswap v3 flashloan remainging balance not correct after paying off the loan
- uniswapRouter.getAmountsOut returns less value of token B than present in reverses
- no scripts folder in hardhat framework instead there's ignition folder with a subfolder named modules
- How does the Hardhat test network process the transfer function
- How does the fee get calculated in hardhat?
- Solidity: getStudentNotifications Retrieves notifications to other metamask account instead of one metamask account
- Simple Smart Contract Error: Transaction reverted: function selector was not recognized and there's no fallback function
- hardhat deploy.js Error: could not decode result data Weird
- Minting of Fantom token with Hardhat fails
- Hardhat: When I deploying a contract to sepolia test-network, I meet the error:"Invalid URL protocol: the URL must start with `http:` or `https:`"
- Ethers.JS: convert an HDNodeWallet to a SignerWithAddress from Hardhat
- hardhat & ehters v5 (5.7.0) I want to make sure that the contract is working normally
Related Questions in MORALIS
- how does moralis streaming api parse extra data inside transaction?
- Moralis.Auth.verify 400 bad request error
- Error when using MoralisProvider in layout.js file (Next.js)
- Need to listen events emitted from contract using React moralis
- CORS Issue with Firebase Cloud Function Despite CORS Middleware
- express and moralis token price API not fetching json data in console
- Error: require() of ES Module NextJS Web3AuthConnector
- logout metamask user onClick a button how can I implement it?
- Create autosigned transaction approval using moralis, ethers and metamask
- Moralis self-hosted server
- Having trouble deploying a parse server to heroku. Using moralis parse server and MongoDB
- How can we find the total number of tokens available in a wallet ? (withOut initialising Moralis) -As it is time taking
- get EthPrice with Moralis JavaScript
- I cannot get the address and its balance even if I connected to the Metamask
- How can I set Next-Auth callback url? and next-auth session return null
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
No, hardhat is used to compile, test and deploy smart contracts, on your own local hardhat blockchain instance, or a testnet or mainnet. If you have already deployed the contract to a blockchain then you don't need hardhat anymore.
If you verified the contract, you should be able to interact with it via https://mumbai.polygonscan.com/ > search your contract's address > contract tab.
Yet, from what I can grasp from your question, I think what you'll need to do is create a website that would be used as an interface for the contract.