Simple Storage

Complete SimpleStorage, a contract that stores a single state variable named text of type string.

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

contract SimpleStorage {
    string public text;

    function set(string calldata _text) external {
        text = _text;
    }

    function get() external view returns (string memory) {
        return text;
    }
}

Last updated

Was this helpful?