Form cover
Page 1 of 1

Week 2 Session 4 Quest

This session takes builders from environment setup to live on-chain interaction. Using Foundry, you will scaffold a payments project, write a real Payment Splitter and Escrow contract in Solidity, deploy both to the Fuji testnet using the Avalanche CLI, and execute live cast transactions against your deployed contracts.

Name

Email

Required only if you might need a response.

Do you have your github account created https://github.com/?

Do you have your github account created https://github.com/?

If yes,Drop us link to your GitHub acc.

Scaffold Your Foundry Payments Project

Set up a complete Foundry project for on-chain payments from scratch. This confirms you can initialise a professional Solidity development environment and wire in OpenZeppelin dependencies a baseline skill for every subsequent build in this cohort.
What to submit: 1.Run forge init inside a folder named avalanche-payments-foundry and share a screenshot of the clean project tree (tree -L 2 or your file explorer). 2.Paste your final foundry.toml showing [profile.default] with the correct Fuji RPC URL, Solidity version, and the OpenZeppelin remapping. 3.Share a screenshot of forge install OpenZeppelin/openzeppelin-contracts running successfully.

đź’ˇ Note: Your .env file must NOT appear in any screenshot. Add it to .gitignore before pushing.

Write the PaymentSplitter Contract

Implement a Solidity PaymentSplitter contract that accepts an ERC-20 token and splits a payment between two recipients in any ratio specified by the caller. Your contract must import from OpenZeppelin and emit an event on every split.

What to submit:

1.Paste the complete Solidity source of your PaymentSplitter contract (contracts/PaymentSplitter.sol). 2.Include a brief comment block at the top of the file explaining what the splitPayment function does and why you approve the token before calling it. 3.Show forge build output with zero errors.

đź’ˇ Note: Your splitPayment function signature must match: splitPayment(address tokenA, address recipientA, address recipientB, uint256 amountA, uint256 amountB)

Deploy to Fuji & Verify On-Chain

Use your DeployPayments.s.sol script together with the Avalanche CLI key you created tonight to broadcast your PaymentSplitter and Escrow contracts to the Fuji C-Chain. Confirm deployment using Snowtrace and cast.

What to submit:

Share the full terminal output of forge script ... --broadcast (redact your private key it should never appear; use $PRIVATE_KEY). Paste the Snowtrace link to your deployed PaymentSplitter contract (testnet.snowtrace.io). Run cast balance

đź’ˇ Note: You must use source .env before running the forge script command. Never hardcode your private key in the script file.

Execute a Live Split Payment with Cast

Interact directly with your deployed PaymentSplitter contract using cast send. Approve the mUSDC spend, execute a 70/30 split, and confirm both recipient balances changed on-chain. This proves you can drive a deployed contract from the CLI a key skill for testing and devops.

What to submit:

Share the terminal output of the cast send approve transaction (with tx hash). Share the terminal output of the cast send splitPayment transaction (with tx hash). Run cast call $TOKEN 'balanceOf(address)(uint256)'

Avalanche Academy Smart Contracts on Avalanche (Certification)

Complete the 'Smart Contracts on Avalanche' course on Avalanche Academy and earn your official certificate. Everything you built tonight Foundry, Solidity, Fuji deployment maps directly to the Academy content. This is your chance to get a globally-recognised credential that proves your Avalanche builder status to the world.

What to submit:

Visit: https://academy.avax.network and log in (or create a free account). Search for the course 'Smart Contracts on Avalanche' and complete all modules here https://docs.avax.network/academy/blockchain/solidity-foundry Download your certificate as a PDF and upload it to Plug and Play as your Quest 5 submission. Upload your Avalanche Academy Certificate showing the course as completed.

đź’ˇ Note: This certification counts toward your certified builder status, which is reported directly to the Avalanche Foundation. Do not skip it!

Post & Tag (social activity)

Build in public from day one. Write ONE post on X (or LinkedIn) about the Sessions . something you learned, something that surprised you, something you’re going to build. Tag us so we can amplify it.
Feel free to use this poster to show you are attending the mini hack;https://drive.google.com/file/d/1lEZbDm9xDqxOGVBF6VWHcBHQrWzRQBta/view?usp=drivesdk
Must tag: @AvaxAfrica @FOEG_Labs @BCentreNBO @lavenderesther1 @KenyaTechEvents @the_sylus @code_mwangi
Must include: #Team1Kenya #MiniHack #BuildOnAvalanche

Attach Link to the post here.

Reflection

What’s the one thing from the sessions that’s still sitting with you?