Skip to content
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

Compiling with warnings breaks interaction page #102

Closed
Cygnusfear opened this issue Sep 8, 2018 · 3 comments
Closed

Compiling with warnings breaks interaction page #102

Cygnusfear opened this issue Sep 8, 2018 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@Cygnusfear
Copy link

Cygnusfear commented Sep 8, 2018

Environment/Browser

Chrome latest

Description

Not setting pure on lolWut function breaks contract interaction

pragma solidity ^0.4.21;

contract MyContract {
    function MyContract() public {
    }

    function lolWut() public returns(string) {
        return "lulwut";
    }
}

Steps to reproduce

  1. Above code
  2. Compile and deploy
  3. Press lolWut button

Expected result

green button
lolwut

Actual result

yellow button
Sorry, that page could not be found.

Reproducible

I have a feeling we got a winner here

@javier-tarazaga
Copy link
Contributor

javier-tarazaga commented Sep 8, 2018

Hi @Cygnusfear!

Yeap I can see the issue. If you are trying to actually run a constant function, you need to add the constant modifier to the function like this:

 function lolWut() public view returns(string) {
        return "lulwut";
    }

But anyway, the scenario you presented should not happen and we will need to check out what could be happening.

Thanks for reporting it!

@javier-tarazaga javier-tarazaga added the bug Something isn't working label Sep 8, 2018
@Cygnusfear
Copy link
Author

Cygnusfear commented Sep 8, 2018

👍Yes, setting the proper modifier will fix the issue (constant/view etc)

And I love the IDE, the way you approached the UX is nice. Would be great if we can load projects from localhost a la remixd!

@bashlund bashlund self-assigned this Sep 8, 2018
bashlund added a commit that referenced this issue Sep 8, 2018
+ Add safety check to avoid JS errors
+ Add warning message to alert user of a non constant function returning values
bashlund added a commit that referenced this issue Sep 8, 2018
+ Add safety check to avoid JS errors
+ Add warning message to alert user of a non constant function returning values
@javier-tarazaga
Copy link
Contributor

This issue was fixed in #105

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants