These are the main contracts for Kitty Party Project.
lastStageTime --> checked in every stage, it is updated at each stage
timeToCollection --> Relevant to collection only from initial start
durationInDays --> Relevant to staking period only
InitialCollection : 0
Collection : 1
Staking : 2
Payout : 3
Completed : 4
Refund : 5
git clone [email protected]:kittypartydefi/1-kittyparty-contracts.git
cd 1-kittyparty-contracts/hardhat
yarn install
Create a .env file that has the mnemonic and other parameters as per .env.sample
npx hardhat node --fork https://polygon-mainnet.g.alchemy.com/v2/tDZJwVUxsPjYjSstF0opTtvNFK6FazCj --fork-block-number 22477424
Then in a separate window run,
npx hardhat run scripts/deploy.ts --network localhost
Copy over the latest addresses to the createKitty Script
npx hardhat run scripts/createKitty.ts --network localhost
TESTS ARE IN THE PROCESS OF BEING UPGRADED
npx hardhat test
Currently only covers the ideal test case for the generic Kitty Party Flow
cd hardhat
- Run a local node. Example:
npx hardhat node --fork https://polygon-mainnet.g.alchemy.com/v2/tDZJwVUxsPjYjSstF0opTtvNFK6FazCj --fork-block-number 17409194
- Deploy contracts - I have added an example of kitty joining kitty party.
npx hardhat --network localhost run scripts/deploy.ts
cd ../services/graph-node
- Run ./restart.sh
It should show eth_getBlockNumber in around 2-3 minutes in the blockchain terminal. If not, then retry. Sometimes there could be either permission or state cache issue with subgraph.
cd ../subgraph
Before deploying, change the address of the contracts in subgraph.yaml -> TODO:automation
yarn create-local
yarn deploy-local