npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

contestcontract

v1.0.2

Published

Helps people contribute money to a project, and choose judges to distribute it for various solutions.

Downloads

3

Readme

ContestContract

Helps people contribute money to a project, and choose judges to distribute it for various solutions.

Deploy

when deploy it is need to pass parameters in to init method Params: name | type | description --|--|-- stagesCount|uint256|count of stages for Contest stagesMinAmount|uint256|array of minimum amount that need to reach at each stage. length array should be the same as stagesCount contestPeriodInSeconds|uint256|duration in seconds for contest period(exclude before reach minimum amount) votePeriodInSeconds|uint256|duration in seconds for voting period revokePeriodInSeconds|uint256|duration in seconds for revoking period percentForWinners|uint256[]|array of values in percentages of overall amount that will gain winners judges|address[]|array of judges' addresses. if empty than everyone can vote

Settings

name|type|value|description --|--|--|-- revokeFee|uint256|10e4|10% mul at 1e6. penalty for revoke tokens

Overview

once installed will be use methods:

Methods

isContestOnline

Checking online Contest Params: name | type | description --|--|-- stageID|uint256|Stage number

pledge

can be used only with Constest.sol to send external token into the contract, and issue internal token balance Params: name | type | description --|--|-- amount|uint256|amount to pledge stageID|uint256|Stage number

pledgeETH

can be used only with ConstestETHOnly.sol to send ETH into the contract, and issue internal token balance Note that ETH need to send with transaction/ not directly to contract via native recieve() Params: name | type | description --|--|-- amount|uint256|amount to pledge stageID|uint256|Stage number

delegate

Params: name | type | description --|--|-- judge|address|address of judge which user want to delegate own vote stageID|uint256|Stage number

vote

Params: name | type | description --|--|-- contestantAddress|address|address of contestant which user want to vote stageID|uint256|Stage number

claim

Params: name | type | description --|--|-- stageID|uint256|Stage number

enter

Params: name | type | description --|--|-- stageID|uint256|Stage number

leave

Params: name | type | description --|--|-- stageID|uint256|Stage number

revoke

Params: name | type | description --|--|-- stageID|uint256|Stage number

Lifecycle of Contest

  • creation Contest. emitting event ContestStart. Starting Contest Period with StageID = 0
    • anyone can enter to contest calling method enter() and become contestant
    • anyone can leave to contest calling method leave() and remove itself from contestant list
    • anyone can pledge smth to contest calling method pledge() if didn't not become contestant earlier
  • as soon as pledging by people become more than "stagesMinAmount" Contest Period will be extended for contestPeriodInSeconds seconds. and stop there
    • emitting StageStartAnnounced
  • starting Voting period for votePeriodInSeconds seconds.
    • judge can vote for contestants
    • if judgeList was empty then anyone who pledged before can vote
    • anyone who pledged before can revoke own tokens with gradually increased penalty from 0 to revokeFee
  • starting Revoking period for revokePeriodInSeconds seconds.
    • anyone who pledged before can revoke own tokens with revokeFee penalty
  • Stage completed.(after any request with stageID).
    • emitting ContestWinnerAnnounced
    • if winners exists, then
      • reward winners
      • reward losers (if left smth from winners) they will get equally
    • if winners does not exists, then all who pledged will get equally
    • next stage will begin if current stage < stagesCount