Used to compute sums, counts and averages from incoming input across various categories and tags
when deploy it is not need to pass parameters in to constructor But after need to run method init() because contract is upgradable
once installed will be use methods:
method name | called by | description |
---|---|---|
init | anyone | need to initialize after contract deploy |
updateStat | only which rolew specified at Community Contract | actualize stats if want nothing to send |
record | only which rolew specified at Community Contract | Method reciev stats data |
avgByTag | anyone | return average by tag name and period |
avgSumByAllTags | anyone | return average by all tags name and period |
allTags | anyone | return list of all tags name |
need to run after deploy
Params:
name | type | description |
---|---|---|
community | address | address of community |
roleName | string | role name which specified to send stats data |
actualize stats if want not nothing to send
Params:
name | type | description |
---|---|---|
tag | bytes32 | tag name |
will send stats data
Params:
name | type | description |
---|---|---|
tag | bytes32 | tag name |
price | uint256 | price |
Note that all prices can be multiplied to some fraction to avoid zeros of integer type
will return average by tag name and period
Params:
name | type | description |
---|---|---|
tag | string | tag name |
period | uint256 | period in seconds enum(86400,604800,2592000,31536000) ie STATS_DAY,STATS_WEEK,STATS_MONTH,STATS_YEAR |
will return average by all tags name
Params:
name | type | description |
---|---|---|
period | uint256 | period in seconds enum(86400,604800,2592000,31536000) ie STATS_DAY,STATS_WEEK,STATS_MONTH,STATS_YEAR |
will return list of all tags name
Return params:
name | type | description |
---|---|---|
list | bytes32[] | list with tags name |