Giter Club home page Giter Club logo

1-kittyparty-contracts's Introduction

1-kittyparty-contracts

These are the main contracts for Kitty Party Project.

Duration related information

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

Stages

InitialCollection : 0
Collection : 1
Staking : 2
Payout : 3
Completed : 4
Refund : 5

Installation

Clone the repository

 git clone [email protected]:kittypartydefi/1-kittyparty-contracts.git

Install dependencies

 cd 1-kittyparty-contracts/hardhat
 yarn install

Create a .env file that has the mnemonic and other parameters as per .env.sample

Running Locally
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

Testing

TESTS ARE IN THE PROCESS OF BEING UPGRADED

npx hardhat test

Coverage

Currently only covers the ideal test case for the generic Kitty Party Flow

Subgraph

Run local chain

cd hardhat 
  1. Run a local node. Example:
 npx hardhat node --fork https://polygon-mainnet.g.alchemy.com/v2/tDZJwVUxsPjYjSstF0opTtvNFK6FazCj --fork-block-number 17409194
  1. Deploy contracts - I have added an example of kitty joining kitty party.
npx hardhat --network localhost run scripts/deploy.ts

Run subgraph

cd ../services/graph-node
  1. 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.

Deploy subgraph to local graph node

cd ../subgraph

Before deploying, change the address of the contracts in subgraph.yaml -> TODO:automation

 yarn create-local
 yarn deploy-local

Deployment contract info

1-kittyparty-contracts's People

Contributors

cryptobugbear avatar roentgenium281 avatar shaddamciv avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.