Skip to content
This repository has been archived by the owner on Aug 9, 2022. It is now read-only.

Add timestamp to ExecutionRequested event #19

Merged
merged 7 commits into from
May 20, 2021
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 19 additions & 12 deletions contracts/OneShotSchedule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ contract OneShotSchedule is IERC677TransferReceiver, Initializable, ReentrancyGu
event PlanRemoved(uint256 indexed index);

event ExecutionPurchased(address indexed requestor, uint256 plan, uint256 amount);
event ExecutionRequested(bytes32 indexed id);
event ExecutionRequested(bytes32 indexed id, uint256 timestamp);
event Executed(bytes32 indexed id, bool success, bytes result);
event ExecutionCancelled(bytes32 indexed id);

Expand Down Expand Up @@ -164,26 +164,33 @@ contract OneShotSchedule is IERC677TransferReceiver, Initializable, ReentrancyGu
Execution memory execution = Execution(msg.sender, plan, to, data, gas, timestamp, msg.value, ExecutionState.Scheduled);
bytes32 id = hash(execution);
executions[id] = execution;
emit ExecutionRequested(id);
emit ExecutionRequested(id, timestamp);
}

function getSchedule(bytes32 id)
external
view
returns (
address,
uint256,
address,
bytes memory,
uint256,
uint256,
uint256,
ExecutionState
address requestor,
uint256 plan,
address to,
bytes memory data,
uint256 gas,
uint256 timestamp,
uint256 value,
ExecutionState state
)
{
Execution memory execution = executions[id];
ExecutionState state = getState(id);
return (execution.requestor, execution.plan, execution.to, execution.data, execution.gas, execution.timestamp, execution.value, state);

requestor = execution.requestor;
plan = execution.plan;
to = execution.to;
data = execution.data;
gas = execution.gas;
timestamp = execution.timestamp;
value = execution.value;
state = getState(id);
ilanolkies marked this conversation as resolved.
Show resolved Hide resolved
}

function cancelScheduling(bytes32 id) external {
Expand Down