{"id":18819775,"url":"https://github.com/felixoder/foundry-f24-basics","last_synced_at":"2026-01-17T05:30:14.815Z","repository":{"id":259608577,"uuid":"878383689","full_name":"felixoder/foundry-f24-basics","owner":"felixoder","description":"This is a basics of the foundry framework of solidity [scripting plus the smart contract development]","archived":false,"fork":false,"pushed_at":"2024-11-15T11:14:11.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-30T03:19:06.971Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/felixoder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-25T09:40:47.000Z","updated_at":"2024-11-15T11:14:15.000Z","dependencies_parsed_at":"2024-10-26T21:52:27.706Z","dependency_job_id":"6b1da98b-7d36-47f7-a201-18806ff3b8cb","html_url":"https://github.com/felixoder/foundry-f24-basics","commit_stats":null,"previous_names":["felixoder/foundry-f24-basics"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felixoder%2Ffoundry-f24-basics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felixoder%2Ffoundry-f24-basics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felixoder%2Ffoundry-f24-basics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felixoder%2Ffoundry-f24-basics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/felixoder","download_url":"https://codeload.github.com/felixoder/foundry-f24-basics/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239758830,"owners_count":19692033,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T00:24:56.277Z","updated_at":"2026-01-17T05:30:14.776Z","avatar_url":"https://github.com/felixoder.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"When we send someone some money\nThen the transactions fields needs this -\n\n1. Nonce: tx count for the account\n2. Gas Price: price per unit of gas (in wei)\n3. Gas Limit: max gas that this tx can use [21000 for ether]\n4. To: address that the tx is sent to [address that the tx is sent to]\n5. Value: amount of wei to send\n6. Data: what to send to the \"To\" address [empty]\n7. v, r, s : comments of tx signature\n\nto run foundry\nsource /home/debayan/.zshenv\nfoundryup\n\n## How to start with foundry \\*\\*\\*\n\n1. Install the foundry library` curl -L https://foundry.paradigm.xyz | bash`\n2. add something to the source to add forge, anvil, cast, chisel `` source /home/debayan/.zshenv`\n3. run `foundryup` `forge --version, anvil --version, cast --version, chisel --version`\n4. `forge init ` To initialize a new foundry project\n5. `forge compile` To compile the project\n6. `anvil` to run the anvil : That will be important to onchain transactions and also deployment of the contract to onchain and add the link and import a nice Security key to metamask wallet\n7. `forge create --interactive ` to DEPLOY [It will ask for a Private Key Provide the private key provided by anvil That you added to metamask Localhost]\n8. `forge create SimpleStorage --rpc-url http://127.0.0.1:8545 --private-key ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80`\n   This is the normal and ideal way to put the deployment logics\n\n## Scripting logs\n\n`forge script script/DeploySimpleStorage.s.sol --rpc-url  http://127.0.0.1:8545`\nBroadCast `forge script script/DeploySimpleStorage.s.sol --rpc-url  http://127.0.0.1:8545 --broadcast --private-key ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80`\n\n11. to convert the hex to dec ` cast --to-base 0x572e0 dec`\n\nIMPORT KEYSTOTRES\n`cast wallet import sepoliaWallet --interactive`\n`cast wallet list` [to show all wallets]\n\n`forge script script/DeploySimpleStorage.s.sol --rpc-url $RPC_URL --account myPass --sender $ADDRESS --broadcast -vvvv `\n`forge script script/DeploySimpleStorage.s.sol --rpc-url $RPC_URL --account myPass --sender $ADDRESS --broadcast -vvvv `\n`cast send $ADDRESS \"store(uint256)\" 123 --rpc-url $RPC_URL --private-key $PRIVATE_KEY`\n\n`cast call $ADDRESS \"retrieve()\"`\n\nFOR SEPOLIA\n`forge script script/DeploySimpleStorage.s.sol --rpc-url $SEPOLIA_RPC_URL --account sepoliaWallet --sender 0x13bbf2898f904e9d206ab5363e25fe29be83103d --broadcast -vvvv `\n\n[THE CONTRACT ADDRESS IS THE ADDRESS THAT WE GET AFTER DEPLOYING THE CONTRACT TO THE TESTNET]\n\nTO USE THE CONTRACT [eg store function ]\n`cast send 0x7C6fd774dd133F027EE00ce978bee9CACfa85eE6 \"store(uint256)\" 53 --rpc-url $SEPOLIA_RPC_URL --interactive`\n\nTO RETRIEVE (view function)\n`cast call 0x7C6fd774dd133F027EE00ce978bee9CACfa85eE6 \"retrieve()\"`\n\n# FORMATTING THE CODE\n\nforge fmt\n\nFOR ZKSYNC\n\n1.  install `foundry-zksync`\n2.  Compile with `--zksync`\n3.  Reinstall vanilla foundry\n\nSTEPS\n\n1.  git clone https://github.com/matter-labs/foundry-zksync.git\n2.  source /home/debayan/.zshenv\n3.  foundryup-zksync\n4.  foundryup [to override the all vanilla foundry]\n\nRUN COMMAND 3 to get back the ZkSync\n\n`forge build --zksync` = compile to L2 (zkSync)\n\n`npx zksync-cli dev config `\n`npx zksync-cli dev start`\n\nDEPLOY TO ZKSYNC\n`forge create src/SimpleStorage.sol:SimpleStorage --rpc-url http://127.0.0.1:8011 --private-key 0x7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110 --legacy --zksync `\n\n--legacy flag means type 1 transaction\nand without --legacy flag it will be type 2 transaction\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelixoder%2Ffoundry-f24-basics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffelixoder%2Ffoundry-f24-basics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelixoder%2Ffoundry-f24-basics/lists"}