From 1258b62aea90009f18ede00b9a534572804fe215 Mon Sep 17 00:00:00 2001 From: wawilow Date: Wed, 31 Jul 2024 08:41:16 -0400 Subject: [PATCH] Docs and other stuff --- README.md | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 264fcab..2661c52 100644 --- a/README.md +++ b/README.md @@ -34,20 +34,50 @@ I understand the basics, but just repeat Alibaba cave theory (not plato's!!!!!) > Victor want to make sure what Peggy knows secret key from the dor in alibaba cave +> > The cave is `Q` form, tail is exit, in the opposite side of cave is magic door, this door opens only with secret key +> > Peggy don't want say secret key to Victor, she needs only proof what she now it +> > Solution - Peggy goes to the cave first, he is going randomly left or right, Victor got no clue where she has goes. +> > Victor goes to the cave after peggy, flip a coin and asking her to go from the coin side +> > It will work with 50% chance if Peggy don't know secret key, so they have to make it like 10-20 times (if 10 = (0.5 ** 10) = 0.0009765625) Okay, cool, but, why do the make it more complicated. Why they don't came in this cave together, Peggy goes for example on the left and comes out on the right side ## Time to actually some code +### Build contract +```bash +forge build -h +``` +### Deploy contract on blockchain Simplest command +[//]: # (forge create --rpc-url --private-key src/MyContract.sol:MyContract) ```bash -forge create --rpc-url --private-key src/MyContract.sol:MyContract +forge create --rpc-url http://localhost:6969 --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 src/Counter.sol:Counter ``` -Ful command +Full stuff command +```bash +forge create --rpc-url \ + --constructor-args "ForgeUSD" "FUSD" 18 1000000000000000000000 \ + --private-key \ + --etherscan-api-key \ + --verify \ + src/MyToken.sol:MyToken +``` + +### Verify contract if you not ```bash -forge create --rpc-url --private-key src/MyContract.sol:MyContract +forge verify-contract \ + --chain-id 11155111 \ + --num-of-optimizations 1000000 \ + --watch \ + --constructor-args $(cast abi-encode "constructor(string,string,uint256,uint256)" "ForgeUSD" "FUSD" 18 1000000000000000000000) \ + --etherscan-api-key \ + --compiler-version v0.8.10+commit.fc410830 \ + \ + src/MyToken.sol:MyToken ``` +I really like forge, it has good asf documentation, and it's fucking working, like really just working - and working good!