← Index
Source: docs/zsub/dev2.md (auto-generated by scripts/generate-docs-html.mjs — edit the .md, not this file)

๐ŸŒŸ๐Ÿ“๐Ÿฆ‹โšพ๏ธ๐Ÿณ๐Ÿ€๐ŸŒผ๐ŸŒธ๐Ÿ†๐Ÿœ๐Ÿ˜ˆ๐Ÿถ๐Ÿฆ„โ˜•๏ธ๐Ÿš˜โ€ป

Your branch is ahead of 'origin/pos' by 1 commit.

(use "git push" to publish your local commits)

hint: You have divergent branches and need to specify how to reconcile them. hint: You can do so by running one of the following commands sometime before hint: your next pull: hint: hint: git config pull.rebase false # merge (the default strategy) hint: git config pull.rebase true # rebase hint: git config pull.ff only # fast-forward only hint: hint: You can replace "git config" with "git config --global" to set a default hint: preference for all repositories. You can also pass --rebase, --no-rebase, hint: or --ff-only on the command line to override the configured default per hint: invocation.

==> git pull git reset --hard origin/set-cl-node

remove python3.9 on ubuntu

sudo apt-get remove python3.9

ubuntu@ip-172-31-22-252:~$ git clone git@github.com:linked0/poohgeth

Cloning into 'poohgeth'... The authenticity of host 'github.com (20.200.245.247)' can't be established. ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU. This key is not known by any other names Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added 'github.com' (ED25519) to the list of known hosts. git@github.com: Permission denied (publickey). fatal: Could not read from remote repository.

๊ธฐํƒ€

EC2 key๋กœ ssh์ ‘์† Permission Denied (public key)

pooh-seoul.pem๋ฅผ ์จ์•ผํ•˜๋Š”๋ฐ tednet.pem์„ ์”€.

solidity.md

NodeJS/TypeScript

Event ์ธ์ž๋“ค์ค‘ ํ•˜๋‚˜๋งŒ ์ฒดํฌ

await expect(lock.withdraw())
    .to.emit(lock, "Withdrawal")
    .withArgs(lockedAmount, anyValue);

์œ„ ์ฝ”๋“œ๋ฅผ ์•„๋ž˜์™€ ๊ฐ™์ด ๋ณ€๊ฒฝ. anyValue๊ฐ€ ์ œ๋Œ€๋กœ ๋™์ž‘ ์•ˆํ•จ.

const tx = await lock.withdraw();
const receipt = await tx.wait();
// Find the Withdrawal event in the transaction receipt
const withdrawalEvent = receipt.events.find((e: any) => e.event === "Withdrawal");

// Check if the Withdrawal event was emitted
expect(withdrawalEvent, "Withdrawal event should be emitted").to.not.be.undefined;

// Check only the first argument of the Withdrawal event
expect(withdrawalEvent.args[0]).to.equal(lockedAmount);

anyValue function

import { anyValue } from "@nomicfoundation/hardhat-chai-matchers/withArgs"; wait expect(lock.withdraw()) .to.emit(lock, "Withdrawal") .withArgs(lockedAmount, anyValue); // We accept any value as when arg :error occured like this, AssertionError: Expected 1732243098 to equal function anyValue() { return true; }, but they have different lengths


an issue with fsevents

warning Error running install script for optional dependency: "/Users/hyunjaelee/node_modules/@remix-project/remixd/node_modules/fsevents: Command failed.
Exit code: 1
Command: node install.js
Arguments: 
Directory: /Users/hyunjaelee/node_modules/@remix-project/remixd/node_modules/fsevents
Output:
node:events:491
      throw er; // Unhandled 'error' event
      ^

Error: spawn node-gyp ENOENT
    at Process.ChildProcess._handle.onexit (node:internal/child_process:285:19)
    at onErrorNT (node:internal/child_process:485:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
    at onErrorNT (node:internal/child_process:485:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn node-gyp',
success Saved lockfile.
warning No license field
success Saved 568 new dependencies.

๐Ÿ† ํ•ด๊ฒฐ

  1. Add this to your package.json file, then re-run yarn (or yarn install): "resolutions": { "fsevents": "1.2.9" }
  2. ์ด๋ ‡๊ฒŒ ํ•˜๋ฉด node-gyp๊ฐ€ ์„ค์น˜๋จ
  3. ๊ทธ๋Ÿฌ๊ณ ๋‚˜์„œ ์œ„์˜ resolutions ๋ถ€๋ถ„์„ ์ œ๊ฑฐํ•˜๊ณ  ๋‹ค์‹œ yarn์„ ์‹คํ–‰ํ•ด์„œ fsevents๋ฅผ ์ตœ์„ ์œผ๋กœ ์žฌ์„ค์น˜
  4. ์•ˆ ๊ทธ๋Ÿฌ๋ฉด "Typeerror: fsevents.watch is not a function" ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ์Œ.

๋กœ์ปฌ ๋งํฌ ๋งŒ๋“ค๊ธฐ

- yarn add /Users/hyunjaelee/work/hardhat-zksync/packages/hardhat-zksync-deploy

npm module upgrade

yarn upgrade hardhat-change-network


NPM publish ์—๋Ÿฌ

npm notice Publishing to https://registry.npmjs.org/
This operation requires a one-time password.
Enter OTP: 978999
npm ERR! code E402
npm ERR! 402 Payment Required - PUT https://registry.npmjs.org/@poohnet%2fpooh-swap-v2-core - You must sign up for private packages

npm ERR! A complete log of this run can be found in:

๐Ÿ† ํ•ด๊ฒฐ npm public --access public์„ ์‚ฌ์šฉํ•ด์•ผ ํ•จ.

/bin/sh: python: command not found

gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3310100/sqlite3.c
/bin/sh: python: command not found
make: *** [Release/obj/gen/sqlite-autoconf-3310100/sqlite3.c] Error 127
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/hyunjaelee/.nvm/versions/node/v16.20.2/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:201:23)
gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12)
gyp ERR! System Darwin 23.0.0
gyp ERR! command \"/Users/hyunjaelee/.nvm/versions/node/v16.20.2/bin/node\" \"/Users/hyunjaelee/.nvm/versions/node/v16.20.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js\" \"build\" \"--fallback-to-build\" \"--module=/Users/hyunjaelee/work/ondo-v1/node_modules/sqlite3/lib/binding/node-v93-darwin-x64/node_sqlite3.node\" \"--module_name=node_sqlite3\" \"--module_path=/Users/hyunjaelee/work/ondo-v1/node_modules/sqlite3/lib/binding/node-v93-darwin-x64\" \"--napi_version=8\" \"--node_abi_napi=napi\" \"--napi_build_version=0\" \"--node_napi_label=node-v93\"
gyp ERR! cwd /Users/hyunjaelee/work/ondo-v1/node_modules/sqlite3
gyp ERR! node -v v16.20.2
gyp ERR! node-gyp -v v9.1.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/Users/hyunjaelee/.nvm/versions/node/v16.20.2/bin/node /Users/hyunjaelee/.nvm/versions/node/v16.20.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/hyunjaelee/work/ondo-v1/node_modules/sqlite3/lib/binding/node-v93-darwin-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/Users/hyunjaelee/work/ondo-v1/node_modules/sqlite3/lib/binding/node-v93-darwin-x64 --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/hyunjaelee/work/ondo-v1/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1100:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
node-pre-gyp ERR! System Darwin 23.0.0
node-pre-gyp ERR! command \"/Users/hyunjaelee/.nvm/versions/node/v16.20.2/bin/node\" \"/Users/hyunjaelee/work/ondo-v1/node_modules/sqlite3/node_modules/.bin/node-pre-gyp\" \"install\" \"--fallback-to-build\"
node-pre-gyp ERR! cwd /Users/hyunjaelee/work/ondo-v1/node_modules/sqlite3
node-pre-gyp ERR! node -v v16.20.2
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok 
โœจ  Done in 44.12s.
โžœ  ondo-v1 git:(main) rm -rf node_modules 
โžœ  ondo-v1 git:(main) yarn
yarn install v1.22.19
[1/4] ๐Ÿ”  Resolving packages...
[2/4] ๐Ÿšš  Fetching packages...
[3/4] ๐Ÿ”—  Linking dependencies...
warning " > @nomiclabs/hardhat-waffle@2.0.1" has incorrect peer dependency "@nomiclabs/hardhat-ethers@^2.0.0".
warning " > @uniswap/sdk@3.0.3" has unmet peer dependency "@ethersproject/address@^5.0.0-beta".
warning " > @uniswap/sdk@3.0.3" has unmet peer dependency "@ethersproject/contracts@^5.0.0-beta".
warning " > @uniswap/sdk@3.0.3" has unmet peer dependency "@ethersproject/networks@^5.0.0-beta".
warning " > @uniswap/sdk@3.0.3" has unmet peer dependency "@ethersproject/providers@^5.0.0-beta".
warning " > @uniswap/sdk@3.0.3" has unmet peer dependency "@ethersproject/solidity@^5.0.0-beta".
warning "hardhat-gas-reporter > eth-gas-reporter@0.2.22" has unmet peer dependency "@codechecks/client@^0.1.0".
warning " > @typechain/ethers-v5@7.1.2" has unmet peer dependency "@ethersproject/bytes@^5.0.0".
warning " > @typechain/ethers-v5@7.1.2" has unmet peer dependency "@ethersproject/providers@^5.0.0".
warning " > @typechain/ethers-v5@7.1.2" has unmet peer dependency "@ethersproject/abi@^5.0.0".
warning " > hardhat-deploy@0.8.9" has unmet peer dependency "@ethersproject/hardware-wallets@^5.0.14".
warning "truffle > @truffle/db > jsondown@1.0.0" has unmet peer dependency "abstract-leveldown@*".
warning "truffle > @truffle/db > graphql-tools > @graphql-tools/links > apollo-upload-client@14.1.2" has unmet peer dependency "subscriptions-transport-ws@^0.9.0".
[4/4] ๐Ÿ”จ  Building fresh packages...
[9/31] โ   keccak
[-/31] โ   waiting...
[19/31] โ   fsevents
[10/31] โ   secp256k1
warning Error running install script for optional dependency: "/Users/hyunjaelee/work/ondo-v1/node_modules/sqlite3: Command failed.
Exit code: 1
Command: node-pre-gyp install --fallback-to-build
Arguments: 
Directory: /Users/hyunjaelee/work/ondo-v1/node_modules/sqlite3
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@0.11.0
node-pre-gyp info using node@16.20.2 | darwin | x64
node-pre-gyp WARN Using request for node-pre-gyp https download 
node-pre-gyp info check checked for \"/Users/hyunjaelee/work/ondo-v1/node_modules/sqlite3/lib/binding/node-v93-darwin-x64/node_sqlite3.node\" (not found)
node-pre-gyp http GET https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.2.0/node-v93-darwin-x64.tar.gz
node-pre-gyp http 403 https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.2.0/node-v93-darwin-x64.tar.gz
node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.2.0/node-v93-darwin-x64.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for sqlite3@4.2.0 and node@16.20.2 (node-v93 ABI, unknown) (falling back to source compile with node-gyp) 
node-pre-gyp http 403 status code downloading tarball https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.2.0/node-v93-darwin-x64.tar.gz 
gyp info it worked if it ends with ok
gyp info using node-gyp@9.1.0
gyp info using node@16.20.2 | darwin | x64
gyp info ok 
gyp info it worked if it ends with ok
gyp info using node-gyp@9.1.0
gyp info using node@16.20.2 | darwin | x64
gyp info find Python using Python version 3.9.6 found at \"/Library/Developer/CommandLineTools/usr/bin/python3\"
gyp info spawn /Library/Developer/CommandLineTools/usr/bin/python3
gyp info spawn args [
gyp info spawn args   '/Users/hyunjaelee/.nvm/versions/node/v16.20.2/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   '/Users/hyunjaelee/work/ondo-v1/node_modules/sqlite3/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/hyunjaelee/.nvm/versions/node/v16.20.2/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/hyunjaelee/Library/Caches/node-gyp/16.20.2/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/hyunjaelee/Library/Caches/node-gyp/16.20.2',
gyp info spawn args   '-Dnode_gyp_dir=/Users/hyunjaelee/.nvm/versions/node/v16.20.2/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/hyunjaelee/Library/Caches/node-gyp/16.20.2/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/hyunjaelee/work/ondo-v1/node_modules/sqlite3',
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 ]
gyp info ok 
gyp info it worked if it ends with ok
gyp info using node-gyp@9.1.0
gyp info using node@16.20.2 | darwin | x64
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  ACTION deps_sqlite3_gyp_action_before_build_target_unpack_sqlite_dep Release/obj/gen/sqlite-autoconf-3310100/sqlite3.c
/bin/sh: python: command not found
make: *** [Release/obj/gen/sqlite-autoconf-3310100/sqlite3.c] Error 127
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/hyunjaelee/.nvm/versions/node/v16.20.2/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:201:23)
gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12)
gyp ERR! System Darwin 23.0.0
gyp ERR! command \"/Users/hyunjaelee/.nvm/versions/node/v16.20.2/bin/node\" \"/Users/hyunjaelee/.nvm/versions/node/v16.20.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js\" \"build\" \"--fallback-to-build\" \"--module=/Users/hyunjaelee/work/ondo-v1/node_modules/sqlite3/lib/binding/node-v93-darwin-x64/node_sqlite3.node\" \"--module_name=node_sqlite3\" \"--module_path=/Users/hyunjaelee/work/ondo-v1/node_modules/sqlite3/lib/binding/node-v93-darwin-x64\" \"--napi_version=8\" \"--node_abi_napi=napi\" \"--napi_build_version=0\" \"--node_napi_label=node-v93\"
gyp ERR! cwd /Users/hyunjaelee/work/ondo-v1/node_modules/sqlite3
gyp ERR! node -v v16.20.2
gyp ERR! node-gyp -v v9.1.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/Users/hyunjaelee/.nvm/versions/node/v16.20.2/bin/node /Users/hyunjaelee/.nvm/versions/node/v16.20.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/hyunjaelee/work/ondo-v1/node_modules/sqlite3/lib/binding/node-v93-darwin-x64/node_sqlite3.node --module_name=node_sqlite3 --module_path=/Users/hyunjaelee/work/ondo-v1/node_modules/sqlite3/lib/binding/node-v93-darwin-x64 --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/hyunjaelee/work/ondo-v1/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1100:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
node-pre-gyp ERR! System Darwin 23.0.0
node-pre-gyp ERR! command \"/Users/hyunjaelee/.nvm/versions/node/v16.20.2/bin/node\" \"/Users/hyunjaelee/work/ondo-v1/node_modules/sqlite3/node_modules/.bin/node-pre-gyp\" \"install\" \"--fallback-to-build\"
node-pre-gyp ERR! cwd /Users/hyunjaelee/work/ondo-v1/node_modules/sqlite3
node-pre-gyp ERR! node -v v16.20.2
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok 

๐Ÿ† ํ•ด๊ฒฐ

brew install python3
which python3
npm config set python /path/to/python

error work/polymath-core/node_modules/sha3: Command failed.

error /Users/hyunjaelee/work/polymath-core/node_modules/sha3: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments: 
Directory: /Users/hyunjaelee/work/polymath-core/node_modules/sha3
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@10.0.1
gyp info using node@21.2.0 | darwin | x64
gyp info find Python using Python version 3.9.6 found at "/Library/Developer/CommandLineTools/usr/bin/python3"

gyp http GET https://nodejs.org/download/release/v21.2.0/node-v21.2.0-headers.tar.gz
gyp http 200 https://nodejs.org/download/release/v21.2.0/node-v21.2.0-headers.tar.gz
gyp http GET https://nodejs.org/download/release/v21.2.0/SHASUMS256.txt
gyp http 200 https://nodejs.org/download/release/v21.2.0/SHASUMS256.txt
gyp info spawn /Library/Developer/CommandLineTools/usr/bin/python3
gyp info spawn args [
gyp info spawn args '/usr/local/Cellar/node/21.2.0/libexec/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 '/Users/hyunjaelee/work/polymath-core/node_modules/sha3/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/usr/local/Cellar/node/21.2.0/libexec/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/hyunjaelee/Library/Caches/node-gyp/21.2.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=/Users/hyunjaelee/Library/Caches/node-gyp/21.2.0',
gyp info spawn args '-Dnode_gyp_dir=/usr/local/Cellar/node/21.2.0/libexec/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/Users/hyunjaelee/Library/Caches/node-gyp/21.2.0/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/Users/hyunjaelee/work/polymath-core/node_modules/sha3',
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 ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CXX(target) Release/obj.target/sha3/src/addon.o
In file included from ../src/addon.cpp:4:
In file included from ../node_modules/nan/nan.h:173:
../node_modules/nan/nan_callbacks.h:55:23: error: no member named 'AccessorSignature' in namespace 'v8'
typedef v8::Local<v8::AccessorSignature> Sig;
                  ~~~~^
In file included from ../src/addon.cpp:4:
../node_modules/nan/nan.h:615:39: warning: 'IdleNotificationDeadline' is deprecated: Use MemoryPressureNotification() to influence the GC schedule. [-Wdeprecated-declarations]
    return v8::Isolate::GetCurrent()->IdleNotificationDeadline(
                                      ^
/Users/hyunjaelee/Library/Caches/node-gyp/21.2.0/include/node/v8-isolate.h:1339:3: note: 'IdleNotificationDeadline' has been explicitly marked deprecated here
  V8_DEPRECATE_SOON(
  ^
/Users/hyunjaelee/Library/Caches/node-gyp/21.2.0/include/node/v8config.h:551:39: note: expanded from macro 'V8_DEPRECATE_SOON'
# define V8_DEPRECATE_SOON(message) [[deprecated(message)]]
                                      ^
In file included from ../src/addon.cpp:4:
../node_modules/nan/nan.h:2470:8: error: no matching member function for call to 'SetAccessor'
  tpl->SetAccessor(
  ~~~~~^~~~~~~~~~~
/Users/hyunjaelee/Library/Caches/node-gyp/21.2.0/include/node/v8-template.h:816:8: note: candidate function not viable: no known conversion from 'imp::Sig' (aka 'int') to 'SideEffectType' for 7th argument
  void SetAccessor(
       ^
/Users/hyunjaelee/Library/Caches/node-gyp/21.2.0/include/node/v8-template.h:809:8: note: candidate function not viable: no known conversion from 'imp::NativeGetter' (aka 'void (*)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value> &)') to 'AccessorGetterCallback' (aka 'void (*)(Local<String>, const PropertyCallbackInfo<Value> &)') for 2nd argument
  void SetAccessor(
       ^
In file included from ../src/addon.cpp:4:
In file included from ../node_modules/nan/nan.h:2818:
../node_modules/nan/nan_typedarray_contents.h:34:43: error: no member named 'GetContents' in 'v8::ArrayBuffer'
      data   = static_cast<char*>(buffer->GetContents().Data()) + byte_offset;
                                  ~~~~~~~~^
In file included from ../src/addon.cpp:9:
In file included from ../src/KeccakNISTInterface.h:17:
../src/KeccakSponge.h:23:9: warning: 'ALIGN' macro redefined [-Wmacro-redefined]
#define ALIGN __attribute__ ((aligned(32)))
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/i386/param.h:85:9: note: previous definition is here
#define ALIGN(p)        __DARWIN_ALIGN(p)
        ^
In file included from ../src/addon.cpp:1:
In file included from /Users/hyunjaelee/Library/Caches/node-gyp/21.2.0/include/node/node.h:73:
In file included from /Users/hyunjaelee/Library/Caches/node-gyp/21.2.0/include/node/v8.h:24:
In file included from /Users/hyunjaelee/Library/Caches/node-gyp/21.2.0/include/node/v8-array-buffer.h:12:
/Users/hyunjaelee/Library/Caches/node-gyp/21.2.0/include/node/v8-local-handle.h:253:5: error: static assertion failed due to requirement 'std::is_base_of<v8::Value, v8::Data>::value': type check
    static_assert(std::is_base_of<T, S>::value, "type check");
    ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan_callbacks_12_inl.h:175:20: note: in instantiation of function template specialization 'v8::Local<v8::Value>::Local<v8::Data>' requested here
      cbinfo(info, obj->GetInternalField(kDataIndex));
                   ^
2 warnings and 4 errors generated.
make: *** [Release/obj.target/sha3/src/addon.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.<anonymous> (/usr/local/Cellar/node/21.2.0/libexec/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:209:23)
gyp ERR! System Darwin 23.0.0
gyp ERR! command "/usr/local/Cellar/node/21.2.0/bin/node" "/usr/local/Cellar/node/21.2.0/libexec/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/hyunjaelee/work/polymath-core/node_modules/sha3

๐Ÿ† ํ•ด๊ฒฐ Node 16 ๋ฒ„์ „์„ ์‚ฌ์šฉํ•จ์œผ๋กœ์จ ํ•ด๊ฒฐ

nvm use 16 

Solidity

function type ๋ฐ”๊พธ๊ธฐ

function _getManifest() internal view returns (PluginManifest memory) {
  PluginManifest memory m = abi.decode(_manifest, (PluginManifest));
  return m;
}

function _castToPure(
  function() internal view returns (PluginManifest memory) fnIn
)
  internal
  pure
  returns (function() internal pure returns (PluginManifest memory) fnOut)
{
  assembly ("memory-safe") {
    fnOut := fnIn
  }
}

function pluginManifest() external pure returns (PluginManifest memory) {
  return _castToPure(_getManifest)();
}

getContractFactory & ContractFactory

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

contract Greeter {
    string internal _greeting;

    constructor(string memory newGreeting) {
        _greeting = newGreeting;
    }

    function setGreeting(string memory newGreeting) public {
        _greeting = newGreeting;
    }

    function greet() public view returns (string memory) {
        return _greeting;
    }
}
import { ethers } from "hardhat";
import { expect } from "chai";
import  Greeter from "../artifacts/contracts/Greeter.sol/Greeter.json";

describe("ContractFactory", function () {
  async function greeterFixture() {
    const [owner, otherAccount] = await ethers.getSigners();
    return { owner, otherAccount };
  }

  it("Should return the new contract instance", async function () {
    const Factory = await ethers.getContractFactory("Greeter");
    const greeter = await Factory.deploy("Hello, Hardhat!");

    console.log("Greeter deployed to:", greeter.target);

    expect(await greeter.greet()).to.equal("Hello, Hardhat!");
  });

  it("Should create a new contract instance with ethers.ContractFactory", async function () {
    const { owner } = await greeterFixture();
    const greeter = await new ethers.ContractFactory(
      Greeter.abi, Greeter.bytecode, owner).
      deploy("Hello, Hardhat!");

    const contract = await ethers.getContractAt('Greeter', greeter.target, owner);
    expect(await contract.greet()).to.equal("Hello, Hardhat!");
  });
});

Smart Contract/Hardhat

๐ŸŒŸ๐Ÿ“๐Ÿฆ‹โšพ๏ธ๐Ÿณ๐Ÿ€๐ŸŒผ๐ŸŒธ๐Ÿ†๐Ÿœ๐Ÿ˜ˆ๐Ÿถ๐Ÿฆ„โ˜•๏ธ๐Ÿš˜โ€ป

Hardhat config defaultNetwork

์ฐธ๊ณ : https://github.com/poohgithub/zksync-era/blob/main/poohnet/paymaster-examples/contracts/hardhat.config.ts


create2 ํ•จ์ˆ˜

์•„๋ž˜ ํ•จ์ˆ˜๋Š” UniswapV2Factory์—์„œ ์‚ฌ์šฉ๋˜๋Š” ์ฝ”๋“œ์ž„

bytes memory bytecode = type(UniswapV2Pair).creationCode;
bytes32 salt = keccak256(abi.encodePacked(token0, token1));
assembly {
    pair := create2(0, add(bytecode, 32), mload(bytecode), salt)
}

Unlike create, which generates the contract address based on the address of the creator and how many contracts it has created (nonce), create2 generates the address using the creator's address, a provided salt, and the hash of the initialization code. This allows for predictable computation of the contract's address before the contract is actually deployed.


ํŠธ๋žœ์žญ์…˜ ์ทจ์†Œํ•˜๋Š” ๋ฐฉ๋ฒ•


Nonce ์–ป์–ด๋‚ด๊ธฐ


Type error: Cannot find module '../typechain-types' or its corresponding type declarations.

๊ทธ๋ƒฅ typechain-types ํด๋”๋ฅผ ์“ฐ์ง€ ์•Š๊ธฐ๋กœ ํ•จ


Error HH412: Invalid import

Error HH412: Invalid import @poohnet/pooh-swap-v2-core/contracts/interfaces/IUniswapV2Factory.sol from contracts/periphery/UniswapV2Router01.sol. Trying to import file using the own package's name.

Error: network does not support ENS

๋‹ค์Œ๊ณผ ๊ฐ™์ด VAULT_CONTRACT ์ฃผ์†Œ ์ž˜๋ชป๋จ, ์ฆ‰, 0x๊ฐ€ ๋‘๋ฒˆ ์“ฐ์ด๊ณ  ์žˆ์—ˆ์Œ. VAULT_CONTRACT=0x0x7f28F281d57AC7d99A8C2FAd2d37271c2c9c67D6


L1-governance ๋ฐฐํฌ ์—๋Ÿฌ

L1-governance git:(main) โœ— yarn hardhat run --network localnet ./scripts/deploy.ts 
yarn run v1.22.19
warning package.json: No license field
$ /Users/hyunjaelee/work/tutorials/L1-governance/node_modules/.bin/hardhat run --network localnet ./scripts/deploy.ts
TypeError: (0 , ethers_1.getAddress) is not a function

๐Ÿ† ๋‹ค์Œ์˜ ์„ธ๋‹จ๊ณ„ ํ•„์š”

  1. yarn add --dev hardhat @nomiclabs/hardhat-ethers@npm:hardhat-deploy-ethers ethers
  2. const deployed = await contract.waitForDeployment();
  3. console.log(Governance contract was successfully deployed at ${await deployed.getAddress()});

๐Ÿ† ์›์ธ

wait ํ•จ์ˆ˜์˜ ์ธ์ž

The wait() function of ContractTransaction takes a single optional argument, which is the timeout in blocks. The default timeout is 10 blocks. This means that the wait() function will block for up to 10 blocks before throwing an error if the transaction has not been confirmed. You can increase the timeout period by passing a higher number to the wait() function. For example, the following code will block for up to 20 blocks before throwing an error:

Contract Size

https://ethereum.stackexchange.com/questions/31515/how-to-check-the-size-of-a-contract-in-solidity

Exceeds Gas Limit ์—๋Ÿฌ

Error: Error: processing response error (body="{\"jsonrpc\":\"2.0\",\"id\":151,\"error\":{\"code\":-32000,\"message\":\"exceeds block gas limit\"}}\n", error={"code":-32000}, requestBody="{\"method\":\"eth_sendRawTransaction\",\"params\":[\"0x02f90fd382300d0284461bffd584461bffd58398968094572b9410d9a14fa729f3af92cb83a07aaa472de080b90f644af63f020000000000000000000000000000000000000000000000000000000000000040fe07c7c6f88cdf003f00c1e47076de3576e136c7114496823271143b3d46e97e0000000000000000000000000000000000000000000000000000000000000ef9608060405234801561001057600080fd5b50610ed9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e1461025a578063bce38bd714610275578063c3077fa914610288578063ee82ac5e1461029b57600080fd5b80634d2301cc146101ec57806372425d9d1461022157806382ad56cb1461023457806386d516e81461024757600080fd5b80633408e470116100c65780633408e47014610191578063399542e9146101a45780633e64a696146101c657806342cbb15c146101d957600080fd5b80630f28c97d146100f8578063174dea711461011a578063252dba421461013a57806327e86d6e1461015b575b600080fd5b34801561010457600080fd5b50425b6040519081526020015b60405180910390f35b61012d610128366004610a85565b6102ba565b6040516101119190610bb7565b61014d610148366004610a85565b6104ef565b604051610111929190610bd1565b34801561016757600080fd5b50437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0140610107565b34801561019d57600080fd5b5046610107565b6101b76101b2366004610c59565b610690565b60405161011193929190610cb3565b3480156101d257600080fd5b5048610107565b3480156101e557600080fd5b5043610107565b3480156101f857600080fd5b50610107610207366004610cdb565b73ffffffffffffffffffffffffffffffffffffffff163190565b34801561022d57600080fd5b5044610107565b61012d610242366004610a85565b6106ab565b34801561025357600080fd5b5045610107565b34801561026657600080fd5b50604051418152602001610111565b61012d610283366004610c59565b61085a565b6101b7610296366004610a85565b610a1a565b3480156102a757600080fd5b506101076102b6366004610d11565b4090565b60606000828067ffffffffffffffff8111156102d8576102d8610d2a565b60405190808252806020026020018201604052801561031e57816020015b6040805180820190915260008152606060208201528152602001906001900390816102f65790505b5092503660005b8281101561047757600085828151811061034157610341610d59565b6020026020010151905087878381811061035d5761035d610d59565b905060200281019061036f9190610d88565b6040810135958601959093506103886020850185610cdb565b73ffffffffffffffffffffffffffffffffffffffff16816103ac6060870187610dc6565b6040516103ba929190610e2b565b60006040518083038185875af1925050503d80600081146103f7576040519150601f19603f3d011682016040523d82523d6000602084013e6103fc565b606091505b50602080850191909152901515808452908501351761046d577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b5050600101610325565b508234146104e6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4d756c746963616c6c333a2076616c7565206d69736d6174636800000000000060448201526064015b60405180910390fd5b50505092915050565b436060828067ffffffffffffffff81111561050c5761050c610d2a565b60405190808252806020026020018201604052801561053f57816020015b606081526020019060019003908161052a5790505b5091503660005b8281101561068657600087878381811061056257610562610d59565b90506020028101906105749190610e3b565b92506105836020840184610cdb565b73ffffffffffffffffffffffffffffffffffffffff166105a66020850185610dc6565b6040516105b4929190610e2b565b6000604051808303816000865af19150503d80600081146105f1576040519150601f19603f3d011682016040523d82523d6000602084013e6105f6565b606091505b5086848151811061060957610609610d59565b602090810291909101015290508061067d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060448201526064016104dd565b50600101610546565b5050509250929050565b43804060606106a086868661085a565b905093509350939050565b6060818067ffffffffffffffff8111156106c7576106c7610d2a565b60405190808252806020026020018201604052801561070d57816020015b6040805180820190915260008152606060208201528152602001906001900390816106e55790505b5091503660005b828110156104e657600084828151811061073057610730610d59565b6020026020010151905086868381811061074c5761074c610d59565b905060200281019061075e9190610e6f565b925061076d6020840184610cdb565b73ffffffffffffffffffffffffffffffffffffffff166107906040850185610dc6565b60405161079e929190610e2b565b6000604051808303816000865af19150503d80600081146107db576040519150601f19603f3d011682016040523d82523d6000602084013e6107e0565b606091505b506020808401919091529015158083529084013517610851577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b50600101610714565b6060818067ffffffffffffffff81111561087657610876610d2a565b6040519080825280602002602001820160405280156108bc57816020015b6040805180820190915260008152606060208201528152602001906001900390816108945790505b5091503660005b82811015610a105760008482815181106108df576108df610d59565b602002602001015190508686838181106108fb576108fb610d59565b905060200281019061090d9190610e3b565b925061091c6020840184610cdb565b73ffffffffffffffffffffffffffffffffffffffff1661093f6020850185610dc6565b60405161094d929190610e2b565b6000604051808303816000865af19150503d806000811461098a576040519150601f19603f3d011682016040523d82523d6000602084013e61098f565b606091505b506020830152151581528715610a07578051610a07576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060448201526064016104dd565b506001016108c3565b5050509392505050565b6000806060610a2b60018686610690565b919790965090945092505050565b60008083601f840112610a4b57600080fd5b50813567ffffffffffffffff811115610a6357600080fd5b6020830191508360208260051b8501011115610a7e57600080fd5b9250929050565b60008060208385031215610a9857600080fd5b823567ffffffffffffffff811115610aaf57600080fd5b610abb85828601610a39565b90969095509350505050565b6000815180845260005b81811015610aed57602081850181015186830182015201610ad1565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b84811015610baa578583037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001895281518051151584528401516040858501819052610b9681860183610ac7565b9a86019a9450505090830190600101610b48565b5090979650505050505050565b602081526000610bca6020830184610b2b565b9392505050565b600060408201848352602060408185015281855180845260608601915060608160051b870101935082870160005b82811015610c4b577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa0888703018452610c39868351610ac7565b95509284019290840190600101610bff565b509398975050505050505050565b600080600060408486031215610c6e57600080fd5b83358015158114610c7e57600080fd5b9250602084013567ffffffffffffffff811115610c9a57600080fd5b610ca686828701610a39565b9497909650939450505050565b838152826020820152606060408201526000610cd26060830184610b2b565b95945050505050565b600060208284031215610ced57600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610bca57600080fd5b600060208284031215610d2357600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81833603018112610dbc57600080fd5b9190910192915050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112610dfb57600080fd5b83018035915067ffffffffffffffff821115610e1657600080fd5b602001915036819003821315610a7e57600080fd5b8183823760009101908152919050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc1833603018112610dbc57600080fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa1833603018112610dbc57600080fdfea2646970667358221220eca0cb14f4322010c8eb410ba0738474f94c966328e9db21a580ada159aa6c8564736f6c6343000811003300000000000000c080a086a949d9a5e6c0fca3315b4363c12e9a3953b20445bf0fbe3f659212e7792c92a02e2e4680f844eab38c40aa61874bc199fc45d96ac3d91fe668039df54e060786\"],\"id\":151,\"jsonrpc\":\"2.0\"}", requestMethod="POST", url="http://localhost:8545", code=SERVER_ERROR, version=web/5.7.1)
    at Logger.makeError (/Users/hyunjaelee/work/zksync-era/node_modules/@ethersproject/logger/src.ts/index.ts:269:28)
    at Logger.throwError (/Users/hyunjaelee/work/zksync-era/node_modules/@ethersproject/logger/src.ts/index.ts:281:20)
    at /Users/hyunjaelee/work/zksync-era/node_modules/@ethersproject/web/src.ts/index.ts:341:28
    at step (/Users/hyunjaelee/work/zksync-era/node_modules/@ethersproject/web/lib/index.js:33:23)
    at Object.next (/Users/hyunjaelee/work/zksync-era/node_modules/@ethersproject/web/lib/index.js:14:53)
    at fulfilled (/Users/hyunjaelee/work/zksync-era/node_modules/@ethersproject/web/lib/index.js:5:58)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  reason: 'processing response error',
  code: 'SERVER_ERROR',
  body: '{"jsonrpc":"2.0","id":151,"error":{"code":-32000,"message":"exceeds block gas limit"}}\n',
  error: Error: exceeds block gas limit
      at getResult (/Users/hyunjaelee/work/zksync-era/node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:142:28)
      at processJsonFunc (/Users/hyunjaelee/work/zksync-era/node_modules/@ethersproject/web/src.ts/index.ts:383:22)
      at /Users/hyunjaelee/work/zksync-era/node_modules/@ethersproject/web/src.ts/index.ts:320:42
      at step (/Users/hyunjaelee/work/zksync-era/node_modules/@ethersproject/web/lib/index.js:33:23)
      at Object.next (/Users/hyunjaelee/work/zksync-era/node_modules/@ethersproject/web/lib/index.js:14:53)
      at fulfilled (/Users/hyunjaelee/work/zksync-era/node_modules/@ethersproject/web/lib/index.js:5:58)
      at processTicksAndRejections (node:internal/process/task_queues:96:5) {
    code: -32000,
    data: undefined
  },
  requestBody: '{"method":"eth_sendRawTransaction","params":["0x02f90fd382300d0284461bffd584461bffd58398968094572b9410d9a14fa729f3af92cb83a07aaa472de080b90f644af63f020000000000000000000000000000000000000000000000000000000000000040fe07c7c6f88cdf003f00c1e47076de3576e136c7114496823271143b3d46e97e0000000000000000000000000000000000000000000000000000000000000ef9608060405234801561001057600080fd5b50610ed9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e1461025a578063bce38bd714610275578063c3077fa914610288578063ee82ac5e1461029b57600080fd5b80634d2301cc146101ec57806372425d9d1461022157806382ad56cb1461023457806386d516e81461024757600080fd5b80633408e470116100c65780633408e47014610191578063399542e9146101a45780633e64a696146101c657806342cbb15c146101d957600080fd5b80630f28c97d146100f8578063174dea711461011a578063252dba421461013a57806327e86d6e1461015b575b600080fd5b34801561010457600080fd5b50425b6040519081526020015b60405180910390f35b61012d610128366004610a85565b6102ba565b6040516101119190610bb7565b61014d610148366004610a85565b6104ef565b604051610111929190610bd1565b34801561016757600080fd5b50437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0140610107565b34801561019d57600080fd5b5046610107565b6101b76101b2366004610c59565b610690565b60405161011193929190610cb3565b3480156101d257600080fd5b5048610107565b3480156101e557600080fd5b5043610107565b3480156101f857600080fd5b50610107610207366004610cdb565b73ffffffffffffffffffffffffffffffffffffffff163190565b34801561022d57600080fd5b5044610107565b61012d610242366004610a85565b6106ab565b34801561025357600080fd5b5045610107565b34801561026657600080fd5b50604051418152602001610111565b61012d610283366004610c59565b61085a565b6101b7610296366004610a85565b610a1a565b3480156102a757600080fd5b506101076102b6366004610d11565b4090565b60606000828067ffffffffffffffff8111156102d8576102d8610d2a565b60405190808252806020026020018201604052801561031e57816020015b6040805180820190915260008152606060208201528152602001906001900390816102f65790505b5092503660005b8281101561047757600085828151811061034157610341610d59565b6020026020010151905087878381811061035d5761035d610d59565b905060200281019061036f9190610d88565b6040810135958601959093506103886020850185610cdb565b73ffffffffffffffffffffffffffffffffffffffff16816103ac6060870187610dc6565b6040516103ba929190610e2b565b60006040518083038185875af1925050503d80600081146103f7576040519150601f19603f3d011682016040523d82523d6000602084013e6103fc565b606091505b50602080850191909152901515808452908501351761046d577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b5050600101610325565b508234146104e6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4d756c746963616c6c333a2076616c7565206d69736d6174636800000000000060448201526064015b60405180910390fd5b50505092915050565b436060828067ffffffffffffffff81111561050c5761050c610d2a565b60405190808252806020026020018201604052801561053f57816020015b606081526020019060019003908161052a5790505b5091503660005b8281101561068657600087878381811061056257610562610d59565b90506020028101906105749190610e3b565b92506105836020840184610cdb565b73ffffffffffffffffffffffffffffffffffffffff166105a66020850185610dc6565b6040516105b4929190610e2b565b6000604051808303816000865af19150503d80600081146105f1576040519150601f19603f3d011682016040523d82523d6000602084013e6105f6565b606091505b5086848151811061060957610609610d59565b602090810291909101015290508061067d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060448201526064016104dd565b50600101610546565b5050509250929050565b43804060606106a086868661085a565b905093509350939050565b6060818067ffffffffffffffff8111156106c7576106c7610d2a565b60405190808252806020026020018201604052801561070d57816020015b6040805180820190915260008152606060208201528152602001906001900390816106e55790505b5091503660005b828110156104e657600084828151811061073057610730610d59565b6020026020010151905086868381811061074c5761074c610d59565b905060200281019061075e9190610e6f565b925061076d6020840184610cdb565b73ffffffffffffffffffffffffffffffffffffffff166107906040850185610dc6565b60405161079e929190610e2b565b6000604051808303816000865af19150503d80600081146107db576040519150601f19603f3d011682016040523d82523d6000602084013e6107e0565b606091505b506020808401919091529015158083529084013517610851577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b50600101610714565b6060818067ffffffffffffffff81111561087657610876610d2a565b6040519080825280602002602001820160405280156108bc57816020015b6040805180820190915260008152606060208201528152602001906001900390816108945790505b5091503660005b82811015610a105760008482815181106108df576108df610d59565b602002602001015190508686838181106108fb576108fb610d59565b905060200281019061090d9190610e3b565b925061091c6020840184610cdb565b73ffffffffffffffffffffffffffffffffffffffff1661093f6020850185610dc6565b60405161094d929190610e2b565b6000604051808303816000865af19150503d806000811461098a576040519150601f19603f3d011682016040523d82523d6000602084013e61098f565b606091505b506020830152151581528715610a07578051610a07576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060448201526064016104dd565b506001016108c3565b5050509392505050565b6000806060610a2b60018686610690565b919790965090945092505050565b60008083601f840112610a4b57600080fd5b50813567ffffffffffffffff811115610a6357600080fd5b6020830191508360208260051b8501011115610a7e57600080fd5b9250929050565b60008060208385031215610a9857600080fd5b823567ffffffffffffffff811115610aaf57600080fd5b610abb85828601610a39565b90969095509350505050565b6000815180845260005b81811015610aed57602081850181015186830182015201610ad1565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b84811015610baa578583037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001895281518051151584528401516040858501819052610b9681860183610ac7565b9a86019a9450505090830190600101610b48565b5090979650505050505050565b602081526000610bca6020830184610b2b565b9392505050565b600060408201848352602060408185015281855180845260608601915060608160051b870101935082870160005b82811015610c4b577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa0888703018452610c39868351610ac7565b95509284019290840190600101610bff565b509398975050505050505050565b600080600060408486031215610c6e57600080fd5b83358015158114610c7e57600080fd5b9250602084013567ffffffffffffffff811115610c9a57600080fd5b610ca686828701610a39565b9497909650939450505050565b838152826020820152606060408201526000610cd26060830184610b2b565b95945050505050565b600060208284031215610ced57600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610bca57600080fd5b600060208284031215610d2357600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81833603018112610dbc57600080fd5b9190910192915050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112610dfb57600080fd5b83018035915067ffffffffffffffff821115610e1657600080fd5b602001915036819003821315610a7e57600080fd5b8183823760009101908152919050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc1833603018112610dbc57600080fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa1833603018112610dbc57600080fdfea2646970667358221220eca0cb14f4322010c8eb410ba0738474f94c966328e9db21a580ada159aa6c8564736f6c6343000811003300000000000000c080a086a949d9a5e6c0fca3315b4363c12e9a3953b20445bf0fbe3f659212e7792c92a02e2e4680f844eab38c40aa61874bc199fc45d96ac3d91fe668039df54e060786"],"id":151,"jsonrpc":"2.0"}',
  requestMethod: 'POST',
  url: 'http://localhost:8545',
  transaction: {
    type: 2,
    chainId: 12301,
    nonce: 2,
    maxPriorityFeePerGas: BigNumber { _hex: '0x461bffd5', _isBigNumber: true },
    maxFeePerGas: BigNumber { _hex: '0x461bffd5', _isBigNumber: true },
    gasPrice: null,
    gasLimit: BigNumber { _hex: '0x989680', _isBigNumber: true },
    to: '0x572b9410D9a14Fa729F3af92cB83A07aaA472dE0',
    value: BigNumber { _hex: '0x00', _isBigNumber: true },
    data: '0x4af63f020000000000000000000000000000000000000000000000000000000000000040fe07c7c6f88cdf003f00c1e47076de3576e136c7114496823271143b3d46e97e0000000000000000000000000000000000000000000000000000000000000ef9608060405234801561001057600080fd5b50610ed9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e1461025a578063bce38bd714610275578063c3077fa914610288578063ee82ac5e1461029b57600080fd5b80634d2301cc146101ec57806372425d9d1461022157806382ad56cb1461023457806386d516e81461024757600080fd5b80633408e470116100c65780633408e47014610191578063399542e9146101a45780633e64a696146101c657806342cbb15c146101d957600080fd5b80630f28c97d146100f8578063174dea711461011a578063252dba421461013a57806327e86d6e1461015b575b600080fd5b34801561010457600080fd5b50425b6040519081526020015b60405180910390f35b61012d610128366004610a85565b6102ba565b6040516101119190610bb7565b61014d610148366004610a85565b6104ef565b604051610111929190610bd1565b34801561016757600080fd5b50437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0140610107565b34801561019d57600080fd5b5046610107565b6101b76101b2366004610c59565b610690565b60405161011193929190610cb3565b3480156101d257600080fd5b5048610107565b3480156101e557600080fd5b5043610107565b3480156101f857600080fd5b50610107610207366004610cdb565b73ffffffffffffffffffffffffffffffffffffffff163190565b34801561022d57600080fd5b5044610107565b61012d610242366004610a85565b6106ab565b34801561025357600080fd5b5045610107565b34801561026657600080fd5b50604051418152602001610111565b61012d610283366004610c59565b61085a565b6101b7610296366004610a85565b610a1a565b3480156102a757600080fd5b506101076102b6366004610d11565b4090565b60606000828067ffffffffffffffff8111156102d8576102d8610d2a565b60405190808252806020026020018201604052801561031e57816020015b6040805180820190915260008152606060208201528152602001906001900390816102f65790505b5092503660005b8281101561047757600085828151811061034157610341610d59565b6020026020010151905087878381811061035d5761035d610d59565b905060200281019061036f9190610d88565b6040810135958601959093506103886020850185610cdb565b73ffffffffffffffffffffffffffffffffffffffff16816103ac6060870187610dc6565b6040516103ba929190610e2b565b60006040518083038185875af1925050503d80600081146103f7576040519150601f19603f3d011682016040523d82523d6000602084013e6103fc565b606091505b50602080850191909152901515808452908501351761046d577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b5050600101610325565b508234146104e6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4d756c746963616c6c333a2076616c7565206d69736d6174636800000000000060448201526064015b60405180910390fd5b50505092915050565b436060828067ffffffffffffffff81111561050c5761050c610d2a565b60405190808252806020026020018201604052801561053f57816020015b606081526020019060019003908161052a5790505b5091503660005b8281101561068657600087878381811061056257610562610d59565b90506020028101906105749190610e3b565b92506105836020840184610cdb565b73ffffffffffffffffffffffffffffffffffffffff166105a66020850185610dc6565b6040516105b4929190610e2b565b6000604051808303816000865af19150503d80600081146105f1576040519150601f19603f3d011682016040523d82523d6000602084013e6105f6565b606091505b5086848151811061060957610609610d59565b602090810291909101015290508061067d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060448201526064016104dd565b50600101610546565b5050509250929050565b43804060606106a086868661085a565b905093509350939050565b6060818067ffffffffffffffff8111156106c7576106c7610d2a565b60405190808252806020026020018201604052801561070d57816020015b6040805180820190915260008152606060208201528152602001906001900390816106e55790505b5091503660005b828110156104e657600084828151811061073057610730610d59565b6020026020010151905086868381811061074c5761074c610d59565b905060200281019061075e9190610e6f565b925061076d6020840184610cdb565b73ffffffffffffffffffffffffffffffffffffffff166107906040850185610dc6565b60405161079e929190610e2b565b6000604051808303816000865af19150503d80600081146107db576040519150601f19603f3d011682016040523d82523d6000602084013e6107e0565b606091505b506020808401919091529015158083529084013517610851577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b50600101610714565b6060818067ffffffffffffffff81111561087657610876610d2a565b6040519080825280602002602001820160405280156108bc57816020015b6040805180820190915260008152606060208201528152602001906001900390816108945790505b5091503660005b82811015610a105760008482815181106108df576108df610d59565b602002602001015190508686838181106108fb576108fb610d59565b905060200281019061090d9190610e3b565b925061091c6020840184610cdb565b73ffffffffffffffffffffffffffffffffffffffff1661093f6020850185610dc6565b60405161094d929190610e2b565b6000604051808303816000865af19150503d806000811461098a576040519150601f19603f3d011682016040523d82523d6000602084013e61098f565b606091505b506020830152151581528715610a07578051610a07576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060448201526064016104dd565b506001016108c3565b5050509392505050565b6000806060610a2b60018686610690565b919790965090945092505050565b60008083601f840112610a4b57600080fd5b50813567ffffffffffffffff811115610a6357600080fd5b6020830191508360208260051b8501011115610a7e57600080fd5b9250929050565b60008060208385031215610a9857600080fd5b823567ffffffffffffffff811115610aaf57600080fd5b610abb85828601610a39565b90969095509350505050565b6000815180845260005b81811015610aed57602081850181015186830182015201610ad1565b5060006020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b600082825180855260208086019550808260051b84010181860160005b84811015610baa578583037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001895281518051151584528401516040858501819052610b9681860183610ac7565b9a86019a9450505090830190600101610b48565b5090979650505050505050565b602081526000610bca6020830184610b2b565b9392505050565b600060408201848352602060408185015281855180845260608601915060608160051b870101935082870160005b82811015610c4b577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa0888703018452610c39868351610ac7565b95509284019290840190600101610bff565b509398975050505050505050565b600080600060408486031215610c6e57600080fd5b83358015158114610c7e57600080fd5b9250602084013567ffffffffffffffff811115610c9a57600080fd5b610ca686828701610a39565b9497909650939450505050565b838152826020820152606060408201526000610cd26060830184610b2b565b95945050505050565b600060208284031215610ced57600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610bca57600080fd5b600060208284031215610d2357600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81833603018112610dbc57600080fd5b9190910192915050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112610dfb57600080fd5b83018035915067ffffffffffffffff821115610e1657600080fd5b602001915036819003821315610a7e57600080fd5b8183823760009101908152919050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc1833603018112610dbc57600080fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa1833603018112610dbc57600080fdfea2646970667358221220eca0cb14f4322010c8eb410ba0738474f94c966328e9db21a580ada159aa6c8564736f6c6343000811003300000000000000',
    accessList: [],
    hash: '0x7893259b825674bcb88e9fe491b4390d5f70b8a807cdc57169470db07f431c6c',
    v: 0,
    r: '0x86a949d9a5e6c0fca3315b4363c12e9a3953b20445bf0fbe3f659212e7792c92',
    s: '0x2e2e4680f844eab38c40aa61874bc199fc45d96ac3d91fe668039df54e060786',
    from: '0x52312AD6f01657413b2eaE9287f6B9ADaD93D5FE',
    confirmations: 0
  },
  transactionHash: '0x7893259b825674bcb88e9fe491b4390d5f70b8a807cdc57169470db07f431c6c'
}
error Command failed with exit code 1.

hardhat-gas-reporter

hardhat.config.ts ์ฐธ๊ณ : https://github.com/poohgithub/zksync-era/blob/main/poohnet/paymaster-examples/contracts/hardhat.config.ts


Git

๐ŸŒŸ๐Ÿ“๐Ÿฆ‹โšพ๏ธ๐Ÿณ๐Ÿ€๐ŸŒผ๐ŸŒธ๐Ÿ†๐Ÿœ๐Ÿ˜ˆ๐Ÿถ๐Ÿฆ„โ˜•๏ธ๐Ÿš˜โ€ป

error: cannot run delta: No such file or directory

๐Ÿ† ํ•ด๊ฒฐ

brew install git-delta
sudo apt install git-extras

์ด๋ ‡๊ฒŒ ํ•ด๋„ git diff๋Š” ์•ˆ๋˜๊ธฐ ๋•Œ๋ฌธ์— git-delta ๋ช…๋ น๋งŒ ์‚ฌ์šฉํ•˜๊ธฐ

fatal: Not possible to fast-forward, aborting.

๐Ÿ† ํ•ด๊ฒฐ

git fetch origin
git rebase origin/main

Dev Errors

๐ŸŒŸ๐Ÿ“๐Ÿฆ‹โšพ๏ธ๐Ÿณ๐Ÿ€๐ŸŒผ๐ŸŒธ๐Ÿ†๐Ÿœ๐Ÿ˜ˆ๐Ÿถ๐Ÿฆ„โ˜•๏ธ๐Ÿš˜โ€ป

failed to compute cache key: "/target/debug/zksync_server" not found: not found

Error: Child process exited with code 1

๐Ÿ† ํ•ด๊ฒฐ


Errors

1. Error: VM Exception while processing transaction: reverted with panic code 0x11 (Arithmetic operation underflowed or overflowed outside of an unchecked block)

2. Error: cannot estimate gas; transaction may fail or may require manual gas limit (error="Error: VM Exception while processing transaction: reverted with reason string 'E004'"

Error: cannot estimate gas; transaction may fail or may require manual gas limit (error="Error: VM Exception while processing transaction: reverted with reason string 'E004'", tx={"data":"0x1e28886e3a38e54d9c9b01a63cae0476c624f670359871e7b1463a777cba3247240e31fd76129d005b6f526cbaaf1e1e37494d8091c109bfcf47881a612190af683c1e27000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000412dcb94cce59dd93b63aae7cedc6f7f0b64083b6a29b6f8ce403b2b8f862d8a5a17a797b880310346766ca58d2b9a01b4060b3bfcd7ad02c9aec7da9cd41f77431b00000000000000000000000000000000000000000000000000000000000000","to":{},"from":"0x0e1eE98EDF5BDbc5caaFed491526A0Cd3eD31fad","type":2,"maxFeePerGas":{"type":"BigNumber","hex":"0xa650c80c"},"maxPriorityFeePerGas":{"type":"BigNumber","hex":"0x9502f900"},"nonce":{},"gasLimit":{},"chainId":{}}, code=UNPREDICTABLE_GAS_LIMIT, version=abstract-signer/5.5.0)

3. Error: cannot estimate gas; transaction may fail or may require manual gas limit

Error: cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ] (error={"reason":"VM Exception while processing transaction: reverted with reason string 'E000'","code":"UNPREDICTABLE_GAS_LIMIT","method":"estimateGas","transaction":{"from":"0x3287f4b4953471234DbeAFf7d2F9EA58dFedD7fd","maxPriorityFeePerGas":{"type":"BigNumber","hex":"0x59682f00"},"maxFeePerGas":{"type":"BigNumber","hex":"0xa80d7dfe"},"to":"0xeEdC2Ac65dF232AB6d229EBD4E3F564e194ffe7D","value":{"type":"BigNumber","hex":"0x056bc75e2d63100000"},

4. AssertionError: Expected transaction to be reverted with E001, but other exception was thrown: RangeError: Maximum call stack size exceeded

a. typechain ๋ชจ๋“ˆ ์—…๊ทธ๋ ˆ์ด๋“œ
b. ์ด ์ปค๋ฐ‹ ์ฐธ์กฐ

5. TypeError: Cannot read property 'eth' of undefined [closed]

โ—‹ ์ด ์ฝ”๋“œ ์‹คํ–‰์‹œ ๋ฐœ์ƒ
	ยง hre.web3.eth.accounts.decrypt(data,"boa2022!@");
โ—‹ ๋‹ค์Œ ์„ค์น˜ ํ•„์š”
	ยง npm install -s web3
	ยง npm install -s @nomiclabs/hardhat-web3
โ—‹ hardhat.config.ts์—์„œ ๋‹ค์Œ ์ถ”๊ฐ€
	ยง import"@nomiclabs/hardhat-web3";
โ—‹ ๊ฒฐ๊ตญ hardhat๊ณผ web3๋ฅผ ์—ฐ๊ฒฐํ•˜๋Š” ์ž‘์—…์ด ํ•„์š”ํ•จ.

6. HardhatError: HH103: Account 0x3e29aefa7af16625691a9fca4a7fff0624aabc6f is not managed by the node you are connected to.

hardhat.config.ts์˜ getAccountsํ•จ์ˆ˜์— ํ•ด๋‹น ๊ณ„์ขŒ๋ฅผ ์ถ”๊ฐ€ํ•ด์•ผํ•จ.

ยง accounts:[process.env.ADMIN_KEY||"",process.env.VOTE_KEY||"",process.env.USER_KEY||"",process.env.MANAGER_KEY||""],

7. docker: Got permission denied while trying to connect to the Docker daemon socket

1.Create the docker group if it does not exist
$ sudo groupadd docker
2.Add your user to the docker group.
$ sudo usermod -aG docker $USER
3.Run the following command or Logout and login again and run (that doesn't work you may need to reboot your machine first)
$ newgrp docker

8. Authority๋…ธ๋“œ๋ฅผ ์‹คํ–‰์‹œํ‚ฌ๋•Œ, block number๊ฐ€ ๋Š˜์–ด๋‚˜์ง€ ์•Š์„๋•Œ

self=enode://6d59a1ce195d9251e8f5234b3dbd486cf15eeac6cb8199898af3e11b9b7f5c54e334317d1cc3ab8077360383bc08b8aa93299ccb169b55dbea59414847dbce2d@127.0.0.1:30303

9. Merge pull request #1 from linked0/initial-code

ยฎ ๋‘๋ฒˆ์งธ ์ปค๋ฐ‹์€ <Hyunjae Lee>์ด๊ณ , ์„ธ๋ฒˆ์งธ ์ปค๋ฐ‹์€ <Jay>๋กœ ๋˜์–ด ์žˆ์Œ.

10. ์ด๋ฏธ ์ž„ํฌํŠธ๋œ ๊ณ„์ •์ด ์žˆ๋Š”๋ฐ ๋‹ค์‹œ ์ž„ํฌํŠธ๋ฅผ ํ•˜๋ ค๊ณ ํ•  ๋•Œ ์—๋Ÿฌ๊ฐ€ ๋œจ๋Š”๋ฐ ๊ด€๋ จ ์„ค๋ช…

Imported Accounts are accounts you import using a private key string or a private key JSON file, and were not created with the same Secret Recovery Phrase as your wallet and accounts. For this reason, these accounts will not appear automatically when you restore your MetaMask account with your Secret Recovery Phrase. The data associated with your MetaMask Secret Recovery Phrase cannot be added or extended to the imported account.

11. An unexpected error occurred:

Error: Cannot find module './IERC165__factory' โ€ข ํ•ด๊ฒฐ: typechain-types์™€ artifacts ํด๋” ์‚ญ์ œ โ€ข ์ƒ์„ธ ๋‚ด์šฉ

Require stack:
- /Users/hyunjaelee/work/commons-budget-contract/typechain-types/factories/@openzeppelin/contracts/utils/introspection/index.ts
- /Users/hyunjaelee/work/commons-budget-contract/typechain-types/factories/@openzeppelin/contracts/utils/index.ts
- /Users/hyunjaelee/work/commons-budget-contract/typechain-types/factories/@openzeppelin/contracts/index.ts
- /Users/hyunjaelee/work/commons-budget-contract/typechain-types/factories/@openzeppelin/index.ts
- /Users/hyunjaelee/work/commons-budget-contract/typechain-types/factories/index.ts
- /Users/hyunjaelee/work/commons-budget-contract/typechain-types/index.ts
- /Users/hyunjaelee/work/commons-budget-contract/test/VoteHelper.ts
- /Users/hyunjaelee/work/commons-budget-contract/test/AdminAction.test.ts
- /Users/hyunjaelee/work/commons-budget-contract/node_modules/hardhat/node_modules/mocha/lib/mocha.js
- /Users/hyunjaelee/work/commons-budget-contract/node_modules/hardhat/node_modules/mocha/index.js
- /Users/hyunjaelee/work/commons-budget-contract/node_modules/hardhat/builtin-tasks/test.js
- /Users/hyunjaelee/work/commons-budget-contract/node_modules/hardhat/internal/core/tasks/builtin-tasks.js
- /Users/hyunjaelee/work/commons-budget-contract/node_modules/hardhat/internal/core/config/config-loading.js
- /Users/hyunjaelee/work/commons-budget-contract/node_modules/hardhat/internal/cli/cli.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._resolveFilename.sharedData.moduleResolveFilenameHook.installedValue [as _resolveFilename] (/Users/hyunjaelee/work/commons-budget-contract/node_modules/@cspotcode/source-map-support/source-map-support.js:679:30)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/Users/hyunjaelee/work/commons-budget-contract/typechain-types/factories/@openzeppelin/contracts/utils/introspection/index.ts:4:1)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Module.m._compile (/Users/hyunjaelee/work/commons-budget-contract/node_modules/ts-node/src/index.ts:1459:23)
    at Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Object.require.extensions.<computed> [as .ts] (/Users/hyunjaelee/work/commons-budget-contract/node_modules/ts-node/src/index.ts:1462:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/hyunjaelee/work/commons-budget-contract/typechain-types/factories/@openzeppelin/contracts/utils/introspection/index.ts',
    '/Users/hyunjaelee/work/commons-budget-contract/typechain-types/factories/@openzeppelin/contracts/utils/index.ts',
    '/Users/hyunjaelee/work/commons-budget-contract/typechain-types/factories/@openzeppelin/contracts/index.ts',
    '/Users/hyunjaelee/work/commons-budget-contract/typechain-types/factories/@openzeppelin/index.ts',
    '/Users/hyunjaelee/work/commons-budget-contract/typechain-types/factories/index.ts',
    '/Users/hyunjaelee/work/commons-budget-contract/typechain-types/index.ts',
    '/Users/hyunjaelee/work/commons-budget-contract/test/VoteHelper.ts',
    '/Users/hyunjaelee/work/commons-budget-contract/test/AdminAction.test.ts',
    '/Users/hyunjaelee/work/commons-budget-contract/node_modules/hardhat/node_modules/mocha/lib/mocha.js',
    '/Users/hyunjaelee/work/commons-budget-contract/node_modules/hardhat/node_modules/mocha/index.js',
    '/Users/hyunjaelee/work/commons-budget-contract/node_modules/hardhat/builtin-tasks/test.js',
    '/Users/hyunjaelee/work/commons-budget-contract/node_modules/hardhat/internal/core/tasks/builtin-tasks.js',
    '/Users/hyunjaelee/work/commons-budget-contract/node_modules/hardhat/internal/core/config/config-loading.js',
    '/Users/hyunjaelee/work/commons-budget-contract/node_modules/hardhat/internal/cli/cli.js'
  ]
}

12. Unexpected end of JSON input ์—๋Ÿฌ

An unexpected error occurred:

SyntaxError: /Users/hyunjaelee/work/commons-budget-contract/artifacts/@openzeppelin/contracts/utils/Context.sol/Context.dbg.json: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at /Users/hyunjaelee/work/commons-budget-contract/node_modules/jsonfile/index.js:33:18
    at /Users/hyunjaelee/work/commons-budget-contract/node_modules/graceful-fs/graceful-fs.js:123:16
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3)

13. HardhatError: HH103: Account 0x3e29aefa7af16625691a9fca4a7fff0624aabc6f is not managed by the node you are connected to.

14. TypeError: Cannot read properties of undefined (reading 'sourceName')

/Users/hyunjaelee/work/seaport/node_modules/hardhat/internal/hardhat-network/stack-traces/solidity-errors.js:111
    return new SolidityCallSite(sourceReference.sourceName, sourceReference.contract, sourceReference.function !== undefined
                                                ^
TypeError: Cannot read properties of undefined (reading 'sourceName')
(Use `node --trace-uncaught ...` to show where the exception was thrown)
error Command failed with exit code 7.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

15. .

16. Uncaught ReferenceError: Buffer is not defined

์—ฌ๊ธฐ ์Šคํ…์˜ค๋ฒ„ํ”Œ๋กœ์šฐ ์ฐธ์กฐ

import{ Buffer} from'buffer';
// @ts-ignorewindow.Buffer= Buffer;
  1. Error HH700: Artifact for contract "hardhat/console.sol:console" not found.
  1. TestNet์—์„œ Contract ๋ฐฐํฌ์‹œ UND_ERR_CONNECT_TIMEOUT์ด ๋ฐœ์ƒ

19. TestNet์—์„œ Contract ๋ฐฐํฌ ์Šคํฌ๋ฆฝํŠธ ์‹คํ–‰์‹œ ๋‹ค์Œ ํ”„๋กฌํ”„ํŠธ๋กœ ์•ˆ ๋–จ์–ด์ง€๊ณ  ๋จนํ†ต]

20. npm ERR! code EINTEGRITY

npm ERR! sha1-UzRK2xRhehP26N0s4okF0cC6MhU=sha512-XWwnNNFCuuSQ0m3r3C4LE3EiORltHd9M05pq6FOlVeiophzRbMo50Sbz1ehl8K3Z+jw9+vmgnXefY1hz8X+2wA== integrity checksum failed when using sha1: wanted sha1-UzRK2xRhehP26N0s4okF0cC6MhU=sha512-XWwnNNFCuuSQ0m3r3C4LE3EiORltHd9M05pq6FOlVeiophzRbMo50Sbz1ehl8K3Z+jw9+vmgnXefY1hz8X+2wA== but got sha512-XWwnNNFCuuSQ0m3r3C4LE3EiORltHd9M05pq6FOlVeiophzRbMo50Sbz1ehl8K3Z+jw9+vmgnXefY1hz8X+2wA== sha1-UzRK2xRhehP26N0s4okF0cC6MhU=. (42300 bytes)

21. Error: error:0308010C:digital envelope routines::unsupported

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at createHash (node:crypto:133:10)
    at ripemd160 (/Users/hyunjaelee/work/pooh-land/node_modules/@ethersproject/sha2/src.ts/sha2.ts:14:29)
    at new HDNode (/Users/hyunjaelee/work/pooh-land/node_modules/@ethersproject/hdnode/src.ts/index.ts:115:67)
    at Function.HDNode._fromSeed (/Users/hyunjaelee/work/pooh-land/node_modules/@ethersproject/hdnode/src.ts/index.ts:258:16)
    at Function.HDNode.fromMnemonic (/Users/hyunjaelee/work/pooh-land/node_modules/@ethersproject/hdnode/src.ts/index.ts:269:23)
    at Function.Wallet.fromMnemonic (/Users/hyunjaelee/work/pooh-land/node_modules/@ethersproject/wallet/src.ts/index.ts:192:34)
    at Function.Wallet.createRandom (/Users/hyunjaelee/work/pooh-land/node_modules/@ethersproject/wallet/src.ts/index.ts:177:23)
    at getAccounts (/Users/hyunjaelee/work/pooh-land/hardhat.config.ts:35:26)
    at Object.<anonymous> (/Users/hyunjaelee/work/pooh-land/hardhat.config.ts:116:17) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'

22. jiyoungminjung์œผ๋กœ ์ฒ˜์Œ์— push๋ฅผ ํ•˜๋ ค๊ณ ํ• ๋•Œ ๊ถŒํ•œ ๋ฌธ์ œ ๋ฐœ์ƒ

23. BigInt ์ธ์‹ ๋ชปํ•˜๋Š” ๋ฌธ์ œ

๊ด€๋ จ github repo: github.com:poohgithub/pooh-swap-v2-core.git

const swapTestCases: BigInt[][] = [
   [1, 5, 10, '1662497915624478906'],
   [1, 10, 5, '453305446940074565'],


   [2, 5, 10, '2851015155847869602'],
   [2, 10, 5, '831248957812239453'],


   [1, 10, 10, '906610893880149131'],
   [1, 100, 100, '987158034397061298'],
   [1, 1000, 1000, '996006981039903216']
 ].map(a => a.map(n => (typeof n === 'string' ? BigInt(n) : BigInt(n * 10 ** 18))));
 swapTestCases.forEach((swapTestCase, i) => {
   it(`getInputPrices:${i}`, async () => {
     const swapAmount = BigInt(swapTestCase[0].toString());
     const token0Amount = BigInt(swapTestCase[1].toString());
     const token1Amount = BigInt(swapTestCase[2].toString());
     const expectedOutputAmount = BigInt(swapTestCase[3].toString());
     await addLiquidity(token0Amount, token1Amount);
     await token0.transfer(pair.target, swapAmount);
     await expect(pair.swap(0, expectedOutputAmount + 1n, admin.address, '0x', overrides)).to.be.revertedWith('UniswapV2: K');
     await pair.swap(0, expectedOutputAmount, admin.address, '0x', overrides);


   });
 });

Codes

Solidity์˜ address type์ด TypeScript์—์„œ๋Š” string

TypeScript ํ”„๋กœ๊ทธ๋žจ์— ํŒŒ๋ผ๋ฏธํ„ฐ ์ถ”๊ฐ€

async function main() {
  const parameter = process.env.PARAMETER;
  console.log("Received parameter:", parameter);

  // Your deployment or other script logic here
}
PARAMETER=value npx hardhat run deploy.ts

Agora Locanet ์‹คํ–‰

Subgraph ๊ฐœ๋ฐœ์‹œ ๊ฑธ๋ฆฐ ์‹œ๊ฐ„: ๋”ฑ 10์ผ

๊ฐœ์š”: ๋ฌธ์„œ ํŒŒ์•…์ด 3์ผ, ํ…Œ์ŠคํŠธ๊ฐ€ 4์ผ, ์‹ค์ œ ๊ฐœ๋ฐœ: 3์ผ Post Mortem

  1. ๋ชฉ/๊ธˆ/ํ™”(2/9~10, 2/14): Graph ๊ตฌ์กฐ ํŒŒ์•…
  2. ์ˆ˜(2/15): ์‹ค์ œ ์‹คํ–‰ ๊ด€๋ จ ์ž๋ฃŒ ์กฐ์‚ฌ
  3. ๋ชฉ/๊ธˆ(2/16~17): Goerli/local ๋…ธ๋“œ์—์„œ ์˜ˆ์ œ ๋Œ๋ ค๋ณด๊ธฐ
  4. ์›”(20): ํ…Œ์ŠคํŠธ๋„ท ์˜ˆ์ œ ์ปจํŠธ๋ž™ํŠธ ํ…Œ์ŠคํŠธ
  5. ํ™”/์ˆ˜(21~22): ERC1155/ERC721/AssetContract์— ๋Œ€ํ•œ ํ…Œ์ŠคํŠธ ์™„๋ฃŒ
  6. ๋ชฉ(23): ํ…Œ์ŠคํŠธ๋„ท์—์„œ ์Šคํ‚ค๋งˆ ๋ฐ ๋งคํ•‘ 1์ฐจ ๊ฐœ๋ฐœ ์™„๋ฃŒ

hardhat ํ”„๋กœ์ ํŠธ ๊ฐœ๋ฐœ์‹œ ์ฐธ๊ณ 

๊ฐœ๋…

Solidity version

ยท ๊ฐ€์žฅ ํ™•์‹คํ•œ ํ˜•ํƒœ โ—‹ pragma solidity >=0.8.0 <=0.8.10; ยท pragma solidity ^0.5.2; โ—‹ 0.5.2 ์ด์ „ ๋ฒ„์ „ ์ปดํŒŒ์ผ๋Ÿฌ๋กœ๋Š” ์ปดํŒŒ์ผ ์•ˆ๋จ โ—‹ 0.6.0 ์œผ๋กœ ์‹œ์ž‘๋˜๋Š” ๋ฒ„์ „์—๋Š” ์ปดํŒŒ์ผ ์•”๋จ (^๊ฐ€ ๊ทธ๋Ÿฐ ์˜๋ฏธ์ž„)

harthat ํ”„๋กœ์ ํŠธ ๋งŒ๋“ค๊ธฐ

In our case we created the folder named ProjetoLivroNFTERC1155OZ.

  1. Start npm in standard mode. npm init -y
  2. Install the hardhat. npm install --save-dev hardhat yarn add --dev hardhat <== yarn์œผ๋กœ ์ธ์Šคํ†จํ•  ๊ฒฝ์šฐ.
  3. Install OpenZeppelin smart contracts. npm install @openzeppelin/contracts
  4. Install required modules and dependencies. npm install --save-dev @nomiclabs/hardhat-waffle npm install --save-dev "@nomiclabs/hardhat-ethers@^2.0.0" "ethereum- waffle@^3.4.0" "ethers@^5.0.0"
  5. Install the dotenv module. npm install dotenv
  6. Start the hardhat. npx hardhat

delegatecall ๊ด€ํ•˜์—ฌ

Medium delegatecall Preventing Vulnerabilities in Solidity - Delegate Call Stackexchange Solidity storage Storage slot in Inheritance

pragma solidity ^0.8.0; import "hardhat/console.sol";

contract Executor { uint256 public luckyNumber; address public sender; uint256 public value;

function setLuckyNumber(uint256 _luckyNumber) public payable { luckyNumber = _luckyNumber; sender = msg.sender; value = msg.value; }

function showNumber() public { console.log("luckeyNumber:", luckyNumber); } }

// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "hardhat/console.sol"; contract Caller { function setLuckyNumber(address executor, uint256 _luckyNumber) public payable { (bool success, bytes memory data) = executor.delegatecall( abi.encodeWithSignature("setLuckyNumber(uint256)", _luckyNumber) ); } function showNumber(address executor) public { (bool success, bytes memory data) = executor.delegatecall( abi.encodeWithSignature("showNumber()") ); } }

static call

staticcall works in a similar way as a normal call (without any value (sending eth) as this would change state). But when staticcall is used, the EVM has a STATIC flag set to true. Then, if any state modification is attempted, an exception is thrown. Once the staticcall returns, the flag is turned off.

npm publish, NPM module ๋ฐฐํฌ, ๋ชจ๋“ˆ ๋ฐฐํฌ

  1. ๋ณธ์ธ์˜ npm node ํ”„๋กœ์ ํŠธ ๋ฃจํŠธ ํด๋”๋ฅผ ๋“ค์–ด๊ฐ€์„œ "npm login" ๋ช…๋ น ์‹คํ–‰
  2. NPM ํŽ˜์ด์ง€์—์„œ ๋กœ๊ทธ์ธ ์ง„ํ–‰, Google Authenticator ํ•„์š”
  3. ๋‹ค์‹œ ํ”„๋กœ์ ํŠธ ๋ฃจํŠธ ํด๋”์—์„œ "npm publish" ๋ช…๋ น ์‹คํ–‰
  4. NPM ํŽ˜์ด์ง€์—์„œ ๋ฐฐํฌ ์ง„ํ–‰, Google Authenticator ํ•„์š”

Transaction์˜ ํ˜•ํƒœ

transaction: { hash: '0x4508d350b89655c9452d527ff1b3d307ed566228661b0a805567561ebc7590f1', type: 2, accessList: [], blockHash: '0xb0f9792fbe40b2b9c85fbdabb90e7f0e4ee08f82f9f82ef485814d3002a34c8f', blockNumber: 59, transactionIndex: 0, confirmations: 1, from: '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC', gasPrice: BigNumber { value: "1000591199" }, maxPriorityFeePerGas: BigNumber { value: "1000000000" }, maxFeePerGas: BigNumber { value: "1001182398" }, gasLimit: BigNumber { value: "211019" }, to: '0x09635F643e140090A9A8Dcd712eD6285858ceBef', value: BigNumber { value: "0" }, nonce: 3, data: '0xe7acab24000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000005600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000046000000000000000000000000000000000000000000000000000000000000004c0000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb9226600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000063be212dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff3000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ea4da12fc3f3f34300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000006509f2a854ba7441039fce3b959d5badd2ffcfcd00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008ac7230489e800000000000000000000000000000000000000000000000000008ac7230489e800000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000300000000000000000000000033c0024ebc7a8989c1ae32988d5402295c8fd42b3c44cdddb6a900fa2b585dd299e03d12fa4293bc000000000000010000000064000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb9226600000000000000000000000000000000000000000000000000000000000000010000000000000000000000006509f2a854ba7441039fce3b959d5badd2ffcfcd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003782dace9d9000000000000000000000000000000000000000000000000000003782dace9d9000000000000000000000000000070997970c51812dc3a010c7d01b50e0d17dc79c800000000000000000000000000000000000000000000000000000000000000401fb0dfbaf5bce7c5a92402efbcec0e173531b3e3378e7b236a83eda892e6ac0603ef19202e3b2217622f4a881609e592f598fde0d14849af8b0fb024b71de187000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007f688786', r: '0xe41292838da7454d5932feef08cb49c12e56721edfab2df873d79abaf35fed26', s: '0x2a9cf276597a3559d1784c95234ff0c0805e4b29e846ccbe13e59fb3f0874f2a', v: 0, creates: null, chainId: 1, wait: [Function (anonymous)] }

sendTransaction - hardhat ํ…Œ์ŠคํŠธ ์ฝ”๋“œ

const encodedData = feeCollectorContract.interface.encodeFunctionData( "unwrapAndWithdraw", [ feeAdmin.address.toString(), wboaContract.address, BigNumber.from("10") ] ); const result = await ownerSigner.sendTransaction({ to: proxyContract.address, data: encodedData });

Predicted Address

contract C { functioncreateDSalted(bytes32 salt, uint arg) public { // This complicated expression just tells you how the address // can be pre-computed. It is just there for illustration. // You actually only need new D{salt: salt}(arg). address predictedAddress = address(uint160(uint(keccak256(abi.encodePacked( bytes1(0xff), address(this), salt, keccak256(abi.encodePacked( type(D).creationCode, abi.encode(arg) )) )))));

        D d = newD{salt: salt}(arg);
        require(address(d) == predictedAddress);
    }
}
}

์ปจํŠธ๋ž™ํŠธ ์‚ฌ์ด์ฆˆ

1. npm install --dev hardhat-contract-sizer
2. hardhat.config.ts์— ๋‹ค์Œ ๋ผ์ธ ์ถ”๊ฐ€
	โ—‹ import "hardhat-contract-sizer";
3. npx hardhat size-contracts

์˜›๋‚  ๋ฐฉ์‹

solc-select install 0.8.0

truffle-config.js module.exports = { networks: { development: { host: "127.0.0.1", port: 8545, network_id: "*" // Match any network id } }, compilers: { solc: { version: "^0.8.0" } } };

data = fs.readFileSync('/Users/hyunjaelee/work/commons-budget-contract/build/contracts/VoteraVote.json'); obj = JSON.parse(data); size = Buffer.byteLength(obj.deployedBytecode) / 2;

Nonce ์˜ค๋ฅ˜ ๊ด€๋ จํ•ด์„œ ํ—จ๋ฆฌ๋‹˜์ด ์–˜๊ธฐํ•ด์ค€๊ฒƒ

private async resetTransactionCount() { this.manager_signer.setTransactionCount(await this.manager_signer.getTransactionCount()); } 3:42 nonce-manager.ts setTransactionCount(transactionCount: ethers.BigNumberish | Promise<ethers.BigNumberish>): void { this._initialPromise = Promise.resolve(transactionCount).then((nonce) => { return ethers.BigNumber.from(nonce).toNumber(); }); this._deltaCount = 0;

TODO: boa-space-contracts conduit ๊ด€๋ จ assembly ์ฝ”๋“œ (#conduit.spec.ts)

Error: call revert exception [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ]      (method="getDomain(bytes4,uint256)")
`boa-space-contracts`      ํ”„๋กœ์ ํŠธ, conduit.spec.ts 1079๋ผ์ธ ์—๋Ÿฌ. ์ž์„ธํ•œ ๋‚ด์šฉ์€ web/solidity.html์—์„œ      `#conduit.spec.ts`๋กœ ๊ฒ€์ƒ‰ => test.yml ์›๋ณตํ•ด์„œ ํ•ด๋ณด๊ธฐ(Run Linters, Run Reference      Tests, Run "
  it.only("Reverts when attempting to execute transfers on a conduit when not called from a channel", async () => {
    const expectedRevertReason =
      getCustomRevertSelector("ChannelClosed(address)") +
      owner.address.slice(2).padStart(64, "0").toLowerCase();

    const tx = await conduitOne.connect(owner).populateTransaction.execute([]);
    const returnData = await provider.call(tx);
    expect(returnData).to.equal(expectedRevertReason);

    await expect(conduitOne.connect(owner).execute([])).to.be.reverted;
  });
modifier onlyOpenChannel() {
        console.log("onlyOpenChannel");
        // Utilize assembly to access channel storage mapping directly.
        assembly {
            // Write the caller to scratch space.
            mstore(ChannelKey_channel_ptr, caller())

            // Write the storage slot for _channels to scratch space.
            mstore(ChannelKey_slot_ptr, _channels.slot)

            // Derive the position in storage of _channels[msg.sender]
            // and check if the stored value is zero.
            if iszero(
                sload(keccak256(ChannelKey_channel_ptr, ChannelKey_length))
            ) {
                // The caller is not an open channel; revert with
                // ChannelClosed(caller). First, set error signature in memory.
                mstore(ChannelClosed_error_ptr, ChannelClosed_error_signature)

                // Next, set the caller as the argument.
                mstore(ChannelClosed_channel_ptr, caller())

                // Finally, revert, returning full custom error with argument.
                revert(ChannelClosed_error_ptr, ChannelClosed_error_length)
            }
        }

        console.log("onlyOpenChannel return");
        // Continue with function execution.
        _;
    }

Jay's code sneppets

latest forge

yarn cache clean --force

vm.expectRever(
  abi.encodeWithSelector(
    Raffle.Raffle__UpkeepNotNeeded.selector,
      ...
    )
} 

vm.recordLogs();
Vm.Log[] memory entries = vm.getRecordedLogs();

forge sanpshot -m testWithrawFromMultipleFunders
vm.txGasPrice(GAS_PRICE);
uint256 gasStart = gasleft();

uint256 gasEnd = gasleft();
uint256 gasUsed = (gasStart - gasEnd) * tx.gasprice;
forge inspect FundMe storageLayout
cast storage 0x...(Contract address) ์จ๋ณด๊ธฐ
cast --to-wei 15
cast balance 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045
๋ฐฐํฌ ์Šคํฌ๋ฆฝํŠธ ์‹คํ–‰์‹œ์—๋Š” --broadcast๋ฅผ ์จ์•ผ ํ•จ.

cast --calldata-decode "fund()" 0xa7ea5e4e

ํŒŒ์ด์„  ์ธํ„ฐํ”„๋Ÿฌํ„ฐ ๋ชจ๋“œ ๊ฐ™์€ ๊ฒƒ.
chisel - Test and receive verbose feedback on Solidity inputs within a REPL environment.

latest hardhat

๊ธฐํƒ€: reset array ๋“ฑ

uint16 ํƒ€์ž…๋„ ์žˆ์Œ.

constructor (..., vrfCoordinator, ...) VRFConsumerBaseV2(vrfCoordinator) {
...
}

% ์—ฐ์‚ฐ์ž๋„ ์žˆ์Œ.

address payable winner = s_players[indexOfWinner];

resetting!
s_players = new address payable[](0);

event WinnerPicked(address indexed winner);
This allows these parameters to be searchable when looking through the blockchain logs. 

abi.decode

function addPerson(bytes calldata data) external {
    // Assuming `data` is ABI-encoded with (string, uint8)
    (string memory name, uint8 age) = abi.decode(data, (string, uint8));

    // Store the information in the contract's state
    people[msg.sender] = Person(name, age);

    // Emit an event to log the addition
    emit PersonAdded(msg.sender, name, age);
}

slot.value

function upgrade(address implementation_) external virtual {
    require(_isValidSigner(msg.sender), "Caller is not owner");
    require(implementation_ != address(0), "Invalid implementation address");
    ++state;
    StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = implementation_;
}

Promise.all && map

await Promise.all(Array.from({ length: 14 }, (_, i) => i).map((i) => claimTopicsRegistry.addClaimTopic(i)));

signMessage

// ์ด๊ฑด ethers v5์šฉ์ด๋ผ ์ฐธ๊ณ ์šฉ
claimForBob.signature = await claimIssuerSigningKey.signMessage(
  ethers.utils.arrayify(
    ethers.utils.keccak256(
      ethers.utils.defaultAbiCoder.encode(['address', 'uint256', 'bytes'], [claimForBob.identity, claimForBob.topic, claimForBob.data]),
    ),
  ),
);

// ethers v6
const signature = await signer.signMessage(
  ethers.toBeArray(
    ethers.solidityPackedKeccak256(
      ["bytes32", "address", "uint256"],
      [
        SIGNATURE_DELEGATION_HASH_TYPE,
        delegates[index]!.address,
        endTimestamp,
      ],
    ),
  ),
);

์ฐธ๊ณ ํ•  ๋‚ด์šฉ ๋งŽ์Œ

function cheaperWithdraw() public onlyOwner {
    address[] memory funders = s_funders;
    // mappings can't be in memory, sorry!
    for (uint256 funderIndex = 0; funderIndex < funders.length; funderIndex++) {
        address funder = funders[funderIndex];
        s_addressToAmountFunded[funder] = 0;
    }
    s_funders = new address[](0);
    // payable(msg.sender).transfer(address(this).balance);
    (bool success,) = i_owner.call{value: address(this).balance}("");
    require(success);
}

CALLDATA

CALLDATACOPY(t, f, s): msg.data ์˜ f๋ฒˆ์งธ ์œ„์น˜์—์„œ s๊ฐœ์˜ ๋ฐ”์ดํŠธ๋ฅผ ์ฝ์–ด ๋ฉ”๋ชจ๋ฆฌ์˜ t๋ฒˆ์งธ ์œ„์น˜์— ์ €์žฅํ•ฉ๋‹ˆ๋‹ค.
create2(
  callvalue(), // wei sent with current call
  // Actual code starts after skipping the first 32 bytes
  add(bytecode, 0x20),
  (bytecode), // Load the size of code contained in the first 32 bytes
   _salt // Salt from function arguments
)

Make sure that we can transfer out token 200

vm.prank(owner4);
IERC6551Executable(account4).execute(
    address(account3),
    0,
    abi.encodeWithSignature(
        "execute(address,uint256,bytes,uint8)",
        address(nft),
        0,
        abi.encodeWithSignature(
            "safeTransferFrom(address,address,uint256)", account3, newTokenOwner, 200
        ),
        0
    ),
    0
);

function callTransfer(address _token, address _to, uint256 _amount) external {
    // This will encode the function call to `transfer(address,uint256)` with the specified arguments
    bytes memory data = abi.encodeWithSignature("transfer(address,uint256)", _to, _amount);
    // Making the actual call to the token contract's transfer function
    (bool success, ) = _token.call(data);
    require(success, "Transfer failed");
}

Nick's Factory

The registry MUST be deployed at address 0x000000006551c19487814612e58FE06813775758 using Nickโ€™s Factory (0x4e59b44847b379578588920cA78FbF26c0B4956C) with salt 0x0000000000000000000000000000000000000000fd8eb4e1dca713016c518e31.
The registry can be deployed to any EVM-compatible chain using the following transaction:

{
        "to": "0x4e59b44847b379578588920ca78fbf26c0b4956c",
        "value": "0x0",
        "data": "0x0000000000000000000000000000000000000000fd8eb4e1dca713016c518e31608060405234801561001057600080fd5b5061023b806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063246a00211461003b5780638a54c52f1461006a575b600080fd5b61004e6100493660046101b7565b61007d565b6040516001600160a01b03909116815260200160405180910390f35b61004e6100783660046101b7565b6100e1565b600060806024608c376e5af43d82803e903d91602b57fd5bf3606c5285605d52733d60ad80600a3d3981f3363d3d373d3d3d363d7360495260ff60005360b76055206035523060601b60015284601552605560002060601b60601c60005260206000f35b600060806024608c376e5af43d82803e903d91602b57fd5bf3606c5285605d52733d60ad80600a3d3981f3363d3d373d3d3d363d7360495260ff60005360b76055206035523060601b600152846015526055600020803b61018b578560b760556000f580610157576320188a596000526004601cfd5b80606c52508284887f79f19b3655ee38b1ce526556b7731a20c8f218fbda4a3990b6cc4172fdf887226060606ca46020606cf35b8060601b60601c60005260206000f35b80356001600160a01b03811681146101b257600080fd5b919050565b600080600080600060a086880312156101cf57600080fd5b6101d88661019b565b945060208601359350604086013592506101f46060870161019b565b94979396509194608001359291505056fea2646970667358221220ea2fe53af507453c64dd7c1db05549fa47a298dfb825d6d11e1689856135f16764736f6c63430008110033",
}

assembly ๊ตฌ์กฐ

# Asssembly ๊ตฌ์กฐ
// Memory Layout:
// ----
// 0x00   0xff                           (1 byte)
// 0x01   registry (address)             (20 bytes)
// 0x15   salt (bytes32)                 (32 bytes)
// 0x35   Bytecode Hash (bytes32)        (32 bytes)
// ----
// 0x55   ERC-1167 Constructor + Header  (20 bytes)
// 0x69   implementation (address)       (20 bytes)
// 0x5D   ERC-1167 Footer                (15 bytes)
// 0x8C   salt (uint256)                 (32 bytes)
// 0xAC   chainId (uint256)              (32 bytes)
// 0xCC   tokenContract (address)        (32 bytes)
// 0xEC   tokenId (uint256)              (32 bytes)

// Silence unused variable warnings
pop(chainId)

// Copy bytecode + constant data to memory
calldatacopy(0x8c, 0x24, 0x80) // salt, chainId, tokenContract, tokenId
mstore(0x6c, 0x5af43d82803e903d91602b57fd5bf3) // ERC-1167 footer
mstore(0x5d, implementation) // implementation
mstore(0x49, 0x3d60ad80600a3d3981f3363d3d373d3d3d363d73) // ERC-1167 constructor + header

// Copy create2 computation data to memory
mstore8(0x00, 0xff) // 0xFF
mstore(0x35, keccak256(0x55, 0xb7)) // keccak256(bytecode)
mstore(0x01, shl(96, address())) // registry address
mstore(0x15, salt) // salt

// Compute account address
let computed := keccak256(0x00, 0x55)

// If the account has not yet been deployed
if iszero(extcodesize(computed)) {
    // Deploy account contract
    let deployed := create2(0, 0x55, 0xb7, salt)

    // Revert if the deployment fails
    if iszero(deployed) {
        mstore(0x00, 0x20188a59) // `AccountCreationFailed()`
        revert(0x1c, 0x04)
    }

    // Store account address in memory before salt and chainId
    mstore(0x6c, deployed)

    // Emit the ERC6551AccountCreated event
    log4(
        0x6c,
        0x60,
        // `ERC6551AccountCreated(address,address,bytes32,uint256,address,uint256)`
        0x79f19b3655ee38b1ce526556b7731a20c8f218fbda4a3990b6cc4172fdf88722,
        implementation,
        tokenContract,
        tokenId
    )

    // Return the account address
    return(0x6c, 0x20)
}

// Otherwise, return the computed account address
mstore(0x00, shr(96, shl(96, computed)))
return(0x00, 0x20)



(address signer, ECDSA.RecoverError err) =
    userOpHash.toEthSignedMessageHash().tryRecover(userOp.signature);
if (err != ECDSA.RecoverError.NoError) {
    revert InvalidSignature();
}

/// @title Base Session Key Plugin
/// @author Decipher ERC-6900 Team
/// @notice This plugin allows some designated EOA or smart contract to temporarily
/// own a modular account.
/// This base session key plugin acts as a 'parent plugin' for all specific session
/// keys. Using dependency, this plugin can be thought as a proxy contract that stores
/// session key duration information, but with validation functions for session keys.
///
/// It allows for session key owners to access MSCA both through user operation and 
/// runtime, with its own validation functions.
/// @notice Route call to executeFromPluginExternal at the MSCA.
    /// @dev This function will call with value = 0, since sending ether 
    /// for ERC20 contract is not a normal case.
    /// @param target The target address to execute the call on.
    /// @param data The call data to execute.

์š”๊ฒƒ๋„ ๊ดœ์ฐฎ๋„ค: https://github.com/erc6900/reference-implementation/pull/22/commits/0fb2113a0f1b09e8eeef72dd6d04b04bbc0151a8

โ€‹โ€‹    // โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“
    // โ”ƒ    Execution functions    โ”ƒ
    // โ”—โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”›
/// @inheritdoc ISessionKeyPlugin
function addTemporaryOwner(address tempOwner, uint48 _after, uint48 _until) external {

PR์— ์„ค๋ช… ๋‹ฌ๊ธฐ

## Motivation
We would like to accumulate the money for Poohnet Fund which will be used to support the real world projects which have content to make our world friendly.

## Solution
commit 789c3cf6c : Change the code for generating inflation for Poohnet Fund
commit c595c22a9 : Apply configuration for make the inflation start

supportsInterface

function supportsInterface(bytes4 interfaceId) public view override returns (bool) {
    return interfaceId == type(ISessionKeyPlugin).interfaceId || super.supportsInterface(interfaceId);
}

storage modifier

EnumerableSet.Bytes32Set storage sessionKeySet = _sessionKeySet[msg.sender]; Purpose: This line declares a variable sessionKeySet that refers to a set of session keys for the message sender (msg.sender). The storage modifier indicates that sessionKeySet is a pointer to the data located in the contract's persistent storage, not a temporary copy. This is crucial in Solidity because changes to a storage variable directly modify the state on the blockchain.


unchecked block

The unchecked block is used here to tell the compiler not to check for overflows when incrementing the index i. This can save gas since the overflow is unlikely given the controlled environment of the loop (i.e., looping over an array length


transient storage sample

https://solidity-by-example.org/transient-storage/


forge create

npx hardhat node // ๊ผญ hardhat ํ”„๋กœ์ ํŠธ ํด๋”์—์„œ ์ง„ํ–‰ํ•ด์•ผํ•จ.

forge script script/DeployTransactionDelegator.s.sol --rpc-url $LOCALNET_RPC_URL


CREATE a CONTRACT with 2 SAME addresses on 2 DIFFERENT chains

address = bytes20(keccak256(0xFF, senderAddress, salt, bytecode))

How to deploy my contract on 2 different chains with the same address? Now, letโ€™s answer to the question: How to deploy a smart contract with the same addresses in 2 different chains?

You can do it with the CREATE2 opcode by providing the same salt on different chains. (easier than providing the nonce because you canโ€™t fully control it)

here


foundry remapping์€ toml์—์„œ ์ง€์ •ํ•จ.

tokenURI ํ•จ์ˆ˜, ERC721

forge init โ€“force forge install https://github.com/OpenZeppelin/openzeppelin-contracts@v4.9.3


Fatal: Failed to write genesis block: database contains incompatible genesis

==> ์›๋ž˜ genesis_testnet.json๊ณผ genesis_fund_testnet์˜ ์•„๋ž˜ ๋ถ€๋ถ„์ด ๋‹ค๋ฆ„

"difficulty": "1",
  "gasLimit": "8000000",
  "extradata": "0x00000000000000000000000000000000000000000000000000000000000000008532654aD638Db3deE3836B22B35f7Ca707428ca0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
  "alloc": {
    // ์ค‘๋žต
  }
}

OnlyHardhatNetworkError: This helper can only be used with Hardhat Network. You are connected to 'localnet', whose identifier is 'Geth/v1.12.1-unstable-5e198bde-20240602/darwin-amd64/go1.21.3'

  at checkIfDevelopmentNetwork (/Users/hyunjaelee/work/web/ex/node_modules/@nomicfoundation/hardhat-network-helpers/src/utils.ts:29:11)
  at processTicksAndRejections (node:internal/process/task_queues:95:5)
  at async getHardhatProvider (/Users/hyunjaelee/work/web/ex/node_modules/@nomicfoundation/hardhat-network-helpers/src/utils.ts:40:3)
  at async Object.latest (/Users/hyunjaelee/work/web/ex/node_modules/@nomicfoundation/hardhat-network-helpers/src/helpers/time/latest.ts:7:20)
  at async deployOneYearLockFixture (/Users/hyunjaelee/work/web/ex/test/basic.spec.localnet.ts:24:25)
  at async loadFixture (/Users/hyunjaelee/work/web/ex/node_modules/@nomicfoundation/hardhat-network-helpers/src/loadFixture.ts:59:18)
  at async Context.<anonymous> (/Users/hyunjaelee/work/web/ex/test/basic.spec.localnet.ts:37:36)

info

version.toLowerCase().startsWith("hardhatnetwork") ||
version.toLowerCase().startsWith("anvil");

TypeError: Cannot read properties of undefined (reading 'provider')

at Object.<anonymous> (/Users/hyunjaelee/work/web/ex/test/create2/base.spec.ts:5:25)
at Module._compile (node:internal/modules/cjs/loader:1364:14)
at Module.m._compile (/Users/hyunjaelee/work/web/ex/node_modules/ts-node/src/index.ts:1618:23)
at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
at Object.require.extensions.<computed> [as .ts] (/Users/hyunjaelee/work/web/ex/node_modules/ts-node/src/index.ts:1621:12)
at Module.load (node:internal/modules/cjs/loader:1203:32)
at Function.Module._load (node:internal/modules/cjs/loader:1019:12)
at Module.require (node:internal/modules/cjs/loader:1231:19)
at require (node:internal/modules/helpers:177:18)
at /Users/hyunjaelee/work/web/ex/node_modules/mocha/lib/mocha.js:414:36

error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

hardhat.config.ts์— ์•„๋ž˜ ์ถ”๊ฐ€

import '@nomiclabs/hardhat-waffle' import '@typechain/hardhat' import { HardhatUserConfig } from 'hardhat/config' import 'hardhat-deploy' import '@nomiclabs/hardhat-etherscan'

TypeError: Cannot read properties of undefined (reading 'provider'):

์ด๋Ÿฐ ์—๋Ÿฌ๊ฐ€ ๋–จ์–ด์ง€๋Š” ์ด์œ ๊ฐ€ ์•„๋ž˜ import ๋ฌธ ๋•Œ๋ฌธ์ธ๋ฐ, 
import { ethers } from โ€œhardhatโ€
hardhat์˜ ethers ๋ฒ„์ „์€ ๋‚ด๊ฐ€ ์“ฐ๋ ค๋Š” ๋ฒ„์ „๋ณด๋‹ค ๋‚ฎ์•„์„œ ๊ทธ๋Ÿฐ ๊ฒƒ์ด๋‹ค. ์•„๋ž˜์™€ ๊ฐ™์ด ๋ฐ”๊พธ๋ฉด ๋จ. 
import { ethers } from "ethers";
hardhat์˜ ethers ๋ฒ„์ „๊ณผ ๋‚˜์˜ ethers ๋ฒ„์ „์ด ๋‹ค๋ฅด๋ฉด ๋˜ ๋ฌธ์ œ๊ฐ€ ์ƒ๊น€. 
const provider = ethers.provider;
signer = await ethers.getSigner();
์œ„์—์„œ ๋ฐœ์ƒํ•˜๋Š” โ€œTypeError: Cannot read properties of undefined (reading 'provider')โ€ ๋ฌธ์ œ๋Š” ๋ชจ๋‘  ์•„๋ž˜์™€ ์—ฐ๊ด€์ด ์žˆ๋Š” ๊ฒƒ์ด๊ณ ,
ethers: typeof ethers & HardhatEthersHelpers;
์ด๊ฒƒ์€ hardhat.config.ts์— import "@nomicfoundation/hardhat-toolbox"; ์ถ”๊ฐ€ํ•ด์•ผ ํ•จ.
๊ฒฐ๊ตญ provider์™€ getSigner๋Š” hardhat.config.ts์™€ ๊ด€๋ จ๋œ ๊ฒƒ์ด์—ˆ์Œ.

TypeError: Cannot read properties of undefined (reading 'waitForTransaction')

await expect(execAccount.executeUserOp(userOp, 1)).to.emit(execAccount, "Executed").withArgs("Got it!", hashedMessage);
     TypeError: Cannot read properties of undefined (reading 'waitForTransaction')
      at waitForPendingTransaction (node_modules/@nomicfoundation/hardhat-chai-matchers/src/internal/emit.ts:34:19)
      at /Users/hyunjaelee/work/web/ex/node_modules/@nomicfoundation/hardhat-chai-matchers/src/internal/emit.ts:84:21

"ethers": "^6.1.0", <== ์•Œ์•„์„œ ์„ค์น˜๋จ

TypeError: (0 , ethers_1.getAddress) is not a function

hardhat์˜ ethers๋ฅผ ์“ธ๋•Œ ์ด๋Ÿฐ์ผ์ด ๋ฐœ์ƒํ•จ์œผ๋กœ 6.7.0์„ ์จ์•ผํ•จ. ๊ทธ๋ ‡๋‹ค๋ฉด hardhat์€ ๋‚ด ethers๋ฅผ ์“ด๋‹ค๋Š” ์–˜๊ธฐ? ๋‚ด๊บผ ์“ฐ๋Š”๊ฒŒ ๋งž์Œ. ๊ทธ๋Ÿฌ๋ฉด ๋ญํ•˜๋Ÿฌ import { ethers } from "hardhat"; ์ด๊ฑธ์“ฐ๋ƒ๊ตฌ??? ์–ด์จŒ๋“  hardhat์˜ node_modules์—๋Š” hardhat ๊น”๋ฆฌ๊ฒŒ ์—†์Œ.

forge install ํ• ๋•Œ, .gitmodules๊ฐ€ ํ•„์š”ํ•จ

forge init โ€“force

forge install OpenZeppelin/openzeppelin-contracts

forge test --match-contract PoohnetFund

forge test --match-contract PoohnetFund --fork-url $LOCALNET_RPC_URL

forge test --match-path test/forge/FulfillBasicOrderTest.sol --gas-report

source code

import "@openzeppelin/contracts/utils/Create2.sol";

address fundContractAddr = vm.envAddress(
  "POOHNET_FUND_CONTRACT_ADDRESS"
);

command

console.log(balance of deployer: ${await provider.getBalance(deployer.address)}); console.log(Receipt: ${JSON.stringify(receipt)}); const tx = await deployerListSetStore.addValue(valueData);

CONTRACT="AllBasic" yarn contract --network localnet

function _getListValue(uint240 value) internal pure returns (SetValue) { return SetValue.wrap(bytes30(value)); }

byte(0, mload(add(sig, 96))) extracts the first byte of this 32-byte value, because 0 is the index for the first byte.

// Clear any dirty upper bits of address ์ƒ์œ„๋น„ํŠธ๊ฐ€ ์ง€์›Œ์ง์„ ์ฃผ์˜ addr := and(addr, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)

https://github.com/ethereum/solidity/releases

expect(receipt?.status).to.equal(1); ์ด๋ ‡๊ฒŒ ํ•ด์•ผ ๋นจ๊ฐ„์ค„์ด ์•ˆ์ƒ๊น€

slot := keccak256(keyBuffer, 0x80) // Solidity keccack256๊ณผ๋Š” ์ข€ ๋‹ค๋ฆ„.

function executeUserOp ๋ฆฌํ„ด๊ฐ’์„ ์ฒดํฌํ•˜์ง€ ๋ชปํ•˜๋˜ ๋ฌธ์ œ In view and pure functions, which are called statically from a local node without a transaction. Or when doing such a static call to any function, but knowing that the state changes are not persisted.

๋‘๊ฐœ์˜ ์ฐจ์ด ==> ์ฒซ๋ฒˆ์žฌ๊ฒƒ ์„ค๋ช…: This expression generally means you are waiting for the expect function (a promise) to resolve. This is typically used with assertion libraries like Chai when you are expecting a promise to be rejected or resolved in a certain way.

await expect(execAccount.executeUserOp(userOp, 1)).to.emit(execAccount, "Executed").withArgs("Got it!", hashedMessage);
expect(await execAccount.executeUserOp(userOp, 1)).to.emit(execAccount, "Executed").withArgs("Got it!", hashedMessage);

contract size

const contractCode = await provider.getCode(tooBig.address);
const contractSize = (contractCode.length - 2) / 2; // Subtract 2 for '0x' prefix and divide by 2 to get the byte count

์•„๋ž˜์˜ isPrime์ฒ˜๋ฆฌ ์ฝ”๋“œ๋ฅผ library call ํ•˜๋Š” ๊ฒƒ์œผ๋กœ ๋ฐ”๊พธ๋ฉด 200bytes ์ฐจ์ด, ๊ทธ๋ƒฅ ์—†์• ๋ฉด 500๋ฐ”์ดํŠธ ์ฐจ์ด.

 function addSixtyTwo(uint256 n) public returns (bool) {
    // return n.isPrime();
    if (n <= 1) return false;
    if (n <= 3) return true;
    if (n % 2 == 0 || n % 3 == 0) return false;
    for (uint256 i = 5; i * i <= n; i += 6) {
      if (n % i == 0 || n % (i + 2) == 0) return false;
    }
    return true;
  }

solc --bin --abi contracts/assembly/DataStorage.sol -o output


npx hardhat node


// Call transfer function and check for success/failure (bool sent, ) = _to.call{value: msg.value}(""); require(sent, "Failed to send Ether");


yarn init -y yarn add typescript ts-node @types/node --dev tsc --init


error: externally-managed-environment

ร— This environment is externally managed โ•ฐโ”€> To install Python packages system-wide, try brew install xyz, where xyz is the package you are trying to install.

==> python3 -m pip config set global.break-system-packages true


ModuleNotFoundError: No module named 'web3' python3 -m pip --version

python3 -m pip install web3


curl v4.ident.me

๐Ÿ“ ์•„๋ž˜ Frequent Use(์œ„ Memory) ๐Ÿ“

๐Ÿ“๐Ÿ“๐Ÿ“๐Ÿ“๐Ÿ“๐Ÿ“๐Ÿ“๐Ÿ“๐Ÿ“๐Ÿ“๐Ÿ“๐Ÿ“๐Ÿ“๐Ÿ“๐Ÿ“๐Ÿ“๐Ÿ“๐Ÿ“๐Ÿ“๐Ÿ“๐Ÿ“๐Ÿ“๐Ÿ“๐Ÿ“๐Ÿ“๐Ÿ“๐Ÿ“๐Ÿ“๐Ÿ“๐Ÿ“

forge script script/poohnet-fund/DeployPoohnetFund.s.sol --rpc-url localnet --private-key $PRIVATE_KEY --broadcast

cast call $POOHNET_FUND_CONTRACT_ADDRESS "getOwner()" --rpc-url $LOCALNET_RPC_URL

cast balance 0xE024589D0BCd59267E430fB792B29Ce7716566dF --rpc-url $LOCALNET_RPC_URL

cast send $POOHNET_FUND_CONTRACT_ADDRESS --value 2ether --private-key $PRIVATE_KEY

cast send $POOHNET_FUND_CONTRACT_ADDRESS "transferBudget(address,uint256)" 0xE024589D0BCd59267E430fB792B29Ce7716566dF 1000000000000000000 --rpc-url $LOCALNET_RPC_URL --private-key $PRIVATE_KEY

cast balance 0xE024589D0BCd59267E430fB792B29Ce7716566dF --rpc-url http://localhost:8545

cast sig "calculatePower(uint256,uint256)"

cast storage 0xCada01dfasdfa03a0Da2343bc0daF 0 <=

cast chain-id --rpc-url https://rpc.ankr.com/bsc

cast tx 0x3f6da406747a55797a7f84173cbb243f4fd929d57326fdcfcf8d7ca55b75fe99 --rpc-url https://rpc.ankr.com/bsc

cast block --help

cast 4byte 88303dbd <= signame ๊ฐ€์ ธ์˜ค๊ธฐ cast sig 'buyTickets(uint256,uint32[])' <= sig ๊ฐ€์ ธ์˜ค๊ธฐ

cast --calldata-decode