Once we finished the cycle, we move into the distribution state. Now we know which oracles lost and which won.
To process the data and set the rewards for each oracles we now have to call this function in KonaPools, once for each Pool:

  • distributeFunds: it takes the pool that you want to calculate the values for. This function will set all the values inside the KonaStaking and Pool contracts to then later allow each user that voted in that cycle for a certain oracle to claim their tokens/ receive their slashing.

Remember that only when we called this for all valid Pools, we can move to the following state. Any user can call this function to guarantee decentralization.