New answers tagged

0 votes

Trying to use window.ethereum.request in Typescript errors out with Property 'request' does not exist on type 'EthereumProvider'

Apparently, the desired type lives in @metamask/providers NPM library . I've solved the type issue by installing this lib in devDependencies: npm i -D @metamask/providers and extended a global Window ...
denbon05's user avatar
0 votes

How to get deployed contract address with ethers?

The answer by @AlexanderHerranz is for ethers v5, for newer versions of hardhat that use ethers v6 you can get the deployed address using the async getAddress() method as shown below: const ...
MShakeG's user avatar
  • 1,099
0 votes
Accepted

Cannot recover signer

abiCoder.encode is not packed, eg.: abiCoder.encode(["address"], ['0x473173aDa23BE87a4740646b09F9c22d115CE5a0']) '0x000000000000000000000000473173ada23be87a4740646b09f9c22d115ce5a0' but in ...
high_byte's user avatar
  • 233
0 votes

Instantiate a contract using interface generated by TypeChain

Define the type as both BaseContract and the typechain type: import { Contract, BaseContract } from 'ethers' import { IHintHelpers } from '../typechain-types'; const contract = new Contract(address, ...
Jeanclaude Aoun's user avatar
0 votes

What is the right way to import a contract type that uses an interface in hardhat?

I guess the right way to do it is to deployContract('ONLY THE CONTRACT NAME WITHOUT THE PATH gives you the needed interface')
Eugene1111's user avatar
0 votes

Trying to use window.ethereum.request in Typescript errors out with Property 'request' does not exist on type 'EthereumProvider'

try with this. interface CustomWindow extends Window { ethereum?: any; } declare const window: CustomWindow;
Alvaro Martinez's user avatar
1 vote
Accepted

Can we add network param to run function to verify contract on specific network?

Here is solution.. I created seperate tasks and then kind of used them in single task... As per @Jaskaran Singh 's Answer.. it's correct to use --network param straight away as it is provided already ...
Rushikesh Jadhav's user avatar
0 votes

Can we add network param to run function to verify contract on specific network?

Yes we can run --network to deploy and verify the smart contract . I would suggest you build two scripts one for deployment and one for verification . You can use this command for deployment npx ...
Jaskaran Singh's user avatar
0 votes

Need help testing my smart contract

You can use this code to test the creation of all tokens: import { ethers } from 'hardhat'; import { expect } from 'chai'; import { Contract, Signer } from 'ethers'; describe('SpiderVerse Contract', ...
Mehran Ra's user avatar
  • 410

Top 50 recent answers are included