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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow functions to be defined outside of contracts #566

Merged
merged 1 commit into from Oct 11, 2021

Conversation

sbillig
Copy link
Collaborator

@sbillig sbillig commented Oct 10, 2021

What was wrong?

Utility functions couldn't be defined at the module level, they had to be inside of contracts.

How was it fixed?

Nothing too complicated here. Note that every module-level fn will be compiled into every contract (in yul) for now (but a pub module-level fn doesn't become a public contract function). Someday soon I hope to change the yulgen to only include things that are used.

I didn't update the spec. I figured module functions should be discussed in the section on modules that doesn't exist yet, and also I just didn't really feel like updating it 馃し

The grammar file contains a small lie; self isn't allowed in module function parameter lists. Feeling lazy, I guess.

To-Do

  • OPTIONAL: Update Spec if applicable

  • Add entry to the release notes (may forgo for trivial changes)

  • Clean up commit history

@sbillig sbillig marked this pull request as ready for review October 11, 2021 15:26
@cburgdorf
Copy link
Collaborator

I figured module functions should be discussed in the section on modules that doesn't exist yet

Yep, realized that, too when adding const but was too lazy to update it. As module level becomes more useful I will eventually find enough motivation to add it 馃槃

@g-r-a-n-t g-r-a-n-t merged commit b8b0514 into ethereum:master Oct 11, 2021
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.

None yet

3 participants