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

Do not error on state change for transient objects #229

Merged
merged 1 commit into from
Mar 28, 2024

Conversation

ferranbt
Copy link
Collaborator

📝 Summary

Since we fail the CCR when a state change happens, this type of patterns is not possible:

contract Suapp {
  function example() public {
      Other o = new Other();
  }
}

contract Other {
   string jsonrpc;

   constructor(string _jsonrpc) {
       jsonrpc = _jsonrpc;
   }
}

We use this pattern a lot in suave-std and it is helpful as a way to describe transient objects with state.

This PR fixes the issue and only fails if the user tries to make state changes for the Suapp itself.

📚 References


  • I have seen and agree to CONTRIBUTING.md

Copy link
Member

@dmarzzz dmarzzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LSTM

@ferranbt ferranbt merged commit cc42af4 into main Mar 28, 2024
4 checks passed
@ferranbt ferranbt deleted the fix/state-change-warning-not-of-temp-objects branch March 28, 2024 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants