scaffold-eth / scaffold-eth-challenges Goto Github PK
View Code? Open in Web Editor NEWScaffold-Eth 🏗 Challenges repository
Home Page: https://speedrunethereum.com
Scaffold-Eth 🏗 Challenges repository
Home Page: https://speedrunethereum.com
When you paste an address into the AddressInput you cannot delete and paste another or type one in.
I get this error after run yarn chain
and when i run yarn start
Logger.makeError
/home/arnaud/challenge-1-decentralized-staking/packages/src.ts/index.ts:213
Logger.throwError
/home/arnaud/challenge-1-decentralized-staking/packages/src.ts/index.ts:225
(anonymous function)
/home/arnaud/challenge-1-decentralized-staking/packages/src.ts/index.ts:234
rejected
http://localhost:3000/static/js/0.chunk.js:94577:32
This screen is visible only in development. It will not appear if the app crashes in production.
Open your browser’s developer console to further inspect this error. Click the 'X' or hit ESC to dismiss this message.```
[4/4] Building fresh packages...
[-/21] ⠁ waiting...
[15/21] ⠁ ursa-optional
[16/21] ⠁ keytar
[-/21] ⠁ waiting...
warning Error running install script for optional dependency: "/root/challenge-1-decentralized-staking/node_modules/keytar: Command failed.
Exit code: 1
Command: prebuild-install || node-gyp rebuild
Arguments:
Directory: /root/challenge-1-decentralized-staking/node_modules/keytar
Output:
prebuild-install WARN install No prebuilt binaries found (target=16.17.0 runtime=node arch=x64 libc= platform=linux)
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info find Python using Python version 3.7.3 found at "/usr/bin/python3"
gyp info spawn /usr/bin/python3
gyp info spawn args [
gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/root/challenge-1-decentralized-staking/node_modules/keytar/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/root/.cache/node-gyp/16.17.0/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/root/.cache/node-gyp/16.17.0',
gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/root/.cache/node-gyp/16.17.0/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/root/challenge-1-decentralized-staking/node_modules/keytar',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
/bin/sh: 1: pkg-config: not found
gyp: Call to 'pkg-config --cflags libsecret-1' returned exit status 127 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp
failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:284:16)
gyp ERR! stack at ChildProcess.emit (node:events:513:28)
gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Linux 4.19.0-20-amd64
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /root/challenge-1-decentralized-staking/node_modules/keytar
success Saved lockfile.
Done in 399.39s.
$ hardhat run scripts/publish.js
✅ Published contracts to the subgraph package.
Done in 6.05s.
gitpod /workspace/scaffold-eth-challenges (challenge-0-simple-nft) $ yarn start
yarn run v1.22.19
$ yarn workspace @scaffold-eth/react-app start
warning package.json: No license field
$ node ./scripts/create_contracts.js
$ react-scripts --openssl-legacy-provider start
/home/gitpod/.nvm/versions/node/v16.19.0/bin/node: bad option: --openssl-legacy-provider
error Command failed with exit code 9.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed.
Exit code: 9
Command: /home/gitpod/.nvm/versions/node/v16.19.0/bin/node
Arguments: /home/gitpod/.nvm/versions/node/v16.19.0/lib/node_modules/yarn/lib/cli.js start
Directory: /workspace/scaffold-eth-challenges/packages/react-app
Output:
info Visit https://yarnpkg.com/en/docs/cli/workspace for documentation about this command.
error Command failed with exit code 9.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I wasn't able to get through the first checkpoint with this error.
I tired on VS code on my machine and with gitpod.io
https://speedrunethereum.com/challenge/simple-nft-example
I'm finishing up what's in this tutorial. But when I run the ‘yarn start ’command, it reports an error.
What I should do to solve this error?
Thanks.
Instructions to verify the contracts on Etherscan exist in both checkpoint 5 and checkpoint 7. Instructions should be removed from the bottom of checkpoint 5.
The following block is still appearing in the speedrunethereum.com instructions for Challenge 1, in Checkpoint 5. It is commented out in the github instructions, but is showing as plaintext on SRE.com:
The vscode settings file is pointing to the wrong directory for the solidity node modules, right now it is "solidity.packageDefaultDependenciesDirectory": "packages/hardhat-ts/node_modules"
. The problem here is that the hardhat-ts
folder does not exist.
change "solidity.packageDefaultDependenciesDirectory": "packages/hardhat-ts/node_modules"
to "solidity.packageDefaultDependenciesDirectory": "packages/hardhat/node_modules"
The gitpod environment serves ports at specific urls, instead of on a single served URL. While this usually isn't an issue, because the react application is at a served port 3000, URL requests to a different port URL don't pass a CORs check. This causes breaks in the application when making requests to the localhost chain, making it unusable.
3000
. The application should appear.Access to fetch at 'https://8545-amethyst-condor-919k7bwb.ws-us25.gitpod.io/' from origin 'https://3000-amethyst-condor-919k7bwb.ws-us25.gitpod.io' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
README
.I have to update the test code to
await network.provider.send("evm_increaseTime", [28])
to pass the test, otherwise, it generates error
ProviderError: Error: VM Exception while processing transaction: reverted with panic code 0x11 (Arithmetic operation underflowed or overflowed outside of an unchecked block)
at HttpProvider.request (node_modules/hardhat/src/internal/core/providers/http.ts:49:19)
at GanacheGasMultiplierProvider.request (node_modules/hardhat/src/internal/core/providers/gas-providers.ts:297:34)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Can’t automatically merge. Don’t worry, you can still create the pull request.
Occasionally the app will crash and require the user to refresh the browser.
To recreate the Error:
Spin up challenge-0-simple-nft with yarn, wait, and the app should crash.
Error message:
Unhandled Rejection (Error): call revert exception (method="getReserves()", errorArgs=null, errorName=null, errorSignature=null, reason=null, code=CALL_EXCEPTION, version=abi/5.4.0)
Logger.makeError
/Users/mojo/projects/eth/challenge-0-simple-nft/packages/src.ts/index.ts:213
Logger.throwError
/Users/mojo/projects/eth/challenge-0-simple-nft/packages/src.ts/index.ts:225
Interface.decodeFunctionResult
/Users/mojo/projects/eth/challenge-0-simple-nft/packages/src.ts/interface.ts:425
422 | const value = values[index];
423 | if (param.indexed) {
424 | if (param.type === "string") {
> 425 | topics.push(id(value));
| ^ 426 | }
427 | else if (param.type === "bytes") {
428 | topics.push(keccak256(value));
View compiled
Contract.
/Users/mojo/projects/eth/challenge-0-simple-nft/packages/src.ts/index.ts:332
fulfilled
http://localhost:3000/static/js/0.chunk.js:78806:24
There is a bug at line 114 where the the call to stake is being made from the owner signer instead of secondAccount.
This line needs to be :
const stakeResult = await stakerContract.connect(secondAccount).stake({value: ethers.utils.parseEther("0.001")});
Without this change, the test case cannot pass since secondAccount's balance never changes and the assertion of equality on line 144 will never be true.
NOTE: This entire test case probably needs to be redone due to changes in the withdraw method signature included in #88. If withdraw is intended to work without specifying an address, the comparison on line 144 will have to account not only for the difference in the stake being returned after the call to withdraw but also the gas used in calling the transaction. The withdraw method would also have to be called on the contract returned from stakerContract.connect(secondAccount) also.
Challenge-3-muti-sig needs to be built out.
In "Checkpoint 3: Deploy it!", the hardhat.config.js file instruction does not show the correct explanation for changing to a different network. When changing the network to rinkeby, the correct code should read const defaultNetwork = 'rinkeby';
The image below shows what the current instructions on the site show - const defaultNetwork = 'NETWORKS.rinkeby';
which leads to an error in the console.
There is an error in Challenge 5.
First of all, there was a path mistake for useLookupAddress
import in AddressInput.jsx
, which I believe to have fixed in #58 (comment)
But even after this fix, clicking on either of the two wallets in the frontend results in:
During node install of challenge-0-simple-nft
got error:
warning Error running install script for optional dependency: "/home/devl/gitcoin/scaffold-directory/challenge-0-simple-nft/node_modules/keytar: Command failed. Exit code: 1 Command: prebuild-install || node-gyp rebuild Arguments: Directory: /home/devl/gitcoin/scaffold-directory/challenge-0-simple-nft/node_modules/keytar Output: prebuild-install WARN install No prebuilt binaries found (target=16.13.1 runtime=node arch=x64 libc= platform=linux)
Node 16.13.1 Ubuntu 18.04.4
An optional dependency, but was a concern.
Installing Ubuntu module libsecret-1-dev
apparently solves it.
yarn deploy
fails on node 17.4.0.
Here is the upstream issue NomicFoundation/hardhat#2239
Maybe it's worth adding a warning?
Code error : Failed to verify contract on Etherscan NomicLabsHardhatPluginError: The constru
ctor for contracts/Vendor.sol:Vendor has 1 parameters
but 0 arguments were provided instead.
Fix : await run("verify:verify", {
address: vendor.address,
constructorArguments: [yourToken.address],
});
replace contract arguments with constructor arguments
Branch: challenge-0-simple-nft
⚔️ Side Quests > 🐟 Open Sea
The user interface on the Open Sea collections page has been updated. The instructions and screenshots in the side quest no longer correspond with what is shown on the Open Sea website.
The side quest instructions and screenshots to create a collection for an existing smart contract on Open Sea should be updated to correspond with the new user interface.
Approval is needed if expected token amount exceeds allowance.
The current logic doesn't take into account the expected token amount. Instead it compares allowance to the ethValuePlusExtra:
The expected token amount is
(ethValue.mul(dexTokenBalance).div(dexEthBalance)).add(1)
,
according to the smart contract logic:
So we don't need ethValuePlusExtra at all, instead we should check for smth like
dexApproval.gte(expectedTokenAmount)
I was doint the challenge-2 and following the instructions. I came to transfer ownership step and uncommented the code at this line. I have provided my frontend address but somehow it's giving me this error:
yarn run v1.22.19
$ yarn workspace @scaffold-eth/hardhat deploy --reset
$ hardhat deploy --export-all ../react-app/src/contracts/hardhat_contracts.json --reset
Nothing to compile
deploying "YourToken" (tx: 0xe5375d58ee48aa8b33b3b97b79d503eb3d7a3c92b90ac312a2d386209a16ff1b)...: deployed at 0x5FbDB2315678afecb367f032d93F642f64180aa3 with 637479 gas
deploying "Vendor" (tx: 0x2df0779ea222307500ecc0e0201255f2bf84c3f53e9810c588b3aeb5b3b92ec0)...: deployed at 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512 with 331303 gas
🏵 Sending all 1000 tokens to the vendor...
✅ confirming...
🤹 Sending ownership to frontend address...
An unexpected error occurred:
Error: ERROR processing /home/rishabh/Documents/practice/solidity-practice/challenge-2-token-vendor/packages/hardhat/deploy/01_deploy_vendor.js:
TypeError: vendor.transferOwnership is not a function
at Object.module.exports [as func] (/home/rishabh/Documents/practice/solidity-practice/challenge-2-token-vendor/packages/hardhat/deploy/01_deploy_vendor.js:33:45)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at DeploymentsManager.executeDeployScripts (/home/rishabh/Documents/practice/solidity-practice/challenge-2-token-vendor/packages/hardhat/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1055:22)
at DeploymentsManager.runDeploy (/home/rishabh/Documents/practice/solidity-practice/challenge-2-token-vendor/packages/hardhat/node_modules/hardhat-deploy/src/DeploymentsManager.ts:891:5)
at Environment._runTaskDefinition (/home/rishabh/Documents/practice/solidity-practice/challenge-2-token-vendor/packages/hardhat/node_modules/hardhat/src/internal/core/runtime-environment.ts:217:14)
at Environment.run (/home/rishabh/Documents/practice/solidity-practice/challenge-2-token-vendor/packages/hardhat/node_modules/hardhat/src/internal/core/runtime-environment.ts:129:14)
at SimpleTaskDefinition.action (/home/rishabh/Documents/practice/solidity-practice/challenge-2-token-vendor/packages/hardhat/node_modules/hardhat-deploy/src/index.ts:528:32)
at Environment._runTaskDefinition (/home/rishabh/Documents/practice/solidity-practice/challenge-2-token-vendor/packages/hardhat/node_modules/hardhat/src/internal/core/runtime-environment.ts:217:14)
at Environment.run (/home/rishabh/Documents/practice/solidity-practice/challenge-2-token-vendor/packages/hardhat/node_modules/hardhat/src/internal/core/runtime-environment.ts:129:14)
at SimpleTaskDefinition.action (/home/rishabh/Documents/practice/solidity-practice/challenge-2-token-vendor/packages/hardhat/node_modules/hardhat-deploy/src/index.ts:605:5)
at DeploymentsManager.executeDeployScripts (/home/rishabh/Documents/practice/solidity-practice/challenge-2-token-vendor/packages/hardhat/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1058:19)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at DeploymentsManager.runDeploy (/home/rishabh/Documents/practice/solidity-practice/challenge-2-token-vendor/packages/hardhat/node_modules/hardhat-deploy/src/DeploymentsManager.ts:891:5)
at Environment._runTaskDefinition (/home/rishabh/Documents/practice/solidity-practice/challenge-2-token-vendor/packages/hardhat/node_modules/hardhat/src/internal/core/runtime-environment.ts:217:14)
at Environment.run (/home/rishabh/Documents/practice/solidity-practice/challenge-2-token-vendor/packages/hardhat/node_modules/hardhat/src/internal/core/runtime-environment.ts:129:14)
at SimpleTaskDefinition.action (/home/rishabh/Documents/practice/solidity-practice/challenge-2-token-vendor/packages/hardhat/node_modules/hardhat-deploy/src/index.ts:528:32)
at Environment._runTaskDefinition (/home/rishabh/Documents/practice/solidity-practice/challenge-2-token-vendor/packages/hardhat/node_modules/hardhat/src/internal/core/runtime-environment.ts:217:14)
at Environment.run (/home/rishabh/Documents/practice/solidity-practice/challenge-2-token-vendor/packages/hardhat/node_modules/hardhat/src/internal/core/runtime-environment.ts:129:14)
at SimpleTaskDefinition.action (/home/rishabh/Documents/practice/solidity-practice/challenge-2-token-vendor/packages/hardhat/node_modules/hardhat-deploy/src/index.ts:605:5)
at Environment._runTaskDefinition (/home/rishabh/Documents/practice/solidity-practice/challenge-2-token-vendor/packages/hardhat/node_modules/hardhat/src/internal/core/runtime-environment.ts:217:14)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed.
Exit code: 1
Command: /usr/bin/node
Arguments: /usr/lib/node_modules/yarn/lib/cli.js deploy --reset
Directory: /home/rishabh/Documents/practice/solidity-practice/challenge-2-token-vendor/packages/hardhat
Output:
info Visit https://yarnpkg.com/en/docs/cli/workspace for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I am struggling for two days to solve this issue but can't find any solution. May anyone look into this what's the issue. The Vendor contract is inheriting Ownable
from openzepplin.
When trying yarn surge windows users will get this error.
Easy fix is for them to remove cp from the surge script in package.json under react-app.
"surge": "cp build/index.html build/200.html && surge ./build"
Occasionally the roll animation will get stuck in the rolling state, and the roll button will stay disabled until page reload.
Branch: challenge-0-simple-nft
Checkpoint 5: 📜 Contract Verification
When verifying a contract with a newly created API key from etherscan users might encounter the following error when running yarn verify
since it can take roughly 5 minutes for the API key to become active.
contract YourCollectible failed to submit : "NOTOK" : "Invalid API Key" [object Object]
Note: The speed with which you complete these steps will impact the outcome.
yarn verify
script in packages/hardhat/package.json
yarn verify
(with the --network
of your choice)Perhaps a small note could be added to the Contract Verification section explaining that it might take a few minutes for the Etherscan API key to become active.
Challenge-7-create-stream needs built out.
When minting NFTs in Challenge 0, the frontend throws an error when attempting to mint any more than 8 NFTs. Error: ×
Unhandled Rejection (HTTPError): Too Many Requests.
Checkpoint 2: 🖨 Minting
✏️ Mint some NFTs! Click the MINT NFT button in the YourCollectables tab. When press MINT NFT Button this error occur :
Transaction Error
Cannot read property 'gasPrice' of undefined
Challenge 0 - Update screenshot in checkpoint 4 to include the MINT NFT button.
Challenge-0-simple-nft needs to be built out.
Hello, I recently followed the steps on this repository to run the Ethereum app for the NFT challenge. My problem comes after I run the command yarn start
.
From the terminal, there is no error message, and the localhost page GUI loads successfully. However, after about 5 seconds, it crashes and shows me the following error:
Even after the error, the terminal does not show anything wrong, but if I run yarn deploy
from another window, it fails because it cannot connect to the network localhost.
It is worth noting that I run this code successfully just about 1 or two weeks ago. I did not change anything. I simply ran the same commands. I'm using Ubuntu 20.04 and Firefox. Additionally, I am not very familiar with internet communication protocols, which seem to be the problem here.
Is there a simple thing that I should pay attention to? It is confusing to me because this was working before and now it is not. Thanks for the help in advance.
Tried installing challenge-1-decentralized-staking using yarn and then using npm, both failed
Yarn install fails.
Looks like it is the missing content at https://codeload.github.com/hugomrdias/concat-stream/tar.gz/057bc7b5d6d8df26c8cf00a3f151b6721a0a8034
Here are some details:
Yarn version:
1.22.19
Node version:
18.17.1Platform:
linux x64Trace:
Error: https://codeload.github.com/hugomrdias/concat-stream/tar.gz/057bc7b5d6d8df26c8cf00a3f151b6721a0a8034: Request failed "404 Not Found"
at ResponseError.ExtendableBuiltin (/<local_path>/.nvm/versions/node/v18.17.1/lib/node_modules/yarn/lib/cli.js:696:66)
at new ResponseError (/<local_path>/.nvm/versions/node/v18.17.1/lib/node_modules/yarn/lib/cli.js:802:124)
at Request. (<local_path>/.nvm/versions/node/v18.17.1/lib/node_modules/yarn/lib/cli.js:66215:16)
at Request.emit (node:events:514:28)
at module.exports.Request.onRequestResponse (<local_path>/.nvm/versions/node/v18.17.1/lib/node_modules/yarn/lib/cli.js:141767:10)
at ClientRequest.emit (node:events:514:28)
at HTTPParser.parserOnIncomingClient (node:_http_client:700:27)
at HTTPParser.parserOnHeadersComplete (node:_http_common:119:17)
at TLSSocket.socketOnData (node:_http_client:541:22)
at TLSSocket.emit (node:events:514:28)
npm fails
Here are the details:
/<local_path>/.npm/_logs/2023-08-31T13_14_33_660Z-debug-0.log
npm resolution error report
While resolving: @scaffold-eth/[email protected]
Found: @testing-library/[email protected]
node_modules/@testing-library/dom
dev @testing-library/dom@"^6.12.2" from @scaffold-eth/[email protected]
packages/react-app
@scaffold-eth/[email protected]
node_modules/@scaffold-eth/react-app
workspace packages/react-app from the root projectCould not resolve dependency:
peer @testing-library/dom@">=7.21.4" from @testing-library/[email protected]
node_modules/@testing-library/user-event
@testing-library/user-event@"^12.1.8" from @scaffold-eth/[email protected]
packages/react-app
@scaffold-eth/[email protected]
node_modules/@scaffold-eth/react-app
workspace packages/react-app from the root projectFix the upstream dependency conflict, or retry
this command with --force or --legacy-peer-deps
to accept an incorrect (and potentially broken) dependency resolution.
The it("Should not call DiceGame for a roll greater than 2") test is missing an await in front an expect assertion.
Without it, when it fails, the test has a race condition that makes it look another test is causing the failure.
File location is: challenge-3-dice-game/packages/hardhat/test/challenge_3.js)
Fix needs to be:
await expect(riggedRoll.riggedRoll()).to.reverted;
Getting error message, when I run npx hardhat run script/deploy.js --network goerli
Terminal error response:Error HH100: Network goerli doesn't exist
For more info go to https://hardhat.org/HH100 or run Hardhat with --show-stack-traces
require("@nomicfoundation/hardhat-toolbox");
require("dotenv").config();
require("@nomiclabs/hardhat-ethers");
/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: "0.8.7",
Network:{
hardhat: {
Goerli: {
url: process.env.RPC_URL,
account: [process.env.PRIVATE_KEY],
},
},
},
etherscan: {
apiKey: process.env.ETHERSCAN_KEY,
},
};
Challenge-4-oracle needs built out.
Challenge-6-nft-marketplace needs built out.
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.