Skip to content

Commit

Permalink
add creator bounty to votes
Browse files Browse the repository at this point in the history
  • Loading branch information
lorbke committed Nov 16, 2024
1 parent 21ea151 commit 4773bab
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/foundry/contracts/HumanOracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ contract HumanOracle {
}
}

function createVote(string calldata question, string[] calldata answers, uint256 startBlock, uint256 durationInBlocks) external {
function createVote(string calldata question, string[] calldata answers, uint256 startBlock, uint256 durationInBlocks, uint256 bounty) external {
uint256 voteId = votes.length;
Vote memory newVote = Vote({
id: voteId,
Expand All @@ -185,7 +185,7 @@ contract HumanOracle {
});
votes.push(newVote);

createNewStake(voteId);
createNewStake(voteId, bounty);

emit VoteCreated(votes[voteId].id, votes[voteId].question, votes[voteId].startBlock, votes[voteId].durationInBlocks);
}
Expand Down Expand Up @@ -252,8 +252,9 @@ contract HumanOracle {
// internal

// stake related
function createNewStake(uint256 voteId) internal {
function createNewStake(uint256 voteId, uint256 initialStake) internal {
Stake storage newStake = stakesForVoteIds[voteId];
newStake.totalStake = initialStake;
uint256 answerCount = votes[voteId].answers.length;
for (uint i = 0; i < answerCount; i++) {
newStake.answers.push();
Expand Down

0 comments on commit 4773bab

Please sign in to comment.