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

Feature/add minting to transfer 726 #792

Merged

Conversation

0xvangrim
Copy link
Contributor

@0xvangrim 0xvangrim commented Apr 13, 2022

Description

Issue: #726

  • Enabled REP minting for REP guilds
  • Calling the contract ERC20SnapshotRep mint-function

TODO:

  • Add integration tests.
  • Fix dev-script to work with REP guilds

Modal
Screenshot 2022-04-13 at 23 20 05

RepMintEditor
Screenshot 2022-04-13 at 23 20 26

RepMintInfoLine
Screenshot 2022-04-13 at 23 20 33

RepMintSummary
Screenshot 2022-04-13 at 23 20 45

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • [X ] New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

This has only been manually tested. Since the dev-script is currently not working with REP guilds, it was not possible to execute the actual action. Thus, it needs to be tested that it actually sends the correct data in the calldata.

Checklist:

  • [X ] My code follows the existing style of this project
  • [X ] I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • [ x ] Any UI changes have been tested and made responsive for mobile views

@github-actions
Copy link

✔️ Preview deployment is ready!

🔨 Explore the source changes: fb94b07

😎 Browse the preview: https://bafybeif7msfu4pewfrumw2wwctsqndmdb7sao3ony4tmtng4fas3ctbmiy.ipfs.dweb.link

Comment on lines 24 to 25
console.log({ tokenData });
console.log(tokenData.symbol);
Copy link
Contributor

Choose a reason for hiding this comment

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

console.log removal

Comment on lines 62 to 76
const { guild_id: guildId } =
useParams<{ chain_name?: string; guild_id?: string }>();
const { data } = useGuildConfig(guildId);
const { data: tokenData } = useERC20Info(data?.token);
const totalSupply = useBigNumberToNumber(tokenData?.totalSupply, 18);

const parsedData = useMemo<REPMintState>(() => {
if (!decodedCall) return null;
return {
toAddress: decodedCall.args.to,
amount: decodedCall.args.amount,
};
}, [decodedCall]);

const { imageUrl } = useENSAvatar(parsedData?.toAddress, MAINNET_ID);
Copy link
Contributor

Choose a reason for hiding this comment

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

This chunk of code is very similar throughout the REPMint components. I suggest that it would be worth placing this processing into its own hook.

}
};
return (
<div>
Copy link
Member

Choose a reason for hiding this comment

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

Could this be a fragment?

Comment on lines 24 to 25
console.log({ tokenData });
console.log(tokenData.symbol);
Copy link
Member

Choose a reason for hiding this comment

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

Can we remove this logs?

@github-actions
Copy link

✔️ Preview deployment is ready!

🔨 Explore the source changes: 0334f04

😎 Browse the preview: https://bafybeie4pfotyuhybfs7aj6sotwvxtafu7w53qvqaqy63s2q4akewijosy.ipfs.dweb.link

@0xvangrim 0xvangrim requested review from MiltonTulli and hhamud April 20, 2022 13:00
@github-actions
Copy link

✔️ Preview deployment is ready!

🔨 Explore the source changes: d311fbf

😎 Browse the preview: https://bafybeiewcgf7rgxhzy46khw73b4a26ndqyhcdglcjhbeuvzie2dgsxqssu.ipfs.dweb.link

@github-actions
Copy link

✔️ Preview deployment is ready!

🔨 Explore the source changes: 12d68ee

😎 Browse the preview: https://bafybeicebedbm5yjuvfyqwocatwr2geapi3dtow6s33774nmmlfvte7oby.ipfs.dweb.link

@0xvangrim
Copy link
Contributor Author

Hello guys @MiltonTulli @hhamud, back from the dead here in ETHAmsterdam :D. Thanks for the comments, the latest commits do:

  • Added two reusable hooks useTokenData and useTotalSupply
  • Remove console.log
  • Replaced div with React.Fragment

@0xvangrim 0xvangrim merged commit f70810c into DXgovernance:develop Apr 20, 2022
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.

3 participants