GithubHelp home page GithubHelp logo

openzeppelin / workshops Goto Github PK

View Code? Open in Web Editor NEW
419.0 26.0 273.0 40.66 MB

Code and slides for OpenZeppelin Workshops

Shell 0.52% HTML 2.38% CSS 3.06% JavaScript 61.99% Solidity 30.11% TypeScript 1.94%

workshops's People

Contributors

abcoathup avatar alexbehrens avatar amxx avatar cairoeth avatar frangio avatar manhuichi avatar morganjweaver avatar mverzilli avatar offgridauthor avatar orenyomtov avatar shahnami avatar spalladino avatar stevenlanders avatar tinchoabbate 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

workshops's Issues

invalid BigNumber value (argument="value", value=undefined, code=INVALID_ARGUMENT, version=bignumber/5.6.2)

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

HH700: Artifact for contract "MinimalForwarder" not found

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.

NFT Marketplace: contract and limitations questions

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:

  1. what kind of contract would be ideal for this purpose with lazy minting
  2. should we use just a single contract for everything that will be ever minted through the platform
  3. related to item 2; what are the limits of tokens a contract can store

These are just some initial thoughts and nothing is built up yet.

Thanks all!

got "Error: call revert exception (method="getNonce(address)...." error when running "yarn sign" script

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

Import not found

$ 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 ]

Copy-Paste Button Not Working in OpenZeppelin Contracts Wizard

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:

  1. Navigate to the Contracts Wizard page.
  2. Complete the contract configuration.
  3. Click the copy button to copy the generated code.

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!

Error HH404: Import not found

node version 10.12.0

npm run compile

[email protected] compile zpl-workshops\workshops\02-contracts-clone
hardhat compile

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] 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

forwarder.getNonce is not a function

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!

Many errors in 25-defender-metatx-api

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().

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.