ERC20 Token contract: 0x828115756176849B3fa65a21Fe55b23B20A33bBB

Vesting Contract

Remix로 시작

etherscan 으로 코드 카피(포크)

https://etherscan.io/address/0xe29a625ba44cb442207f5640e77e05d8307a20f9#code

image.png

Hardhat으로 Deploy

openzeppelin 버전이슈

//hardhat.config.js
require("@nomiclabs/hardhat-waffle");

module.exports = {
  solidity: {
    compilers: [
      {
        version: "0.8.9",
      },
      {
        version: "0.8.20",
      },
    ],
  },
  paths: {
    sources: "./contracts",  // Solidity 파일들이 있는 경로를 지정
  },
};

Deploy

//deploy.js (초기버전은 삭제하였고, 해당 버전은 마지막 버전임. 중간에 ethers 추가함)
const { ethers } = require("hardhat");

async function main() {
  const FireVesting = await ethers.getContractFactory("FireVesting");
  const fireVesting = await FireVesting.deploy("0x828115756176849B3fa65a21Fe55b23B20A33bBB");

  await fireVesting.deployed();

  console.log("FireVesting deployed to:", fireVesting.address);
}

main()
  .then(() => process.exit(0))
  .catch((error) => {
    console.error(error);
    process.exit(1);
  });

openzeppelin 버전 하나로 통일(구 버전 로드)