Contract to manage DGX rewards
/contracts/interactive/DaoRewardsManager.sol

Digix Holdings

constructor

DaoRewardsManager

inputs0address_resolver
inputs1address_dgxAddress
event

StartNewQuarter fc764255

inputs0uint256_quarterNumber
function, constant

ADDRESS_DGX_TOKEN 0d12144b

function, constant

CONTRACT_ADDRESS db4ecbc1

function

calculateGlobalRewardsBeforeNewQuarter 7bf4a98d

Function called by the founder after transfering the DGX fees into the DAO at the beginning of the quarter

This function needs to do lots of calculation, so it might not fit into one transaction As such, it could be done in multiple transactions, each time passing _operations which is the number of operations we want to calculate. When the value of _done is finally true, that's when the calculation is done. Only after this function runs, any other activities in the DAO could happen. Basically, if there were M participants and N moderators in the previous quarter, it takes M+N "operations". In summary, the function populates the DaoQuarterInfo of this quarter. The bulk of the calculation is to go through every participant in the previous quarter to calculate their effectiveDGDBalance and sum them to get the totalEffectiveDGDLastQuarter

inputs0uint256_operations
function

claimRewards 372500ab

Function for users to claim the claimable DGX rewards

Will revert if _claimableDGX < MINIMUM_TRANSFER_AMOUNT of DGX. Can only be called after calculateGlobalRewardsBeforeNewQuarter() has been called in the current quarter This cannot be called once the current version of Dao contracts have been migrated to newer version

function, constant

currentQuarterNumber 7f6a26b6

Get the current quarter index

Quarter indexes starts from 1

outputs0uint256_quarterNumber

the current quarter index

function, constant

currentTimeInQuarter 560a25ea

Get the current relative time in the quarter

For example: the currentTimeInQuarter of the first second of any quarter is 1

outputs0uint256_currentT

the current relative time in the quarter

function, constant

getUintConfig b1e2b9dd

inputs0bytes32_configKey
function, constant

get_contract 3f83acff

Get the address of a contract

inputs0bytes32_key

the resolver key to look up

outputs0address_contract

the address of the contract

function, constant

isDaoNotReplaced d70d9358

Check if the DAO contracts have been replaced by a new set of contracts

outputs0bool_isNotReplaced

true if it is not replaced, false if it has already been replaced

function, constant

isLockingPhase 7d6fed80

Check if it is currently in the locking phase

No governance activities can happen in the locking phase. The locking phase is from t=0 to t=CONFIG_LOCKING_PHASE_DURATION-1

outputs0bool_isLockingPhase

true if it is in the locking phase

function, constant

isMainPhase 68533060

Check if it is currently in a main phase.

The main phase is where all the governance activities could take plase. If the DAO is replaced, there can never be any more main phase.

outputs0bool_isMainPhase

true if it is in a main phase

function, constant

key 3943380c

function

moveDGXsToNewDao 3f5a7583

Function to transfer the claimableDGXs to the new DaoRewardsManager

This is done during the migrateToNewDao procedure

inputs0address_newDaoRewardsManager

Address of the new daoRewardsManager contract

function, constant

resolver 04f3bcec

function

updateRewardsAndReputationBeforeNewQuarter 49da49bc

Function to update DGX rewards of user. This is only called during locking/withdrawing DGDs, or continuing participation for new quarter

inputs0address_user

Address of the DAO participant