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 when destinationContract does not match the token address in _sessionKeyData.

  • Function reverts with ERC20SV Non Zero Value when a nonzero callValue 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 the maxAmount described in _sessionKeyData.

Zellic © 2024Back to top ↑