dethcrypto / dethcrypto/TypeChain

Structs are incorrectly generated in Typechain

Open
#826 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
2.8k
Forks
376
PR merge metrics
No merged PRs in 30d

Description

# Overview
I'm trying to generate typechain bindings using `ethers-v6`. I have some files in Solidity that are just structs. The are imported into contracts and appear in their typechain files.

The output of the typechain bindings for those structs looks like
```typescript
export type CommonExtDataStruct = {
undefined: AddressLike;
undefined: BigNumberish;
undefined: AddressLike;
undefined: BigNumberish;
undefined: BigNumberish;
undefined: AddressLike;
};
```

`tsc` throws tons of errors when trying to bundle this as a library. Is it normal for the keys to be `undefined`? I have a feeling this is off because I cannot build our library with the bindings created by Typechain.

For reference, our structs in Solidity look like:
```solidity
pragma solidity ^0.8.19;

struct CommonExtData {
address recipient;
int256 extAmount;
address relayer;
uint256 fee;
uint256 refund;
address token;
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.