buildspace / buildspace-dao-final Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
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"
}
}
I put it in the same location mentioned here, that it differs from the one present https://buildspace.so/p/build-dao-with-javascript/lessons/LE9ead268d-a22e-4d93-80fd-672f11362276:
right under the mintNft function:
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
);
}
});
}}
>`
buildspace-dao-final/src/App.jsx
Line 96 in 95772c6
As referenced in the above line, getAllClaimerAddresses returns no addresses and remains empty. Can you check why?
// The maximum number of NFTs that can be claimed.
maxQuantity: 1,
What does it mean precisely? That just 1 NFT can get minted overall or that one user can mint max 1 NFT?
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
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)
"
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);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.