oasisprotocol / sapphire-paratime

The Sapphire ParaTime monorepo.
https://oasisprotocol.org/sapphire
Apache License 2.0
34 stars 24 forks source link

Wrong gas estimates for sending ether during contract create #319

Open matevz opened 2 months ago

matevz commented 2 months ago
SUMMARY

Passing some ethers along the contract create transaction (e.g. https://github.com/oasisprotocol/demo-quiz/blob/3c6c15038f75fc96bf706a7a0d5ecdbca3b6f46d/backend/test/Quiz.ts#L9-L11) fails with out of gas error on sapphire networks:

Hardcoding the gas limit to 10M worked:

Also, not sending any ethers along estimates fine:

Works fine on emerald and hardhat node.

ISSUE TYPE
STEPS TO REPRODUCE

Run sapphire-localnet:

docker run -it -p8545:8545 -p8546:8546 ghcr.io/oasisprotocol/sapphire-localnet -test-mnemonic

Check out https://github.com/oasisprotocol/demo-quiz/ and do

cd backend
pnpm test -- --network sapphire-localnet
ACTUAL RESULTS

Contract deployment fails.

EXPECTED RESULTS

Contract should be deployed and funded.