GithubHelp home page GithubHelp logo

buildspace-dao-final's People

Contributors

almostefficient avatar farzaa avatar nachoiacovino avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

buildspace-dao-final's Issues

issue #1 dao-final: scripts/1-initialize-sdk.js

the final version give this bug (the legacy was OK)

const sdk = ThirdwebSDK.fromPrivateKey(
^

TypeError: ThirdwebSDK.fromPrivateKey is not a function
at file:///home/runner/

I am in Replit node -v
v16.7.0

Mac OSX

for information package.json:

{
"name": "my-dao",
"version": "3.0.0",
"scripts": {
"dev": "vite",
"build": "vite build",
"serve": "vite preview"
},
"dependencies": {
"@thirdweb-dev/react": "^3.5.1",
"@thirdweb-dev/sdk": "^3.5.1",
"ethers": "^5.6.6",
"react": "^18.0.2",
"react-dom": "^18.0.2",
"@vitejs/plugin-react": "^2.0.0",
"vite": "^3.1.4"
}
}

Membership page is rendered despite wallet transaction rejection

Issue: When we hit the "Mint your NFT" button, the wallet pops up on the browser. When we hit "accept", the the minting process is initiated and the membership page is rendered once the NFT is minted. However, when we "reject" the transfer, it still takes us to the membership page.

It looks like under button onClick, we're executing the bundleDropModule where it sets the HasClaimedNFT state variable to True regardless of whether or an exception is thrown or caught. This is because we're using "finally".

One way to fix this problem is to add a "errorTx" flag and set it to true whenever there's an exception and set HasClaimedNFT state variable to True only if this flag is set to false.

`<button
disabled={isClaiming}
onClick={() => {
setIsClaiming(true);
// Call bundleDropModule.claim("0", 1) to mint nft to user's wallet.
let errorTx = false;

      bundleDropModule
        .claim("0", 1)
        .catch((err) => {
          console.error("failed to claim", err);
          setIsClaiming(false);
          **errorTx = true;**
        })
        .finally(() => {
          // Stop loading state.
          **if (!errorTx)** {
            setIsClaiming(false);
            // Set claim state.
            setHasClaimedNFT(true);
            // Show user their fancy new NFT!
            console.log(
              Successfully Minted! Check it our on OpenSea: https://testnets.opensea.io/assets/${bundleDropModule.address}/0
            );
          }
        });
    }}
  >`

token.mint is not a function in 6-print-money.js

When running node scripts/6-print-money.js it returns an error Failed to print money TypeError: token.mint is not a function because the mint function doesn't exist.

The syntax should be await token.mintToSelf(amount); on line 11 in 6-print-money.js

issue #2

npm install @thirdweb-dev/react @thirdweb-dev/sdk ethers

create ERROR

Capture d’écran 2022-11-10 à 08 56 13

my configuration: Mac OSX
node 16.7
Replit

issue # 3 index.jsx "[vite] Internal server error: Failed to resolve import "react-dom/client" from "src/index.jsx". Does the file exist?"

Hello,

The new index.jsx file as in the tutorial give this error "[vite] Internal server error: Failed to resolve import "react-dom/client" from "src/index.jsx". Does the file exist?"

The complete error is: "10:29:09 AM [vite] Internal server error: Failed to resolve import "react-dom/client" from "src/index.jsx". Does the file exist?
Plugin: vite:import-analysis
File: /home/runner/12111028buildspace-dao-starter-v3/src/index.jsx
1 | var _jsxFileName = "/home/runner/12111028buildspace-dao-starter-v3/src/index.jsx";
2 | import React from "react";
3 | import { createRoot } from "react-dom/client";
| ^
4 | import "./index.css";
5 | import App from "./App";
at formatError (file:///home/runner/12111028buildspace-dao-starter-v3/node_modules/vite/dist/node/chunks/dep-88cc3a4f.js:35044:46)
at TransformContext.error (file:///home/runner/12111028buildspace-dao-starter-v3/node_modules/vite/dist/node/chunks/dep-88cc3a4f.js:35040:19)
at normalizeUrl (file:///home/runner/12111028buildspace-dao-starter-v3/node_modules/vite/dist/node/chunks/dep-88cc3a4f.js:40248:33)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async TransformContext.transform (file:///home/runner/12111028buildspace-dao-starter-v3/node_modules/vite/dist/node/chunks/dep-88cc3a4f.js:40382:47)
at async Object.transform (file:///home/runner/12111028buildspace-dao-starter-v3/node_modules/vite/dist/node/chunks/dep-88cc3a4f.js:35293:30)
at async loadAndTransform (file:///home/runner/12111028buildspace-dao-starter-v3/node_modules/vite/dist/node/chunks/dep-88cc3a4f.js:39879:29)
"
Capture d’écran 2022-11-12 à 11 37 22

In 11-revoke-roles.js, it incorrectly revokes minting role for Governance/Vote contract

I believe the recommended code in tutorial for 11-revoke-roles.js incorrectly revokes all minting roles, including the vote/governance contract.

Specifically, in this line:
await token.roles.setAll({ admin: [], minter: [] });

On my local end, I noticed both my personal wallet and the vote contract held minting roles in the 'before' section, and then all were revoked in the 'after' section.

Recommended fix would be to just specify the role to revoke. i.e.:

await token.roles.revoke("admin", process.env.WALLET_ADDRESS);
await token.roles.revoke("minter", process.env.WALLET_ADDRESS);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.