Privacy preferences

Choose separately whether we may use analytics and advertising measurement. Both stay off unless you turn them on. You can change these choices any time.

All challenges

Challenge 1

Solidity simple bug!

LowSolidity basics

Challenge

Can you solve this Solidity simple bug? The name setter should update the stored value.

Starter code

// SPDX-License-Identifier: MIT
pragma solidity 0.8.0;

contract Storage {
  string s_name;

  function changeName(string memory _name) public {
    // Find and fix the missing state update.
  }

  function getName() public view returns (string memory) {
    return s_name;
  }
}
Show hint

The state change belongs inside the setter function.