Create contribution when proposal gets executed
This commit is contained in:
parent
6d9a54b71c
commit
6b8f718051
@ -3,6 +3,7 @@ pragma solidity ^0.4.18;
|
||||
// ToDo: only load interfaces
|
||||
import './Token.sol';
|
||||
import './Contributors.sol';
|
||||
import './Contribution.sol';
|
||||
|
||||
contract Operator is Upgradeable {
|
||||
|
||||
@ -47,6 +48,9 @@ contract Operator is Upgradeable {
|
||||
function tokenContract() view public returns (Token) {
|
||||
return Token(registry.getProxyFor('Token'));
|
||||
}
|
||||
function contributionContract() view public returns (Contribution) {
|
||||
return Contribution(registry.getProxyFor('Contribution'));
|
||||
}
|
||||
|
||||
function contributorsCount() view public returns (uint) {
|
||||
return contributorsContract().contributorsCount();
|
||||
@ -122,7 +126,7 @@ contract Operator is Upgradeable {
|
||||
require(!p.executed);
|
||||
require(p.votesCount >= p.votesNeeded);
|
||||
address recipientAddress = contributorsContract().getContributorAddressById(p.contributorId);
|
||||
tokenContract().mintFor(recipientAddress, p.amount, proposalId);
|
||||
contributionContract().add(p.amount, proposalId, recipientAddress, 0, '');
|
||||
p.executed = true;
|
||||
ProposalExecuted(proposalId, p.contributorId, p.amount);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user