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

Add standard library support #139

Merged
merged 3 commits into from
Jan 27, 2022
Merged

Add standard library support #139

merged 3 commits into from
Jan 27, 2022

Conversation

cd1m0
Copy link
Collaborator

@cd1m0 cd1m0 commented Jan 26, 2022

This PR adds a built-in standard library of macros that is shipped with the normal scribble release. You can refer to those macros without having to specify an explicit --macro-path command line option. Initially the library contains 3 macros:

  • ERC20 macro. You can invoke it for any standard delfationary (fixed-supply) ERC20 contract with the #macro erc20(balances, allowances, totalSupply); contract-level annotation. Note that the balances, allowances and totalSupply are names of expected state variables in the annotated contract

  • ERC721 macro. You can invoke it for any standard ERC721 contract with the #macro erc721(); annotation

  • Ownable macro. You can invoke it for the standard Ownable contract with the #macro ownable(owner); annotation where owner is the name of the state variable storing the owner.

@cd1m0 cd1m0 requested a review from blitz-1306 January 26, 2022 09:05
Copy link
Contributor

@blitz-1306 blitz-1306 left a comment

Choose a reason for hiding this comment

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

Good job. A few ideas and suggestions.

src/instrumenter/annotations.ts Outdated Show resolved Hide resolved
src/instrumenter/annotations.ts Outdated Show resolved Hide resolved
test/integration/src2srcmap.spec.ts Outdated Show resolved Hide resolved
test/integration/utils.ts Outdated Show resolved Hide resolved
@cd1m0 cd1m0 requested a review from blitz-1306 January 27, 2022 00:09
…hods that have macro properties instantiated on them.
Copy link
Contributor

@blitz-1306 blitz-1306 left a comment

Choose a reason for hiding this comment

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

Looks good to me

@cd1m0 cd1m0 merged commit 62d32dd into develop Jan 27, 2022
@cd1m0 cd1m0 deleted the feature/stdlib branch January 27, 2022 06:07
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