armaniferrante 4 lat temu
rodzic
commit
ab576305c2
1 zmienionych plików z 4 dodań i 6 usunięć
  1. 4 6
      README.md

+ 4 - 6
README.md

@@ -18,16 +18,14 @@ For example, one could imagine easily writing a faulty SPL token program that fo
 See a full example [here](./examples/basic/src/lib.rs) along with a generated [IDL](./examples/basic/idl.json).
 
 ```rust
-use anchor::prelude::*;
-
 // Program instruction handler.
 
 #[program]
 mod example {
     pub fn create_root(ctx: Context<Initialize>, initial_data: u64) {
       let root = &mut ctx.accounts.root;
-	  root.account.initialized = true;
-	  root.account.data = initial_data;
+      root.account.initialized = true;
+      root.account.data = initial_data;
     }
 }
 
@@ -63,7 +61,7 @@ The `#[program]` attribute marks a program.
 ```rust
 #[program]
 mod example {
- ...
+   ...
 }
 ```
 
@@ -72,7 +70,7 @@ Internally, this generates the usual Solana entry code, i.e.,
 ```rust
 solana_program::entrypoint!(entry);
 fn entry(program_id: &Pubkey, accounts: &[AccountInfo], instruction_data: &[u8]) -> ProgramResult {
-  ...
+    ...
 }
 ```