Docs/Developers
Deploy the contracts
Deploy your own Scarf, Forwarder and Paymaster to Base Sepolia.
Set up#
Terminal
cd Contract
npm installCreate Contract/.env:
.env
PRIVATE_KEY=your_deployer_private_key
SEPOLIA_BASE_URL=https://sepolia.base.org
ETHERSCAN_API_KEY=your_etherscan_keyDeploy and verify#
Terminal
npx hardhat compile
npx hardhat ignition deploy ./ignition/modules/Scarf.ts --network sepoliaBase
npx hardhat run scripts/verify.ts --network sepoliaBaseIgnition deploys in order: Forwarder, then Scarf and the Paymaster, both pointing at the Forwarder.
After deploying#
- 1
Point the app at your contracts
SetNEXT_PUBLIC_SCARF_ADDRESS,NEXT_PUBLIC_FORWARDER_ADDRESSandNEXT_PUBLIC_PAYMASTER_ADDRESSinFrontend/.env.local. - 2
Fund the Paymaster
Send it ETH, or calldeposit(). It pays relayer refunds from this balance. - 3
Fund the relayer
TheRELAYER_PRIVATE_KEYwallet pays gas up front, so give it some ETH. - 4
Regenerate types (if the ABI changed)
Copy the new ABI intoFrontend/blockchainand runnpm run typechain.