Category "hardhat"

How to deploy multiple smart contracts using hardhat-deploy

I have two smart contracts that I want to deploy. I want to deploy the first one, then pass the address of the first into the constructor of the second one. I a

Contracts do not compile with zksync-solc. Their ABI and bytecode seem to be printed as an error

I am pretty new to development and asking questions on stackoverflow, so if there is something else I could provide, please tell me in comments! I have installe

How do I add ether to my localhost Metamask wallet with Hardhat?

I've connected metamask to a node created with hardhat. I can connect to this node on http://localhost:8545 network in metamask after setting the chain id to ma

Ethers.js "Error: unknown account #0 (operation="getAddress", code=UNSUPPORTED_OPERATION)"

I'm trying to fetch the price of ETH from KyberSwap, using Ethers.js, but I'm receiving the following error: Error: unknown account #0 (operation="getAddress",

Implementing fixtures with @nomiclabs/hardhat-waffle

In the official waffle documentation you may find the next way to implement fixtures: import {expect} from 'chai'; import {loadFixture, deployContract} from 'et

Npx hardhat could not determine executable to run

I am trying to follow this guide and I am struggling running hardhat. After following the commands in the article: mkdir hardhat-tutorial cd hardhat-tutorial np

Error: VM Exception while processing transaction: reverted with reason string 'ERC721: transfer caller is not owner nor approved'

i try to write NFT marketplace and i have problem with reselling items from user that buy item from owner and new, third user. I use next.js + openzeppelin + ha

Ethereum - insufficient funds for intrinsic transaction cost

I'm trying to create my own NFT contract factory, but it fails in mainnet. I have ETH on my wallet. In test it works fine. Here's my contract: //Contract based

How to restart a local hardhat node to initial state?

I am not really sure how to restart the state of the node to the initial state. Each time I try to redeploy a contract - I'm getting the same contract, the cons

How to use a getter function inside a React component?

I am trying to make a basic React component to retrieve a value from a deployed contract. In this example, I am using an input box to receive a contract address

HardHat and Rinkeby ProviderError: Must be authenticated Error

When I run npx hardhat console --network rinkeby accounts = await ethers.provider.listAccounts(); I get Uncaught ProviderError: Must be authenticated! with bel

What's the difference between .deploy() vs. .deployed()

I am writing a script for a smart contract that I'll deploy using hardhat. I'm confused on the difference between .deploy() and .deployed(), what does each one

How is hardhat implicitly knowing deployer address?

I am new to using hardhat and I was trying to figure out how it is working. The documentation seems a little bit fuzzy as there are multiple layers of abstracti

Transaction reverted: function selector was not recognized and there's no fallback function

I am interacting with my own smart contract. It's a very simple one. // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; contract ERC20 { string public n

Hardhat – What are the strange calls to my smart contract?

I am using Hardhat hackathon boilerplate and calling my smart contract's (address 1c0, addresses shortened for clarity) function MyContract#addProduct from the

How do I reset Hardhat's mainnet fork between tests?

I'm writing unit tests in Hardhat using Hardhat's mainnet fork, however it seems that the results from one test are affecting future tests and causing my assert

Verify the contract from a contract factory

I am learning about web3 and using web3-react, ethers and hardhat. I made a contract, and I want that every user deploys their own Contract. The Contract is dep

How to deploy two smart contracts consequently on RSK via Hardhat?

I am developing two smart contracts whose deployment order matters. First comes an ERC20 token, and then its deployment address should be passed to an ERC721 sm

I can't get "Typechain" folder when I install dependencies using hardhat

When I install all the dependencies but didn't get the "typechain" folder in the typescript hardhat. how to get it? npm init npm install --save-dev hardhat npx

Passing a Struct Array to constructor of Solidity Contract

I am building an NFT smart contract with solidity, and I am trying to pass and Array of Structs into the constructor when I deploy the contract. However I am ge