Cyfrin-Updraft-Course
-
This are personal notes for the course am taking on
Cyfrin Updraft Course
. -
The course deals with blockchain development and security auditting.
-
Notes:
To previews markdown, use [Ctr + Shift + V]
For Italics use: * word *
For Bold use: ** word **
- Creating a Foundry project on cmd, use the following commands:
Command for biulding or compiling:
forge compile
- Initiate the project
forge init
- Biuld and Compile smart contracts in the project
forge build
or
I prefer
forge compile
forge compile
- After making changed in the smart contracts, run
forge test
to test the updates or run a script usingforge script
forge test
or
forge script
- Run anvil command to list all fake available accounts ready for testing purposes:
anvil
- Command to inpect the storage.
forge inspect Counter storage
- Foundry command to test a function
forge test --match-test test_Increment
cd ~/foundry-f23/foundry-simple-storage-f23
forge create SimpleStorage --interactive
forge script script/DeploySimpleStorage.s.sol --rpc-url http://127.0.0.1:8545 --broadcast --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
cast send 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 "store(uint256)" 1337 --rpc-url $RPC_URL --private-key $PRIVATE_KEY
cast call 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 "retrieve()"
cast --to-base 0x0000000000000000000000000000000000000000000000000000000000000539 dec
forge script script/DeploySimpleStorage.s.sol --rpc-url=$SEPOLIA_RPC_URL --private-key=$PRIVATE_KEY --broadcast
$ forge build
$ forge test
$ forge fmt
$ forge snapshot
$ anvil
$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key>
$ cast <subcommand>
$ forge --help
$ anvil --help
$ cast --help
- On Replay Attacks i.e Double Spending:
nonce
is a unique identifier assigned to each transaction sent from a specific account. The nonce is used to ensure that each transaction is processed only once and to prevent replay attacks. nonce is incremented with every single transaction;
- Terms
- RPC -> Remote Procedure Call (RPC) URL
- Naas -> Node As A Service ...such as Alchemy.
- Happy Web3 Revolution