Skip to content

Used to compute sums, counts and averages from incoming input across various categories and tags

License

Notifications You must be signed in to change notification settings

Intercoin/StatsContract

Repository files navigation

StatsContract

Used to compute sums, counts and averages from incoming input across various categories and tags

Deploy

when deploy it is not need to pass parameters in to constructor But after need to run method init() because contract is upgradable

Overview

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

Methods

init

need to run after deploy

Params:

name type description
community address address of community
roleName string role name which specified to send stats data

updateStat

actualize stats if want not nothing to send

Params:

name type description
tag bytes32 tag name

record

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

avgByTag

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

avgSumByAllTags

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

allTags

will return list of all tags name

Return params:

name type description
list bytes32[] list with tags name

About

Used to compute sums, counts and averages from incoming input across various categories and tags

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published