-
Notifications
You must be signed in to change notification settings - Fork 7
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
Modularize Solidity contracts for upgradeability & extensibility #67
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #67 +/- ##
==========================================
+ Coverage 82.88% 86.03% +3.15%
==========================================
Files 18 18
Lines 818 888 +70
==========================================
+ Hits 678 764 +86
+ Misses 140 124 -16 ☔ View full report in Codecov by Sentry. |
Add unit conversion test coverage & bugfix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mainly looked over the Solidity contracts. The overall organization of the contracts looks good to me. Didn't notice any implementation issues, but suggested a few documentation changes.
There was a problem hiding this 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, though I have limited skills in reviewing codes in solidity.
Co-authored-by: Jordan Schalm <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't really review the Solidity code much but everything else looks fine
view fun isValidCadenceAsset(type: Type): Bool { | ||
let isCadenceNFT = type.isSubtype(of: Type<@{NonFungibleToken.NFT}>()) | ||
let isCadenceFungibleToken = type.isSubtype(of: Type<@{FungibleToken.Vault}>()) | ||
return isCadenceNFT != isCadenceFungibleToken |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically it is possible for assets to be both fungible and non-fungible tokens, right? Are we not supporting that for simplicity?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically it is possible for assets to be both fungible and non-fungible tokens, right?
Not without function overloading in Cadence since both have functions named deposit
and `withdraw.
Are we not supporting that for simplicity?
That's right - mutually exclusive implementations are the only use cases supported for v1. That may change in the future. While it's not currently possible to have a mixed FT/NFT due to the need for function overloading, I added the check here anyway in case it does become technically possible at some point in the future.
Closes: #66
Description
To enhance the extensibility and modularity of the EVM contract, this PR refactors the EVM factory contract into 3 distinct entities:
A.123.ExampleNFT.NFT
=>0x345...789
and vice versadeploy
interface methodOf these three, the registry is intended for permanent use. By decoupling state from functionality, we're able to upgrade to new factory contract version (e.g. add util methods, etc.), add new deployers (e.g. support bridging novel Cadence assets as totally new ERCs or new ERC combinations, etc.).
For contributor use:
main
branchFiles changed
in the Github PR explorer