For the complete documentation index, see llms.txt. This page is also available as Markdown.

5.3 Writing a Smart Contract

Create a new file in the Remix workspace and define a simple Solidity contract.

Example:

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

contract FreCxStorage {
uint256 public value;

function setValue(uint256 _value) public {
value = _value;
}

function getValue() public view returns (uint256) {
return value;
}
}

This contract demonstrates:

  • state storage (value)

  • a function to update state (setValue)

  • a function to read state (getValue)

Last updated