0% found this document useful (0 votes)
3 views4 pages

Blockchain Lab 3

This document provides a step-by-step guide to install and run Foundry for deploying a smart contract. It includes commands for installation, verification, and deployment, along with instructions for configuring the project files and running a local server. The document emphasizes not to present any code sections due to potential duplication issues.

Uploaded by

mwaruguru003
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views4 pages

Blockchain Lab 3

This document provides a step-by-step guide to install and run Foundry for deploying a smart contract. It includes commands for installation, verification, and deployment, along with instructions for configuring the project files and running a local server. The document emphasizes not to present any code sections due to potential duplication issues.

Uploaded by

mwaruguru003
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Steps to follow to run the code shared

1. Install Foundry.

In your terminal, install Foundry by running these commands below, one by one.

sudo apt update


sudo apt install -y curl git build-essential

curl -L [Link] | bash

source ~/.bashrc

foundryup

2. Verify installation by running these commands as well in the terminal (before the “version”
there are two hyphens and no spaces, I spaced them for visibility)

forge - -version

anvil - - version

3. Switch to superuser.

su –

4. Run anvil in this terminal.

LEAVE THIS TERMINAL RUNNING!!

Remember to not present any code sections for this work since this work is duplicated across
some groups and Talo might raise issues. Just present as guided. Thank You!!
5. Open another terminal and repeat Steps 3. Navigate to the project folder.

6. Deploy the contract. Take note of the Deployed To address and copy it.

forge create ./contracts/[Link]:Splitwise \

--rpc-url [Link] \

--broadcast \

--private-key
0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80

Remember to not present any code sections for this work since this work is duplicated across
some groups and Talo might raise issues. Just present as guided. Thank You!!
7. In Lab3/StarterCode/web_app/[Link], locate the var contractAddress variable and paste the
Transaction Hash.
8. Then in the project folder, go to this file StarterCode/build/[Link]/[Link]. it
has the ABI to use for the lab. Copy paste it, and also copy paste the entire [Link] in
ChatGPT/Deepseek and tell it to structure the ABI you provided to follow the structure of the
ABI already used in the code I shared. (In case this is confusing ask but yeah, do not let it
change anything other than the structure of the ABI. Once it gives you the structure, replace it
in the var abi variable).
9. In the new terminal, run a python server.

python3 -m [Link] 3000

10. Access the [Link] in Firefox on your Linux VM.

Remember to not present any code sections for this work since this work is duplicated across
some groups and Talo might raise issues. Just present as guided. Thank You!!
11. Press Ctrl+Shift+R to clear the browser cache.
12. Click F12 to open the browser console. Type this command

sanityCheck()

Remember to not present any code sections for this work since this work is duplicated across
some groups and Talo might raise issues. Just present as guided. Thank You!!

You might also like