Skip to content

executeTxn may fail #49

Description

@JuanXavier

You're passing the value in the call taken from the input parameter, as a uint256 instead of the msg.value and making the function payable.

This will revert if you pass a parameter greater than zero, as the transaction itself will have a msg.value of 0.

  function executeTxn(
    uint256[2] memory a,
    uint256[2][2] memory b,
    uint256[2] memory c,
    uint256[2] memory input,
    address callee,
    uint256 value
  ) external isOwner returns (bytes memory result) {
    require(verifyOTP(a, b, c, input), "Proof failed");
    (bool success, bytes memory result) = callee.call{value: value}("");
    require(success, "external call reverted");
    // emit TransactionExecuted(callee, value, data);
    return result;
  }

You could delete the value input, make the function payable and change

(bool success, bytes memory result) = callee.call{value: value}("");

to

(bool success, bytes memory result) = callee.call{value: msg.value}("");

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions