Help me with this error #3168
Unanswered
Aashim-Limbu
asked this question in
Q&A
Replies: 3 comments 9 replies
-
Honestly, It is tough to say what could be wrong, considering the issue is not persistent. It could be an issue on etherscan, considering it didn't occur when you were testing stuff locally. |
Beta Was this translation helpful? Give feedback.
0 replies
-
@Aashim-Limbu did you try to check for out of bounds in your getMyFile? function getMyFile(uint256 fileCounter)
external
view
returns (string memory fHash, uint256 fee)
{
// Boundary check
if (fileCounter >= s_addressToFiles[msg.sender].length) {
revert("File index out of bounds");
}
File memory file = s_addressToFiles[msg.sender][fileCounter];
return (file.fileHash, file.fee);
} You can use forge to test it forking a chain. |
Beta Was this translation helpful? Give feedback.
3 replies
-
Hey @Aashim-Limbu, Are you sure you are calling the |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Discussion: Identifying the Cause of Unexpected Revert in Next.js Integration with Etherscan
Context:
I am integrating my project with Next.js and encountered an unexpected revert while interacting with Etherscan. The issue arises during a read operation in my Solidity smart contract. Given that this is a read operation, I assume it is not related to gas limits.
Here’s the relevant part of my Solidity code:
Issue:
-
getFileFee()
orgetMyFile()
for specific file indices or owners, the call sometimes reverts on Etherscan with an error message indicating a problem.Observations:
_fileId >= s_addressToFiles[_owner].length
) is explicitly defined, but I’ve double-checked the file IDs and owner addresses in my test cases.Questions:
You can copy and paste this into any markdown-compatible platform.
Beta Was this translation helpful? Give feedback.
All reactions