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

Invest #3

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

Invest #3

wants to merge 13 commits into from

Conversation

Anirudha619
Copy link
Collaborator

Added NFT minter smart contract and UI improvements

@@ -21,7 +21,7 @@ const NavBar = () => {
<>
<section className="nav">
<Link to="/">
<Button variant="outlined">{" Home"}</Button>
{/* <Button variant="outlined">{" Home"}</Button> */}
Copy link
Owner

Choose a reason for hiding this comment

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

Why is this line commented?

const token = "0x420d23b5D7B70fFEF09A6076B7Db1176472BaA37";

export async function approve(amount) {
if (amount <= 0 || amount <= "0" ) {
Copy link
Owner

Choose a reason for hiding this comment

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

amount <= "0" this check is not correct

@@ -19,8 +37,9 @@ export async function stake(amount) {
dygnifyStaking.abi,
signer
);
const transaction = await contract.stake(amount);
await transaction.wait();
const transaction1 = await contract.stake(amount);
Copy link
Owner

Choose a reason for hiding this comment

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

improper naming of variable 'transaction1', variable naming needs to be corrected

@@ -14,6 +14,7 @@ const Home = () => {
const form = () => {
return (
<div className="box">

Copy link
Owner

Choose a reason for hiding this comment

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

Unnecessary line addition, please remove

@@ -3,8 +3,26 @@ import dygnifyStaking from "../../artifacts/contracts/DygnifyStaking.sol/Dygnify
import dygnifyToken from "../../artifacts/contracts/DygnifyToken.sol/DygnifyToken.json";
Copy link
Owner

Choose a reason for hiding this comment

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

Add try catch in all the functions in this file

import { uploadFileToIPFS } from '../services/PinataIPFSOptions';
const axios = require('axios');

const REACT_APP_PINATA_API_KEY = "bd910e460ee4b6ef0519";
Copy link
Owner

Choose a reason for hiding this comment

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

We need to remove these secrets from here and keep it in env files



async function mint_NFT(tokenURI,imageURI) {
if (typeof window.ethereum !== 'undefined') {
Copy link
Owner

Choose a reason for hiding this comment

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

Add try catch to this function

const provider = new ethers.providers.Web3Provider(window.ethereum);
const signer = provider.getSigner();
const contract = new ethers.Contract(NFT_minter, NFTMinter.abi, signer);
const transaction = await contract.mint(tokenURI);
Copy link
Owner

Choose a reason for hiding this comment

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

Use return to decide on next action

import {amlCheck} from "../../services/OFACAxiosOptions.js"
import axiosHttpService from '../../services/axioscall';

const REACT_APP_OFAC_MIN_SCORE = "90"
Copy link
Owner

Choose a reason for hiding this comment

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

Remove these settings from here and put it in env file

@@ -8,9 +8,9 @@
.top > h1 {
padding: 10px 0;
}

/*
Copy link
Owner

Choose a reason for hiding this comment

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

We can remove this i guess

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