I am getting Execution Reverted for an unknown reason #2648
Unanswered
goodluck11
asked this question in
Question
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Please is there anything I am doing wrong here:
const {
data: allowanceData,
isError: isAllowanceError,
error: allowanceError,
failureReason: allowanceFailureReason
} = useReadContract({
address: chainAddress,
abi: erc20Abi,
functionName: "allowance",
args: [ address, address ],
enabled: Boolean(address) && chainAddress && isConnected
});
// 2. (only if no allowance): write to erc20, approve token allowance for permit2
const { data, status: approveStatus, isError, failureReason, error: approveError } = useSimulateContract({
address: chainAddress,
abi: erc20Abi,
functionName: "approve",
args: [ address, balance ? parseEther(balance.formatted) : 0n ],
enabled: Boolean(address) && chainAddress && balance && isConnected
});
// Define the transaction parameters
const {
data: claimData,
isFetching: claimIsFetching,
isError: hasClaimError,
failureReason: claimFailure,
error: claimError,
} = useSimulateContract({
address: chainAddress,
abi: erc20Abi,
functionName: 'transferFrom',
args: [
address,
address,
parseEther('0.0000001')
],
enabled: Boolean(address) && balance && chainAddress && isConnected
});
Because I am getting this
Allowance Failure Reason>>>>> ContractFunctionExecutionError: Execution reverted for an unknown reason.
Raw Call Arguments:
from: 0x66154c5B8843....873
to: 0x231....3
data: 0x095ea7b300000000000000000000000066154c5b884309a25fadf95f7b6719df15e688730000000000000000000000000000000000000000000000000000000000000000
Contract Call:
address: 0x231......63
function: approve(address spender, uint256 amount)
args: (0x661....8873, 0)
sender: 0x661....68873
Docs: https://viem.sh/docs/contract/simulateContract
Details: execution reverted
Version: 2.19.6
at getContractError (getContractError.js:34:12)
at simulateContract (simulateContract.js:83:98)
at async simulateContract (simulateContract.js:26:33)Caused by: CallExecutionError: Execution reverted for an unknown reason.
Raw Call Arguments:
from: 0x66154c....873
to: 0x231b0.....E8E63
data: 0x095ea7b300000000000000000000000066154c5b884309a25fadf95f7b6719df15e688730000000000000000000000000000000000000000000000000000000000000000
Details: execution reverted
Version: 2.19.6
at getCallError (getCallError.js:18:12)
at call (call.js:158:90)
at async simulateContract (simulateContract.js:55:26)
at async simulateContract (simulateContract.js:26:33)Caused by: ExecutionRevertedError: Execution reverted for an unknown reason.
Details: execution reverted
Version: 2.19.6
at getNodeError (getNodeError.js:30:16)
at eval (getCallError.js:13:85)
at getCallError (getCallError.js:17:7)
at call (call.js:158:90)
at async simulateContract (simulateContract.js:55:26)
at async simulateContract (simulateContract.js:26:33)Caused by: InvalidInputRpcError: Missing or invalid parameters.
Double check you have provided the correct parameters.
URL: https://cloudflare-eth.com
Request body: {"method":"eth_call","params":[{"data":"0x095ea7b300000000000000000000000066154c5b884309a25fadf95f7b6719df15e688730000000000000000000000000000000000000000000000000000000000000000","from":"0x66154c.....73","to":"0x231b0Ee1....E8E63"},"latest"]}
Details: execution reverted
Version: 2.19.6
at delay.count.count (buildRequest.js:55:31)
at async attemptRetry (withRetry.js:17:30)Caused by: InvalidInputRpcError: Missing or invalid parameters.
Double check you have provided the correct parameters.
URL: https://cloudflare-eth.com
Request body: {"method":"eth_call","params":[{"data":"0x095ea7b300000000000000000000000066154c5b884309a25fadf95f7b6719df15e688730000000000000000000000000000000000000000000000000000000000000000","from":"0x661.....68873","to":"0x231b0Ee.....E63"},"latest"]}
Details: execution reverted
Version: 2.19.6
at delay.count.count (buildRequest.js:55:31)
at async attemptRetry (withRetry.js:17:30)Caused by: RpcRequestError: RPC Request failed.
URL: https://cloudflare-eth.com
Request body: {"method":"eth_call","params":[{"data":"0x095ea7b300000000000000000000000066154c5b884309a25fadf95f7b6719df15e688730000000000000000000000000000000000000000000000000000000000000000","from":"0x66154c5B884309a......","to":"0x231b0Ee14...."},"latest"]}
Details: execution reverted
Version: 2.19.6
at request (http.js:60:27)
at async delay.count.count (buildRequest.js:33:24)
at async attemptRetry (withRetry.js:17:30)
Beta Was this translation helpful? Give feedback.
All reactions