I have the following on a MyLibrary contract:
struct MyStruct {
uint256 id;
address owner;
address eventContract;
uint256 price;
TheState theState;
bool exist;
string tierName;
}
function formatTokenURI(MyStruct memory self, ... more params)
public
pure
returns (string memory)
{
I have the exact same function in Contract X like so:
function formatTokenURI(MyLibrary.MyStruct memory tempStruct,...more params)
public
pure
returns (string memory)
{
Now, when I call formatTokenURI from Contract X, I input all the params and the struct I make it like this:
[1,"0x5B38Da6a701c568545dCfcB03FcB875f56beddC4","0x7EF2e0048f5bAeDe046f6BF797943daF4ED8CB47",26,0,true,"crazyname"]
And it goes throught successfully.
But if I deploy a MyLibrary contract and try to call directly the formatTokenURI function I get: Error encoding arguments: Error: invalid type (argument="type", value="MyLibrary.TheState", code=INVALID_ARGUMENT, version=abi/5.5.0)
I have literally tried everything (inserting/removing quotes, using uint8 as input for TheState params; but nothing seems to work.
When it comes from the context of the same contract the tuple needs to be formatted differently. Any ideas???
Thank you so much for your help!