Interactive DAO contract for creating/modifying/endorsing proposals
/contracts/interactive/Dao.sol

Digix Holdings

constructor

Dao

inputs0address_resolver
event

AddProposalDoc 7e60a4e6

inputs0bytes32_proposalId
inputs1bytes32_newDoc
event

ChangeProposalFunding c9e43761

inputs0bytes32_proposalId
event

CloseProposal cc0c35dc

inputs0bytes32_proposalId
event

FinalizeProposal 7987ab68

inputs0bytes32_proposalId
event

FinishMilestone 7f575746

inputs0bytes32_proposalId
inputs1uint256_milestoneIndex
event

MigrateToNewDao bdee2a20

inputs0address_newDaoContract
inputs1address_newDaoFundingManager
inputs2address_newDaoRewardsManager
event

ModifyProposal 8ed872b5

inputs0bytes32_proposalId
inputs1bytes32_newDoc
event

NewProposal ab48f599

inputs0bytes32_proposalId
inputs1address_proposer
event

PRLAction 75c2f2b4

inputs0bytes32_proposalId
inputs1uint256_actionId
inputs2bytes32_doc
function, constant

CONTRACT_ADDRESS db4ecbc1

function

addProposalDoc eef7b8f5

Add IPFS docs to a proposal

This is allowed only after a proposal is finalized. Before finalizing a proposal, proposer can modifyProposal and basically create a different ProposalVersion. After the proposal is finalized, they can only allProposalDoc to the final version of that proposal

inputs0bytes32_proposalId

ID of the proposal

inputs1bytes32_newDoc

hash of the new IPFS doc

function

changeFundings 711f2614

Function to change the funding structure for a proposal

Proposers can only change fundings for the subsequent milestones, during the duration of an on-going milestone (so, cannot be before proposal finalization or during any voting phase)

inputs0bytes32_proposalId

ID of the proposal

inputs1uint256[]_milestonesFundings

Array of fundings for milestones

inputs2uint256_finalReward

Final reward needed for completion of proposal

inputs3uint256_currentMilestone

the milestone number the proposal is currently in

function

closeProposal 078f872c

Function to close proposal (also get back collateral)

Can only be closed if the proposal has not been finalized yet

inputs0bytes32_proposalId

ID of the proposal

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

endorseProposal 926851af

Function to endorse a pre-proposal (can be called only by DAO Moderator)

inputs0bytes32_proposalId

ID of the proposal (hash of IPFS doc of the first version of the proposal)

function

finalizeProposal 47d0da14

Finalize a proposal

After finalizing a proposal, no more proposal version can be added. Proposer will only be able to change fundings and add more docs Right after finalizing a proposal, the draft voting round starts. The proposer would also not be able to closeProposal() anymore (hence, cannot claim back the collateral anymore, until the final voting round passes)

inputs0bytes32_proposalId

ID of the proposal

function

finishMilestone 55cc3136

Function to set milestone to be completed

This can only be called in the Main Phase of DigixDAO by the proposer. It sets the voting time for the next milestone, which is immediately, for most of the times. If there is not enough time left in the current quarter, then the next voting is postponed to the start of next quarter

inputs0bytes32_proposalId

ID of the proposal

inputs1uint256_milestoneIndex

Index of the milestone. Index starts from 0 (for the first milestone)

function

founderCloseProposals 0247afe8

Function for founders to close all the dead proposals

Dead proposals = all proposals who are not yet finalized, and been there for more than the threshold time The proposers of dead proposals will not get the collateral back

inputs0bytes32[]_proposalIds

Array of proposal IDs

function, constant

getAddressConfig 1d8ccd04

inputs0bytes32_configKey
function, constant

getBytesConfig 93ddad08

inputs0bytes32_configKey
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

isModerator fa6f3936

Check if a user is a moderator in the current quarter

inputs0address_user
function, constant

isParticipant 929066f5

Check if a user is a participant in the current quarter

inputs0address_user
function, constant

isProposalPaused f94f0f33

Check if a proposal is currently paused/stopped

If a proposal is paused/stopped (by the PRLs): proposer cannot call for voting, a current on-going voting round can still pass, but no funding can be withdrawn.A paused proposal can still be unpausedIf a proposal is stopped, this function also returns true

inputs0bytes32_proposalId
outputs0bool_isPausedOrStopped

true if the proposal is paused(or stopped)

function, constant

key 3943380c

function

migrateToNewDao 3b00763d

Migrate this DAO to a new DAO contract

This is the second step of the 2-step migration Migration can only be done during the locking phase, after the global rewards for current quarter are set. This is to make sure that there is no rewards calculation pending before the DAO is migrated to new contracts The addresses of the new Dao contracts have to be provided again, and be double checked against the addresses that were set in setNewDaoContracts()

inputs0address_newDaoContract

Address of the new DAO contract

inputs1address_newDaoFundingManager

Address of the new DaoFundingManager contract, which would receive the remaining ETHs in this DaoFundingManager

inputs2address_newDaoRewardsManager

Address of the new daoRewardsManager contract, which would receive the claimableDGXs from this daoRewardsManager

function

modifyProposal d0bd65b1

Modify a proposal (this can be done only before setting the final version)

inputs0bytes32_proposalId

Proposal ID (hash of IPFS doc of the first version of the proposal)

inputs1bytes32_docIpfsHash

Hash of IPFS doc of the modified version of the proposal

inputs2uint256[]_milestonesFundings

Array of fundings of the modified version of the proposal (in wei)

inputs3uint256_finalReward

Final reward on successful completion of all milestones of the modified version of proposal (in wei)

function, constant

resolver 04f3bcec

function

setNewDaoContracts b202cc96

Set addresses for the new Dao and DaoFundingManager contracts

This is the first step of the 2-step migration

inputs0address_newDaoContract

Address of the new Dao contract

inputs1address_newDaoFundingManager

Address of the new DaoFundingManager contract

inputs2address_newDaoRewardsManager

Address of the new daoRewardsManager contract

function

setStartOfFirstQuarter 5b30f1cc

Call this function to mark the start of the DAO's first quarter. This can only be done once, by a founder

inputs0uint256_start

Start time of the first quarter in the DAO

function, payable

submitPreproposal 2b847105

Submit a new preliminary idea / Pre-proposal

The proposer has to send in a collateral == getUintConfig(CONFIG_PREPROPOSAL_COLLATERAL) which he could claim back in these scenarios: - Before the proposal is finalized, by calling closeProposal() - After all milestones are done and the final voting round is passed

inputs0bytes32_docIpfsHash

Hash of the IPFS doc containing details of proposal

inputs1uint256[]_milestonesFundings

Array of fundings of the proposal milestones (in wei)

inputs2uint256_finalReward

Final reward asked by proposer at successful completion of all milestones of proposal

function

updatePRL 7ef37354

Function to update the PRL (regulatory status) status of a proposal

if a proposal is paused or stopped, the proposer wont be able to withdraw the funding

inputs0bytes32_proposalId

ID of the proposal

inputs1uint256_action
inputs2bytes32_doc

hash of IPFS uploaded document, containing details of PRL Action