Created
March 7, 2023 12:44
-
-
Save DavideSilva/534b244e5abbbd26f380c8a746908aba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[contract] | |
mod HelloStarknet { | |
struct Storage { | |
balance: felt, | |
} | |
#[external] | |
fn increase_balance(amount: felt) { | |
let new_balance = balance::read() + amount; | |
balance::write(new_balance); | |
} | |
#[view] | |
fn get_balance() -> felt { | |
balance::read() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment