You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This will allow chaining contract type calls which will further stream-line the development experience.
To make this working, we need a way to understand that a method return type is an actual contract. @ethersproject/abi's Interface does not provide too much help in this regards:
even though the solidity compiler does appear to export more info regarding the raw internalType of the output:
One way to avoid this is to try and have a naming convention in place similar to the one present in the above example where we could say that 'if a returned variable name ends with an underscore, then try to map its address to a live-contract and return that'. If we go on this path, we need to settle on this convention. For flexibility reasons, It would be nice if we could avoid enforcing this convention and take advantage of solidity's internalType.
Another issue that needs to be addressed for this feature to be implemented is the parser's access to the ABIs for which the resulting live-contracts are built. Basically, in our previous example case, this is the equivalent to answering the question of how to make available the Square ABI to the create result mapper. What happens if the returned contract type is not part of the same solidity file (eg. import path)?
This feature should be flagged by a context config-parameter.
The text was updated successfully, but these errors were encountered:
Given the following solidity file:
it would be nice if we would support doing this:
This will allow chaining contract type calls which will further stream-line the development experience.
To make this working, we need a way to understand that a method return type is an actual contract.
![image](https://user-images.githubusercontent.com/210908/156533657-1b303785-32d3-4a04-870e-7d83a14ef70b.png)
![image](https://user-images.githubusercontent.com/210908/156533887-fb9cb022-9476-470a-aaed-cb6521bd2454.png)
@ethersproject/abi
'sInterface
does not provide too much help in this regards:even though the solidity compiler does appear to export more info regarding the raw
internalType
of the output:One way to avoid this is to try and have a naming convention in place similar to the one present in the above example where we could say that 'if a returned variable name ends with an underscore, then try to map its address to a live-contract and return that'. If we go on this path, we need to settle on this convention. For flexibility reasons, It would be nice if we could avoid enforcing this convention and take advantage of solidity's
internalType
.Another issue that needs to be addressed for this feature to be implemented is the parser's access to the ABIs for which the resulting live-contracts are built. Basically, in our previous example case, this is the equivalent to answering the question of how to make available the
Square
ABI to thecreate
result mapper. What happens if the returned contract type is not part of the same solidity file (eg. import path)?This feature should be flagged by a context config-parameter.
The text was updated successfully, but these errors were encountered: