-
Notifications
You must be signed in to change notification settings - Fork 0
feat: adds erc20 wrapper example project #6
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
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Co-authored-by: Raphael <10075759+ra-phael@users.noreply.github.com>
Co-authored-by: Raphael <10075759+ra-phael@users.noreply.github.com>
Co-authored-by: Raphael <10075759+ra-phael@users.noreply.github.com>
| * | ||
| * Saves the new wrapped token address on the erc20ToCompliantWrapped mapping | ||
| */ | ||
| contract CompliantFactory { |
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.
Ok nevermind! 😅
| {!isPageLoading ? ( | ||
| <> | ||
| {wrapTransaction ? ( | ||
| <SuccessfulWrapTransaction wrapTransaction={wrapTransaction} /> | ||
| ) : ( | ||
| <div> | ||
| {status == 'connected' && | ||
| !isWrongChain && | ||
| !isPageLoading && | ||
| !nonCompliantERC20 ? ( | ||
| <ERC20Input | ||
| setTokenInput={setTokenInput} | ||
| setNonCompliantERC20={setNonCompliantERC20} | ||
| tokenInput={tokenInput} | ||
| /> | ||
| ) : ( | ||
| <div> | ||
| {erc20NotWrapped && readyToWrap && erc20ToBeWrapped ? ( | ||
| <WrapERC20 | ||
| erc20ToBeWrapped={erc20ToBeWrapped} | ||
| compliantFactoryContract={compliantFactoryContract} | ||
| setIsPageLoading={setIsPageLoading} | ||
| nonCompliantERC20={nonCompliantERC20} | ||
| setWrapTransaction={setWrapTransaction} | ||
| /> | ||
| ) : ( | ||
| <div> | ||
| {erc20InstanceError ? ( | ||
| <ERC20InstanceError /> | ||
| ) : ( | ||
| <div></div> | ||
| )} | ||
| </div> | ||
| )} | ||
|
|
||
| {compliantErc20 ? ( | ||
| <DeployedCompliantERC20 | ||
| foundDeployedWrappedErc20={foundDeployedWrappedErc20} | ||
| compliantErc20={compliantErc20} | ||
| /> | ||
| ) : ( | ||
| <div className={styles.grid}></div> | ||
| )} | ||
| </div> | ||
| )} | ||
| </div> | ||
| )} | ||
| </> | ||
| ) : null} |
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.
Ternary madness! Hahaha
Suggestion, use intermediary components to create the relevant layers of abstractions:
const componentA = (props) => {
if (!a || !b) return;
if (c && d) return <WrapERC20 />
else return <Whatever />
}
This PR adds a frontend together to a set of contracts that enable the easy wrapping of ERC20 tokens to a compliant version that uses the VioletID for the _update functionality per openZeppelin recommendation;
It only allows wrapping and unwrapping of tokens to valid VioletID status holders
Frontend detects if a given addres is an ERC20 address, and if positive, if it has already been wrapped to a compliant token, displaying the deployed address of it