address UserAddress;
uint256 UserBalance;
uint256[] UserOwnedProducts;
mapping(uint256 => uint256) UserOwnedProductsAmount;
}
function createUser() public {
require(users[msg.sender].UserAddress != msg.sender, "User already created");
User storage newUser;
newUser.UserAddress = msg.sender;
newUser.UserBalance = balances[msg.sender];
users[msg.sender] = newUser;
}
whats wrong?
Guys?
mappings not allowed in structs
https://codeforgeek.com/mappings-inside-structs-in-solidity/
differnce between nested and not erdogan https://medium.com/coinmonks/nested-mapping-error-in-solidity-39edf29eb9af
You can always use it in a library and make declaration from there or better still check openseppeline illiterableMapping for guide.
Обсуждают сегодня