Assessment reports>Lido Gateway>Threat Model>permit

Function: permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s)

Permits spender to spend value tokens on behalf of owner with a valid signature.

Inputs

  • owner

    • Control: Fully controlled by the caller.

    • Constraints: Ensured that the owner is the recovered address from the computed signature (in isValidSignatureNow).

    • Impact: The owner of the tokens to be approved.

  • spender

    • Control: Fully controlled by the caller.

    • Constraints: Ensured that spender is included in the computed signature (in isValidSignatureNow).

    • Impact: The spender of the tokens to be approved.

  • value

    • Control: Fully controlled by the caller.

    • Constraints: Ensured that value is the approved amount of tokens (in isValidSignatureNow).

    • Impact: The amount of tokens to be approved.

  • deadline

    • Control: Fully controlled by the caller.

    • Constraints: Ensured that the deadline is respected.

    • Impact: The deadline of the signature.

  • v

    • Control: Fully controlled by the caller.

    • Constraints: Ensured that v is valid in the computed signature (in isValidSignatureNow).

    • Impact: Component of the ECDSA signature.

  • r

    • Control: Fully controlled by the caller.

    • Constraints: Ensured that r is valid in the computed signature (in isValidSignatureNow).

    • Impact: Component of the ECDSA signature.

  • s

    • Control: Fully controlled by the caller.

    • Constraints: Ensured that s is valid in the computed signature (in isValidSignatureNow).

    • Impact: Component of the ECDSA signature.

Branches and code coverage (including function calls)

Intended branches

  • Ensure that the signature is valid.

  • Use a nonce for replay protection.

  • Approve the desired amount of tokens.

Negative behavior

  • Should not allow using signatures that have been revoked (due to ERC-1271). That is enforced in isValidSignatureNow.

  • Should not allow the usage of expired signatures.

Zellic © 2024Back to top ↑