MCPcopy Create free account
hub / github.com/AlmostEfficient/full-stack-solana-dev / initialize

Function initialize

counter/programs/counter/src/lib.rs:9–15  ·  view source on GitHub ↗
(ctx: Context<Initialize>)

Source from the content-addressed store, hash-verified

7 use super::*;
8
9 pub fn initialize(ctx: Context<Initialize>) -> Result<()> {
10 let counter = &mut ctx.accounts.counter;
11 counter.bump = ctx.bumps.counter; // store bump seed in `Counter` account
12 msg!("Counter account created! Current count: {}", counter.count);
13 msg!("Counter bump: {}", counter.bump);
14 Ok(())
15 }
16
17 pub fn increment(ctx: Context<Increment>) -> Result<()> {
18 let counter = &mut ctx.accounts.counter;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected