Use new naming convention to call address things accounts
So here we use creatorAccount - similar to proposalId. Like this we will always have an *Account or *Id as identifier.
This commit is contained in:
parent
147904e237
commit
e116e7ebf3
@ -7,7 +7,7 @@ import './Contributors.sol';
|
|||||||
contract Operator is Upgradeable {
|
contract Operator is Upgradeable {
|
||||||
|
|
||||||
struct Proposal {
|
struct Proposal {
|
||||||
address creator;
|
address creatorAccount;
|
||||||
uint recipientId;
|
uint recipientId;
|
||||||
uint votesCount;
|
uint votesCount;
|
||||||
uint votesNeeded;
|
uint votesNeeded;
|
||||||
@ -24,9 +24,9 @@ contract Operator is Upgradeable {
|
|||||||
mapping(uint256 => Proposal) public proposals;
|
mapping(uint256 => Proposal) public proposals;
|
||||||
uint256 public proposalsCount;
|
uint256 public proposalsCount;
|
||||||
|
|
||||||
event ProposalCreated(uint256 id, address creator, uint recipientId, uint256 amount);
|
event ProposalCreated(uint256 id, address creatorAccount, uint256 recipientId, uint256 amount);
|
||||||
event ProposalVoted(uint256 id, address voter, uint256 totalVotes);
|
event ProposalVoted(uint256 id, uint256 contributorId, uint256 totalVotes);
|
||||||
event ProposalExecuted(uint256 id, uint recipientId, uint256 amount);
|
event ProposalExecuted(uint256 id, uint256 recipientId, uint256 amount);
|
||||||
|
|
||||||
modifier coreOnly() {
|
modifier coreOnly() {
|
||||||
require(contributorsContract().addressIsCore(msg.sender));
|
require(contributorsContract().addressIsCore(msg.sender));
|
||||||
@ -62,7 +62,7 @@ contract Operator is Upgradeable {
|
|||||||
uint _votesNeeded = contributorsContract().coreContributorsCount() / 100 * 75;
|
uint _votesNeeded = contributorsContract().coreContributorsCount() / 100 * 75;
|
||||||
|
|
||||||
var p = proposals[proposalId];
|
var p = proposals[proposalId];
|
||||||
p.creator = msg.sender;
|
p.creatorAccount = msg.sender;
|
||||||
p.recipientId = recipientId;
|
p.recipientId = recipientId;
|
||||||
p.amount = amount;
|
p.amount = amount;
|
||||||
p.ipfsHash = ipfsHash;
|
p.ipfsHash = ipfsHash;
|
||||||
@ -106,7 +106,7 @@ contract Operator is Upgradeable {
|
|||||||
if (p.votesCount >= p.votesNeeded) {
|
if (p.votesCount >= p.votesNeeded) {
|
||||||
executeProposal(proposalId);
|
executeProposal(proposalId);
|
||||||
}
|
}
|
||||||
ProposalVoted(proposalId, msg.sender, p.votesCount);
|
ProposalVoted(proposalId, voterId, p.votesCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
function executeProposal(uint proposalId) private {
|
function executeProposal(uint proposalId) private {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user