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
destinationContractControl: Full.
Constraints: Must match the token address specified in
_sessionKeyData.Impact: The address of the contract to be called.
callValueControl: Full.
Constraints: Must be zero in value, as nonzero values will result in a revert.
Impact: The value to be sent with the call.
_funcCallDataControl: Full.
Constraints: Must adhere to the ERC-20 standard.
Impact: The data for the call. It is parsed inside the SVM.
_sessionKeyDataControl: Full.
Constraints: Must contain valid session key data that represents session key permissions.
Impact: SessionKey data that describes sessionKey permissions.
NoneControl: 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_funcCallDatathat matches_sessionKeyData.
Negative behavior
Function reverts with
ERC20SV Invalid TokenwhendestinationContractdoes not match the token address in_sessionKeyData.Function reverts with
ERC20SV Non Zero Valuewhen a nonzerocallValueis provided.Function reverts with
ERC20SV Wrong Recipientwhen the recipient in_funcCallDatadoes not match the intended recipient from_sessionKeyData.Function reverts with
ERC20SV Max Amount Exceededwhen the amount specified in_funcCallDataexceeds themaxAmountdescribed in_sessionKeyData.