-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Weird type mismatch is not of kind
error.
#1105
Comments
Hello there, facing the exact same issue, have you been able to solve it ? Thanks |
Nope, I ended up not using it :/ |
Ok same here, recoded the entire smart contrat function in the mapping. Would be cool to have any update on it |
Hello, sorry we didn't look into this earlier, I'll see if I can take a look over the weekend. I agree that it seems a conversion error, but I think it is on |
Hello! Sorry for the long time to respond 😅 Well, I've investigated through the code and here is the "stack trace" of it:
It happens because of a We actually use a fork of this crate, there are two possible scenarios:
Either way we shall patch it. I've yet to reproduce the bug locally on my machine, I don't think it will be hard though, I'll document it here. More updates coming in the following days 🙂 Edit: I've used both Sample code: use ethabi::{Token, Address, ParamType};
use std::str::FromStr;
// Array([
// Address(0x7be8076f4ea4a4ad08075c2508e481d6c946d12b),
// Address(0xb13c38273e001f0427c26f15b79b57db90606a91),
// Address(0x0000000000000000000000000000000000000000),
// Address(0x0000000000000000000000000000000000000000),
// Address(0x79986af15539de2db9a5086382daeda917a9cf0c),
// Address(0x0000000000000000000000000000000000000000),
// Address(0x0000000000000000000000000000000000000000)
// ])
fn main() {
let a0 = Token::Address(Address::from_str("7be8076f4ea4a4ad08075c2508e481d6c946d12b").unwrap());
let a1 = Token::Address(Address::from_str("b13c38273e001f0427c26f15b79b57db90606a91").unwrap());
let a2 = Token::Address(Address::from_str("0000000000000000000000000000000000000000").unwrap());
let a3 = Token::Address(Address::from_str("0000000000000000000000000000000000000000").unwrap());
let a4 = Token::Address(Address::from_str("79986af15539de2db9a5086382daeda917a9cf0c").unwrap());
let a5 = Token::Address(Address::from_str("0000000000000000000000000000000000000000").unwrap());
let a6 = Token::Address(Address::from_str("0000000000000000000000000000000000000000").unwrap());
let token = Token::Array(vec![a0, a1, a2, a3, a4, a5, a6]);
assert!(token.type_check(&ParamType::Array(Box::new(ParamType::Address))));
} And [package]
name = "ethabi-bug"
version = "0.1.0"
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
# works for both versions below:
ethabi = "15.0.0"
# ethabi = { git = "https://github.com/graphprotocol/ethabi" } |
@Benjythebee @xenoliss I think I've found the issue, we have a printing bug in |
Closing per graphprotocol/graph-node#3034, please re-open if still an issue |
I've been making a subgraph based on Opensea's exchange contract and I'm struggling quite a bit due to some pretty weird error causing the subgraph to crash. I'm posting this here as I'm now clueless and I suspect there might be a misinterpretation in types from ts -> wasm -> eth or ABI -> ts -> wasm (Just a bit suspicious).
If we can't figure out the issue I'm hoping this issue may at least lead to some better feedback when an error like that is ever encountered again.
The error
As you can see, the error message is not really informative. At least it doesn't tell us what the expected type is.
The
hashOrder_
function in solidity:graph init
interpretshashOrder_
call asHere is my
mapping.ts
for the ones curious:The opensea contract code:
https://etherscan.io/address/0x7be8076f4ea4a4ad08075c2508e481d6c946d12b#code
The Wyvern Exchange contract documentation:
https://docs.projectwyvern.com/docs/Exchange/
Typical Opensea transaction:
https://etherscan.io/tx/0xc4364dcfb016e277290036cd10f6c84a86f3758e2dea6bb6ce978d065dfb46cd
Am I missing something?
Dependencies:
"@graphprotocol/graph-cli": "^0.22.1",
"@graphprotocol/graph-ts": "^0.22.1"
Graph node: v0.24.1+17
The text was updated successfully, but these errors were encountered: