tomusdrw / rust-web3

Ethereum JSON-RPC multi-transport client. Rust implementation of web3 library. ENS address: rust-web3.eth
MIT License
1.45k stars 465 forks source link

Cannot send EIP-1559 Contract Interactions #593

Closed the-Jamz closed 2 years ago

the-Jamz commented 2 years ago

Problem

When setting transaction type to 2, which should according to PR #533 use EIP-1559, I'm still sending a legacy contract interaction. I was however able to send EIP-1559 transactions just fine.

Perhaps a misunderstanding

Is this the fault of the contract? I'm new to this in general, so maybe I misunderstand, but I would expect that the client is responsible for sending the contract interaction and therefore it shouldn't be my test smart contract causing the issue? If I'm mistaken, I hope someone else can at least learn from this issue at some point.

Possible duplicates

I did find issue #542 but the solution is not clear.

Setup

I'm using revision e81265bb4a3f40a5ac2d60bd2f57f0fce0b5af76 because PR #591 seems to have created a conflict with tokio. cargo update to the rescue

To be precise: web3 = { git = "https://github.com/tomusdrw/rust-web3", features = ["default"] }

I have tried playing around with feature flags, maybe I missed something, but couldn't get it to work.

I'm testing using an NFT project on the rinkeby testnet created with this guide. You can view mine here.

Code

    let options = web3::contract::Options {
        transaction_type: Some(2.into()),
        ..Default::default()
    };

    let tx = contract
        .signed_call_with_confirmations(
            "mintNFT",
            (our_address, "".to_string()),
            options,
            1,
            &prvk
        )
        .await
        .unwrap();
717a56e1 commented 2 years ago

600 should fix this.

the-Jamz commented 2 years ago

PR #600 was merged resolving the issue.