I want to use two dimensional mapping or array but one key should be address and the other key is a number ,how can I do this? Similar to Mapping (address , uint256=> unit) How to do it? Use struct? Thanks
1 Answer
You can have a mapping of a mapping.
mapping (address => mapping(uint256 => uint256))
-
Because mapping uint256=>uint256 will be different for each key address in this way 0x123=>(2=>99) and 0x234=>(2=>99) should be different since actually it is a kind of two dimensional array similar like value[0x1234][2]– LouisNov 28, 2018 at 11:55