Skip to main content

Questions tagged [typechain]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
23 views

Why smart contract calls transferFrom ERC721 instead of ERC20?

I create project using Solidity, Hardhat for testing deploying, and hardhat tracer for debugging? I have smart contract that inherits ERC721Holder from @openzeppelin library. On this smart contract I ...
Aaaaaaaaa Aaaaaaaaa's user avatar
0 votes
1 answer
51 views

How to connect to a proxy contract with Typechain?

I'm currently using the ERC20 contract available from OpenZeppelin to generate the typechains. Now, one of the ERC20 I wish to use is USDC. USDC is a proxy contract. How can I connect the typechain ...
Jallrich's user avatar
  • 115
0 votes
1 answer
19 views

How to get proper typesafe version from ethers.getContractAt or any other alternative method

I have a hardhat + typescript project , where I have a script like the below: import { ethers } from "hardhat"; import { diamond as diamondAddress } from "../../deploy/addresses.json&...
Somjit's user avatar
  • 265
3 votes
3 answers
5k views

How to get deployed contract address with ethers?

I using hardhat deploy (TypeScript) and am deploying two contracts: the first is a mock ERC20 token and a second is a crowdfunding contract that uses the mock when on a hardhat chain/localhost. I am ...
Kate Johnson's user avatar
1 vote
2 answers
2k views

TypeError: glob is not a function after updating typechain-hardhat to @typechain/hardhat

After updating project from typechain-hardhat to @typechain/hardhat package. Compilation of project throws TypeError: glob is not a function error. And I can not run scripts, tests, compile etc. An ...
r0uge's user avatar
  • 11
2 votes
1 answer
1k views

How can I assign my custom contract type to a contract instance from Ethers?

Using Ethers, I'm creating an instance of my deployed contract as follows: import MySwapV2FactoryABI from "src/abis/MySwapV2Factory.json"; const provider = new ethers.providers....
code_learner93's user avatar
1 vote
0 answers
445 views

Ethers: abi.map is not a function

I'm trying to import a contract using ethers. I'm getting an error: ..\node_modules@ethersproject\abi\src.ts\interface.ts:100 defineReadOnly(this, "fragments", abi.map((fragment) => { ...
Ritzy Dev's user avatar
  • 303
3 votes
3 answers
3k views

How can I create the typechain directory in my hardhat project?

I have set up a hardhat project with typescript a while ago and want to write some tests. Now I only have a typechain-types directory and it doesn't give me the types I am used to. Where is the plain ...
Marlo's user avatar
  • 361
4 votes
2 answers
3k views

Instantiate a contract using interface generated by TypeChain

in my solidity codebase I am using an interface and these are the types generated by TypeChain: import { BaseContract, BigNumber, BigNumberish, BytesLike, CallOverrides, PopulatedTransaction, Signer, ...
Jan Beneš's user avatar