-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug(cast
): cast interface generates unexpected library instead of interface
#9960
Comments
This is likely related to us moving from Solang to Solar foundry/crates/cast/bin/cmd/interface.rs Lines 152 to 167 in 45c3ba1
|
cast
): cast interface generates unexpected library instead of interface
@sakulstra I just checked with an (really) old build and there is no regression introduced here, how do you think the output should look? CC @zerosnacks |
Interesting, I would expect it to yield an output like this where interface ITestContract {
struct TestStruct {
address asset;
}
}
interface TestContract is ITestContract {
function test(ITestContract.TestStruct memory) external;
} |
Trying to figure out which version we were on, but seems like in fact we manually patched the interface because in the version there was some problem with the scoping and i simply forgot.
I would have expected:
At least how we currently use |
thanks. ah, I think I was making a mistake and could be a regression at the end, anyways, will look into solving it |
confirmed it's an regression introduced in d8f6631, most probably in alloy here https://github.com/alloy-rs/core/blob/5b29eb74afb26417704833a0985a2e35bd218ee6/crates/json-abi/src/to_sol.rs#L154-L175 |
after checking the alloy code I think that's something desired and not an issue, @DaniPopes could you pls chime in? thank you! |
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
9bcfbaa
What version of Foundryup are you on?
No response
What command(s) is the bug in?
cast interface
Operating System
None
Describe the bug
Hey, i think there is a regression in
cast interface
(or at least an unexpected change).I have a:
Now
cast interface ./src/Test.sol:TestContract
will yield:Which I think different to previous versions as i'm pretty sure that before structs were included in the generated interface. Is this change intentional?, as ux wise it's a bit weird.
More of a question out of curiosity: Would it be possible to include the natspec on the generated interface?
In most smart contracts i'm reading i have to constantly jump between interface and contract to fully understand the code. Therefore i'm wondering if it wouldn't be a better approach to just have all the natspec on the actual contract (not the interface) and then simply generate the interface.
The text was updated successfully, but these errors were encountered: