You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently experiencing a similar problem to issue #521
This is the complete error I get:
Error: invalid data for function output (arg="data", errorArg="type", errorValue="Bit", value="0x0000000000000000000000000000000000000000000000000000000000000001", reason="invalid type", version=4.0.45)
This is the contract I am using(tested on remix with 0.5.1 compiler):
[pragma solidity >=0.5.0 <0.6.0;
contract structEnumPOC {
string word;
enum Bit {
OFF,
ON
}
Bit a;
struct S {
Bit b;
}
mapping (uint256 => S) public route;
function clampy() public view returns(Bit){
return a;
}
/// two different ways to test the same thing
function clampoo(uint256 name) public view returns(Bit){
return route[name].b;
}
function clamclam(uint256 name) public view returns(Bit){
S memory s = route[name];
return s.b;
}
////
function setClampName (uint256 name)public{
route[name]=S(Bit.ON);
}
//side testing to verify if issue happens with a plain string
function setString(string memory random)public{
word = random;
}
function getString() public view returns (string memory){
return word;
}
}
]
This is the function I am using:
async function check() {
// let a = ethers.utils.bigNumberify(document.getElementById("circuit").value);
let a = document.getElementById("foo").value;
let o = await contract.clamclam(a);
console.log(o);
let receipt = await o.wait(1);
console.log('receipt');
let event = receipt.events.pop();
console.log(event);
}
The other side issue/question I have is how to define the abi for signatures that include the keyword memory? If I include the word memory it gives an error message otherwise if I remove it,when I transact I get: Error: VM Exception while processing transaction: revert etherjs xxxxx
which I think is Truffles fault.
Are you only intermittently getting this error and only under load? Is that why you think it related to the other issue?
If you use v5, it won't mind the "memory" keyword. But you can safely remove the memory keyword from the ABI passed into ethers. If it is reverting, it is unrelated.
Can you include the code you are using th instantiation the contract? Also, can you make sure the code is deployed before you call the clam clam function, using await provider.getCode(contract.address)? If you are using Truffle, often removing the build files and re-building can help, since it isn't reliable at times when it comes to updating artifact files.
This is during testing and reproducible. Error is the same as the prior issue, that is the only simility I based that comment about, and may not be related at all.
Moving to v5.
Hello Richard Sir,
I am currently experiencing a similar problem to issue #521
This is the complete error I get:
Error: invalid data for function output (arg="data", errorArg="type", errorValue="Bit", value="0x0000000000000000000000000000000000000000000000000000000000000001", reason="invalid type", version=4.0.45)
This is the contract I am using(tested on remix with 0.5.1 compiler):
This is the function I am using:
async function check() {
The other side issue/question I have is how to define the abi for signatures that include the keyword memory? If I include the word memory it gives an error message otherwise if I remove it,when I transact I get: Error: VM Exception while processing transaction: revert etherjs xxxxx
which I think is Truffles fault.
I checked the guide: https://docs.ethers.io/ethers.js/html/api-contract.html#connecting-to-a-contract but do not see particular examples concerning this.
Please let me know if you can provide further suggestions on what am I doing wrong or how to proceed.
Best Regards
The text was updated successfully, but these errors were encountered: