My attempt at learning Solana program (smart contract) development through RareSkill's Solana course.
- Day 1: Hello World (Solana installation)
- Day 2: Function arguments, math, and arithmetic overflow
- Day 3: Anchor function magic and the Interface Definition Language
- Day 4: Solana reverts, errors, and basic access control
- Day 5: Where is the constructor? About anchor deploy
- Day 6: Solidity Translations to Rust and Solana
- Day 7: The unusual syntax of Rust
- Day 8: Understanding function-like macros in Rust
- Day 9: Rust Structs and Attribute-like and Custom Derive Macros
- Day 10: Translating Solidity function visibility and contract inheritance to Solana
- Day 11: Block variables in Solana: block.timestamp and block.number and others
- Day 12: Beyond the block: Sysvars
- Day 13: Native Programs: Sysvars
- Day 14: tx.origin, msg.sender, and onlyOwner in Solana
- Day 15: Transaction fees and compute units
- Day 16: Accounts in Solana
- Day 17: Writing to storage
- Day 18: Reading Accounts from Typescript — an alternative to public variables and view functions
- Day 19: Creating mappings and nested mappings in Solana
- Day 20: Cost of storage, maximum storage size, and account resizing
- Day 21: Reading an account balance in Rust: address(account).balance in Solana
- Day 22: More differences: modifiers, view pure, payable, and fallback in Solana
- Day 23: Building a payment splitter: “payable” and “msg.value” in Solana
- Day 24: Authorizing various wallets to write to an account: "Pranking tx.origin"
- Day 25: PDA vs Keypair Accounts
- Day 26: Understanding Account Ownership in Solana: Transferring SOL out of a PDA
- Day 27: init_if_needed and the Reinitialization Attack
- Day 28: Multicall in Solana: Batching Transactions
- Day 29: Owner vs Authority
- Day 30: Deleting Accounts and Closing Programs
❯ anchor deploy
Deploying cluster: https://api.devnet.solana.com
Upgrade authority: /Users/ajackti/.config/solana/id.json
Deploying program "day_2"...
Program path: /Users/ajackti/Downloads/Code/Solana/rareskills-solana-tutorial/day_2/target/deploy/day_2.so...
=============================================================================
Recover the intermediate account's ephemeral keypair file with
`solana-keygen recover` and the following 12-word seed phrase:
=============================================================================
slide swear salmon castle awkward alter fossil swamp tonight note invest code
=============================================================================
To resume a deploy, pass the recovered keypair as the
[BUFFER_SIGNER] to `solana program deploy` or `solana program write-buffer'.
Or to recover the account's lamports, pass it as the
[BUFFER_ACCOUNT_ADDRESS] argument to `solana program close`.
=============================================================================
Error: Deploying program failed: RPC response error -32002: Transaction simulation failed: Error processing Instruction 0: account data too small for instruction [3 log messages]
There was a problem deploying: Output { status: ExitStatus(unix_wait_status(256)), stdout: "", stderr: "" }.```
- Follow the below solution:
rm -rf target
anchor build
anchor deploy
anchor keys sync