Skip to content

Conversation

@sudoFerraz
Copy link
Contributor

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

@vercel
Copy link

vercel bot commented Nov 28, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
violet-examples ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 30, 2023 11:11am
violet-examples-wrapper ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 30, 2023 11:11am

Co-authored-by: Raphael <10075759+ra-phael@users.noreply.github.com>
sudoFerraz and others added 2 commits November 29, 2023 17:04
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 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Ok nevermind! 😅

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}
Copy link
Contributor

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 /> 
}

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.

4 participants