I am new to solidity. I have a struct and an array of structs, like this:
struct Adopter{
uint age;
uint gender; // 0 woman, 1 man
// maybe add an id field
}
Adopter[] adopters;
So, a person can adopt an animal only once. How do I keep adopters in such a way that I can check if the person already has adopted an animal? I can't search for a struct inside an array of structs and I can't create a mapping (struct => bool). There must be a simple way to achieve this.
bool adoptedPet
in the struct.