dethcrypto / dethcrypto/TypeChain
Always generate overloads works differently with struct parameters
- Dominant language
- TypeScript
- Stars
- 2.8k
- Forks
- 376
- PR merge metrics
- No merged PRs in 30d
Description
Hi there,
Thanks for this cool library, it works perfectly. However, I tried to compile this contract:
```SOLIDITY
contract PaperMoney {
struct Order {
address from;
address payable to;
}
function transfer(Order memory order, uint256 amount) external payable returns (uint256) {
// ...
}
function transfer(address from, address payable to, uint256 amount) external payable returns (uint256) {
// ...
}
}
```
And the abi of this inputs:
```JSON
{
"abi": [
{
"inputs": [
{
"components": [
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"internalType": "struct Order",
"name": "_order",
"type": "tuple"
}
],
"name": "trade",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "trade",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "payable",
"type": "function"
}
]
}
```
It turns `"trade((address,address),uint256)": FunctionFragment;` function was missing in compiled ts interface:
```JAVASCRIPT
interface AMMWrapperInterface extends ethers.utils.Interface {
functions: {
"trade(address,address,uint256)": FunctionFragment;
}
...
```
It works different in some complicated structs, eg struct XXXLIB.Order, night be related to #343:
```JAVASCRIPT
interface AMMWrapperInterface extends ethers.utils.Interface {
functions: {
"trade((tuple),uint256)": FunctionFragment;
}
...
```
Note: I cleaned up smart contract for some reason.
Contributor guide
Assessment
This issue has not been assessed yet.