Skip to content

Commit

Permalink
Merge pull request #47 from FuelLabs/SilentCicero-example-simplify
Browse files Browse the repository at this point in the history
Simplify example.
  • Loading branch information
SilentCicero authored Mar 16, 2024
2 parents a2aa012 + 80bf1aa commit 7172101
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions projects/swaypad/src/main.sw
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
contract;

abi TestContract {
abi Counter {
#[storage(read, write)]
fn increment_counter(amount: u64) -> u64;
fn increment(amount: u64) -> u64;

#[storage(read)]
fn get_counter() -> u64;
fn get() -> u64;
}

storage {
counter: u64 = 0,
}

impl TestContract for Contract {
impl Counter for Contract {
#[storage(read, write)]
fn increment_counter(amount: u64) -> u64 {
fn increment(amount: u64) -> u64 {
let incremented = storage.counter.read() + amount;
storage.counter.write(incremented);
incremented
}

#[storage(read)]
fn get_counter() -> u64 {
fn get() -> u64 {
storage.counter.read()
}
}
}

0 comments on commit 7172101

Please sign in to comment.