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

[WIP] Expose immediate base contracts and base constructors #132

Merged
merged 17 commits into from
Jan 25, 2019

Conversation

Xenomega
Copy link
Member

@Xenomega Xenomega commented Jan 14, 2019

This pull request aims to resolve #131 . It aims to provide the immediate base contracts of a given contract in the correct order of declaration via contract.immediate_inheritance. This contrasts to the existing provided contract.inheritance which provides a flattened, linearized base contract list (all ancestors in the inheritance chain, immediate and not).

@Xenomega Xenomega changed the title [WIP] Expose immediate base contracts [WIP] Expose immediate base contracts and base constructors Jan 23, 2019
@Xenomega
Copy link
Member Author

Xenomega commented Jan 23, 2019

This pull request has now been refactored. It additionally adds support for both AST formats. It also now exposes explicit base constructor calls on both contract definitions and constructor definitions. (Meaning base constructors called on a contract's constructor definition, or those called via the use of parenthesis on the contract definition).

The example below has explicit constructor calls on the contract definition for B and D, and explicit constructor calls on the constructor definition for C and D.

contract E is B(1), C, D() {
    constructor() C(2) D() public {

    }
}

NOTE: Please verify legacy-ast heuristics are sufficient, as legacy-ast is known to present unreliable nodes at times. All tests to this point have yielded expected results.

Xenomega and others added 5 commits January 22, 2019 22:30
        - contract.constructor return the first constructor (following c3 lin.)
        - remove contract.contract_not_inherited
        - add contract.constructors, which returns all the constructors (including inherited)

Add documentation on constructor call on contract's definition
@montyly montyly merged commit 1195894 into master Jan 25, 2019
@montyly montyly deleted the dev-immediate-inheritance branch January 29, 2019 13:40
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.

Expose immediate base contracts for each contract
2 participants