etherwallet icon indicating copy to clipboard operation
etherwallet copied to clipboard

etherwallet-3.5.0: read contract returns blank text-box.

Open avatar-lavventura opened this issue 7 years ago • 14 comments

I am using myetherwallet on my private Ethereum network. Under Contracts=>"Read/Write Contract", I was able to access methods of my contract(entering its address and abi) successfully and I was able to write into my contract successfully. I do check through geth, that string "hello" is written into my contract.

screen shot 2017-03-01 at 22 00 21

But I was not able to read my contract's method(ex: mycontract.getSize()) which returns nothing. Please note that when I can read my contract inside geth which returns a valid information.

Example code:

  function getSize() constant returns ( uint ) {
    return 100;
  }

As you can see my contract's constant method returned value show as a blank text box.

screen shot 2017-03-01 at 21 57 32 screen shot 2017-03-01 at 22 13 42

[Q] Is there anything I could do to fix this issue that my method's return value would show up?

Thank you for your valuable time and help. By the way, this upgrade is great.

avatar-lavventura avatar Mar 01 '17 19:03 avatar-lavventura

Is there any way you can provide me with Address / ABI so I can look into this further. You mentioned its on a private net but is there anything on the main net or (currently broken Ropsten) thats creating this same issue?

tayvano avatar Mar 01 '17 19:03 tayvano

Sure:

Address= "0x027d798dadb260836c18f955fe3cc13723285920"
abi=[{"constant":true,"inputs":[],"name":"get","outputs":[{"name":"num","type":"uint32"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"number","outputs":[{"name":"num","type":"int8"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"val","type":"int8"}],"name":"set","outputs":[],"payable":false,"type":"function"},{"inputs":[],"payable":false,"type":"constructor"}]

My Contract: (Here is a simple contract that I have tried.) get() does not return 100 via myetherwallet, but it returns 100 when I access it through geth. Please note that write(contract.set()) works through myetherwallet. screen shot 2017-03-01 at 23 31 22

pragma solidity ^0.4.6;
contract C {
    int8 i;
    function C() {
      i = -1;
    }
    function number() constant returns (int8 num) {
      return i;
    }
    function set(int8 val) {
      i = val;
    }
    function get() constant returns (uint32 num) {
      return 100;
    }
}

Sorry I have not tried on the main net or Ropsten. Please let me know if you require any additional information.

avatar-lavventura avatar Mar 01 '17 20:03 avatar-lavventura

image

I have a feeling you might not have your mew connected to local node, or the testnet you are using. use the top right node switcher and make sure you are connected to the correct node. I just deployed your contract at 0x7047c65D21b8e0942B69f5fb7719034e8addBc79 and used mew to read the get value and it returned 100. you can also use the above address to test

kvhnuke avatar Mar 20 '17 08:03 kvhnuke

Thank you @kvhnuke. I have tried this on my private ethereum network (http://ethereum.stackexchange.com/a/11240/4575). I have followed your guide to use the wallet for private network as well. I have done the node switcher and the red error box on top of the page also removed. I think my mew is connected to my local node where I can get my account's balance and also send transaction to other addresses.

I can see the correct balance: screen shot 2017-03-20 at 11 53 39 I can send transaction of my contract's function, it does updated on the blockchain as well: screen shot 2017-03-20 at 12 03 14

Interesting part is, I can't read the function, which returns blank text. screen shot 2017-03-20 at 11 53 20

Please note that I am using v.3.5.0.

avatar-lavventura avatar Mar 20 '17 09:03 avatar-lavventura

can you please open up the browser console and send us a screenshot, it might be failing due to a different error, if you can send the network tab screenshot it'll be great too. Ill try to test it on a custom network as soon as I get a chance

kvhnuke avatar Mar 20 '17 11:03 kvhnuke

etherwallet-master.js

        if (hasApply) {
          return function () {
            var args = [];
            forEach(arguments, function (arg) {
              args.push(formatError(arg));
            });
            return logFn.apply(console, args); //ERROR is coming from this line.
          };
        }

Call order of the error: completeRequest(callback, status, response, xhr.getAllResponseHeaders(), statusText);=> callback(status, response, headersString, statusText);=> if (!$rootScope.$$phase) $rootScope.$apply();=> $rootScope.$digest();=> asyncTask.scope.$eval(asyncTask.expression, asyncTask.locals);=> return $parse(expr)(this, locals);=> exceptionHandler(errorMessage);=> $log.error.apply($log, arguments);=> return logFn.apply(console, args);

Please not that, I have added few lines to the etherwallet-master.js so the error lines probably not correct on the original code.

screen shot 2017-03-20 at 16 44 11 screen shot 2017-03-20 at 16 45 27

avatar-lavventura avatar Mar 20 '17 13:03 avatar-lavventura

There is this error always show up.

screen shot 2017-03-20 at 17 10 17

avatar-lavventura avatar Mar 20 '17 14:03 avatar-lavventura

Let me re-try with the latest version v3.5.6 and updated you based on that without changing the original code. @kvhnuke

avatar-lavventura avatar Mar 20 '17 14:03 avatar-lavventura

Same error, lines are on the original code: v3.5.0. @kvhnuke screen shot 2017-03-21 at 14 45 26

avatar-lavventura avatar Mar 21 '17 11:03 avatar-lavventura

@kvhnuke Status update on this?

tayvano avatar Apr 17 '17 19:04 tayvano

@avatar-lavventura is this still happening?

tayvano avatar Jun 18 '17 08:06 tayvano

Is there any update related to issue on the newer version?, with the v3.5.0 yes still happening. @tayvano

avatar-lavventura avatar Jun 22 '17 19:06 avatar-lavventura

@avatar-lavventura is this still an issue?

gamalielhere avatar Aug 29 '18 20:08 gamalielhere

Yeah, I think so.

avatar-lavventura avatar Aug 29 '18 20:08 avatar-lavventura