openzeppelin / workshops Goto Github PK
View Code? Open in Web Editor NEWCode and slides for OpenZeppelin Workshops
Code and slides for OpenZeppelin Workshops
Hi, I am having an issue for nft-drop repo. When I run the script 2-sign.js for
AUTOTASK START
2022-06-28T18:19:22.679Z INFO Relaying {
value: 0,
gas: 1000000,
nonce: '1',
to: '0x02f50082297c86E8c4D878D4c7dc68B236D3616c',
from: '0x84E5B4cf1B91EC15dD34E097B403B07175f72d35',
data: '0xf2c298be000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000044d617a6900000000000000000000000000000000000000000000000000000000'
}
2022-06-28T18:19:26.459Z ERROR Invoke Error {"errorType":"Error","errorMessage":"invalid BigNumber value (argument="value", value=undefined, code=INVALID_ARGUMENT, version=bignumber/5.6.2)","code":"INVALID_ARGUMENT","reason":"invalid BigNumber value","argument":"value","stack":["Error: invalid BigNumber value (argument="value", value=undefined, code=INVALID_ARGUMENT, version=bignumber/5.6.2)"," at Logger.makeError (/opt/nodejs/node_modules/@ethersproject/logger/lib/index.js:233:21)"," at Logger.throwError (/opt/nodejs/node_modules/@ethersproject/logger/lib/index.js:242:20)"," at Logger.throwArgumentError (/opt/nodejs/node_modules/@ethersproject/logger/lib/index.js:245:21)"," at Function.BigNumber.from (/opt/nodejs/node_modules/@ethersproject/bignumber/lib/bignumber.js:239:23)"," at DefenderRelaySigner.sendTransaction (/opt/nodejs/node_modules/defender-relay-client/lib/ethers/signer.js:88:45)"," at processTicksAndRejections (internal/process/task_queues.js:97:5)"]}
END RequestId: 01339f85-07b3-49f6-b445-74040d7a48c3
AUTOTASK COMPLETE
Running through the readme. for workshop 25, try to run yarn deploy
and get this error
workshops/25-defender-metatx-api [master●] » yarn deploy
yarn run v1.22.19
$ node scripts/deploy.js
HardhatError: HH700: Artifact for contract "MinimalForwarder" not found.
at Artifacts._getArtifactPathFromFiles (/Users/kylemantesso/dev/workshops/25-defender-metatx-api/node_modules/hardhat/internal/artifacts.js:264:19)
at Artifacts._getArtifactPath (/Users/kylemantesso/dev/workshops/25-defender-metatx-api/node_modules/hardhat/internal/artifacts.js:217:21)
at async Artifacts.readArtifact (/Users/kylemantesso/dev/workshops/25-defender-metatx-api/node_modules/hardhat/internal/artifacts.js:46:30)
at async getContractFactoryByName (/Users/kylemantesso/dev/workshops/25-defender-metatx-api/node_modules/@nomiclabs/hardhat-ethers/dist/src/helpers.js:49:22)
at async main (/Users/kylemantesso/dev/workshops/25-defender-metatx-api/scripts/deploy.js:19:21)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I can't get Goerli Eth, is there a way to use Sepolia
Minimalforwader function of getNonce is not working
I have tried so many ways but it is still not working
Hi all,
I'm not currently building a marketplace yet, but very keen to better understand some of the concepts and best practices.
Let's say I want to build a marketplace that only shows the items that are created and minted there, not like OpenSea where you can see pretty much everything anyone owns in the currently active chain.
The tokens would be single items with one or multiple editions. Support for generative collections with thousands of unique tokens is not needed.
I've been looking at this workshop but a couple of things are not very clear to me yet:
These are just some initial thoughts and nothing is built up yet.
Thanks all!
Hi, I wonder why i got this error
Error: call revert exception (method="getNonce(address)", errorSignature=null, errorArgs=[null], reason=null, code=CALL_EXCEPTION, version=abi/5.0.12)
at Logger.makeError (D:\react-next-js\gasless\workshops\25-defender-metatx-api\node_modules\@ethersproject\logger\src.ts\index.ts:205:28)
at Logger.throwError (D:\react-next-js\gasless\workshops\25-defender-metatx-api\node_modules\@ethersproject\logger\src.ts\index.ts:217:20)
at Interface.decodeFunctionResult (D:\react-next-js\gasless\workshops\25-defender-metatx-api\node_modules\@ethersproject\abi\src.ts\interface.ts:326:23)
at Contract.<anonymous> (D:\react-next-js\gasless\workshops\25-defender-metatx-api\node_modules\@ethersproject\contracts\src.ts\index.ts:309:44)
at step (D:\react-next-js\gasless\workshops\25-defender-metatx-api\node_modules\@ethersproject\contracts\lib\index.js:46:23)
at Object.next (D:\react-next-js\gasless\workshops\25-defender-metatx-api\node_modules\@ethersproject\contracts\lib\index.js:27:53)
at fulfilled (D:\react-next-js\gasless\workshops\25-defender-metatx-api\node_modules\@ethersproject\contracts\lib\index.js:18:58)
Notes: I already make sure that Forwarder and Registry contract are deployed in Goerli and I call the contract with the deployed address (never run & test in local node for this project) so different network problem im pretty sure is eliminated.
It seems this function call is the cause of the error :
async function buildRequest(forwarder, input) {
// console.log("go here?");
// console.log(forwarder.address);
// console.log(input.from);
const nonce = await forwarder
.getNonce(input.from)
.then((nonce) => nonce.toString());
return { value: 0, gas: 1e6, nonce, ...input };
}
Thanks before
$ uname -a
Linux 5.8.0-44-generic #50-Ubuntu SMP Tue Feb 9 06:29:41 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
$ npm run test
> [email protected] test open-zeppeling/workshops/02-contracts-clone
> hardhat test
Error HH404: File argent-contracts/contracts/modules/VersionManager.sol, imported from contracts/3-argent/import_0.6.sol, not found.
For more info go to https://hardhat.org/HH404 or run Hardhat with --show-stack-traces
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] test: `hardhat test`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! 2021-03-16T12_50_13_704Z-debug.log
$ cat 021-03-16T12_50_13_704Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'v14.16.0/bin/node',
1 verbose cli 'v14.16.0/bin/npm',
1 verbose cli 'run',
1 verbose cli 'test'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'pretest', 'test', 'posttest' ]
5 info lifecycle [email protected]~pretest: [email protected]
6 info lifecycle [email protected]~test: [email protected]
7 verbose lifecycle [email protected]~test: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~test: PATH: .nvm/versions/node/v14.16.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:open-zeppeling/workshops/02-contracts-clone/node_modules/.bin:.nvm/versions/node/v14.16.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
9 verbose lifecycle [email protected]~test: CWD: open-zeppeling/workshops/02-contracts-clone
10 silly lifecycle [email protected]~test: Args: [ '-c', 'hardhat test' ]
11 silly lifecycle [email protected]~test: Returned: code: 1 signal: null
12 info lifecycle [email protected]~test: Failed to exec test script
13 verbose stack Error: [email protected] test: `hardhat test`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (.nvm/versions/node/v14.16.0/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:315:20)
13 verbose stack at ChildProcess.<anonymous> (.nvm/versions/node/v14.16.0/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:315:20)
13 verbose stack at maybeClose (internal/child_process.js:1048:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid [email protected]
15 verbose cwd open-zeppeling/workshops/02-contracts-clone
16 verbose Linux 5.8.0-44-generic
17 verbose argv ".nvm/versions/node/v14.16.0/bin/node" ".nvm/versions/node/v14.16.0/bin/npm" "run" "test"
18 verbose node v14.16.0
19 verbose npm v6.14.11
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] test: `hardhat test`
22 error Exit status 1
23 error Failed at the [email protected] test script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
In the AutoTask code the relay is defined with 4 arguments:
async function relay(forwarder, request, signature, whitelist)
and then it is called with 3 arguments:
const tx = await relay(forwarder, request, signature);
What sorcery is this?
Hi,
I´m having compilation issues with this file. https://github.com/OpenZeppelin/workshops/blob/master/01-defender-meta-txs/app/src/eth/signer.js
./src/eth/signer.js
SyntaxError: C:\Dev\repos\workshops-Oz\01-defender-meta-txs\app\src\eth\signer.js: Unexpected token (1:0)
> 1 | ../../../src/signer.js
| ^
Any idea? Did I miss some step?
Hi,
I encountered an issue while using the OpenZeppelin Contracts Wizard on macOS(link). The copy-paste button for generated code doesn't seem to be functioning properly.
Steps to Reproduce:
Expected Behavior:
The generated contract code should be copied to the clipboard.
Actual Behavior:
The copy button doesn't seem to work; the code is not copied to the clipboard.
Thank you for looking into this!
node version 10.12.0
npm run compile
[email protected] compile zpl-workshops\workshops\02-contracts-clone
hardhat compileError HH404: File argent-contracts/contracts/modules/VersionManager.sol, imported from contracts/3-argent/import_0.6.sol, not found.
For more info go to https://hardhat.org/HH404 or run Hardhat with --show-stack-traces
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] compile:hardhat compile
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] compile script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.npm ERR! A complete log of this run can be found in:
npm ERR! AppData\Roaming\npm-cache_logs\2022-09-10T11_05_01_796Z-debug.log
Hi All !
I am getting this error when i run the script npx hardhat run scripts/sign.js --network rinkeby (Rinkeby Testnet)
Sign authorization:
TypeError: Cannot read properties of undefined (reading '_signTypedData')
at main (/home/umer/OpenZepplineNFTMinting/scripts/sign.js:20:36)
I have tried your example workshops/25-defender-metatx-api
and on running script scripts/sign.js
got error:
Signing registration of alice as 0xA7C37aEfF34ac0994B3a350c56a591f321EbD8A3...
TypeError: forwarder.getNonce is not a function
Please help me to resolve this issue!
I've just tried the meta-transactions demo but found many errors when just following the instructions. It seems that it was published without checking that it works beforehand, which is bad practise.
Please fix all errors so that it actually runs.
e.g.:
Replace forwarder.verify(request, signature)
with forwarder.verify(forwardRequestData)
where forwardRequestData
corresponds with ForwardRequestData.
Add deadline
to the request
.
Should EIP712Domain
have salt
?
Replace API_KEY
with RELAYER_API_KEY
and API_SECRET
with RELAYER_API_SECRET
in various files.
Replace apiKey
with relayerApiKey
and apiSecret
with relayerApiSecret
in the call to handler()
.
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.