Assessment reports>Y2K Finance>Threat Model>_bridgeWithHyphen

Function: _bridgeWithHyphen(address _receiver, address _token, uint256 _amount, uint16 _srcChainId)

This bridges with Hyphen.

Inputs

  • _receiver

    • Constraints: No constraints.

    • Impact: The address to receive the bridged tokens.

  • _token

    • Constraints: No constraints.

    • Impact: The address of the token to bridge.

  • _amount

    • Constraints: No constraints.

    • Impact: The amount of the token to bridge.

  • _srcChainId

    • Constraints: No constraints.

    • Impact: The ID of the chain the token is being bridged from.

Branches and code coverage (including function calls)

Intended branches

  • The function approves the hyphenBridge contract to spend _amount of _token.

  • The function call hyphenBridge.depositErc20(...) succeeds without reverting.

Negative behavior

  • The function reverts if the approval for hyphenBridge fails.

Function call analysis

  • ERC20(_token).safeApprove(address(hyphenBridge), _amount)

    • What is controllable? _token and _amount.

    • If return value controllable, how is it used and how can it go wrong? N/A.

    • What happens if it reverts, reenters, or does other unusual control flow? If this reverts, the entire call fails --- no reentrancy issues.

  • hyphenBridge.depositErc20(_srcChainId, _token, _receiver, _amount, "Y2K")

    • What is controllable? _srcChainId, _token, _receiver, and _amount.

    • If return value controllable, how is it used and how can it go wrong? N/A.

    • What happens if it reverts, reenters, or does other unusual control flow? If this reverts, the entire call fails --- no reentrancy issues.

Zellic © 2024Back to top ↑