skalenetwork / skaled

Running more than 20 production blockchains, SKALED is Ethereum-compatible, high performance C++ Proof-of-Stake client, tools and libraries. Uses SKALE consensus as a blockchain consensus core. Includes dynamic Oracle. Implements file storage and retrieval as an EVM extension.
https://skale.network
GNU General Public License v3.0
84 stars 39 forks source link

Unable to query string on Testnet #2001

Closed quanttb closed 1 week ago

quanttb commented 3 weeks ago

Describe the bug I am unable to query string on Skale testnets (Titan AI and Europa DeFi). When I use Web3.js, it returns the error: "Returned values aren't valid, did it run Out of Gas?". This works fine on other chains like BSC, etc.

To Reproduce Steps to reproduce the behavior:

  1. Go to one of below explorers:
  2. Input "1"
  3. Click "Read"
  4. See error

Expected behavior It returns "Hello World". Or you can try test1(1) and test2(1), it works. You can do the same on BSC Testnet to compare: https://testnet.bscscan.com/address/0x3b622b5EA13F70DF0B46D7F0105DAa9dA7B09Ea0#readContract#F5

Contract:

// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;

contract MemoContract {
    struct Memo {
        address sender;
        uint256 timestamp;
        string message;
    }

    mapping(uint256 => Memo) public memos;
    mapping(uint256 => address) public test1;
    mapping(uint256 => uint256) public test2;
    mapping(uint256 => string) public test3;

    uint256 public memoCounter;

    constructor() {
        memoCounter = 0;
    }

    function sendMemo(string memory _message) public {
        memoCounter++;

        memos[memoCounter] = Memo(msg.sender, block.timestamp, _message);

        test1[memoCounter] = msg.sender;
        test2[memoCounter] = block.timestamp;
        test3[memoCounter] = _message;
    }
}

Compiler: v0.8.25 with 200 runs optimization

DmytroNazarenko commented 1 week ago

Hey @quanttb ! I was able to deploy and verify contract and test3() is returning data: https://juicy-low-small-testnet.explorer.testnet.skalenodes.com/address/0xd54C2483048c39838f2Bb3b1d31fced893fb93fD?tab=read_contract

The only difference is in the version of EVM - I have set the Istanbul one. When compiling with the Default parameter, the compiler typically selects the latest version of the EVM. However, the Cancun fork is currently not supported by SKALE chains. We are planning to add it in one of the future releases: https://github.com/skalenetwork/skaled/issues/1912

quanttb commented 1 week ago

It works on 0.8.24, thanks for your support!