Spec:
- Wallets have sums paid to them for different tokens.
Design
- Wallet address maps to totalpaid by token.
Implementation
- Two mappings, one for wallet address, one for a token label (designed to be an integer based on a second struct)
Error
- Integer constant expected
This line fails -
uint _TotalPaid = PaymentDetail[_TokenIndex][_Wallet].TotalPaid;
Has anyone any ideas about how to solve this error?
Here is the code -
struct PaymentDetail { uint TotalPaid; } mapping (bytes32 => mapping (uint => PaymentDetail[]) ) public PaymentDetails; function addPaymentDetail (bytes32 _Wallet, uint _TokenIndex, uint _Payment) public { uint _TotalPaid = PaymentDetail[_TokenIndex][_Wallet].TotalPaid; _TotalPaid=_TotalPaid+_Payment; PaymentDetail[_Wallet][_TokenIndex].TotalPaid=_TotalPaid; }