0

To encode and decode data the way we do in solidity I am using ethabi. It is working fine in compilation and testing but when I am running the command cargo contract build, it is giving me a build error.

Let me know if someone can help me on this issue or has any other way.

1
  • Could you please provide more details regarding the problem? Some code snippet, build error logs, crate versions... Oct 5, 2022 at 9:43

1 Answer 1

2

Add the following changes in your contact Cargo.toml

[dependencies]
ink = { version ="4.0.0-alpha.3", default-features = false }
ethabi = { path = "../ethabi", default-features = false } 
hex = { version = "0.4.3", default-features = false } 
scale = { package = "parity-scale-codec", version = "3.2.1", default-features = false, features = ["derive"] }
scale-info = { version = "2", default-features = false, features = ["derive"], optional = true }


[profile.release] 
overflow-checks = false

Earlier it was as following

[dependencies]
ink = { version ="4.0.0-alpha.3", default-features = false }
ethabi = { path = "../ethabi" }
hex = { version = "0.4.3" }

scale = { package = "parity-scale-codec", version = "3.2.1", default-features = false, features = ["derive"] }
scale-info = { version = "2", default-features = false, features = ["derive"], optional = true }
2
  • You said the following changes but never posted the original Cargo.toml. Changes from what? Oct 9, 2022 at 20:11
  • 1
    Sounds like the answer is "remember to add default-features = false when importing ethabi and hex". Oct 10, 2022 at 10:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.