Authorization
Inside each checks-deferrable call function, an onBehalfOfAccount must be specified. The function will determine whether or not msg.sender is authorized to perform operations on this account:
- If
msg.senderhas never before interacted with the EVC, if it shares the first 19 bytes with theonBehalfOfAccount, thenonBehalfOfAccountis considered to be a sub-account ofmsg.senderand thereforemsg.senderis authorized. Upon that first interaction with the EVC,msg.senderaddress is stored in EVC's storage as an owner of the group of 256 accounts having the same first 19 bytes - If
msg.senderhas interacted with the EVC before and it shares the first 19 bytes with theonBehalfOfAccount, its address is supposed to match the one stored in the EVC's storage. If it does, then it is authorized - If
msg.senderhas previously been authorized as an operator for theonBehalfOfAccount, it is authorized - If the
msg.senderis the EVC itself, then this must be from thepermitfunction and the effective sender is taken from the execution context - In all other cases, the caller is invalid, and the entire transaction will fail