Governance
Access all governance related methods of GovBlocks Smart Contracts through this module
Governance Module is an instance of dApp

Functions

getTotalRewardsByDapp

1
governance.getTotalRewardsByDapp(callback)
Copied!
Get total number of rewards issued by the dApp
Rewards are incentives distributed for contributing in decision making process
Returns
1
Number of rewards issued by dApp
Copied!

createProposal

1
governance.createProposal(data :<json>,callback)
Copied!
Creates an uncategorized proposal in dApp
Arguments:
1
data json:{
2
proposalData:[{
3
title //proposal title
4
shortDescription //description in short form
5
description //complete description of proposal
6
}],
7
votingType //voting type id
8
}
Copied!
Returns
1
Resulting transaction hash
Copied!

createProposalwithOption

1
governance.createProposalwithOption(data :<json>,callback)
Copied!
Create a proposal, categorize, open it for voting and submit solution at a time
Arguments:
1
data json : {
2
proposalData:[{title,shortDescription,description}],
3
optionData:{
4
paramValues // Onchain action parameter values
5
apiParamValues // Offchain action parameter values
6
},
7
cId //sub category id,
8
votingType
9
}
Copied!
Returns
1
Resulting transaction hash
Copied!

categorizeProposal

1
governance.categorizeProposal(data :<json>,callback)
Copied!
Categorize a proposal
Arguments:
1
data json : {
2
proposalId //Id of the proposal to categorize
3
categoryId //Id of subCategory
4
}
Copied!
Returns
1
Resulting transaction hash
Copied!

openProposalForVoting

1
governance.openProposalForVoting(proposalId,callback)
Copied!
Open a proposal for voting
Arguments:
1
proposalId
Copied!
Returns
1
Resulting transaction hash
Copied!

initiateAddSolution

1
governance.initiateAddSolution(data :<json>,proposalId,memberAddress,callback)
Copied!
Add solution with parameters for proposal
Arguments:
1
data json : {
2
optionData:{
3
paramValues //Onchain parameter values
4
apiParamValues //Offchain parameter values
5
}
6
},
7
proposalId,
8
memberAddress
Copied!
Returns
1
Resulting transaction hash
Copied!

submitProposalWithSolution

1
governance.submitProposalWithSolution(data :<json>,proposalId,callback)
Copied!
Open a categorized proposal for voting and submit a solution simultaneously
Arguments:
1
data:{
2
optionData:{
3
paramValues //Onchain parameter values
4
apiParamValues //Offchain parameter values
5
}
6
}
7
proposalId
Copied!
Returns
1
Resulting transaction hash
Copied!

checkProposalVoteClosing

1
governance.checkProposalVoteClosing(proposalId,callback)
Copied!
Check if voting is closed for current voting layer of proposal
Arguments:
1
proposalId
Copied!
Returns
1
Whether proposal voting has been closed for current voting layer
Copied!

proposalVoting

1
governance.proposalVoting(proposalId,optionChosen,callback)
Copied!
Vote for a solution of proposal
Arguments:
1
proposalId //Id of proposal
2
optionChosen //Array of options chosen to upvote
Copied!
Returns
1
Resulting transaction hash
Copied!

getTokensLockedAtTime

1
governance.getTokensLockedAtTime(dAppName,memberAddress,reason,time,callback)
Copied!
Get number of tokens locked by the address at given time for specified reason
Arguments:
1
dAppName //Name of dApp
2
memberAddress //Ethereum address of member
3
reason //Reason for which tokens are locked
4
time //Timestamp of time at which tokens locked to be known
Copied!
Returns
1
Number of tokens locked
Copied!

checkTokensLockedForStake

1
governance.checkTokensLockedForStake(memberAddress,reason,time,subCategoryId,categoryId) : <callback>
Copied!
Check whether address has enough tokens locked for submitting stake to a categorized proposal
Arguments:
1
memberAddress //Ethereum address of member
2
reason //Reason for which tokwns are locked
3
time //Timestamp of time at which tokens locked to be known
4
subCategoryId //Sub category id of proposal
5
categoryId //Category id of proposal
Copied!
Returns
1
<boolean> Whether member has enough tokens
Copied!

canCreateProposal

1
governance.canCreateProposal(memberAddress,subCategoryId,callback)
Copied!
Check whether member can create proposal under a category
Arguments:
1
memberAddress //Ethereum address of member
2
subCategoryId //Sub category id of proposal
Copied!
Returns
1
<boolean> Whether member can create proposal
Copied!

Vote Details

getVoteEventData

1
governance.getVoteEventData(memberAddress,callback)
Copied!
Get details of all votes cast by member
Arguments:
1
memberAddress //Ethereum address of member
Copied!
Returns
1
Array of all vote details
Copied!

getVoteDetailById

1
governance.getVoteDetailById(voteId,callback)
Copied!
Get details of vote
Arguments:
1
voteId //Id of the vote
Copied!
Returns
1
voteValue,
2
address of voter,
3
id of solution for which vote has been registered
Copied!

getVotingTypeLength

1
governance.getVotingTypeLength(callback)
Copied!
Get length of the voting types existing in GovBlocks
Returns
1
Length of voting types
Copied!

getVotingTypeDetailsById

1
governance.getVotingTypeDetailsById(votingTypeId,callback)
Copied!
Get basic details of a voting type
Arguments:
1
votingTypeId //Id of voting type
Copied!
Returns
1
votingTypeid,
2
votingTypeName <hex>,
3
votingTypeAddress
Copied!

getVoteArrayById

1
governance.getVoteArrayById(proposalId,callback)
Copied!
Get id's of all votes polled for a proposal
Arguments:
1
proposalId //Id of the proposal
Copied!
Returns
1
Array of vote id's
Copied!

getPendingReward

1
governance.getPendingReward(memberAddress,callback)
Copied!
Get number of rewards to be claimed by the member
Arguments:
1
memberAddress //Ethereum address of member
Copied!
Returns
1
Array of pending GBT rewards and pending dApp rewards
Copied!

getRewardClaimed

1
governance.getRewardClaimed(proposalId,memberAddress,callback)
Copied!
Check whether member had claimed his reward
Arguments:
1
proposalId //Id of proposal
2
memberAddress //Ethereum address of member
Copied!
Returns
1
<boolean> Whether member had claimed his reward
Copied!

getVoteRewardClaimed

1
governance.getVoteRewardClaimed(voteId,callback)
Copied!
Check if reward has been claimed for the vote
Arguments:
1
voteId //Id of vote
Copied!
Returns
1
<boolean> Whether reward has been claimed for the vote
Copied!

Voting Weights

getQuorumPercentage

1
governance.getQuorumPercentage(callback)
Copied!
Get quorum percentage
Returns
1
Quorum percentage
Copied!

getStakeWeight

1
governance.getStakeWeight(callback)
Copied!
Get stake weight
Returns
1
Stake weight
Copied!

getBonusReputation

1
governance.getBonusReputation(callback)
Copied!
Get bonus reputation
Returns
1
Bonus reputation
Copied!

getBonusStake

1
governance.getBonusStake(callback)
Copied!
Get bonus stake
Returns
1
Bonus stake
Copied!

Reputation Weights

getReputationWeight

1
governance.getReputationWeight(callback)
Copied!
Get reputation weight
Returns
1
Reputation weight
Copied!

getProposalOwnerPoints

1
governance.getProposalOwnerPoints(callback)
Copied!
Get number of reputation points distributed to proposal owner
Returns
1
Reputation points
Copied!

getOptionOwnerPoints

1
governance.getOptionOwnerPoints(callback)
Copied!
Get number of reputation points distributed to solution owner
Returns
1
Reputation points
Copied!

Locking

dAppTokenSupportsLocking

1
governance.dAppTokenSupportsLocking(callback)
Copied!
Check whether dApp token supports locking
Returns
1
<boolean> Whether dApp token supports locking
Copied!

getdAppTokenProxy

1
governance.getdAppTokenProxy(callback)
Copied!
Get proxy of dApp token
Returns
1
Proxy token address ofdApp
Copied!

getTokenAddress

1
governance.getTokenAddress(dAppName,callback)
Copied!
Get dApp token Address
Arguments:
1
dAppName //Name of dApp
Copied!
Returns
1
Token address of dApp
Copied!

getTotalBalance_user

1
governance.getTotalBalance_user(memberAddress,dAppName,callback)
Copied!
Get total dApp token balance of member inclusive of locked tokens
Arguments:
1
memberAddress //Ethereum address of member
2
dAppName //Name of dApp
Copied!
Returns
1
total dApp token balance
Copied!

getTotalGBTBalance_user

1
governance.getTotalGBTBalance_user(memberAddress,callback)
Copied!
Get total GBT balance of member inclusive of locked tokens
Arguments:
1
memberAddress //Ethereum address of member
Copied!
Returns
1
total GBT balance of user
Copied!

getTokensLocked

1
governance.getTokensLocked(dAppName,memberAddress,reason,callback)
Copied!
Get number of tokens locked by the member for specified reason
Arguments:
1
dAppName //Name of dApp
2
memberAddress //Ethereum address of member
3
reason //Reason for which tokens are locked
Copied!
Returns
1
Number of tokens locked by the member
Copied!

getTokensLockedValidity

1
governance.getTokensLockedValidity(dAppName,memberAddress,reason),callback
Copied!
Get time up-to which member had locked tokens for specified reason
Arguments:
1
dAppName //dAppName
2
memberAddress //Ethereum address of member
3
reason //Reason for which tokens are locked
Copied!
Returns
1
Time upto which member had locked tokens
Copied!

getUnlockableTokens

1
governance.getUnlockableTokens(dAppName,membrAddress,reason,callback)
Copied!
Get number of unlock-able tokens of specified reason available for member
Arguments:
1
dAppName //Name of dApp
2
memberAddres //Ethereum address of member
3
reason //Reason for which tokens are locked
Copied!
Returns
1
Number of unlockable tokens available for member
Copied!

getTotalUnlockableTokens

1
governance.getTotalUnlockableTokens(dAppName,memberAddress,callback)
Copied!
Get total number of unlocked tokens
Arguments:
1
dAppName //Name of dApp
2
memberAddress //Ethereum address of member
Copied!
Returns
1
Total number of unlockable tokens
Copied!

transferTokens

1
governance.transferTokens(dAppName,recipientAddress,value,callback)
Copied!
Transfer dApp tokens of member address to recipients address
Arguments:
1
dAppName //Name of dApp
2
recipientAddress //Ethereum address of recipient
3
value //Amount of tokens to transfer
Copied!
Returns
1
Resulting transaction hash
Copied!

lockTokens

1
governance.lockTokens(dAppName,reason,amount,time,callback)
Copied!
Lock member tokens for specified reason and time
Arguments:
1
dAppName //Name of dApp
2
reason //Reason for which tokens to be locked
3
amount //Amount of tokens to lock
4
time //Time for which tokens to be locked
Copied!
Returns
1
Resulting transaction hash
Copied!

extendLockValidity

1
governance.extendLockValidity(dAppName,reason,time,callback)
Copied!
Extend amount of time tokens were locked for reason
Arguments:
1
dAppName //Name of dApp
2
reason //Reason for which tokens are locked
3
time //Time to extend locking period
Copied!
Returns
1
Resulting transaction hash
Copied!

unlockTokens

1
governance.unlockTokens(dAppName,memberAddress,callback)
Copied!
Release the unlock-able tokens available for member
Arguments:
1
dAppName //Name of dApp
2
memberAddress //Ethereum address of member
Copied!
Returns
1
Resulting transaction hash
Copied!

claimPendingRewards

1
governance.claimPendingRewards(memberAddress,callback)
Copied!
Claim all the pending rewards available for member
Arguments:
1
memberAddress //Ethereum address of member
Copied!
Returns
1
Resulting transaction hash
Copied!

getDataFromHash

1
governance.getDataFromHash(hash)
Copied!
Get data from the IPFS hash
Arguments:
1
hash //Valid IPFS hash
Copied!
Returns
1
Data present in hash
Copied!
Last modified 3yr ago