Basic pseudocode mockup of my problem
import libraryB;
contract A{
struct Person{
string Name;
uint age;
}
Person[] public Party;
Party[0] = (Alice, 30);
libraryB.addAgeToPerson(Party[0], 1)
}
library libraryB{
struct Person{
string Name;
uint age;
}
function addAgeToPerson(Person storage PersonToAddAgeTo, uint ageToAdd) external {
PersonToAddAgeTo.age += ageToAdd;
}
}
Contract A is using a delegatecall unto the libraryB to use the function, passing the storage pointer to Person[] public Party; The struct is defined in both instances, but I get the error:
TypeError: Invalid type for argument in function call. Invalid implicit conversion from struct Contract A.Person storage ref to struct libraryB.Person storage pointer requested.
Any idea on how to pass a storage struct from a contract into a delegatecall to a Library to work with? I thought delegatecalls preserve the callers context..
Thanks for any input!