//hardhat 다운로드
npm init
npm install --save-dev hardhat
npm install --save-dev @nomicfoundation/hardhat-toolbox
npx hardhat
//hardhat 사용법
npx hardhat //hardhat이 다운로드 된 상태에서 사용하면 명령어 옵션을 알려준다
npx hardhat compile // hardhat 컴파일
npx hardhat node // 테스트 서버 실행
npx hardhat run ./scripts/deploy.js --network "localhost 또는 sepolia 등"
//sepolia에 컨트랙트 verify 하는 방법
npx hardhat verify --network sepolia "CA 주소"
- Ignition 사용방법 (모르는 내용은 hardhat 공식문서 참고)
//hardhat 다운로드
npm init
npm install --save-dev hardhat
npm install --save-dev @nomicfoundation/hardhat-toolbox
npx hardhat
//hardhat 사용법
npx hardhat //js 또는 ts 선택
npx hardhat compile // hardhat 컴파일
npx hardhat node // 테스트 서버 실행
npx hardhat ignition deploy ./ignition/modules/Lock.js --network "localhost 또는 sepolia 등"
//sepolia에 컨트랙트 verify 하는 방법
npx hardhat verify --network sepolia "CA 주소"
//test 하는 방법
npx hardhat test //test 조건은 'test' 폴더 내 js파일에 입력
npx hardhat test --network "localhost 또는 네트워크" //원하는 네트워크에서 테스트
ex) npx hardhat test ./test/RewardContractTest.ts --network localhost