Helps people contribute money to a project, and choose judges to distribute it for various solutions.
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 |
| name | type | value | description |
|---|---|---|---|
| revokeFee | uint256 | 10e4 | 10% mul at 1e6. penalty for revoke tokens |
once installed will be use methods:
| method name | called by | contract | description |
|---|---|---|---|
| isContestOnline | anyone | boths | Checking online Contest |
| pledge | anyone | Constest.sol only | can be used to send external token into the contract, and issue internal token balance |
| pledgeETH | anyone | ConstestETHOnly.sol only | can be used to send ETH into the contract, and issue internal token balance |
| delegate | anyone outside the contestant list | boths | user can delegate own vote |
| vote | anyone on the judge list (if judgelist empty anyone outside the contestant list) |
boths | vote for contestant |
| claim | anyone on the contestant list | boths | claim funds |
| enter | anyone | boths | sender is become a contestant |
| leave | anyone on the contestant list | boths | sender leave from contest |
| revoke | anyone outside the contestant list | boths | revoke own vote or delegation |
Checking online Contest Params:
| name | type | description |
|---|---|---|
| stageID | uint256 | Stage number |
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 |
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 |
Params:
| name | type | description |
|---|---|---|
| judge | address | address of judge which user want to delegate own vote |
| stageID | uint256 | Stage number |
Params:
| name | type | description |
|---|---|---|
| contestantAddress | address | address of contestant which user want to vote |
| stageID | uint256 | Stage number |
Params:
| name | type | description |
|---|---|---|
| stageID | uint256 | Stage number |
Params:
| name | type | description |
|---|---|---|
| stageID | uint256 | Stage number |
Params:
| name | type | description |
|---|---|---|
| stageID | uint256 | Stage number |
Params:
| name | type | description |
|---|---|---|
| stageID | uint256 | Stage number |
- creation Contest. emitting event
ContestStart. Starting Contest Period withStageID= 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
- anyone can enter to contest calling method
- as soon as pledging by people become more than "stagesMinAmount" Contest Period will be extended for
contestPeriodInSecondsseconds. and stop there- emitting
StageStartAnnounced
- emitting
- starting Voting period for
votePeriodInSecondsseconds.- 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
revokePeriodInSecondsseconds.- 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
- emitting