Skip to content

Commit

Permalink
Allow DAO to alter board member threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
protinam committed Dec 13, 2017
1 parent 7ab8c13 commit 64a47a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion contracts/dao/DelegatedShareholderAssociation.sol
Expand Up @@ -162,13 +162,15 @@ contract DelegatedShareholderAssociation is TokenRecipient {
*
* @param minimumSharesToPassAVote proposal can vote only if the sum of shares held by all voters exceed this number
* @param minutesForDebate the minimum amount of delay between when a proposal is made and when it can be executed
* @param sharesToBeBoardMember the minimum number of shares required to create proposals
*/
function changeVotingRules(uint minimumSharesToPassAVote, uint minutesForDebate) public onlySelf {
function changeVotingRules(uint minimumSharesToPassAVote, uint minutesForDebate, uint sharesToBeBoardMember) public onlySelf {
if (minimumSharesToPassAVote == 0 ) {
minimumSharesToPassAVote = 1;
}
minimumQuorum = minimumSharesToPassAVote;
debatingPeriodInMinutes = minutesForDebate;
requiredSharesToBeBoardMember = sharesToBeBoardMember;
ChangeOfRules(minimumQuorum, debatingPeriodInMinutes, sharesTokenAddress);
}

Expand Down
6 changes: 3 additions & 3 deletions test/test-dao.js
Expand Up @@ -27,7 +27,7 @@ contract('TestDAO', (accounts) => {
return TestDAO
.deployed()
.then(daoInstance => {
return daoInstance.changeVotingRules.call(0, 0)
return daoInstance.changeVotingRules.call(0, 0, 0)
})
.then(ret => {
assert.equal(true, false, 'Anyone was allowed to change the voting rules')
Expand Down Expand Up @@ -141,7 +141,7 @@ contract('TestDAO', (accounts) => {
return TestDAO
.deployed()
.then(daoInstance => {
const abi = new web3.eth.Contract(daoInstance.abi, daoInstance.address).methods.changeVotingRules(2, 0).encodeABI()
const abi = new web3.eth.Contract(daoInstance.abi, daoInstance.address).methods.changeVotingRules(2, 0, 0).encodeABI()
return daoInstance.newProposal.sendTransaction(daoInstance.address, 0, '0x', abi)
.then(() => {
return daoInstance.vote.sendTransaction(1, true)
Expand Down Expand Up @@ -176,7 +176,7 @@ contract('TestDAO', (accounts) => {
return TestDAO
.deployed()
.then(daoInstance => {
const abi = new web3.eth.Contract(daoInstance.abi, daoInstance.address).methods.changeVotingRules(3, 3).encodeABI()
const abi = new web3.eth.Contract(daoInstance.abi, daoInstance.address).methods.changeVotingRules(3, 3, 0).encodeABI()
return daoInstance.newProposal.sendTransaction(daoInstance.address, 0, '0x', abi)
.then(() => {
return daoInstance.vote.sendTransaction(2, false)
Expand Down

0 comments on commit 64a47a3

Please sign in to comment.