Skip to content

Commit

Permalink
recover debits logic (#728)
Browse files Browse the repository at this point in the history
  • Loading branch information
huangzhiran authored Oct 29, 2024
1 parent 10ce496 commit 3c49f6b
Show file tree
Hide file tree
Showing 2 changed files with 357 additions and 357 deletions.
8 changes: 4 additions & 4 deletions smartcontracts/contracts/W3bstreamTaskManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ contract W3bstreamTaskManager is OwnableUpgradeable, ITaskManager {
require(!projectReward.isPaused(projectId), "project paused");
address taskOwner = hash.recover(signature);
uint256 rewardAmount = projectReward.rewardAmount(taskOwner, projectId);
//address rewardToken = projectReward.rewardToken(projectId);
//debits.withhold(rewardToken, taskOwner, rewardAmount);
address rewardToken = projectReward.rewardToken(projectId);
debits.withhold(rewardToken, taskOwner, rewardAmount);
Record storage record = records[projectId][taskId];
require(record.settled == false, "task already settled");
if (record.prover != address(0)) {
Expand Down Expand Up @@ -159,8 +159,8 @@ contract W3bstreamTaskManager is OwnableUpgradeable, ITaskManager {
amounts[0] = record.rewardForProver;
recipients[1] = record.sequencer;
amounts[1] = record.rewardForSequencer;
//address rewardToken = IProjectReward(projectReward).rewardToken(projectId);
//debits.distribute(rewardToken, record.owner, recipients, amounts);
address rewardToken = IProjectReward(projectReward).rewardToken(projectId);
debits.distribute(rewardToken, record.owner, recipients, amounts);
}

function recall(uint256 projectId, bytes32 taskId) public {
Expand Down
Loading

0 comments on commit 3c49f6b

Please sign in to comment.