3lLobo / 3lLobo/zkAuth

`executeTxn` may fail

Abierto
#49 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
TypeScript
Estrellas
46
Forks
6
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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.

```solidity
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}("");
```

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.