Coder Social home page Coder Social logo

ccs-cadence's Introduction

ccs-cadence

The main logic is

  1. creator spend tokens to create an activity

  2. other users spend tokens to buy ballots then spend ballot to vote activities

  3. admin close activity and mint NFT to voter who vote at right side, this is automatic task at server

  4. NFT can increase user voting power

    ps: all useful data will emit by event and sync to server database

how to run unit test

  1. brew install flow-cli (if flow-cli not install)
  2. cd tests && yarn
  3. yarn test

how to run local dev environment

  1. flow emulator
  2. open a new terminal
  3. flow project deploy (maybe need modify emulator-account's key in ./flow.json to servicePrivKey which find the emulator output)

how to deploy testnet

  1. cp .env.example .env and fill your key info
  2. deploy use flow project deploy -n testnet
  3. (redeploy) run sh remove.sh, then rewrite all path in contract's init(), for example, replace self.ActivityStoragePath = /storage/ActivitiesCollection_0 to self.ActivityStoragePath = /storage/ActivitiesCollection_1, than run 2.
  4. check deploy result at https://flow-view-source.com/testnet/account/[contract_address]
  5. use flow keys generate and flow transactions send ./transactions/account/add_keys.cdc [PK] -n testnet --signer testnet-account for server key rotation sign.

how to close activity manualy

  1. fill moderator account and private in .env
  2. flow transactions send transactions/Activity/close_activity.cdc ACTIVITYID --network testnet --signer testnet-account

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.