Menu
Coddy logo textTech

Member Records

Part of the Fundamentals section of Coddy's Solidity journey. Lesson 45 of 53.

challenge icon

Challenge

Medium

Declare struct Member with uint256 points and bool active, plus mapping(uint256 => Member) members. Store the supplied points and active at memberId. Print those stored fields, then the points of memberId + 1.

The tests pass arguments to main in this order: uint256 memberId, uint256 points, bool active. Each test starts with fresh contract state.

Use console.log for the requested output. Print only the requested values, one per line, with no extra labels unless the task specifies them.

Try it yourself

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;
import "forge-std/console.sol";
contract Main {
    function main(uint256 memberId, uint256 points, bool active) external  {
        // Write your solution here.
    }
}

All lessons in Fundamentals

Practice on your own: Solidity playground