Rubidity by Example
Storage Example
contract SimpleStorage {
uint storedData;
function set(uint x) public {
storedData = x;
}
function get() public view returns (uint) {
return storedData;
}
}class Contracts::SimpleStorage < Contract
uint256 :storedData
function :set, { x: :uint256 }, :public do
s.storedData = x
end
function :get, {}, :public, :view, returns: :uint256 do
return s.storedData
end
constructor() {}
endContract Definition
Function Definitions
Set Function
Get Function
Accessing State
Token Minting Example
Last updated