public Moloch( ISmartContractState state, Address summoner, Address _approvedToken, ulong _periodDuration, ulong _votingPeriodLength, ulong _gracePeriodLength, ulong _abortWindow, ulong _proposalDeposit, ulong _dilutionBound, ulong _processingReward, Address approvedTokenAddress, IStandardToken approvedStandardToken ) : base(state) { Assert(summoner != Address.Zero, "Moloch::constructor - summoner cannot be 0"); Assert(_approvedToken != Address.Zero, "Moloch::constructor - _approvedToken cannot be 0"); Assert(_periodDuration > 0, "Moloch::constructor - _periodDuration cannot be 0"); Assert(_votingPeriodLength > 0, "Moloch::constructor - _votingPeriodLength cannot be 0"); Assert(_votingPeriodLength <= MAX_VOTING_PERIOD_LENGTH, "Moloch::constructor - _votingPeriodLength exceeds limit"); Assert(_gracePeriodLength <= MAX_GRACE_PERIOD_LENGTH, "Moloch::constructor - _gracePeriodLength exceeds limit"); Assert(_abortWindow > 0, "Moloch::constructor - _abortWindow cannot be 0"); Assert(_abortWindow <= _votingPeriodLength, "Moloch::constructor - _abortWindow must be smaller than or equal to _votingPeriodLength"); Assert(_dilutionBound > 0, "Moloch::constructor - _dilutionBound cannot be 0"); Assert(_dilutionBound <= MAX_DILUTION_BOUND, "Moloch::constructor - _dilutionBound exceeds limit"); Assert(_proposalDeposit >= _processingReward, "Moloch::constructor - _proposalDeposit cannot be smaller than _processingReward"); // todo: how to wrap calls from/to? ApprovedTokenAddress = approvedTokenAddress; ApprovedStandardToken = approvedStandardToken; // todo: how to start a new guildbank contract as well? GuildBank = new GuildBank(state, approvedTokenAddress, approvedStandardToken); PeriodDuration = _periodDuration; VotingPeriodLength = _votingPeriodLength; GracePeriodLength = _gracePeriodLength; AbortWindow = _abortWindow; ProposalDeposit = _proposalDeposit; DilutionBound = _dilutionBound; ProcessingReward = _processingReward; // todo: summoningTime = now; // now operator/call missing in stratis? SummoningTime = DateTime.UtcNow.Ticks; SetMember(summoner, new Member() { DelegateKey = summoner, Shares = 1, Exists = true, HighestIndexYesVote = 0 }); SetMemberAddressByDelegateKey(summoner, summoner); TotalShares = 1; SetProposalQueue(new Proposal[0]); LogSummonComplete(summoner, 1); }
public GuildBank(ISmartContractState state, Address approvedTokenAddress, IStandardToken approvedStandardToken) : base(state) { ApprovedTokenAddress = approvedTokenAddress; ApprovedStandardToken = approvedStandardToken; }