1

I firstly apologise if I am asking something stupid. I am a newbie to smart contract development (and this is my first time to ask a question).

I would like to get more familiar with gas fee consumption. So I wrote a short transaction contract like this:

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;


contract ethDeposit {
    
    struct information {
        string[] dataList;
        uint totalValue;
    }
    mapping (address => information) transactionInfo;
    mapping (address => uint64) transactionCount;


    event transactionLog(address sendAddress, address receiveAddress, string transactionData, uint transactionValue);

    function logStorage (address payable receiver, string memory data) payable external {
        receiver.transfer(msg.value);
        emit transactionLog(msg.sender, receiver, data, msg.value);
    }


}

I am using Remix IDE currently. I could deploy it on JavaVM and the Ropsten test network. However, when I try to deploy the contract on Optimistic Ethereum, I got the following error and stating Gas Estimation Failed:

Internal JSON-RPC error. { "code": -32000, "message": "gas required exceeds allowance (125000000)" }

I did enable the Optimistic Ethereum plugin for Remix IDE. Majority of the related issue on Google are due to coding issue, but I doubt if this is the issue here as I could deploy the contract smoothly on other networks.

If I force the transaction to continue, it then returns the following error:

creation of ethDeposit errored: Error: [ethjs-query] while formatting outputs from RPC '{"value":{"code":-32603,"data":{"code":-32000,"message":"L2 gas limit too low: 0, use at least 100000"}}}'

I did set the gas limit to 3000000 in Remix IDE. Did I do the whole deployment process wrongly for Optimistic Ethereum? Or is there some other way I should declared Layer 2 gas limit?

I followed this tutorial for Remix Optimistic Ethereum plugin, but I still get the same errors if I use the sample code mentioned in the tutorial. (https://remix-optimism-compiler-plugin.readthedocs.io/en/latest/)

Am I missing something or doing something wrong? Is there anyone encountered this issue before? Any hint and help would be appreciated. Thanks a lot.

1

Deploying contracts on Optimistic Ethereum is still in the whitelist stage, not for the public.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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