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

Properly reject circular dependency when using create/create2 #363

Merged

Conversation

cburgdorf
Copy link
Collaborator

What was wrong?

As found by the fuzzer in #362, circular dependencies when using create or create2 were not correctly rejected yet.

How was it fixed?

In the analyzer we check if the name of the contract to create is the same as the contract of the inherited scope. If so, we reject it with a newly added CircularDependency kind.

@cburgdorf cburgdorf changed the title Christoph/fix/circular create dependency Properly reject circular dependency when using create/create2 Apr 22, 2021
@cburgdorf cburgdorf requested a review from g-r-a-n-t April 22, 2021 14:31
@cburgdorf
Copy link
Collaborator Author

I can't yet assign @satyamakgec as a reviewer (assigning issues does work though)

Copy link
Member

@g-r-a-n-t g-r-a-n-t left a comment

Choose a reason for hiding this comment

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

👍

@@ -0,0 +1,5 @@
contract Foo:
pub def bar()->address:
foo:Foo=Foo.create(0)
Copy link
Member

Choose a reason for hiding this comment

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

np: format the code

@cburgdorf cburgdorf force-pushed the christoph/fix/circular-create-dependency branch from 14ed698 to 244ec08 Compare April 23, 2021 08:49
@codecov-commenter
Copy link

Codecov Report

Merging #363 (009fe76) into master (22771e7) will increase coverage by 0.01%.
The diff coverage is 100.00%.

❗ Current head 009fe76 differs from pull request most recent head 244ec08. Consider uploading reports for the commit 244ec08 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master     #363      +/-   ##
==========================================
+ Coverage   92.80%   92.81%   +0.01%     
==========================================
  Files          59       59              
  Lines        4015     4022       +7     
==========================================
+ Hits         3726     3733       +7     
  Misses        289      289              
Impacted Files Coverage Δ
analyzer/src/errors.rs 89.28% <100.00%> (+0.39%) ⬆️
analyzer/src/traversal/expressions.rs 92.07% <100.00%> (+0.17%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 22771e7...244ec08. Read the comment docs.

@cburgdorf cburgdorf merged commit 3f10a8f into ethereum:master Apr 23, 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.

3 participants