- Follow the link to install Foundry, Node.js, and PNPM: https://mud.dev/quickstart
- From the root
pa-hack
directory, run the commandpnpm install
. - Navigate to the
contracts
folder by runningcd packages/contracts
from the root directory. - Change your MUD namespace in the
contracts/mud.config.ts
file. - After changing the namespace, run the command
pnpm clean
. Note: If you encounter an error in the/scripts
folder, 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.ts
file. 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.ts
file.
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.ts
file.
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.ts
file. - Note: You can change the caller by changing the PLAYER_KEY in the
.env
file.
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.ts
file.
pnpm run claim-prize
- Comment out the