ERC20 토큰 발행하려는데 IDE Deploy & Truffle로 스마트 컨트랙 배포 차이

답변 감사합니다 ^ ^

  1. truffle-config.js 참고해서 진행했는데 에러가 나네요
    node v12.11.0으로 업그레이드 했고, $ npm install truffle-hdwallet-provider-klaytn 했더니 아래와 같은 에러가 뜨네요. $truffle version하면 나오던 truffle, solc, web3 버전도 이젠 갑자기 안나오고, 이런 에러 메시지만 나옵니다.

Error: Cannot find module ‘@truffle/hdwallet-provider’

  • node v12.11.
  • npm v6.11.3
  • truffle v5.1.?

myerc20 npm install truffle-hdwallet-provider-klaytn
npm WARN deprecated mkdirp-promise@5.0.1: This package is broken and no longer maintained. 'mkdirp' itself supports promises now, please switch to that.
npm WARN deprecated tar.gz@1.0.7: ⚠️  WARNING ⚠️ tar.gz module has been deprecated and your application is vulnerable. Please use tar module instead: https://npmjs.com/tar
npm WARN deprecated fs-promise@2.0.3: Use mz or fs-extra^3.0 with Promise Support

> scrypt@6.0.3 preinstall /Users/david/klaytn2/node_modules/scrypt
> node node-scrypt-preinstall.js


> scrypt@6.0.3 install /Users/david/klaytn2/node_modules/scrypt
> node-gyp rebuild

  SOLINK_MODULE(target) Release/copied_files.node
  CC(target) Release/obj.target/scrypt_wrapper/src/util/memlimit.o
  CC(target) Release/obj.target/scrypt_wrapper/src/scryptwrapper/keyderivation.o
  CC(target) Release/obj.target/scrypt_wrapper/src/scryptwrapper/pickparams.o
  CC(target) Release/obj.target/scrypt_wrapper/src/scryptwrapper/hash.o
  LIBTOOL-STATIC Release/scrypt_wrapper.a
  CC(target) Release/obj.target/scrypt_lib/scrypt/scrypt-1.2.0/lib/crypto/crypto_scrypt.o
  CC(target) Release/obj.target/scrypt_lib/scrypt/scrypt-1.2.0/lib/crypto/crypto_scrypt_smix.o
  CC(target) Release/obj.target/scrypt_lib/scrypt/scrypt-1.2.0/libcperciva/util/warnp.o
  CC(target) Release/obj.target/scrypt_lib/scrypt/scrypt-1.2.0/libcperciva/alg/sha256.o
  CC(target) Release/obj.target/scrypt_lib/scrypt/scrypt-1.2.0/libcperciva/util/insecure_memzero.o
  CC(target) Release/obj.target/scrypt_lib/scrypt/scrypt-1.2.0/lib/scryptenc/scryptenc_cpuperf.o
  LIBTOOL-STATIC Release/scrypt_lib.a
  CXX(target) Release/obj.target/scrypt/src/node-boilerplate/scrypt_common.o
../src/node-boilerplate/scrypt_common.cc:98:12: warning: address of stack memory associated with local variable
      'scrypt_err_description' returned [-Wreturn-stack-address]
    return scrypt_err_description.c_str();
           ^~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
  CXX(target) Release/obj.target/scrypt/src/node-boilerplate/scrypt_params_async.o
In file included from ../src/node-boilerplate/scrypt_params_async.cc:4:
In file included from ../src/node-boilerplate/inc/scrypt_params_async.h:28:
In file included from ../src/node-boilerplate/inc/scrypt_async.h:28:
../src/node-boilerplate/inc/scrypt_common.h:39:14: warning: 'Get' is deprecated: Use maybe version
      [-Wdeprecated-declarations]
      N(obj->Get(Nan::New("N").ToLocalChecked())->Uint32Value()),
             ^
/Users/david/Library/Caches/node-gyp/12.11.0/include/node/v8.h:3457:3: note: 'Get' has been explicitly marked
      deprecated here
  V8_DEPRECATED("Use maybe version", Local Get(Local key));
  ^
/Users/david/Library/Caches/node-gyp/12.11.0/include/node/v8config.h:311:29: note: expanded from macro
      'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
In file included from ../src/node-boilerplate/scrypt_params_async.cc:4:
In file included from ../src/node-boilerplate/inc/scrypt_params_async.h:28:
In file included from ../src/node-boilerplate/inc/scrypt_async.h:28:
../src/node-boilerplate/inc/scrypt_common.h:39:63: error: too few arguments to function call, single argument
      'context' was not specified
      N(obj->Get(Nan::New("N").ToLocalChecked())->Uint32Value()),
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/Users/david/Library/Caches/node-gyp/12.11.0/include/node/v8.h:2611:3: note: 'Uint32Value' declared here
  V8_WARN_UNUSED_RESULT Maybe Uint32Value(
  ^
/Users/david/Library/Caches/node-gyp/12.11.0/include/node/v8config.h:351:31: note: expanded from macro
      'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
In file included from ../src/node-boilerplate/scrypt_params_async.cc:4:
In file included from ../src/node-boilerplate/inc/scrypt_params_async.h:28:
In file included from ../src/node-boilerplate/inc/scrypt_async.h:28:
../src/node-boilerplate/inc/scrypt_common.h:40:14: warning: 'Get' is deprecated: Use maybe version
      [-Wdeprecated-declarations]
      r(obj->Get(Nan::New("r").ToLocalChecked())->Uint32Value()),
             ^
/Users/david/Library/Caches/node-gyp/12.11.0/include/node/v8.h:3457:3: note: 'Get' has been explicitly marked
      deprecated here
  V8_DEPRECATED("Use maybe version", Local Get(Local key));
  ^
/Users/david/Library/Caches/node-gyp/12.11.0/include/node/v8config.h:311:29: note: expanded from macro
      'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
In file included from ../src/node-boilerplate/scrypt_params_async.cc:4:
In file included from ../src/node-boilerplate/inc/scrypt_params_async.h:28:
In file included from ../src/node-boilerplate/inc/scrypt_async.h:28:
../src/node-boilerplate/inc/scrypt_common.h:40:63: error: too few arguments to function call, single argument
      'context' was not specified
      r(obj->Get(Nan::New("r").ToLocalChecked())->Uint32Value()),
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/Users/david/Library/Caches/node-gyp/12.11.0/include/node/v8.h:2611:3: note: 'Uint32Value' declared here
  V8_WARN_UNUSED_RESULT Maybe Uint32Value(
  ^
/Users/david/Library/Caches/node-gyp/12.11.0/include/node/v8config.h:351:31: note: expanded from macro
      'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
In file included from ../src/node-boilerplate/scrypt_params_async.cc:4:
In file included from ../src/node-boilerplate/inc/scrypt_params_async.h:28:
In file included from ../src/node-boilerplate/inc/scrypt_async.h:28:
../src/node-boilerplate/inc/scrypt_common.h:41:14: warning: 'Get' is deprecated: Use maybe version
      [-Wdeprecated-declarations]
      p(obj->Get(Nan::New("p").ToLocalChecked())->Uint32Value()) {}
             ^
/Users/david/Library/Caches/node-gyp/12.11.0/include/node/v8.h:3457:3: note: 'Get' has been explicitly marked
      deprecated here
  V8_DEPRECATED("Use maybe version", Local Get(Local key));
  ^
/Users/david/Library/Caches/node-gyp/12.11.0/include/node/v8config.h:311:29: note: expanded from macro
      'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
In file included from ../src/node-boilerplate/scrypt_params_async.cc:4:
In file included from ../src/node-boilerplate/inc/scrypt_params_async.h:28:
In file included from ../src/node-boilerplate/inc/scrypt_async.h:28:
../src/node-boilerplate/inc/scrypt_common.h:41:63: error: too few arguments to function call, single argument
      'context' was not specified
      p(obj->Get(Nan::New("p").ToLocalChecked())->Uint32Value()) {}
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/Users/david/Library/Caches/node-gyp/12.11.0/include/node/v8.h:2611:3: note: 'Uint32Value' declared here
  V8_WARN_UNUSED_RESULT Maybe Uint32Value(
  ^
/Users/david/Library/Caches/node-gyp/12.11.0/include/node/v8config.h:351:31: note: expanded from macro
      'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
In file included from ../src/node-boilerplate/scrypt_params_async.cc:4:
In file included from ../src/node-boilerplate/inc/scrypt_params_async.h:28:
../src/node-boilerplate/inc/scrypt_async.h:53:17: warning: 'Call' is deprecated [-Wdeprecated-declarations]
      callback->Call(1, argv);
                ^
../../nan/nan.h:1741:3: note: 'Call' has been explicitly marked deprecated here
  NAN_DEPRECATED inline v8::Local
  ^
../../nan/nan.h:106:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
                                       ^
In file included from ../src/node-boilerplate/scrypt_params_async.cc:4:
../src/node-boilerplate/inc/scrypt_params_async.h:35:36: error: too few arguments to function call, single
      argument 'context' was not specified
      maxtime(info[0]->NumberValue()),
              ~~~~~~~~~~~~~~~~~~~~ ^
/Users/david/Library/Caches/node-gyp/12.11.0/include/node/v8.h:2608:3: note: 'NumberValue' declared here
  V8_WARN_UNUSED_RESULT Maybe NumberValue(Local context) const;
  ^
/Users/david/Library/Caches/node-gyp/12.11.0/include/node/v8config.h:351:31: note: expanded from macro
      'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
In file included from ../src/node-boilerplate/scrypt_params_async.cc:4:
../src/node-boilerplate/inc/scrypt_params_async.h:36:39: error: too few arguments to function call, single
      argument 'context' was not specified
      maxmemfrac(info[1]->NumberValue()),
                 ~~~~~~~~~~~~~~~~~~~~ ^
/Users/david/Library/Caches/node-gyp/12.11.0/include/node/v8.h:2608:3: note: 'NumberValue' declared here
  V8_WARN_UNUSED_RESULT Maybe NumberValue(Local context) const;
  ^
/Users/david/Library/Caches/node-gyp/12.11.0/include/node/v8config.h:351:31: note: expanded from macro
      'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
In file included from ../src/node-boilerplate/scrypt_params_async.cc:4:
../src/node-boilerplate/inc/scrypt_params_async.h:37:36: error: too few arguments to function call, single
      argument 'context' was not specified
      maxmem(info[2]->IntegerValue()),
             ~~~~~~~~~~~~~~~~~~~~~ ^
/Users/david/Library/Caches/node-gyp/12.11.0/include/node/v8.h:2609:3: note: 'IntegerValue' declared here
  V8_WARN_UNUSED_RESULT Maybe IntegerValue(
  ^
/Users/david/Library/Caches/node-gyp/12.11.0/include/node/v8config.h:351:31: note: expanded from macro
      'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
In file included from ../src/node-boilerplate/scrypt_params_async.cc:4:
../src/node-boilerplate/inc/scrypt_params_async.h:38:39: error: too few arguments to function call, single
      argument 'context' was not specified
      osfreemem(info[3]->IntegerValue())
                ~~~~~~~~~~~~~~~~~~~~~ ^
/Users/david/Library/Caches/node-gyp/12.11.0/include/node/v8.h:2609:3: note: 'IntegerValue' declared here
  V8_WARN_UNUSED_RESULT Maybe IntegerValue(
  ^
/Users/david/Library/Caches/node-gyp/12.11.0/include/node/v8config.h:351:31: note: expanded from macro
      'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
../src/node-boilerplate/scrypt_params_async.cc:23:8: warning: 'Set' is deprecated: Use maybe version
      [-Wdeprecated-declarations]
  obj->Set(Nan::New("N").ToLocalChecked(), Nan::New(logN));
       ^
/Users/david/Library/Caches/node-gyp/12.11.0/include/node/v8.h:3402:3: note: 'Set' has been explicitly marked
      deprecated here
  V8_DEPRECATED("Use maybe version",
  ^
/Users/david/Library/Caches/node-gyp/12.11.0/include/node/v8config.h:311:29: note: expanded from macro
      'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
../src/node-boilerplate/scrypt_params_async.cc:24:8: warning: 'Set' is deprecated: Use maybe version
      [-Wdeprecated-declarations]
  obj->Set(Nan::New("r").ToLocalChecked(), Nan::New(r));
       ^
/Users/david/Library/Caches/node-gyp/12.11.0/include/node/v8.h:3402:3: note: 'Set' has been explicitly marked
      deprecated here
  V8_DEPRECATED("Use maybe version",
  ^
/Users/david/Library/Caches/node-gyp/12.11.0/include/node/v8config.h:311:29: note: expanded from macro
      'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
../src/node-boilerplate/scrypt_params_async.cc:25:8: warning: 'Set' is deprecated: Use maybe version
      [-Wdeprecated-declarations]
  obj->Set(Nan::New("p").ToLocalChecked(), Nan::New(p));
       ^
/Users/david/Library/Caches/node-gyp/12.11.0/include/node/v8.h:3402:3: note: 'Set' has been explicitly marked
      deprecated here
  V8_DEPRECATED("Use maybe version",
  ^
/Users/david/Library/Caches/node-gyp/12.11.0/include/node/v8config.h:311:29: note: expanded from macro
      'V8_DEPRECATED'
  declarator __attribute__((deprecated(message)))
                            ^
../src/node-boilerplate/scrypt_params_async.cc:32:13: warning: 'Call' is deprecated [-Wdeprecated-declarations]
  callback->Call(2, argv);
            ^
../../nan/nan.h:1741:3: note: 'Call' has been explicitly marked deprecated here
  NAN_DEPRECATED inline v8::Local
  ^
../../nan/nan.h:106:40: note: expanded from macro 'NAN_DEPRECATED'
# define NAN_DEPRECATED __attribute__((deprecated))
                                       ^
8 warnings and 7 errors generated.
make: *** [Release/obj.target/scrypt/src/node-boilerplate/scrypt_params_async.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:196:23)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 19.6.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/david/klaytn2/node_modules/scrypt
gyp ERR! node -v v12.11.0
gyp ERR! node-gyp -v v5.0.3
gyp ERR! not ok
npm WARN ajv-keywords@3.5.2 requires a peer of ajv@^6.9.1 but none is installed. You must install peer dependencies yourself.
npm WARN klaytn2@1.0.0 No description
npm WARN klaytn2@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! scrypt@6.0.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the scrypt@6.0.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/david/.npm/_logs/2021-04-08T09_05_12_623Z-debug.log
  1. truffle 설치 후 truffle hdwallet을 설치해야 winnie 님이 작성하신 truffle-config.js를 이용해 스마트컨트랙 배포하거나 배포한 거에 접근할 수 있는거죠?

일단 truffle-hdwallet-provider-klaytn이 node 12에서는 제공안하는거 같은데 맞나요?
node 11로 다운그레이드하고 npm install truffle-hdwallet-provider-klaytn을 했을 때 여러 warning은 뜨는데 error는 안뜨긴 하네요.
그리고 truffle version을 입력하면 아까처럼 cannot find moudle '@truffle/hdwallet-provider’는 동일하고요
다시 처음부터 해야될거 같습니다…윽…