Skip to content

Conversation

@orhanoguz356
Copy link

No description provided.

Copy link
Author

@orhanoguz356 orhanoguz356 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stellar contract invoke ... -- --help
#![no_std]
use soroban_sdk::{contract, contractimpl, log, symbol_short, Env, Symbol};

const COUNTER: Symbol = symbol_short!("COUNTER");

#[contract]
pub struct IncrementContract;

#[contractimpl]
impl IncrementContract {
/// Increment increments an internal counter, and returns the value.
pub fn increment(env: Env) -> u32 {
let mut count: u32 = env.storage().instance().get(&COUNTER).unwrap_or(0);
log!(&env, "count: {}", count);

    count += 1;
    env.storage().instance().set(&COUNTER, &count);
    env.storage().instance().extend_ttl(50, 100);

    count
}

}

mod test;

@tupui
Copy link
Contributor

tupui commented Jan 12, 2026

Looks like a mistake @orhanoguz356 😉 I don't think there is anything here.

Copy link
Author

@orhanoguz356 orhanoguz356 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#![no_std]
use soroban_sdk::{contract, contractimpl, symbol_short, vec, Env, Symbol, Vec};

#[contract]
pub struct HelloContract;

#[contractimpl]
impl HelloContract {
pub fn hello(env: Env, to: Symbol) -> Vec {
vec![&env, symbol_short!("Hello"), to]
}
}

mod test;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants