UNPKG

@gooddollar/goodcontracts

Version:
1,050 lines 3.56 MB
{ "contractName": "GenesisProtocolLogic", "abi": [ { "inputs": [ { "internalType": "contract IERC20", "name": "_stakingToken", "type": "address" } ], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "bytes32", "name": "_proposalId", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "_organization", "type": "address" } ], "name": "CancelProposal", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "bytes32", "name": "_proposalId", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "_organization", "type": "address" }, { "indexed": true, "internalType": "address", "name": "_voter", "type": "address" } ], "name": "CancelVoting", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "bytes32", "name": "_proposalId", "type": "bytes32" }, { "indexed": false, "internalType": "uint256", "name": "_confidenceThreshold", "type": "uint256" } ], "name": "ConfidenceLevelChange", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "bytes32", "name": "_proposalId", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "_organization", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "_decision", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "_totalReputation", "type": "uint256" } ], "name": "ExecuteProposal", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "bytes32", "name": "_proposalId", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "_beneficiary", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "_amount", "type": "uint256" } ], "name": "ExpirationCallBounty", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "bytes32", "name": "_proposalId", "type": "bytes32" }, { "indexed": false, "internalType": "enum GenesisProtocolLogic.ExecutionState", "name": "_executionState", "type": "uint8" } ], "name": "GPExecuteProposal", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "bytes32", "name": "_proposalId", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "_organization", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "_numOfChoices", "type": "uint256" }, { "indexed": false, "internalType": "address", "name": "_proposer", "type": "address" }, { "indexed": false, "internalType": "bytes32", "name": "_paramsHash", "type": "bytes32" } ], "name": "NewProposal", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "bytes32", "name": "_proposalId", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "_organization", "type": "address" }, { "indexed": true, "internalType": "address", "name": "_beneficiary", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "_amount", "type": "uint256" } ], "name": "Redeem", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "bytes32", "name": "_proposalId", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "_organization", "type": "address" }, { "indexed": true, "internalType": "address", "name": "_beneficiary", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "_amount", "type": "uint256" } ], "name": "RedeemDaoBounty", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "bytes32", "name": "_proposalId", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "_organization", "type": "address" }, { "indexed": true, "internalType": "address", "name": "_beneficiary", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "_amount", "type": "uint256" } ], "name": "RedeemReputation", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "bytes32", "name": "_proposalId", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "_organization", "type": "address" }, { "indexed": true, "internalType": "address", "name": "_staker", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "_vote", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "_amount", "type": "uint256" } ], "name": "Stake", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "bytes32", "name": "_proposalId", "type": "bytes32" }, { "indexed": false, "internalType": "enum GenesisProtocolLogic.ProposalState", "name": "_proposalState", "type": "uint8" } ], "name": "StateChange", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "bytes32", "name": "_proposalId", "type": "bytes32" }, { "indexed": true, "internalType": "address", "name": "_organization", "type": "address" }, { "indexed": true, "internalType": "address", "name": "_voter", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "_vote", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "_reputation", "type": "uint256" } ], "name": "VoteProposal", "type": "event" }, { "constant": true, "inputs": [], "name": "NO", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "NUM_OF_CHOICES", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "YES", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "name": "averagesDownstakesOfBoosted", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "bytes32", "name": "_proposalId", "type": "bytes32" } ], "name": "cancelVote", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [], "name": "getAllowedRangeOfChoices", "outputs": [ { "internalType": "uint256", "name": "min", "type": "uint256" }, { "internalType": "uint256", "name": "max", "type": "uint256" } ], "payable": false, "stateMutability": "pure", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "bytes32", "name": "_proposalId", "type": "bytes32" } ], "name": "getNumberOfChoices", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "isAbstainAllow", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "payable": false, "stateMutability": "pure", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "bytes32", "name": "_proposalId", "type": "bytes32" } ], "name": "isVotable", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "name": "orgBoostedProposalsCnt", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "name": "organizations", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "name": "parameters", "outputs": [ { "internalType": "uint256", "name": "queuedVoteRequiredPercentage", "type": "uint256" }, { "internalType": "uint256", "name": "queuedVotePeriodLimit", "type": "uint256" }, { "internalType": "uint256", "name": "boostedVotePeriodLimit", "type": "uint256" }, { "internalType": "uint256", "name": "preBoostedVotePeriodLimit", "type": "uint256" }, { "internalType": "uint256", "name": "thresholdConst", "type": "uint256" }, { "internalType": "uint256", "name": "limitExponentValue", "type": "uint256" }, { "internalType": "uint256", "name": "quietEndingPeriod", "type": "uint256" }, { "internalType": "uint256", "name": "proposingRepReward", "type": "uint256" }, { "internalType": "uint256", "name": "votersReputationLossRatio", "type": "uint256" }, { "internalType": "uint256", "name": "minimumDaoBounty", "type": "uint256" }, { "internalType": "uint256", "name": "daoBountyConst", "type": "uint256" }, { "internalType": "uint256", "name": "activationTime", "type": "uint256" }, { "internalType": "address", "name": "voteOnBehalf", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "name": "proposals", "outputs": [ { "internalType": "bytes32", "name": "organizationId", "type": "bytes32" }, { "internalType": "address", "name": "callbacks", "type": "address" }, { "internalType": "enum GenesisProtocolLogic.ProposalState", "name": "state", "type": "uint8" }, { "internalType": "uint256", "name": "winningVote", "type": "uint256" }, { "internalType": "address", "name": "proposer", "type": "address" }, { "internalType": "uint256", "name": "currentBoostedVotePeriodLimit", "type": "uint256" }, { "internalType": "bytes32", "name": "paramsHash", "type": "bytes32" }, { "internalType": "uint256", "name": "daoBountyRemain", "type": "uint256" }, { "internalType": "uint256", "name": "daoBounty", "type": "uint256" }, { "internalType": "uint256", "name": "totalStakes", "type": "uint256" }, { "internalType": "uint256", "name": "confidenceThreshold", "type": "uint256" }, { "internalType": "uint256", "name": "expirationCallBountyPercentage", "type": "uint256" }, { "internalType": "bool", "name": "daoRedeemItsWinnings", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "proposalsCnt", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "stakingToken", "outputs": [ { "internalType": "contract IERC20", "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "bytes32", "name": "_proposalId", "type": "bytes32" }, { "internalType": "uint256", "name": "_vote", "type": "uint256" }, { "internalType": "uint256", "name": "_rep", "type": "uint256" }, { "internalType": "address", "name": "_voter", "type": "address" } ], "name": "vote", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "bytes32", "name": "_proposalId", "type": "bytes32" }, { "internalType": "uint256", "name": "_choice", "type": "uint256" } ], "name": "voteStatus", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "uint256", "name": "", "type": "uint256" }, { "internalType": "bytes32", "name": "_paramsHash", "type": "bytes32" }, { "internalType": "address", "name": "_proposer", "type": "address" }, { "internalType": "address", "name": "_organization", "type": "address" } ], "name": "propose", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "bytes32", "name": "_proposalId", "type": "bytes32" } ], "name": "executeBoosted", "outputs": [ { "internalType": "uint256", "name": "expirationCallBounty", "type": "uint256" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "uint256[11]", "name": "_params", "type": "uint256[11]" }, { "internalType": "address", "name": "_voteOnBehalf", "type": "address" } ], "name": "setParameters", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "bytes32", "name": "_proposalId", "type": "bytes32" }, { "internalType": "address", "name": "_beneficiary", "type": "address" } ], "name": "redeem", "outputs": [ { "internalType": "uint256[3]", "name": "rewards", "type": "uint256[3]" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "bytes32", "name": "_proposalId", "type": "bytes32" }, { "internalType": "address", "name": "_beneficiary", "type": "address" } ], "name": "redeemDaoBounty", "outputs": [ { "internalType": "uint256", "name": "redeemedAmount", "type": "uint256" }, { "internalType": "uint256", "name": "potentialAmount", "type": "uint256" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "bytes32", "name": "_proposalId", "type": "bytes32" } ], "name": "shouldBoost", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "bytes32", "name": "_paramsHash", "type": "bytes32" }, { "internalType": "bytes32", "name": "_organizationId", "type": "bytes32" } ], "name": "threshold", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "internalType": "uint256[11]", "name": "_params", "type": "uint256[11]" }, { "internalType": "address", "name": "_voteOnBehalf", "type": "address" } ], "name": "getParametersHash", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "payable": false, "stateMutability": "pure", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"_stakingToken\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_proposalId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_organization\",\"type\":\"address\"}],\"name\":\"CancelProposal\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_proposalId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_organization\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_voter\",\"type\":\"address\"}],\"name\":\"CancelVoting\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_proposalId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_confidenceThreshold\",\"type\":\"uint256\"}],\"name\":\"ConfidenceLevelChange\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_proposalId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_organization\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_decision\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_totalReputation\",\"type\":\"uint256\"}],\"name\":\"ExecuteProposal\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_proposalId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"ExpirationCallBounty\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_proposalId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"enum GenesisProtocolLogic.ExecutionState\",\"name\":\"_executionState\",\"type\":\"uint8\"}],\"name\":\"GPExecuteProposal\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_proposalId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_organization\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_numOfChoices\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"_proposer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_paramsHash\",\"type\":\"bytes32\"}],\"name\":\"NewProposal\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_proposalId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_organization\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"Redeem\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_proposalId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_organization\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"RedeemDaoBounty\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_proposalId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_organization\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_beneficiary\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"RedeemReputation\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_proposalId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_organization\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_staker\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_vote\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"Stake\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_proposalId\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"enum GenesisProtocolLogic.ProposalState\",\"name\":\"_proposalState\",\"type\":\"uint8\"}],\"name\":\"StateChange\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"_proposalId\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_organization\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"_voter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_vote\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_reputation\",\"type\":\"uint256\"}],\"name\":\"VoteProposal\",\"type\":\"event\"},{\"constant\":true,\"inputs\":[],\"name\":\"NO\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"NUM_OF_CHOICES\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"YES\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"averagesDownstakesOfBoosted\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_proposalId\",\"type\":\"bytes32\"}],\"name\":\"cancelVote\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_proposalId\",\"type\":\"bytes32\"}],\"name\":\"executeBoosted\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"expirationCallBounty\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getAllowedRangeOfChoices\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_proposalId\",\"type\":\"bytes32\"}],\"name\":\"getNumberOfChoices\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256[11]\",\"name\":\"_params\",\"type\":\"uint256[11]\"},{\"internalType\":\"address\",\"name\":\"_voteOnBehalf\",\"type\":\"address\"}],\"name\":\"getParametersHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"isAbstainAllow\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"pure\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_proposalId\",\"type\":\"bytes32\"}],\"name\":\"isVotable\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"orgBoostedProposalsCnt\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"organizations\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"parameters\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"queuedVoteRequiredPercentage\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"queuedVotePeriodLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"boostedVotePeriodLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"preBoostedVotePeriodLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"thresholdConst\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"limitExponentValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quietEndingPeriod\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proposingRepReward\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"votersReputationLossRatio\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minimumDaoBounty\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"daoBountyConst\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"activationTime\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"voteOnBehalf\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"proposals\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"organizationId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"callbacks\",\"type\":\"address\"},{\"internalType\":\"enum GenesisProtocolLogic.ProposalState\",\"name\":\"state\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"winningVote\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"proposer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"currentBoostedVotePeriodLimit\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"paramsHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"daoBountyRemain\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"daoBounty\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalStakes\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"confidenceThreshold\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expirationCallBountyPercentage\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"daoRedeemItsWinnings\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"proposalsCnt\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_paramsHash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_proposer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_organization\",\"type\":\"address\"}],\"name\":\"propose\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_proposalId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_beneficiary\",\"type\":\"address\"}],\"name\":\"redeem\",\"outputs\":[{\"internalType\":\"uint256[3]\",\"name\":\"rewards\",\"type\":\"uint256[3]\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_proposalId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_beneficiary\",\"type\":\"address\"}],\"name\":\"redeemDaoBounty\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"redeemedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"potentialAmount\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"uint256[11]\",\"name\":\"_params\",\"type\":\"uint256[11]\"},{\"internalType\":\"address\",\"name\":\"_voteOnBehalf\",\"type\":\"address\"}],\"name\":\"setParameters\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_proposalId\",\"type\":\"bytes32\"}],\"name\":\"shouldBoost\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"stakingToken\",\"outputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_paramsHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_organizationId\",\"type\":\"bytes32\"}],\"name\":\"threshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_proposalId\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_vote\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_rep\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"_voter\",\"type\":\"address\"}],\"name\":\"vote\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_proposalId\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_choice\",\"type\":\"uint256\"}],\"name\":\"voteStatus\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{\"constructor\":{\"details\":\"Constructor\"},\"executeBoosted(bytes32)\":{\"details\":\"executeBoosted try to execute a boosted or QuietEndingPeriod proposal if it is expired\",\"params\":{\"_proposalId\":\"the id of the proposal\"},\"return\":\"uint256 expirationCallBounty the bounty amount for the expiration call\"},\"getAllowedRangeOfChoices()\":{\"details\":\"getAllowedRangeOfChoices returns the allowed range of choices for a voting machine.\",\"return\":\"min - minimum number of choices max - maximum number of choices\"},\"getParametersHash(uint256[11],address)\":{\"details\":\"hashParameters returns a hash of the given parameters\"},\"isAbstainAllow()\":{\"details\":\"isAbstainAllow returns if the voting machine allow abstain (0)\",\"return\":\"bool true or false\"},\"propose(uint256,bytes32,address,address)\":{\"details\":\"register a new proposal with the given parameters. Every proposal has a unique ID which is being generated by calculating keccak256 of a incremented counter.\",\"params\":{\"_organization\":\"address\",\"_paramsHash\":\"parameters hash\",\"_proposer\":\"address\"}},\"redeem(bytes32,address)\":{\"details\":\"redeem a reward for a successful stake, vote or proposing. The function use a beneficiary address as a parameter (and not msg.sender) to enable users to redeem on behalf of someone else.\",\"params\":{\"_beneficiary\":\"- the beneficiary address\",\"_proposalId\":\"the ID of the proposal\"},\"return\":\"rewards - [0] stakerTokenReward [1] voterReputationReward [2] proposerReputationReward\"},\"redeemDaoBounty(bytes32,address)\":{\"details\":\"redeemDaoBounty a reward for a successful stake. The function use a beneficiary address as a parameter (and not msg.sender) to enable users to redeem on behalf of someone else.\",\"params\":{\"_beneficiary\":\"- the beneficiary address\",\"_proposalId\":\"the ID of the proposal\"},\"return\":\"redeemedAmount - redeem token amountpotentialAmount - potential redeem token amount(if there is enough tokens bounty at the organization )\"},\"setParameters(uint256[11],address)\":{\"details\":\"hash the parameters, save them if necessary, and return the hash value\",\"params\":{\"_params\":\"a parameters array _params[0] - _queuedVoteRequiredPercentage, _params[1] - _queuedVotePeriodLimit, //the time limit for a proposal to be in an absolute voting mode. _params[2] - _boostedVotePeriodLimit, //the time limit for a proposal to be in an relative voting mode. _params[3] - _preBoostedVotePeriodLimit, //the time limit for a proposal to be in an preparation state (stable) before boosted. _params[4] -_thresholdConst _params[5] -_quietEndingPeriod _params[6] -_proposingRepReward _params[7] -_votersReputationLossRatio _params[8] -_minimumDaoBounty _params[9] -_daoBountyConst _params[10] -_activationTime\",\"_voteOnBehalf\":\"- authorized to vote on behalf of others.\"}},\"shouldBoost(bytes32)\":{\"details\":\"shouldBoost check if a proposal should be shifted to boosted phase.\",\"params\":{\"_proposalId\":\"the ID of the proposal\"},\"return\":\"bool true or false.\"},\"threshold(bytes32,bytes32)\":{\"details\":\"threshold return the organization's score threshold which required by a proposal to shift to boosted state. This threshold is dynamically set and it depend on the number of boosted proposal.\",\"params\":{\"_organizationId\":\"the organization identifier\",\"_paramsHash\":\"the organization parameters hash\"},\"return\":\"uint256 organization's score threshold as real number.\"},\"voteStatus(bytes32,uint256)\":{\"details\":\"voteStatus returns the reputation voted for a proposal for a specific voting choice.\",\"params\":{\"_choice\":\"the index in the\",\"_proposalId\":\"the ID of the proposal\"},\"return\":\"voted reputation for the given choice\"}},\"title\":\"GenesisProtocol implementation -an organization's voting machine scheme.\"},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"@daostack/infra/contracts/votingMachines/GenesisProtocolLogic.sol\":\"GenesisProtocolLogic\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@daostack/infra/contracts/libs/RealMath.sol\":{\"keccak256\":\"0x3ee79c4b483da327916ac36f9d5cc6a1f2f0363db3ad06793ec67f46e1f653db\",\"urls\":[\"bzz-raw://19b423aa16b93e414c50ca513caabc0f1cb835f31deec82d85d9bb31c0f8d5fb\",\"dweb:/ipfs/QmS8gjtT3jxxoNAosJf6QSStFAE2KZLhNA1Qq9MXwT2CnN\"]},\"@daostack/infra/contracts/votingMachines/GenesisProtocolLogic.sol\":{\"keccak256\":\"0x2bf5fba64fbda5605b9250ea8ca6d8e28dab41fb0e2b43c9145b91e1d0425eef\",\"urls\":[\"bzz-raw://3b34c1f70c2b98d4f3add9264700f60cb3deed47610e010f3d4ac112ab107930\",\"dweb:/ipfs/QmY46SXZnKJeUmbsSfwkW1zNh1YP4FHUjAbVJUJXqhKNwV\"]},\"@daostack/infra/contracts/votingMachines/IntVoteInterface.sol\":{\"keccak256\":\"0x877991da94b1fe9c2accf69367b32fff474c4e4f7897e9cf5a61fa5d1378908f\",\"urls\":[\"bzz-raw://4ea2c35248b82ea74884313752870789de61b0bcbc14425e97192b1ef1450e5a\",\"dweb:/ipfs/QmZ9RxpmG6SsMLJm1hT9ZmVy3CVPNZyRihQxZFDk8u3w1G\"]},\"@daostack/infra/contracts/votingMachines/ProposalExecuteInterface.sol\":{\"keccak256\":\"0xb80a153793e1723b35e70ba1c3800975fbc1fae63c989cfb8134a4e58085e181\",\"urls\":[\"bzz-raw://7ea97373ca977623d4c480c1d03e0853b1b34d59df4928ef72548987b2943899\",\"dweb:/ipfs/QmZ1MmDX4ExZ1iEo9gFp3SHfpNjWoLHS9nVhFkTRokgoLS\"]},\"@daostack/infra/contracts/votingMachines/VotingMachineCallbacksInterface.sol\":{\"keccak256\":\"0xec215d305f0aa5a5193b6f0302a1aa6bb84e85460167f80b261faf9d30564563\",\"urls\":[\"bzz-raw://8edb25b20c86a28b5c7c7c3a918f219106a1d3047933984dd76e33e30911857d\",\"dweb:/ipfs/Qme1iBcLjPPrC6jMF56cSE9pmEdCQ23aT43wQbnqKjXEYe\"]},\"openzeppelin-solidity/contracts/math/Math.sol\":{\"keccak256\":\"0x37605dd0606b349cfb1b679892e1bb0ef4ddc16dedb06e229cc4402610a7a848\",\"urls\":[\"bzz-raw://c44b0c7fe0523f3f9a10d2924d7d7137b1349b1e71cd4be57550e185a098ca55\",\"dweb:/ipfs/QmbBLBCBPpqna3QZTiomSwyBdtt5Ua9DqkFgYicMd7Coya\"]},\"openzeppelin-solidity/contracts/math/SafeMath.sol\":{\"keccak256\":\"0x965012d27b4262d7a41f5028cbb30c51ebd9ecd4be8fb30380aaa7a3c64fbc8b\",\"urls\":[\"bzz-raw://1eb493553b27efd46c231a836a83ce50d215639feb97b4aac9f301d0fd034ff5\",\"dweb:/ipfs/QmbMdvSXcqGKxeeYvzF3VrWpoHQyVzMXBhzhAokF2Gdymv\"]},\"openzeppelin-solidity/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x079c4e23ee448f529e43bfa3c4e8fb4be52cd0318ee923a276835bedf45b93d8\",\"urls\":[\"bzz-raw://ee762ff5b7746e41d27dcbcea00c7a3034b58adb1b45ddadddb5b721aff450df\",\"dweb:/ipfs/QmdxqtgEFZjHCoiYyz6pUAQ5iBm7As25jcyEbZoTaAgyDa\"]},\"openzeppelin-solidity/contracts/utils/Address.sol\":{\"keccak256\":\"0x5c731061b804fa256fc8c05150eafe5d20b6bb94541a8f187912bf84f7033f34\",\"urls\":[\"bzz-raw://a3c2d9f046beebab7fb41b1b124a6a124a36f510f7c67365861402ac831bdc71\",\"dweb:/ipfs/QmUtASRgitregbKH83anopLtF9vFQe3BKeAjhUa6F7t9YV\"]}},\"version\":1}", "bytecode": "0x", "deployedBytecode": "0x", "sourceMap": "", "deployedSourceMap": "", "source": "pragma solidity ^0.5.4;\n\nimport \"./IntVoteInterface.sol\";\nimport { RealMath } from \"../libs/RealMath.sol\";\nimport \"./VotingMachineCallbacksInterface.sol\";\nimport \"./ProposalExecuteInterface.sol\";\nimport \"openzeppelin-solidity/contracts/math/SafeMath.sol\";\nimport \"openzeppelin-solidity/contracts/math/Math.sol\";\nimport \"openzeppelin-solidity/contracts/token/ERC20/IERC20.sol\";\nimport \"openzeppelin-solidity/contracts/utils/Address.sol\";\n\n\n\n/**\n * @title GenesisProtocol implementation -an organization's voting machine scheme.\n */\ncontract GenesisProtocolLogic is IntVoteInterface {\n using SafeMath for uint256;\n using Math for uint256;\n using RealMath for uint216;\n using RealMath for uint256;\n using Address for address;\n\n enum ProposalState { None, ExpiredInQueue, Executed, Queued, PreBoosted, Boosted, QuietEndingPeriod}\n enum ExecutionState { None, QueueBarCrossed, QueueTimeOut, PreBoostedBarCrossed, BoostedTimeOut, BoostedBarCrossed}\n\n //Organization's parameters\n struct Parameters {\n uint256 queuedVoteRequiredPercentage; // the absolute vote percentages bar.\n uint256 queuedVotePeriodLimit; //the time limit for a proposal to be in an absolute voting mode.\n uint256 boostedVotePeriodLimit; //the time limit for a proposal to be in boost mode.\n uint256 preBoostedVotePeriodLimit; //the time limit for a proposal\n //to be in an preparation state (stable) before boosted.\n uint256 thresholdConst; //constant for threshold calculation .\n //threshold =thresholdConst ** (numberOfBoostedProposals)\n uint256 limitExponentValue;// an upper limit for numberOfBoostedProposals\n //in the threshold calculation to prevent overflow\n uint256 quietEndingPeriod; //quite ending period\n uint256 proposingRepReward;//proposer reputation reward.\n uint256 votersReputationLossRatio;//Unsuccessful pre booster\n //voters lose votersReputationLossRatio% of their reputation.\n uint256 minimumDaoBounty;\n uint256 daoBountyConst;//The DAO downstake for each proposal is calculate according to the formula\n //(daoBountyConst * averageBoostDownstakes)/100 .\n uint256 activationTime;//the point in time after which proposals can be created.\n //if this address is set so only this address is allowed to vote of behalf of someone else.\n address voteOnBehalf;\n }\n\n struct Voter {\n uint256 vote; // YES(1) ,NO(2)\n uint256 reputation; // amount of voter's reputation\n bool preBoosted;\n }\n\n struct Staker {\n uint256 vote; // YES(1) ,NO(2)\n uint256 amount; // amount of staker's stake\n uint256 amount4Bounty;// amount of staker's stake used for bounty reward calculation.\n }\n\n struct Proposal {\n bytes32 organizationId; // the organization unique identifier the proposal is target to.\n address callbacks; // should fulfill voting callbacks interface.\n ProposalState state;\n uint256 winningVote; //the winning vote.\n address proposer;\n //the proposal boosted period limit . it is updated for the case of quiteWindow mode.\n uint256 currentBoostedVotePeriodLimit;\n bytes32 paramsHash;\n uint256 daoBountyRemain; //use for checking sum zero bounty claims.it is set at the proposing time.\n uint256 daoBounty;\n uint256 totalStakes;// Total number of tokens staked which can be redeemable by stakers.\n uint256 confidenceThreshold;\n //The percentage from upper stakes which the caller for the expiration was given.\n uint256 expirationCallBountyPercentage;\n uint[3] times; //times[0] - submittedTime\n //times[1] - boostedPhaseTime\n //times[2] -preBoostedPhaseTime;\n bool daoRedeemItsWinnings;\n // vote reputation\n mapping(uint256 => uint256 ) votes;\n // vote reputation\n mapping(uint256 => uint256 ) preBoostedVotes;\n // address voter\n mapping(address => Voter ) voters;\n // vote stakes\n mapping(uint256 => uint256 ) stakes;\n // address staker\n mapping(address => Staker ) stakers;\n }\n\n event Stake(bytes32 indexed _proposalId,\n address indexed _organization,\n address indexed