-
Notifications
You must be signed in to change notification settings - Fork 249
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
[Bug] wasm erc20 token transfer not working #1095
Comments
Can you try enabling "transports" feature too? |
sure than i got this at exactly the same line within the code
|
I'm having the same problem.. Did someone find a fix for this? I think it is caused by Alloy using std::time instead of something like https://github.com/daxpedda/web-time . std::time is not WASM compatible. |
I ran into the same trouble with I have made a fork with patches that seem to work for me: https://github.com/b-zee/alloy/tree/fix-wasm-instant See the patch here (it's unfortunately based on the Essentially it's a patch changing to depend on
@DaniPopes, do you think the above is suitable for a PR? We'd love to publish a package soon and it would be awesome if the patch can be included in a future release of |
Sure, feel free! |
Great, I've put in a PR: #1426 |
Component
contract, transports
What version of Alloy are you on?
├── alloy v0.2.0 │ ├── alloy-contract v0.2.0 │ │ ├── alloy-dyn-abi v0.7.7 │ │ │ ├── alloy-json-abi v0.7.7 │ │ │ │ ├── alloy-primitives v0.7.7 │ │ │ │ │ ├── alloy-rlp v0.3.7 │ │ │ │ │ │ ├── alloy-rlp-derive v0.3.7 (proc-macro) │ │ │ │ │ │ ├── alloy-rlp v0.3.7 () │ │ │ │ ├── alloy-sol-type-parser v0.7.7 │ │ │ ├── alloy-primitives v0.7.7 () │ │ │ ├── alloy-sol-type-parser v0.7.7 () │ │ │ ├── alloy-sol-types v0.7.7 │ │ │ │ ├── alloy-json-abi v0.7.7 () │ │ │ │ ├── alloy-primitives v0.7.7 () │ │ │ │ ├── alloy-sol-macro v0.7.7 (proc-macro) │ │ │ │ │ ├── alloy-sol-macro-expander v0.7.7 │ │ │ │ │ │ ├── alloy-json-abi v0.7.7 │ │ │ │ │ │ │ ├── alloy-primitives v0.7.7 │ │ │ │ │ │ │ ├── alloy-sol-type-parser v0.7.7 │ │ │ │ │ │ ├── alloy-sol-macro-input v0.7.7 │ │ │ │ │ │ │ ├── alloy-json-abi v0.7.7 () │ │ │ │ │ ├── alloy-sol-macro-input v0.7.7 () │ │ ├── alloy-json-abi v0.7.7 () │ │ ├── alloy-network v0.2.0 │ │ │ ├── alloy-consensus v0.2.0 │ │ │ │ ├── alloy-eips v0.2.0 │ │ │ │ │ ├── alloy-primitives v0.7.7 () │ │ │ │ │ ├── alloy-rlp v0.3.7 () │ │ │ │ │ ├── alloy-serde v0.2.0 │ │ │ │ │ │ ├── alloy-primitives v0.7.7 () │ │ │ │ ├── alloy-primitives v0.7.7 () │ │ │ │ ├── alloy-rlp v0.3.7 () │ │ │ │ ├── alloy-serde v0.2.0 () │ │ │ ├── alloy-eips v0.2.0 () │ │ │ ├── alloy-json-rpc v0.2.0 │ │ │ │ ├── alloy-primitives v0.7.7 () │ │ │ ├── alloy-primitives v0.7.7 () │ │ │ ├── alloy-rpc-types-eth v0.2.0 │ │ │ │ ├── alloy-consensus v0.2.0 () │ │ │ │ ├── alloy-eips v0.2.0 () │ │ │ │ ├── alloy-primitives v0.7.7 () │ │ │ │ ├── alloy-rlp v0.3.7 () │ │ │ │ ├── alloy-serde v0.2.0 () │ │ │ │ ├── alloy-sol-types v0.7.7 () │ │ │ ├── alloy-serde v0.2.0 () │ │ │ ├── alloy-signer v0.2.0 │ │ │ │ ├── alloy-primitives v0.7.7 () │ │ │ ├── alloy-sol-types v0.7.7 () │ │ ├── alloy-primitives v0.7.7 () │ │ ├── alloy-provider v0.2.0 │ │ │ ├── alloy-chains v0.1.23 │ │ │ ├── alloy-consensus v0.2.0 () │ │ │ ├── alloy-eips v0.2.0 () │ │ │ ├── alloy-json-rpc v0.2.0 () │ │ │ ├── alloy-network v0.2.0 () │ │ │ ├── alloy-primitives v0.7.7 () │ │ │ ├── alloy-rpc-client v0.2.0 │ │ │ │ ├── alloy-json-rpc v0.2.0 () │ │ │ │ ├── alloy-transport v0.2.0 │ │ │ │ │ ├── alloy-json-rpc v0.2.0 () │ │ │ │ ├── alloy-transport-http v0.2.0 │ │ │ │ │ ├── alloy-json-rpc v0.2.0 () │ │ │ │ │ ├── alloy-transport v0.2.0 () │ │ │ ├── alloy-rpc-types-eth v0.2.0 () │ │ │ ├── alloy-transport v0.2.0 () │ │ │ ├── alloy-transport-http v0.2.0 () │ │ ├── alloy-rpc-types-eth v0.2.0 () │ │ ├── alloy-sol-types v0.7.7 () │ │ ├── alloy-transport v0.2.0 () │ ├── alloy-core v0.7.7 │ │ ├── alloy-dyn-abi v0.7.7 () │ │ ├── alloy-json-abi v0.7.7 () │ │ ├── alloy-primitives v0.7.7 () │ │ └── alloy-sol-types v0.7.7 () │ ├── alloy-eips v0.2.0 () │ ├── alloy-provider v0.2.0 () │ └── alloy-rpc-client v0.2.0 (*)
Operating System
Linux
Describe the bug
I try todo an erc20 token transfer with target wasm32-unknown-unknown.
contract total supply as well as contract balance of works perfect.
but as soon as i call
contract.transfer("to_adress", "token_amount).from("my_address").send().await
i got the following error message in the browser console:
I have already added wasm bindgen to the future list in my Cargo.toml, but this changed nothing:
alloy = { version = "0.2", features = ["providers", "sol-types", "json", "contract", "wasm-bindgen"] }
The text was updated successfully, but these errors were encountered: