arc_dx
Version:
A platform for building DAOs
615 lines • 1.02 MB
JSON
{
"contractName": "AbsoluteVote",
"abi": [
{
"constant": true,
"inputs": [
{
"name": "",
"type": "bytes32"
}
],
"name": "parameters",
"outputs": [
{
"name": "precReq",
"type": "uint256"
},
{
"name": "allowOwner",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "proposalsCnt",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "bytes32"
}
],
"name": "proposals",
"outputs": [
{
"name": "owner",
"type": "address"
},
{
"name": "organizationId",
"type": "bytes32"
},
{
"name": "callbacks",
"type": "address"
},
{
"name": "numOfChoices",
"type": "uint256"
},
{
"name": "paramsHash",
"type": "bytes32"
},
{
"name": "totalVotes",
"type": "uint256"
},
{
"name": "open",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "MAX_NUM_OF_CHOICES",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "_proposalId",
"type": "bytes32"
},
{
"indexed": false,
"name": "_isOwnerVote",
"type": "bool"
}
],
"name": "AVVoteProposal",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "_proposalId",
"type": "bytes32"
},
{
"indexed": true,
"name": "_organizationId",
"type": "bytes32"
},
{
"indexed": true,
"name": "_voter",
"type": "address"
},
{
"indexed": false,
"name": "_reputation",
"type": "uint256"
}
],
"name": "RefreshReputation",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "_proposalId",
"type": "bytes32"
},
{
"indexed": true,
"name": "_organization",
"type": "address"
},
{
"indexed": false,
"name": "_numOfChoices",
"type": "uint256"
},
{
"indexed": false,
"name": "_proposer",
"type": "address"
},
{
"indexed": false,
"name": "_paramsHash",
"type": "bytes32"
}
],
"name": "NewProposal",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "_proposalId",
"type": "bytes32"
},
{
"indexed": true,
"name": "_organization",
"type": "address"
},
{
"indexed": false,
"name": "_decision",
"type": "uint256"
},
{
"indexed": false,
"name": "_totalReputation",
"type": "uint256"
}
],
"name": "ExecuteProposal",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "_proposalId",
"type": "bytes32"
},
{
"indexed": true,
"name": "_organization",
"type": "address"
},
{
"indexed": true,
"name": "_voter",
"type": "address"
},
{
"indexed": false,
"name": "_vote",
"type": "uint256"
},
{
"indexed": false,
"name": "_reputation",
"type": "uint256"
}
],
"name": "VoteProposal",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "_proposalId",
"type": "bytes32"
},
{
"indexed": true,
"name": "_organization",
"type": "address"
}
],
"name": "CancelProposal",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "_proposalId",
"type": "bytes32"
},
{
"indexed": true,
"name": "_organization",
"type": "address"
},
{
"indexed": true,
"name": "_voter",
"type": "address"
}
],
"name": "CancelVoting",
"type": "event"
},
{
"constant": false,
"inputs": [
{
"name": "_numOfChoices",
"type": "uint256"
},
{
"name": "_paramsHash",
"type": "bytes32"
},
{
"name": "",
"type": "address"
},
{
"name": "_organization",
"type": "address"
}
],
"name": "propose",
"outputs": [
{
"name": "",
"type": "bytes32"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_proposalId",
"type": "bytes32"
}
],
"name": "cancelProposal",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_proposalId",
"type": "bytes32"
},
{
"name": "_vote",
"type": "uint256"
},
{
"name": "",
"type": "address"
}
],
"name": "vote",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_proposalId",
"type": "bytes32"
},
{
"name": "_vote",
"type": "uint256"
},
{
"name": "_voter",
"type": "address"
}
],
"name": "ownerVote",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_proposalId",
"type": "bytes32"
},
{
"name": "_vote",
"type": "uint256"
},
{
"name": "_rep",
"type": "uint256"
},
{
"name": "",
"type": "uint256"
},
{
"name": "",
"type": "address"
}
],
"name": "voteWithSpecifiedAmounts",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_proposalId",
"type": "bytes32"
}
],
"name": "cancelVote",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "_proposalId",
"type": "bytes32"
}
],
"name": "getNumberOfChoices",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "_proposalId",
"type": "bytes32"
},
{
"name": "_voter",
"type": "address"
}
],
"name": "voteInfo",
"outputs": [
{
"name": "",
"type": "uint256"
},
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "_proposalId",
"type": "bytes32"
},
{
"name": "_choice",
"type": "uint256"
}
],
"name": "voteStatus",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "_proposalId",
"type": "bytes32"
}
],
"name": "isVotable",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "isAbstainAllow",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "pure",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getAllowedRangeOfChoices",
"outputs": [
{
"name": "min",
"type": "uint256"
},
{
"name": "max",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "pure",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_proposalId",
"type": "bytes32"
}
],
"name": "execute",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_precReq",
"type": "uint256"
},
{
"name": "_allowOwner",
"type": "bool"
}
],
"name": "setParameters",
"outputs": [
{
"name": "",
"type": "bytes32"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "_precReq",
"type": "uint256"
},
{
"name": "_allowOwner",
"type": "bool"
}
],
"name": "getParametersHash",
"outputs": [
{
"name": "",
"type": "bytes32"
}
],
"payable": false,
"stateMutability": "pure",
"type": "function"
}
],
"bytecode": "0x608060405234801561001057600080fd5b50611285806100206000396000f3006080604052600436106101065763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166302506804811461010b578063119ce91b1461013c57806321b4b3dc1461017957806332ed5b12146101a0578063339e23d1146101ff57806337376ca81461023a57806339500019146102525780635142bc1e1461027f57806351d997b2146102945780635cf19cf5146102a957806376124dac146102c657806388737b5e146102ed5780638d22651e1461031a5780639525c0cc1461032f578063a003651d14610349578063b451291314610361578063c08351061461037c578063e751f27114610394578063e8024473146103ac575b600080fd5b34801561011757600080fd5b506101236004356103c9565b6040805192835290151560208301528051918290030190f35b34801561014857600080fd5b50610160600435600160a060020a03602435166103e5565b6040805192835260208301919091528051918290030190f35b34801561018557600080fd5b5061018e610438565b60408051918252519081900360200190f35b3480156101ac57600080fd5b506101b860043561043e565b60408051600160a060020a039889168152602081019790975294909616858501526060850192909252608084015260a083015291151560c082015290519081900360e00190f35b34801561020b57600080fd5b50610226600435602435600160a060020a036044351661048c565b604080519115158252519081900360200190f35b34801561024657600080fd5b5061022660043561051e565b34801561025e57600080fd5b50610226600435602435604435606435600160a060020a0360843516610608565b34801561028b57600080fd5b50610160610641565b3480156102a057600080fd5b50610226610649565b3480156102b557600080fd5b5061018e600435602435151561064e565b3480156102d257600080fd5b50610226600435602435600160a060020a03604435166106bc565b3480156102f957600080fd5b5061018e600435602435600160a060020a03604435811690606435166106f4565b34801561032657600080fd5b5061018e610a1b565b34801561033b57600080fd5b50610347600435610a20565b005b34801561035557600080fd5b5061018e600435610a50565b34801561036d57600080fd5b5061018e600435602435610a65565b34801561038857600080fd5b50610226600435610a86565b3480156103a057600080fd5b50610226600435610a9e565b3480156103b857600080fd5b5061018e6004356024351515610ad0565b6000602081905290815260409020805460019091015460ff1682565b6000806103f0611206565b5050506000918252600160208181526040808520600160a060020a03949094168552600790930181529282902082518084019093528054808452910154919092018190529091565b60035481565b60016020819052600091825260409091208054918101546002820154600383015460048401546005850154600890950154600160a060020a0396871696949593909416939192909160ff1687565b6000838152600160205260408120548490600160a060020a031633146104b157600080fd5b600085815260016020526040902060080154859060ff1615156104d357600080fd5b600086815260016020818152604080842060040154845290839052909120015460ff1615156105055760009250610515565b6105128685876000610b7a565b92505b50509392505050565b60008181526001602052604081205481908390600160a060020a0316331461054557600080fd5b600084815260016020526040902060080154849060ff16151561056757600080fd5b600085815260016020818152604080842060040154845290839052909120015460ff1615156105995760009350610600565b6000858152600160208190526040909120015492506105b785610dac565b600083815260026020526040808220549051600160a060020a039091169187917f2eb3e89618ae3f1716cf6615be7ce4bbafed3578d8bc1de99897063e9db6a9f69190a3600193505b505050919050565b600085815260016020526040812060080154869060ff16151561062a57600080fd5b61063687338888610b7a565b979650505050505050565b6001600a9091565b600190565b600080606484111580156106625750600084115b151561066d57600080fd5b6106778484610ad0565b6040805180820182529586529315156020808701918252600083815290819052949094209451855592516001909401805460ff19169415159490941790935550919050565b600083815260016020526040812060080154849060ff1615156106de57600080fd5b6106eb8533866000610b7a565b95945050505050565b6000806106ff61121d565b6000868152602081905260408120541161071857600080fd5b6000871180156107295750600a8711155b151561073457600080fd5b600354604080516c01000000000000000000000000300260208083019190915260348083019490945282518083039094018452605490910191829052825182918401908083835b6020831061079a5780518252601f19909201916020918201910161077b565b51815160209384036101000a60001901801990921691161790526040805192909401829003909120600380546001019055606087018d9052608087018c90523387850181905284516c0100000000000000000000000091820281850152600160a060020a038c1690910260348201528451808203602801815260489091019485905280519198509550929350839290850191508083835b602083106108505780518252601f199092019160209182019101610831565b51815160209384036101000a60001901801990921691161790526040805192909401829003909120868201908152338752600160c0880181815260008a81528285528681208a51815473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a0392831617835595519482018590558b890151600280840180549098169183169190911790965560608c0151600383015560808c0151600483015560a08c0151600583015592516008909101805460ff19169115159190911790559182529190925292902054909116151592506109ae91505057600160a060020a0384161515610973576020808201516000908152600290915260409020805473ffffffffffffffffffffffffffffffffffffffff1916331790556109ae565b6020818101516000908152600290915260409020805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0386161790555b6020808201516000908152600282526040908190205481518a815233938101939093528282018990529051600160a060020a039091169184917f75b4ff136cc5de5957574c797de3334eb1c141271922b825eb071e0487ba2c5c9181900360600190a35095945050505050565b600a81565b600081815260016020526040902060080154819060ff161515610a4257600080fd5b610a4c8233610e44565b5050565b60009081526001602052604090206003015490565b60009182526001602090815260408084209284526006909201905290205490565b60009081526001602052604090206008015460ff1690565b600081815260016020526040812060080154829060ff161515610ac057600080fd5b610ac983610f46565b9392505050565b6040805160208082018590527f01000000000000000000000000000000000000000000000000000000000000008415150282840152825160218184030181526041909201928390528151600093918291908401908083835b60208310610b475780518252601f199092019160209182019101610b28565b5181516020939093036101000a600019018019909116921691909117905260405192018290039091209695505050505050565b6000848152600160205260408120600381015482908190861115610b9d57600080fd5b6002830154604080517f9588378e000000000000000000000000000000000000000000000000000000008152600160a060020a038a81166004830152602482018c905291519190921691639588378e9160448083019260209291908290030181600087803b158015610c0e57600080fd5b505af1158015610c22573d6000803e3d6000fd5b505050506040513d6020811015610c3857600080fd5b5051915084821015610c4957600080fd5b5083801515610c555750805b600160a060020a038716600090815260078401602052604090206001015415610c8257610c828888610e44565b6000868152600684016020526040902054610ca490829063ffffffff6111e116565b60008781526006850160205260409020556005830154610ccb90829063ffffffff6111e116565b60058401556040805180820182528781526020808201848152600160a060020a03808c16600081815260078a01855286812095518655925160019586015593880154825260028352908490205484518b8152928301879052845193949116928c927f066c061a3792cb3eb64a441a928655fcbafb4a54b49725fe9cd2951df5e7189e92908290030190a460408051600160a060020a0389163314158152905189917fe715e19c865cb724f3c292cc2fffc24d9cdd398e179fb366f008cc73028e1c52919081900360200190a2610da088610f46565b98975050505050505050565b6000818152600160205260408120905b60038201548111610de0576000818152600683016020526040812055600101610dbc565b505060009081526001602081905260408220805473ffffffffffffffffffffffffffffffffffffffff19908116825591810183905560028101805490921690915560038101829055600481018290556005810191909155600801805460ff19169055565b6000610e4e611206565b50506000828152600160208181526040808420600160a060020a0386168552600781018352818520825180840184528154808252919095015485850181905290865260068201909352932054610ea99163ffffffff6111f416565b815160009081526006840160209081526040909120919091558101516005830154610ed99163ffffffff6111f416565b6005830155600160a060020a03808416600081815260078501602090815260408083208381556001908101849055870154835260029091528082205490519293169187917f0ecab23267930de581498fac1af19a95c888ec6583921ee9c47473e16245d3c891a450505050565b6000806000806000610f5661121d565b600087815260016020526040902060080154879060ff161515610f7857600080fd5b6000888152600160209081526040808320600281015482517fb551c373000000000000000000000000000000000000000000000000000000008152600481018e90529251919a50600160a060020a03169363b551c37393602480850194919392918390030190829087803b158015610fef57600080fd5b505af1158015611003573d6000803e3d6000fd5b505050506040513d602081101561101957600080fd5b5051600487015460009081526020819052604081205491965090945092505b600386015483116111d157600083815260068701602052604090205460648587020410156111c6576040805160e0810182528754600160a060020a03908116825260018901546020830152600289015416918101919091526003870154606082015260048701546080820152600587015460a0820152600887015460ff16151560c082015291506110c888610dac565b6020808301516000908152600282526040908190205481518681529283018890528151600160a060020a03909116928b927f37471b9c9d295ffb1309ad070b8964700bfb7b555e8e8292d0b6cbc7dba35d1092918290030190a360408083015181517f9d4c162d000000000000000000000000000000000000000000000000000000008152600481018b9052602481018690529151600160a060020a0390911691639d4c162d9160448083019260209291908290030181600087803b15801561119057600080fd5b505af11580156111a4573d6000803e3d6000fd5b505050506040513d60208110156111ba57600080fd5b50600197506111d69050565b600190920191611038565b600096505b505050505050919050565b818101828110156111ee57fe5b92915050565b60008282111561120057fe5b50900390565b604080518082019091526000808252602082015290565b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810191909152905600a165627a7a72305820b4f56c41088b779cfb4feee9bb48ddf23094ebe34bd60c8f947bd1a71fb07d0b0029",
"deployedBytecode": "0x6080604052600436106101065763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166302506804811461010b578063119ce91b1461013c57806321b4b3dc1461017957806332ed5b12146101a0578063339e23d1146101ff57806337376ca81461023a57806339500019146102525780635142bc1e1461027f57806351d997b2146102945780635cf19cf5146102a957806376124dac146102c657806388737b5e146102ed5780638d22651e1461031a5780639525c0cc1461032f578063a003651d14610349578063b451291314610361578063c08351061461037c578063e751f27114610394578063e8024473146103ac575b600080fd5b34801561011757600080fd5b506101236004356103c9565b6040805192835290151560208301528051918290030190f35b34801561014857600080fd5b50610160600435600160a060020a03602435166103e5565b6040805192835260208301919091528051918290030190f35b34801561018557600080fd5b5061018e610438565b60408051918252519081900360200190f35b3480156101ac57600080fd5b506101b860043561043e565b60408051600160a060020a039889168152602081019790975294909616858501526060850192909252608084015260a083015291151560c082015290519081900360e00190f35b34801561020b57600080fd5b50610226600435602435600160a060020a036044351661048c565b604080519115158252519081900360200190f35b34801561024657600080fd5b5061022660043561051e565b34801561025e57600080fd5b50610226600435602435604435606435600160a060020a0360843516610608565b34801561028b57600080fd5b50610160610641565b3480156102a057600080fd5b50610226610649565b3480156102b557600080fd5b5061018e600435602435151561064e565b3480156102d257600080fd5b50610226600435602435600160a060020a03604435166106bc565b3480156102f957600080fd5b5061018e600435602435600160a060020a03604435811690606435166106f4565b34801561032657600080fd5b5061018e610a1b565b34801561033b57600080fd5b50610347600435610a20565b005b34801561035557600080fd5b5061018e600435610a50565b34801561036d57600080fd5b5061018e600435602435610a65565b34801561038857600080fd5b50610226600435610a86565b3480156103a057600080fd5b50610226600435610a9e565b3480156103b857600080fd5b5061018e6004356024351515610ad0565b6000602081905290815260409020805460019091015460ff1682565b6000806103f0611206565b5050506000918252600160208181526040808520600160a060020a03949094168552600790930181529282902082518084019093528054808452910154919092018190529091565b60035481565b60016020819052600091825260409091208054918101546002820154600383015460048401546005850154600890950154600160a060020a0396871696949593909416939192909160ff1687565b6000838152600160205260408120548490600160a060020a031633146104b157600080fd5b600085815260016020526040902060080154859060ff1615156104d357600080fd5b600086815260016020818152604080842060040154845290839052909120015460ff1615156105055760009250610515565b6105128685876000610b7a565b92505b50509392505050565b60008181526001602052604081205481908390600160a060020a0316331461054557600080fd5b600084815260016020526040902060080154849060ff16151561056757600080fd5b600085815260016020818152604080842060040154845290839052909120015460ff1615156105995760009350610600565b6000858152600160208190526040909120015492506105b785610dac565b600083815260026020526040808220549051600160a060020a039091169187917f2eb3e89618ae3f1716cf6615be7ce4bbafed3578d8bc1de99897063e9db6a9f69190a3600193505b505050919050565b600085815260016020526040812060080154869060ff16151561062a57600080fd5b61063687338888610b7a565b979650505050505050565b6001600a9091565b600190565b600080606484111580156106625750600084115b151561066d57600080fd5b6106778484610ad0565b6040805180820182529586529315156020808701918252600083815290819052949094209451855592516001909401805460ff19169415159490941790935550919050565b600083815260016020526040812060080154849060ff1615156106de57600080fd5b6106eb8533866000610b7a565b95945050505050565b6000806106ff61121d565b6000868152602081905260408120541161071857600080fd5b6000871180156107295750600a8711155b151561073457600080fd5b600354604080516c01000000000000000000000000300260208083019190915260348083019490945282518083039094018452605490910191829052825182918401908083835b6020831061079a5780518252601f19909201916020918201910161077b565b51815160209384036101000a60001901801990921691161790526040805192909401829003909120600380546001019055606087018d9052608087018c90523387850181905284516c0100000000000000000000000091820281850152600160a060020a038c1690910260348201528451808203602801815260489091019485905280519198509550929350839290850191508083835b602083106108505780518252601f199092019160209182019101610831565b51815160209384036101000a60001901801990921691161790526040805192909401829003909120868201908152338752600160c0880181815260008a81528285528681208a51815473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a0392831617835595519482018590558b890151600280840180549098169183169190911790965560608c0151600383015560808c0151600483015560a08c0151600583015592516008909101805460ff19169115159190911790559182529190925292902054909116151592506109ae91505057600160a060020a0384161515610973576020808201516000908152600290915260409020805473ffffffffffffffffffffffffffffffffffffffff1916331790556109ae565b6020818101516000908152600290915260409020805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0386161790555b6020808201516000908152600282526040908190205481518a815233938101939093528282018990529051600160a060020a039091169184917f75b4ff136cc5de5957574c797de3334eb1c141271922b825eb071e0487ba2c5c9181900360600190a35095945050505050565b600a81565b600081815260016020526040902060080154819060ff161515610a4257600080fd5b610a4c8233610e44565b5050565b60009081526001602052604090206003015490565b60009182526001602090815260408084209284526006909201905290205490565b60009081526001602052604090206008015460ff1690565b600081815260016020526040812060080154829060ff161515610ac057600080fd5b610ac983610f46565b9392505050565b6040805160208082018590527f01000000000000000000000000000000000000000000000000000000000000008415150282840152825160218184030181526041909201928390528151600093918291908401908083835b60208310610b475780518252601f199092019160209182019101610b28565b5181516020939093036101000a600019018019909116921691909117905260405192018290039091209695505050505050565b6000848152600160205260408120600381015482908190861115610b9d57600080fd5b6002830154604080517f9588378e000000000000000000000000000000000000000000000000000000008152600160a060020a038a81166004830152602482018c905291519190921691639588378e9160448083019260209291908290030181600087803b158015610c0e57600080fd5b505af1158015610c22573d6000803e3d6000fd5b505050506040513d6020811015610c3857600080fd5b5051915084821015610c4957600080fd5b5083801515610c555750805b600160a060020a038716600090815260078401602052604090206001015415610c8257610c828888610e44565b6000868152600684016020526040902054610ca490829063ffffffff6111e116565b60008781526006850160205260409020556005830154610ccb90829063ffffffff6111e116565b60058401556040805180820182528781526020808201848152600160a060020a03808c16600081815260078a01855286812095518655925160019586015593880154825260028352908490205484518b8152928301879052845193949116928c927f066c061a3792cb3eb64a441a928655fcbafb4a54b49725fe9cd2951df5e7189e92908290030190a460408051600160a060020a0389163314158152905189917fe715e19c865cb724f3c292cc2fffc24d9cdd398e179fb366f008cc73028e1c52919081900360200190a2610da088610f46565b98975050505050505050565b6000818152600160205260408120905b60038201548111610de0576000818152600683016020526040812055600101610dbc565b505060009081526001602081905260408220805473ffffffffffffffffffffffffffffffffffffffff19908116825591810183905560028101805490921690915560038101829055600481018290556005810191909155600801805460ff19169055565b6000610e4e611206565b50506000828152600160208181526040808420600160a060020a0386168552600781018352818520825180840184528154808252919095015485850181905290865260068201909352932054610ea99163ffffffff6111f416565b815160009081526006840160209081526040909120919091558101516005830154610ed99163ffffffff6111f416565b6005830155600160a060020a03808416600081815260078501602090815260408083208381556001908101849055870154835260029091528082205490519293169187917f0ecab23267930de581498fac1af19a95c888ec6583921ee9c47473e16245d3c891a450505050565b6000806000806000610f5661121d565b600087815260016020526040902060080154879060ff161515610f7857600080fd5b6000888152600160209081526040808320600281015482517fb551c373000000000000000000000000000000000000000000000000000000008152600481018e90529251919a50600160a060020a03169363b551c37393602480850194919392918390030190829087803b158015610fef57600080fd5b505af1158015611003573d6000803e3d6000fd5b505050506040513d602081101561101957600080fd5b5051600487015460009081526020819052604081205491965090945092505b600386015483116111d157600083815260068701602052604090205460648587020410156111c6576040805160e0810182528754600160a060020a03908116825260018901546020830152600289015416918101919091526003870154606082015260048701546080820152600587015460a0820152600887015460ff16151560c082015291506110c888610dac565b6020808301516000908152600282526040908190205481518681529283018890528151600160a060020a03909116928b927f37471b9c9d295ffb1309ad070b8964700bfb7b555e8e8292d0b6cbc7dba35d1092918290030190a360408083015181517f9d4c162d000000000000000000000000000000000000000000000000000000008152600481018b9052602481018690529151600160a060020a0390911691639d4c162d9160448083019260209291908290030181600087803b15801561119057600080fd5b505af11580156111a4573d6000803e3d6000fd5b505050506040513d60208110156111ba57600080fd5b50600197506111d69050565b600190920191611038565b600096505b505050505050919050565b818101828110156111ee57fe5b92915050565b60008282111561120057fe5b50900390565b604080518082019091526000808252602082015290565b6040805160e081018252600080825260208201819052918101829052606081018290526080810182905260a0810182905260c0810191909152905600a165627a7a72305820b4f56c41088b779cfb4feee9bb48ddf23094ebe34bd60c8f947bd1a71fb07d0b0029",
"sourceMap": "238:12771:46:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;238:12771:46;;;;;;;",
"deployedSourceMap": "238:12771:46:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1240:46;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1240:46:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;6705:211;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;6705:211:46;;;-1:-1:-1;;;;;6705:211:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;1554:24;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1554:24:46;;;;;;;;;;;;;;;;;;;;1332:43;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1332:43:46;;;;;;;;;-1:-1:-1;;;;;1332:43:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5128:357;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;5128:357:46;;;;;-1:-1:-1;;;;;5128:357:46;;;;;;;;;;;;;;;;;;;;;;;3887:440;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;3887:440:46;;;;;5491:204;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;5491:204:46;;;;;;;;;-1:-1:-1;;;;;5491:204:46;;;;;8026:123;;8:9:-1;5:2;;;30:1;27;20:12;5:2;8026:123:46;;;;7732:82;;8:9:-1;5:2;;;30:1;27;20:12;5:2;7732:82:46;;;;8644:378;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;8644:378:46;;;;;;;;;4582:170;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;4582:170:46;;;;;-1:-1:-1;;;;;4582:170:46;;;;;2439:1286;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2439:1286:46;;;;;-1:-1:-1;;;;;2439:1286:46;;;;;;;;;;1504:44;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1504:44:46;;;;5898:131;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;5898:131:46;;;;;;;6229:136;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;6229:136:46;;;;;7176:143;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;7176:143:46;;;;;;;7481:120;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;7481:120:46;;;;;8413:127;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;8413:127:46;;;;;9110:163;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;9110:163:46;;;;;;;;;1240:46;;;;;;;;;;;;;;;;;;;;;;:::o;6705:211::-;6782:4;6788;6804:18;;:::i;:::-;-1:-1:-1;;;6825:22:46;;;;:9;:22;;;;;;;;-1:-1:-1;;;;;6825:37:46;;;;;;:29;;;;:37;;;;;;6804:58;;;;;;;;;;;;;;;;;;;;;;;;;6705:211::o;1554:24::-;;;;:::o;1332:43::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;1332:43:46;;;;;;;;;;;;;;;;;;:::o;5128:357::-;5297:4;1787:22;;;:9;:22;;;;;:28;:22;;-1:-1:-1;;;;;1787:28:46;1773:10;:42;1765:51;;;;;;1981:22;;;;:9;:22;;;;;:27;;;5268:11;;1981:27;;1973:36;;;;;;;;5323:10;5334:22;;;:9;:22;;;;;;;;:33;;;5323:45;;;;;;;;;:56;;;;5321:58;5317:101;;;5402:5;5395:12;;;;5317:101;5435:43;5448:11;5461:6;5469:5;5476:1;5435:12;:43::i;:::-;5427:51;;2019:1;1826;5128:357;;;;;;:::o;3887:440::-;4001:4;1787:22;;;:9;:22;;;;;:28;4001:4;;1787:22;;-1:-1:-1;;;;;1787:28:46;1773:10;:42;1765:51;;;;;;1981:22;;;;:9;:22;;;;;:27;;;3980:11;;1981:27;;1973:36;;;;;;;;4023:10;4034:22;;;:9;:22;;;;;;;;:33;;;4023:45;;;;;;;;;:56;;;;4021:58;4017:101;;;4102:5;4095:12;;;;4017:101;4152:22;;;;:9;:22;;;;;;;;:37;;;-1:-1:-1;4199:27:46;4162:11;4199:14;:27::i;:::-;4269:29;;;;:13;:29;;;;;;;4241:58;;-1:-1:-1;;;;;4269:29:46;;;;4256:11;;4241:58;;4269:29;4241:58;4316:4;4309:11;;2019:1;1826;3887:440;;;;;:::o;5491:204::-;5618:4;1981:22;;;:9;:22;;;;;:27;;;5597:11;;1981:27;;1973:36;;;;;;;;5641:47;5654:11;5666:10;5677:5;5683:4;5641:12;:47::i;:::-;5634:54;5491:204;-1:-1:-1;;;;;;;5491:204:46:o;8026:123::-;8121:1;1546:2;8026:123;;:::o;7732:82::-;7803:4;7732:82;:::o;8644:378::-;8715:7;8784:24;8754:3;8742:8;:15;;:31;;;;;8772:1;8761:8;:12;8742:31;8734:40;;;;;;;;8811;8829:8;8839:11;8811:17;:40::i;:::-;8892:90;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;8861:28:46;;;;;;;;;;;:121;;;;;;;;;;;;-1:-1:-1;;8861:121:46;;;;;;;;;;;-1:-1:-1;8861:28:46;8644:378;-1:-1:-1;8644:378:46:o;4582:170::-;4675:4;1981:22;;;:9;:22;;;;;:27;;;4654:11;;1981:27;;1973:36;;;;;;;;4698:47;4711:11;4724:10;4736:5;4743:1;4698:12;:47::i;:::-;4691:54;4582:170;-1:-1:-1;;;;;4582:170:46:o;2439:1286::-;2562:7;2800:18;2928:24;;:::i;:::-;2680:1;2646:23;;;;;;;;;;:31;:35;2638:44;;;;;;2716:1;2700:13;:17;:56;;;;;1546:2;2721:13;:35;;2700:56;2692:65;;;;;;;;2854:12;;2831:36;;;;2848:4;2831:36;;;;;;;;;;;;;;;;;;;26:21:-1;;;22:32;;;6:49;;2831:36:46;;;;;;;;2821:47;;2831:36;;2821:47;;;;2831:36;2821:47;36:153:-1;66:2;58:11;;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;254:3;250:22;-1:-1;;246:30;311:9;;295:26;;;340:21;;377:20;365:33;;2821:47:46;;;;;;;;;;;;;2878:12;:14;;274:1:-1;2878:14:46;;;2962:21;;;:37;;;3009:19;;;:33;;;3073:10;3052:18;;;:31;;;3129:42;;;;;;;;;;-1:-1:-1;;;;;3129:42:46;;;;;;;;;;;26:21:-1;;;22:32;;6:49;;3129:42:46;;;;;;;;3119:53;;2821:47;;-1:-1:-1;3129:42:46;-1:-1:-1;3129:42:46;;-1:-1:-1;3129:42:46;;3119:53;;;;-1:-1:-1;3119:53:46;3129:42;3119:53;36:153:-1;66:2;58:11;;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;254:3;250:22;-1:-1;;246:30;311:9;;295:26;;;340:21;;377:20;365:33;;3119:53:46;;;;;;;;;;;;;3093:23;;;:79;;;3199:10;3182:27;;274:1:-1;3219:13:46;;;:20;;;-1:-1:-1;3249:21:46;;;;;;;;;:32;;;;-1:-1:-1;;3249:32:46;;;-1:-1:-1;;;;;3249:32:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;3249:32:46;;;;;;;;;;3295:38;;;;;;;;;;;;;;:43;3291:283;;-1:-1:-1;3291:283:46;;-1:-1:-1;;3291:283:46;-1:-1:-1;;;;;3358:27:46;;;3354:210;;;3419:23;;;;;3405:38;;;;:13;:38;;;;;;:51;;-1:-1:-1;;3405:51:46;3446:10;3405:51;;;3354:210;;;3509:23;;;;;3495:38;;;;:13;:38;;;;;;:54;;-1:-1:-1;;3495:54:46;-1:-1:-1;;;;;3495:54:46;;;;;3354:210;3626:23;;;;;3612:38;;;;:13;:38;;;;;;;;3588:103;;;;;3667:10;3588:103;;;;;;;;;;;;;;;-1:-1:-1;;;;;3612:38:46;;;;3600:10;;3588:103;;;;;;;;;-1:-1:-1;3708:10:46;2439:1286;-1:-1:-1;;;;;2439:1286:46:o;1504:44::-;1546:2;1504:44;:::o;5898:131::-;1981:22;;;;:9;:22;;;;;:27;;;5956:11;;1981:27;;1973:36;;;;;;;;5979:43;5998:11;6011:10;5979:18;:43::i;:::-;5898:131;;:::o;6229:136::-;6300:4;6323:22;;;:9;:22;;;;;:35;;;;6229:136::o;7176:143::-;7252:4;7275:22;;;:9;:22;;;;;;;;:37;;;:28;;;;:37;;;;;;7176:143::o;7481:120::-;7543:4;7567:22;;;:9;:22;;;;;:27;;;;;;7481:120::o;8413:127::-;8489:4;1981:22;;;:9;:22;;;;;:27;;;8468:11;;1981:27;;1973:36;;;;;;;;8512:21;8521:11;8512:8;:21::i;:::-;8505:28;8413:127;-1:-1:-1;;;8413:127:46:o;9110:163::-;9226:39;;;;;;;;;;;;;;;;;;;;;22:32:-1;26:21;;;22:32;6:49;;9226:39:46;;;;;;;;9216:50;;9190:7;;9226:39;;;9216:50;;;;;9226:39;9216:50;36:153:-1;66:2;58:11;;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;;254:3;250:22;-1:-1;;246:30;311:9;;295:26;;;340:21;;377:20;;;;365:33;;9216:50:46;;;;;;;;;;;;-1:-1:-1;;;;;;9110:163:46:o;11740:1267::-;11838:4;11882:22;;;:9;:22;;;;;11960:21;;;;11838:4;;;;11951:30;;;11943:39;;;;;;12088:18;;;;12056:84;;;;;;-1:-1:-1;;;;;12056:84:46;;;;;;;;;;;;;;;12088:18;;;;;12056:64;;:84;;;;;;;;;;;;;;12088:18;;12056:84;;;5:2:-1;;;;30:1;27;20:12;5:2;12056:84:46;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;12056:84:46;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;12056:84:46;;-1:-1:-1;12158:18:46;;;;12150:27;;;;;;-1:-1:-1;12198:4:46;12216:8;;12212:55;;;-1:-1:-1;12246:10:46;12212:55;-1:-1:-1;;;;;12347:23:46;;;;;;:15;;;:23;;;;;:34;;;:39;12343:109;;12402:39;12421:11;12434:6;12402:18;:39::i;:::-;12523:21;;;;:14;;;:21;;;;;;12515:30;;:3;;:30;:7;:30;:::i;:::-;12491:21;;;;:14;;;:21;;;;;:54;12585:19;;;;12577:28;;:3;;:28;:7;:28;:::i;:::-;12555:19;;;:50;12641:71;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;12615:23:46;;;-1:-1:-1;12615:23:46;;;:15;;;:23;;;;;:97;;;;;;;;;;;12785:23;;;;12771:38;;:13;:38;;;;;;;12745:92;;;;;;;;;;;;;12615:23;;12771:38;;;12758:11;;12745:92;;;;;;;;;12852:51;;;-1:-1:-1;;;;;12881:20:46;;12891:10;12881:20;;12852:51;;;;12867:11;;12852:51;;;;;;;;;;12979:21;12988:11;12979:8;:21::i;:::-;12972:28;11740:1267;-1:-1:-1;;;;;;;;11740:1267:46:o;9772:276::-;9836:25;9864:22;;;:9;:22;;;;;;9896:107;9922:21;;;;9915:28;;9896:107;;9973:19;;;;:14;;;:19;;;;;9966:26;9945:5;;9896:107;;;-1:-1:-1;;10019:22:46;;;;:9;:22;;;;;;;10012:29;;-1:-1:-1;;10012:29:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;10012:29:46;;;9772:276::o;9279:487::-;9363:25;9423:18;;:::i;:::-;-1:-1:-1;;9391:22:46;;;;:9;:22;;;;;;;;-1:-1:-1;;;;;9444:23:46;;;;:15;;;:23;;;;;9423:44;;;;;;;;;;;;;;;;;;;;;;;9507:26;;;:14;;;:26;;;;;;9506:50;;;:32;:50;:::i;:::-;9492:10;;9477:26;;;;:14;;;:26;;;;;;;;:79;;;;9614:16;;;9589:19;;;;9588:43;;;:25;:43;:::i;:::-;9566:19;;;:65;-1:-1:-1;;;;;9648:23:46;;;;;;;:15;;;:23;;;;;;;;9641:30;;;;;;;;;;9726:23;;;9712:38;;:13;:38;;;;;;;9686:73;;9648:23;;9712:38;;9699:11;;9686:73;;;9279:487;;;;:::o;10312:911::-;10389:4;10405:25;10465:20;10587:12;10701:8;10839:27;;:::i;:::-;1981:22;;;;:9;:22;;;;;:27;;;10368:11;;1981:27;;1973:36;;;;;;;;10433:22;;;;:9;:22;;;;;;;;10520:18;;;;10488:89;;;;;;;;;;;;;10433:22;;-1:-1:-1;;;;;;10520:18:46;;10488:76;;:89;;;;;10433:22;;10488:89;;;;;;;;;10520:18;10488:89;;;5:2:-1;;;;30:1;27;20:12;5:2;10488:89:46;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;10488:89:46;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;10488:89:46;10613:19;;;;10602:10;:31;;;10488:89;10602:31;;;;;;:39;10488:89;;-1:-1:-1;10602:39:46;;-1:-1:-1;10602:10:46;-1:-1:-1;10696:499:46;10722:21;;;;10715:28;;10696:499;;10770:19;;;;:14;;;:19;;;;;;10816:3;10792:23;;;:27;-1:-1:-1;10766:419:46;;;10839:38;;;;;;;;;;-1:-1:-1;;;;;10839:38:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;10895:27:46;10910:11;10895:14;:27::i;:::-;10988:26;;;;;10974:41;;;;:13;:41;;;;;;;;10945:93;;;;;;;;;;;;;-1:-1:-1;;;;;10974:41:46;;;;10961:11;;10945:93;;;;;;;;;11081:21;;;;;11056:85;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;11056:63:46;;;;;;:85;;;;;;;;;;;;;;;:63;:85;;;5:2:-1;;;;30:1;27;20:12;5:2;11056:85:46;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;11056:85:46;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;11166:4:46;;-1:-1:-1;11159:11:46;;-1:-1:-1;11159:11:46;10766:419;10745:5;;;;;10696:499;;;11211:5;11204:12;;2019:1;10312:911;;;;;;;;;:::o;1238:128:54:-;1319:7;;;1339;;;;1332:15;;;;1238:128;;;;:::o;1060:116::-;1120:7;1142:8;;;;1135:16;;;;-1:-1:-1;1164:7:54;;;1060:116::o;238:12771:46:-;;;;;;;;;;-1:-1:-1;238:12771:46;;;;;;;;:::o;:::-;;;;;;;;;-1:-1:-1;238:12771:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o",
"source": "pragma solidity ^0.4.25;\n\nimport \"../Reputation.sol\";\nimport \"./IntVoteInterface.sol\";\nimport \"openzeppelin-solidity/contracts/math/SafeMath.sol\";\nimport \"./VotingMachineCallbacksInterface.sol\";\nimport \"./ProposalExecuteInterface.sol\";\n\n\ncontract AbsoluteVote is IntVoteInterface {\n using SafeMath for uint;\n\n\n struct Parameters {\n uint precReq; // how many percentages required for the proposal to be passed\n bool allowOwner; // does this proposal has an owner who has owner rights?\n }\n\n struct Voter {\n uint vote; // 0 - 'abstain'\n uint reputation; // amount of voter's reputation\n }\n\n struct Proposal {\n address owner; // the proposal's owner\n bytes32 organizationId; // the organization Id\n address callbacks;\n uint numOfChoices;\n bytes32 paramsHash; // the hash of the parameters of the proposal\n uint totalVotes;\n mapping(uint=>uint) votes;\n mapping(address=>Voter) voters;\n bool open; // voting open flag\n }\n\n event AVVoteProposal(bytes32 indexed _proposalId, bool _isOwnerVote);\n event RefreshReputation(bytes32 indexed _proposalId, bytes32 indexed _organizationId, address indexed _voter,uint _reputation);\n\n\n mapping(bytes32=>Parameters) public parameters; // A mapping from hashes to parameters\n mapping(bytes32=>Proposal) public proposals; // Mapping from the ID of the proposal to the proposal itself.\n mapping(bytes32 => address ) organizations;\n\n uint public constant MAX_NUM_OF_CHOICES = 10;\n uint public proposalsCnt; // Total amount of proposals\n\n /**\n * @dev Check that there is owner for the proposal and he sent the transaction\n */\n modifier onlyProposalOwner(bytes32 _proposalId) {\n require(msg.sender == proposals[_proposalId].owner);\n _;\n }\n\n /**\n * @dev Check that the proposal is votable (open and not executed yet)\n */\n modifier votable(bytes32 _proposalId) {\n require(proposals[_proposalId].open);\n _;\n }\n\n /**\n * @dev register a new proposal with the given parameters. Every proposal has a unique ID which is being\n * generated by calculating keccak256 of a incremented counter.\n * @param _numOfChoices number of voting choices\n * @param _paramsHash defined the parameters of the voting machine used for this proposal\n * @param _organization address\n * @return proposal's id.\n */\n function propose(uint _numOfChoices, bytes32 _paramsHash, address, address _organization)\n external\n returns(bytes32)\n {\n // Check valid params and number of choices:\n require(parameters[_paramsHash].precReq > 0);\n require(_numOfChoices > 0 && _numOfChoices <= MAX_NUM_OF_CHOICES);\n // Generate a unique ID:\n bytes32 proposalId = keccak256(abi.encodePacked(this, proposalsCnt));\n proposalsCnt++;\n // Open proposal:\n Proposal memory proposal;\n proposal.numOfChoices = _numOfChoices;\n proposal.paramsHash = _paramsHash;\n proposal.callbacks = msg.sender;\n proposal.organizationId = keccak256(abi.encodePacked(msg.sender,_organization));\n proposal.owner = msg.sender;\n proposal.open = true;\n proposals[proposalId] = proposal;\n if (organizations[proposal.organizationId] == 0) {\n if (_organization == address(0)) {\n organizations[proposal.organizationId] = msg.sender;\n } else {\n organizations[proposal.organizationId] = _organization;\n }\n }\n emit NewProposal(proposalId, organizations[proposal.organizationId], _numOfChoices, msg.sender, _paramsHash);\n return proposalId;\n }\n\n /**\n * @dev Cancel a proposal, only the owner can call this function and only if allowOwner flag is true.\n * @param _proposalId the proposal ID\n */\n function cancelProposal(bytes32 _proposalId) external onlyProposalOwner(_proposalId) votable(_proposalId) returns(bool) {\n if (! parameters[proposals[_proposalId].paramsHash].allowOwner) {\n return false;\n }\n bytes32 organizationId = proposals[_proposalId].organizationId;\n deleteProposal(_proposalId);\n emit CancelProposal(_proposalId, organizations[organizationId]);\n return true;\n }\n\n /**\n * @dev voting function\n * @param _proposalId id of the proposal\n * @param _vote a value between 0 to and the proposal number of choices.\n * @return bool true - the proposal has been executed\n * false - otherwise.\n */\n function vote(bytes32 _proposalId, uint _vote,address) external votable(_proposalId) returns(bool) {\n return internalVote(_proposalId, msg.sender, _vote, 0);\n }\n\n /**\n * @dev voting function with owner functionality (can vote on behalf of someone else)\n * @param _proposalId id of the proposal\n * @param _vote a value between 0 to and the proposal number of choices.\n * @param _voter will be voted with that voter's address\n * @return bool true - the proposal has been executed\n * false - otherwise.\n */\n function ownerVote(bytes32 _proposalId, uint _vote, address _voter)\n external\n onlyProposalOwner(_proposalId)\n votable(_proposalId)\n returns(bool)\n {\n if (! parameters[proposals[_proposalId].paramsHash].allowOwner) {\n return false;\n }\n return internalVote(_proposalId, _voter, _vote, 0);\n }\n\n function voteWithSpecifiedAmounts(bytes32 _proposalId,uint _vote,uint _rep,uint,address) external votable(_proposalId) returns(bool) {\n return internalVote(_proposalId,msg.sender,_vote,_rep);\n }\n\n /**\n * @dev Cancel the vote of the msg.sender: subtract the reputation amount from the votes\n * and delete the voter from the proposal struct\n * @param _proposalId id of the proposal\n */\n function cancelVote(bytes32 _proposalId) external votable(_proposalId) {\n cancelVoteInternal(_proposalId, msg.sender);\n }\n\n /**\n * @dev getNumberOfChoices returns the number of choices possible in this proposal\n * @param _proposalId the ID of the proposal\n * @return uint that contains number of choices\n */\n function getNumberOfChoices(bytes32 _proposalId) external view returns(uint) {\n return proposals[_proposalId].numOfChoices;\n }\n\n /**\n * @dev voteInfo returns the vote and the amount of reputation of the user committed to this proposal\n * @param _proposalId the ID of the proposal\n * @param _voter the address of the voter\n * @return uint vote - the voters vote\n * uint reputation - amount of reputation committed by _voter to _proposalId\n */\n function voteInfo(bytes32 _proposalId, address _voter) external view returns(uint, uint) {\n Voter memory voter = proposals[_proposalId].voters[_voter];\n return (voter.vote, voter.reputation);\n }\n\n /**\n * @dev voteStatus returns the reputation voted for a proposal for a specific voting choice.\n * @param _proposalId the ID of the proposal\n * @param _choice the index in the\n * @return voted reputation for the given choice\n */\n function voteStatus(bytes32 _proposalId,uint _choice) external view returns(uint) {\n return proposals[_proposalId].votes[_choice];\n }\n\n /**\n * @dev isVotable check if the proposal is votable\n * @param _proposalId the ID of the proposal\n * @return bool true or false\n */\n function isVotable(bytes32 _proposalId) external view returns(bool) {\n return proposals[_proposalId].open;\n }\n\n /**\n * @dev isAbstainAllow returns if the voting machine allow abstain (0)\n * @return bool true or false\n */\n function isAbstainAllow() external pure returns(bool) {\n return true;\n }\n\n /**\n * @dev getAllowedRangeOfChoices returns the allowed range of choices for a voting machine.\n * @return min - minimum number of choices\n max - maximum number of choices\n */\n function getAllowedRangeOfChoices() external pure returns(uint min,uint max) {\n return (1,MAX_NUM_OF_CHOICES);\n }\n\n /**\n * @dev execute check if the proposal has been decided, and if so, execute the proposal\n * @param _proposalId the id of the proposal\n * @return bool true - the proposal has been executed\n * false - otherwise.\n */\n function execute(bytes32 _proposalId) external votable(_proposalId) returns(bool) {\n return _execute(_proposalId);\n }\n\n /**\n * @dev hash the parameters, save them if necessary, and return the hash value\n */\n function setParameters(uint _precReq, bool _allowOwner) public returns(bytes32) {\n require(_precReq <= 100 && _precReq > 0);\n bytes32 hashedParameters = getParametersHash(_precReq, _allowOwner);\n parameters[hashedParameters] = Parameters({\n precReq: _precReq,\n allowOwner: _allowOwner\n });\n return hash