Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
ra-phael
reviewed
Nov 29, 2023
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>
ra-phael
reviewed
Nov 30, 2023
| * | ||
| * Saves the new wrapped token address on the erc20ToCompliantWrapped mapping | ||
| */ | ||
| contract CompliantFactory { |
Comment on lines
+178
to
+226
| {!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} |
Contributor
There was a problem hiding this comment.
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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