Replies: 1 comment 5 replies
-
I'm not actually sure how structs inside structs are represented. Your struct Property {
uint256 propertyId; // slot 0, 32 bytes
uint256 rent; // slot 1, 32 bytes
uint8 bedrooms; // slot 2, 1 byte
uint8 bathrooms; // slot 2, 1 byte
address _tenant; // slot 2, 20 bytes
bool vacant; // slot 2, 1 bit(?)
} Your struct Agreement {
Property property; // not sure about this one
uint256 agreementId; // slot 0, 32 bytes
uint256 duration; // slot 1, 32 bytes
address _tenant; // slot 2, 20 bytes
address _propertyManager; // slot 3, 20 bytes
} In your case it seems that you are trying to get the slot of the
|
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I am trying to test my contract to see if I am picking up the correct "tenant" address. I know that the contract works because I tested it with remix. However, Im doing this exercise to gain a deeper understanding with Foundry. My contract looks like this:
The specific test i'm having trouble with:
Each time I run it I get "[FAIL. Reason: stdStorage find(StdStorage): Slot(s) not found.]" And i've tried it multiple ways but can't seem to figure out the solution. I think ".depth(3)" is not picking up the index in the struct because its not of type uint256? However I'm not sure how to get past that. Would appreciate any advice. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions