Closed bmateus closed 3 months ago
Thanks for the submission!
Just tested this against the https://github.com/gemstation/contracts-foundry repo and got test failures. I think the code might need a bit of tweaking.
The issue is that functions which take structs as parameters won't have the correct selectors generated. Doing so would require deconstructing the struct and nested structs and then doing something like:
struct InnerStruct {
uint256 x;
bool y;
}
struct OuterStruct {
uint256 a;
address b;
InnerStruct c;
}
function complexFunction(OuterStruct memory param) public {
}
// selector => complexFunction((uint256,address,(uint256,bool)))
Getting this working requires much larger parsing work, not to mention finding where structs are located. So for now I propose doing the following:
bytes4
selector using your new code whenever possiblefunctionName.selector
when the function contains a struct and issuing a warning to the gemforge log output of this.Merged in #42
thanks!
issue discussed here