August 2018
Intermediate to advanced
404 pages
11h 19m
English
Follow these steps to create mappings in solidity:
contract test { struct Person { uint id; string name; } mapping(address => Person) employees; mapping(address => uint) balances; function insert(address _employee, uint _id, string _name, uint _balance) public { employees[_employee] = Person({ id: _id, name: _name }); balances[_employee] = _balance; }}
Mappings can be nested to create a more complex data structure:
contract test { mapping(address ...