Function: validateSessionParams(address destinationContract, uint256 callValue, byte[] _funcCallData, byte[] _sessionKeyData, byte[] None)
This validates that the call (destinationContract
, callValue
, and funcCallData
) complies with the Session Key permissions represented by sessionKeyData
.
Inputs
destinationContract
Control: Full.
Constraints: Must match the token address specified in
_sessionKeyData
.Impact: The address of the contract to be called.
callValue
Control: Full.
Constraints: Must be zero in value, as nonzero values will result in a revert.
Impact: The value to be sent with the call.
_funcCallData
Control: Full.
Constraints: Must adhere to the ERC-20 standard.
Impact: The data for the call. It is parsed inside the SVM.
_sessionKeyData
Control: Full.
Constraints: Must contain valid session key data that represents session key permissions.
Impact: SessionKey data that describes sessionKey permissions.
None
Control: Full.
Constraints: N/A.
Impact: N/A.
Branches and code coverage (including function calls)
Intended branches
Function returns the session key for a valid
destinationContract
,callValue
, and_funcCallData
that matches_sessionKeyData
.
Negative behavior
Function reverts with
ERC20SV Invalid Token
whendestinationContract
does not match the token address in_sessionKeyData
.Function reverts with
ERC20SV Non Zero Value
when a nonzerocallValue
is provided.Function reverts with
ERC20SV Wrong Recipient
when the recipient in_funcCallData
does not match the intended recipient from_sessionKeyData
.Function reverts with
ERC20SV Max Amount Exceeded
when the amount specified in_funcCallData
exceeds themaxAmount
described in_sessionKeyData
.