What is supposed to be packed inside data
parameter passed to schedule(...)
and other functions in AccessManager? Is it just a calldata?
Yes, the manager includes a schedule
and execute
workflow for any operation requiring a delay. The functions that require a delay are listed in the manager's NatSpec. For these cases, the schedule
function will use the data
argument for 2 purposes:
- Extract the function selector (first 4 bytes) and validate that the
msg.sender
is allowed to call that function. - Create an
operationId
that uniquely identifies the scheduled operation. This way the scheduled date can be retrieved from storage.
Using the execute
function doesn't necessarily require a delay if the msg.sender
has enough permissions to call immediately, but it works as a relay function, so the manager can make arbitrary calls to other contracts. This data
argument is the data relayed by the manager to target
1 Like