- Follow the link to install Foundry, Node.js, and PNPM: https://mud.dev/quickstart
- From the root
pa-hackdirectory, run the commandpnpm install. - Navigate to the
contractsfolder by runningcd packages/contractsfrom the root directory. - Change your MUD namespace in the
contracts/mud.config.tsfile. - After changing the namespace, run the command
pnpm clean. Note: If you encounter an error in the/scriptsfolder, comment out theIKingOfTheHill(worldAddress)part. - Build the project by running the command
pnpm build. - Deploy the project on the PA world using the command:
pnpm run deploy:testnet --world-address 0x8dc9cab3e97da6df615a8a24cc07baf110d63071 - Uncomment the
IKingOfTheHill(worldAddress)line in the/scripts/directory undercontracts. Change your prefix based on themud.config.tsfile. Example:SetKingOfTheHillConfig.s.sol IKingOfTheHill(worldAddress).yourMudPrefix__setKingOfTheHillConfig(smartStorageUnitId, 3 minutes, itemId, 3)
-
Deploy KingOfTheHill contracts on the PA world:
pnpm run deploy:testnet --world-address 0x8dc9cab3e97da6df615a8a24cc07baf110d63071 -
Setup KingOfTheHill game config:
- Comment out the
IKingOfTheHill(worldAddress)part inscripts/SetKingOfTheHillConfig.s.ts. - Change the prefix of the function based on your
mud.config.tsfile.
pnpm run setup-koth - Comment out the
-
Reset KingOfTheHill game:
- Comment out the
IKingOfTheHill(worldAddress)part inscripts/SetKingOfTheHillConfig.s.ts. - Change the prefix of the function based on your
mud.config.tsfile.
pnpm run reset-game - Comment out the
-
Claim King on KingOfTheHill game:
- Comment out the
IKingOfTheHill(worldAddress)part inscripts/ClaimKing.s.ts. - Change the prefix of the function based on your
mud.config.tsfile. - Note: You can change the caller by changing the PLAYER_KEY in the
.envfile.
pnpm run claim-king - Comment out the
-
Claim KingOfTheHill prize:
- Comment out the
IKingOfTheHill(worldAddress)part inscripts/ClaimPrize.s.ts. - Change the prefix of the function based on your
mud.config.tsfile.
pnpm run claim-prize - Comment out the