Skip to content

Commit

Permalink
Merge pull request #1 from rhinestonewtf/fix/remediations
Browse files Browse the repository at this point in the history
fix: remediation in nr of executions
  • Loading branch information
kopy-kat authored Jul 4, 2024
2 parents 99c4540 + 2b5f08e commit 20be051
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/SchedulingBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,16 @@ abstract contract SchedulingBase is ERC7579ExecutorBase {
uint256 jobId = accountJobCount[account] + 1;
accountJobCount[account]++;

// prevent user from supplying an invalid number of execution (0)
uint16 nrOfExecutions = uint16(bytes2(orderData[6:8]));
if (nrOfExecutions == 0) revert InvalidExecution();

executionLog[account][jobId] = ExecutionConfig({
numberOfExecutionsCompleted: 0,
isEnabled: true,
lastExecutionTime: 0,
executeInterval: uint48(bytes6(orderData[0:6])),
numberOfExecutions: uint16(bytes2(orderData[6:8])),
numberOfExecutions: nrOfExecutions,
startDate: uint48(bytes6(orderData[8:14])),
executionData: orderData[14:]
});
Expand Down

0 comments on commit 20be051

Please sign in to comment.