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

Refactor token source contracts #229

Merged
merged 21 commits into from
Jan 18, 2024

Conversation

geoff-vball
Copy link
Contributor

Why this should be merged

Closes #219

How this works

Extracts common code from ERC20TokenSource and NativeTokenSource into an abstract contract TokenSource.

How this was tested

Existing tests

How is this documented

N/A

Copy link

Refactor token source contracts

Generated at commit: ba354e6a8f0f33832d95ba8f645e6bf87fc5457f

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
1
0
0
5
19
25
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
1
33
34

For more details view the full report in OpenZeppelin Code Inspector

Copy link
Collaborator

@michaelkaplan13 michaelkaplan13 left a comment

Choose a reason for hiding this comment

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

Makes sense to me, just a few small comments.

contracts/lib/subnet-evm Outdated Show resolved Hide resolved
*/
function _unlockTokens(address recipient, uint256 amount) private {
function _unlockTokens(address recipient, uint256 amount) internal override {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Calling out that the visibility of _unlockTokens and _handleBurnTokens is changing from private to internal. This should be okay, given that we don't expect anything to inherit from these contracts (and if someone does, that's on them), but it is a minor change.

Copy link
Collaborator

@michaelkaplan13 michaelkaplan13 left a comment

Choose a reason for hiding this comment

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

LGTM!

cam-schultz
cam-schultz previously approved these changes Jan 12, 2024
Copy link
Contributor

@cam-schultz cam-schultz left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -0,0 +1,96 @@
// (c) 2024, Ava Labs, Inc. All rights reserved.

Choose a reason for hiding this comment

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

we should update the other licenses to 2024 before launch

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I do not think we should update any old copyright dates. This SO thread aligns with my understanding of copyright law https://stackoverflow.com/questions/2390230/do-copyright-dates-need-to-be-updated

Copy link

@minghinmatthewlam minghinmatthewlam left a comment

Choose a reason for hiding this comment

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

LGTM, left some nits

geoff-vball and others added 4 commits January 12, 2024 21:01
…e/TokenSource.sol

Co-authored-by: minghinmatthewlam <matthew.lam@avalabs.org>
Signed-off-by: Geoff Stuart <geoff.vball@gmail.com>
cam-schultz
cam-schultz previously approved these changes Jan 16, 2024
cam-schultz
cam-schultz previously approved these changes Jan 16, 2024
…e/NativeTokenDestination.sol

Co-authored-by: minghinmatthewlam <matthew.lam@avalabs.org>
Signed-off-by: Geoff Stuart <geoff.vball@gmail.com>
cam-schultz
cam-schultz previously approved these changes Jan 17, 2024
@geoff-vball geoff-vball merged commit ba009b4 into main Jan 18, 2024
14 of 15 checks passed
@geoff-vball geoff-vball deleted the gstuart/tokensource-abstract-contract branch January 18, 2024 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Create TokenSource Abstract Contract
4 participants