medium10 pts · first answer countssolidity
Reset that does not reset
After calling reset(id), what is users[id].balance?
struct User { uint256 balance; bool active; }
mapping(uint256 => User) public users;
function reset(uint256 id) external {
User memory u = users[id];
u.balance = 0;
u.active = false;
}Discussion 0
Join free to post in the discussion.
Related questions
- storage, memory, calldataBlockchain Developer
- Why emit eventsBlockchain Developer
- What msg.sender isBlockchain Developer
- Wei and etherBlockchain Developer
- view vs pureBlockchain Developer
- Sending ETH to a functionBlockchain Developer
- receive vs fallbackBlockchain Developer
- Reading a missing mapping keyBlockchain Developer