I have a exchange type of use case in which the customer needs access to a centralised wallet based on different access methods (eg email, apikeys, actual wallet address). I tried mapping twice to the same struct and remix kicked out an error.
Here is the sample code -
struct ClientWallet { uint clientBalance; bool clientAccountExists; bytes32 apiKeyHash; } mapping (address => ClientWallet) public ClientWallets; // direct access mapping (bytes32 => ClientWallet) public ClientWallets; // hash of email
I can code a workaround by using more structs and variables but this seems pointless. I tried mapping bytes32 to address and then to ClientWallet but that failed.
Any ideas about this?