-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
String memory variable cause function to return no value #3998
Comments
Are you sure you are running this on a byzantium-compatible blockchain? |
I run it on parity. However, it seems just an error because of trying to access other's contract dynamic string method. However, It doesn't work with sized types too:
Here expected value is I'm not sure anymore if it's a compiler bug or just bad EVM, but I think we need at least some explanation here, like some warning or something. |
I have found out that it's parity bug, others ethereum implementations works fine with this code. |
You can link to the Parity issue? It is useful for others finding this issue to be able to track what's going on. |
Of course: openethereum/parity-ethereum#8503 It basically forbids any interacton between contracts, e.g. in provided example you cannot call |
Related to #4259. |
I'm writing a simple smart contract which loops over internal array and checks if strings are equal. It compiles fine but when I run this smart contract I get no value at all. I started my investigation and here is what I have found.
Consider following smart contract:
Deploy it and call
createRequest(somevalue)
. Then callgetRequestsByFilter(anyvalue)
and you should see1 1 1 0x00..00
. Ok, it's good, it works fine.However, try to uncomment
//string memory requestId = request.id();
line and repeat steps above. In this case this contract is still compiling, however trying to call it always leads to0 0 0 null
. But this line shouldn't change observable behaviour?! Yes, it shouldn't, however, it does.I consider it's either VM or compiler bug.
The text was updated successfully, but these errors were encountered: