paritytech / contract-issues

The place to report bugs and issues regarding contract on AssetHub.
0 stars 0 forks source link

Sending value when deploying will generate two transactions #2

Open athei opened 1 week ago

athei commented 1 week ago

I tried to deploy the example storage.sol contract from REMIX. It works when I leave everything as is.

However, when I set 1 Ether (which should map to one WND) it will submit two transaction on-chain.

They are exactly the same except for the value. The first will have no value set and succeeds. The second has a value set and will fail with the error: Contract reverted.

This makes sense because the contructor is not marked payable in this contract.

Which doesn't make sense is to submit two extrinsics.

Example of the two extrinsics: https://assethub-westend.subscan.io/extrinsic/9626508-2 https://assethub-westend.subscan.io/extrinsic/9626514-2

pgherveou commented 1 week ago

We do test it here. Although this might be related to the fact that some transaction are marked as invalid because of the gas fee check.

This looks more like a Remix bug to me, but could be wrong

https://github.com/paritytech/polkadot-sdk/blob/b8fca6a99d345f47672188e4719654295f45c690/substrate/frame/revive/rpc/src/tests.rs?plain=1#L100-L119

athei commented 1 week ago

Agreed. It seems unlikely to be a problem in the proxy. I am testing this again. I can't reproduce the two transaction as of right now. I got the "internal RPC error" this time. Maybe I am hitting the fee bug. Let's wait until this is resolved and I will try again to reproduce.