Skip to main content

Crate stylus_hello_world

Crate stylus_hello_world 

Source
Expand description

Stylus Hello World

The following contract implements the Counter example from Foundry.

contract Counter {
    uint256 public number;
    function setNumber(uint256 newNumber) public {
        number = newNumber;
    }
    function increment() public {
        number++;
    }
}

The program is ABI-equivalent with Solidity, which means you can call it from both Solidity and Rust. To do this, run cargo stylus export-abi.

Note: this code is a template-only and has not been audited.

Structs§

Counter

Functions§

mark_used
user_entrypoint