diff --git a/contracts/test/TestERC20.sol b/contracts/test/TestERC20.sol new file mode 100644 index 0000000..70a9475 --- /dev/null +++ b/contracts/test/TestERC20.sol @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity 0.8.19; + +import '@openzeppelin/contracts/token/ERC20/ERC20.sol'; +import '@openzeppelin/contracts/access/Ownable.sol'; + +contract TestERC20 is ERC20, Ownable { + // Constructor + constructor(string memory name_, string memory symbol_) ERC20(name_, symbol_) {} + + //====================[ Internal ]==================== + + // Unpack data to get token amount and wallet address + function _unpack(uint256 value) internal pure returns (uint96, address) { + return (uint96(value >> 160), address(uint160(value))); + } + + //====================[ Owner ]==================== + + // Mint token in packed data + function batchMint(uint256[] calldata packedData) external onlyOwner returns (uint256) { + for (uint i = 0; i < packedData.length; i += 1) { + (uint96 amount, address to) = _unpack(packedData[i]); + _mint(to, amount); + } + return packedData.length; + } + + // Burn token in packed data + function batchBurn(uint256[] calldata packedData) external onlyOwner returns (uint256) { + for (uint i = 0; i < packedData.length; i += 1) { + (uint96 amount, address from) = _unpack(packedData[i]); + _burn(from, amount); + } + return packedData.length; + } +} diff --git a/hardhat.config.ts b/hardhat.config.ts index 7ddd680..e94ecf3 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -1,11 +1,15 @@ import fs from 'fs'; import { HardhatUserConfig } from 'hardhat/types'; -import { env } from './env'; import '@nomicfoundation/hardhat-toolbox'; -import '@matterlabs/hardhat-zksync'; -import '@matterlabs/hardhat-zksync-deploy'; -import '@matterlabs/hardhat-zksync-solc'; import '@openzeppelin/hardhat-upgrades'; +import { env } from './env'; + +// Only load those libs when we need zkSolc compiler +if (env.USE_ZKSOLC) { + require('@matterlabs/hardhat-zksync'); + require('@matterlabs/hardhat-zksync-deploy'); + require('@matterlabs/hardhat-zksync-solc'); +} if (fs.existsSync('./typechain-types')) { const dir = fs.opendirSync(`${__dirname}/tasks`); @@ -29,268 +33,283 @@ const compilers = ['0.8.19'].map((item: string) => ({ const config: HardhatUserConfig = { defaultNetwork: 'hardhat', - gasReporter: { - enabled: true, - }, zksolc: { version: '1.4.1', settings: {}, }, networks: { - sepolia: { + local: { + url: env.LOCAL_RPC, + chainId: 911, + }, + testnetSepolia: { url: 'https://rpc.sepolia.org', chainId: 11155111, }, - u2: { + ethereum: { + url: 'https://eth-mainnet.public.blastapi.io', + chainId: 1, + }, + testnetU2U: { url: 'https://rpc-nebulas-testnet.uniultra.xyz/', chainId: 2484, + verifyURL: 'https://testnet.u2uscan.xyz/api', }, - a8: { + mainnetU2U: { + url: 'https://rpc-mainnet.uniultra.xyz', + chainId: 39, + verifyURL: 'https://u2uscan.xyz/api', + }, + testnetAncient8: { url: 'https://rpcv2-testnet.ancient8.gg/', chainId: 28122024, }, - seitest: { + mainnetAncient8: { + url: 'https://rpc.ancient8.gg', + chainId: 888888888, + verifyURL: 'https://scan.ancient8.gg/api', + }, + testnetSei: { url: 'https://evm-rpc-arctic-1.sei-apis.com', chainId: 713715, }, - seimain: { + mainnetSei: { url: 'https://evm-rpc.sei-apis.com', chainId: 1329, }, - a8Main: { - url: 'https://rpc.ancient8.gg', - chainId: 888888888, - }, - u2umain: { - url: 'https://rpc-mainnet.uniultra.xyz', - chainId: 39, - }, - ethereum: { - url: 'https://eth-mainnet.public.blastapi.io', - chainId: 1, + testnetBnbChain: { + url: 'https://bsc-testnet-rpc.publicnode.com', + chainId: 97, }, - binance: { + mainnetBnbChain: { url: 'https://bnb.api.onfinality.io/public', chainId: 56, }, - arbitrum: { + testnetArbitrum: { + url: 'https://sepolia-rollup.arbitrum.io/rpc', + chainId: 421614, + }, + mainnetArbitrum: { url: 'https://arbitrum.blockpi.network/v1/rpc/public', chainId: 42161, }, - arbitrumTest: { - url: 'https://sepolia-rollup.arbitrum.io/rpc', - chainId: 421614, + testnetPolygon: { + url: 'https://rpc-amoy.polygon.technology', + chainId: 80002, + verifyURL: 'https://api-amoy.polygonscan.com/api', }, - polygon: { + mainnetPolygon: { url: 'https://rpc-mainnet.matic.quiknode.pro', chainId: 137, }, - optimism: { - url: 'https://optimism-mainnet.public.blastapi.io', - chainId: 10, - }, - optimismTest: { + testnetOptimism: { url: 'https://sepolia.optimism.io', chainId: 11155420, }, - fantomMain: { - url: 'https://fantom-mainnet.public.blastapi.io', - chainId: 250, + mainnetOptimism: { + url: 'https://optimism-mainnet.public.blastapi.io', + chainId: 10, }, - fantomTest: { + testnetFantom: { url: 'https://rpc.testnet.fantom.network', chainId: 4002, }, - okexchain: { + mainnetFantom: { + url: 'https://fantom-mainnet.public.blastapi.io', + chainId: 250, + }, + mainnetOKXChain: { url: 'https://exchainrpc.okex.org', chainId: 66, }, - bnbChainTest: { - url: 'https://bsc-testnet-rpc.publicnode.com', - chainId: 97, - }, - local: { - url: env.LOCAL_RPC, - chainId: 911, - }, - moonbeamTest: { + testnetMoonbeam: { url: 'https://rpc.api.moonbase.moonbeam.network', chainId: 1287, }, - saakuruTest: { + mainnetMoonbeam: { + url: 'https://moonbeam.api.onfinality.io/public', + chainId: 1284, + }, + testnetSaakuru: { url: 'https://rpc.testnet.oasys.games/', chainId: 9372, }, - saakuruTestL2: { - url: 'https://rpc-testnet.saakuru.network', - chainId: 247253, - }, - saakuruMainL2: { + mainnetSaakuru: { url: 'https://rpc.saakuru.network', chainId: 7225878, + verifyURL: 'https://explorer.saakuru.network/api', }, - zkFairTest: { + testnetZKFair: { url: 'https://testnet-rpc.zkfair.io', chainId: 43851, }, - zircuitTest: { + mainnetZKFair: { + url: 'https://rpc.zkfair.io', + chainId: 42766, + }, + testnetZircuit: { url: `https://zircuit1.p2pify.com/`, chainId: 48899, }, - zircuitMain: { + mainnetZircuit: { url: `https://zircuit1-mainnet.p2pify.com/`, chainId: 48900, }, - xLayerTest: { + testnetXLayer: { url: `https://testrpc.xlayer.tech/`, chainId: 195, }, - xLayerMain: { + mainnetXLayer: { url: `https://rpc.xlayer.tech/`, chainId: 196, }, - zkLinkTest: { + testnetZkLink: { url: `https://sepolia.rpc.zklink.io`, zksync: true, ethNetwork: 'https://sepolia.rpc.zklink.io', chainId: 810181, }, - mantaTest: { + mainnetZkLink: { + url: `https://rpc.zklink.io`, + zksync: true, + ethNetwork: `https://rpc.zklink.io`, + chainId: 810180, + }, + testnetManta: { url: `https://pacific-rpc.sepolia-testnet.manta.network/http`, chainId: 3441006, }, - mantaMainnet: { + mainnetManta: { url: `https://pacific-rpc.manta.network/http`, chainId: 169, }, - layerEdgeTest: { - url: `https://testnet-rpc.layeredge.io`, - chainId: 3456, + testnetBase: { + url: `https://base-sepolia-rpc.publicnode.com`, + chainId: 84532, }, - baseMain: { + mainnetBase: { url: `https://base-rpc.publicnode.com`, chainId: 8453, }, - baseTest: { - url: `https://base-sepolia-rpc.publicnode.com`, - chainId: 84532, - }, - morphHoleskyTest: { + testnetMorph: { url: `https://rpc-quicknode-holesky.morphl2.io`, chainId: 2810, }, - scrollTest: { + testnetScroll: { url: `https://sepolia-rpc.scroll.io/`, chainId: 534351, }, - scrollMain: { + mainnetScroll: { url: `https://rpc.scroll.io/`, chainId: 534352, + verifyURL: 'https://api.scrollscan.com/api', }, - wanchainTest: { + testnetWanchain: { url: 'https://gwan-ssl.wandevs.org:46891', chainId: 999, }, - bitlayerMain: { + testnetBitLayer: { + url: `https://testnet-rpc.bitlayer.org`, + chainId: 200810, + }, + mainnetBitlayer: { url: `https://rpc.bitlayer.org`, chainId: 200901, }, - bitlayerTest: { - url: `https://testnet-rpc.bitlayer.org`, - chainId: 200810, + testnetEtherLink: { + url: 'https://node.ghostnet.etherlink.com', + chainId: 128123, }, - etherLinkMain: { + mainnetEtherLink: { url: `https://node.mainnet.etherlink.com`, chainId: 42793, }, - etherLinkTest: { - url: 'https://node.ghostnet.etherlink.com', - chainId: 128123, + testnetZKSync: { + url: 'https://sepolia.era.zksync.dev', + ethNetwork: 'https://sepolia.era.zksync.dev', + chainId: 300, + zksync: true, }, - zkSyncMain: { + mainnetZKSync: { url: 'https://mainnet.era.zksync.io', ethNetwork: 'https://mainnet.era.zksync.io', verifyURL: 'https://zksync2-mainnet-explorer.zksync.io/contract_verification', zksync: true, chainId: 324, }, - zkSyncTest: { - url: 'https://sepolia.era.zksync.dev', - ethNetwork: 'https://sepolia.era.zksync.dev', - chainId: 300, - zksync: true, - }, - corechainTest: { + testnetCoreChain: { url: 'https://rpc.test.btcs.network', chainId: 1115, }, - corechainMain: { + mainnetCoreChain: { url: 'https://rpc.ankr.com/core', chainId: 1116, }, - lumiaTest: { + testnetLumia: { url: 'https://testnet-rpc.lumia.org', chainId: 1952959480, }, - lumiaMain: { + mainnetLumia: { url: 'https://rpc.lumia.org', chainId: 994873017, }, - reactiveTest: { + testnetReactive: { url: 'https://kopli-rpc.rkt.ink', chainId: 5318008, }, - ioTexMain: { - chainId: 4689, - url: 'https://babel-api.mainnet.iotex.io', - }, - ioTexTest: { + testnetIoTex: { chainId: 4690, url: 'https://babel-api.testnet.iotex.io', }, - shardeumTest: { + mainnetIoTex: { + chainId: 4689, + url: 'https://babel-api.mainnet.iotex.io', + }, + testnetShardeum: { chainId: 8082, url: 'https://atomium.shardeum.org', }, - b2Test: { + testnetB2: { chainId: 1123, url: 'https://rpc.ankr.com/b2_testnet', }, - b2Main: { + mainnetB2: { chainId: 223, url: 'https://mainnet.b2-rpc.com', }, - gnosisChainMain: { - chainId: 100, - url: 'https://rpc.gnosischain.com', - }, - gnosisChainTest: { + testnetGnosisChain: { chainId: 10200, url: 'https://rpc.chiadochain.net', }, - stravoTest: { + mainnetGnosisChain: { + chainId: 100, + url: 'https://rpc.gnosischain.com', + }, + testnetStravo: { chainId: 93747, url: 'https://rpc.stratovm.io', + verifyURL: 'https://explorer.stratovm.io/api', }, - lineaTest: { + testnetLinea: { chainId: 59141, url: 'https://rpc.sepolia.linea.build', }, - lineaMain: { + mainnetLinea: { chainId: 59144, url: 'https://rpc.linea.build', }, - polygonTest: { - url: 'https://rpc-amoy.polygon.technology', - chainId: 80002, - }, - lightLinkTest: { + testnetLightLink: { url: 'https://replicator.pegasus.lightlink.io/rpc/v1', chainId: 1891, }, - lightlinkMain: { + mainnetLightLink: { url: 'https://replicator.phoenix.lightlink.io/rpc/v1', chainId: 1890, + verifyURL: 'https://phoenix.lightlink.io/api', + }, + testnetMinato: { + url: 'https://rpc.minato.soneium.org', + chainId: 1946, }, // Hard hat network @@ -319,31 +338,14 @@ const config: HardhatUserConfig = { }, etherscan: { apiKey: { - saakuruMainL2: 'random_string', - binance: env.BSC_API_KEY, - a8Main: 'random_string', - u2uMain: 'random_string', - xLayerMain: env.X_LAYER_API_KEY, + mainnetBnbChain: env.BSC_API_KEY, + mainnetXLayer: env.X_LAYER_API_KEY, + // mainnetZircuit: env.ZIRCUIT_API_KEY, + mainnetZircuit: '0x4039486acc158aA6a0ddeC143252c3C8489f1948', }, customChains: [ { - network: 'saakuruMainL2', - chainId: 7225878, - urls: { - apiURL: 'https://explorer.saakuru.network/api', - browserURL: 'https://explorer.saakuru.network/', - }, - }, - { - network: 'polygonTest', - chainId: 80002, - urls: { - apiURL: 'https://api-amoy.polygonscan.com/api', - browserURL: 'https://amoy.polygonscan.com/', - }, - }, - { - network: 'binance', + network: 'mainnetBnbChain', chainId: 56, urls: { apiURL: 'https://api.bscscan.com/api', @@ -351,39 +353,7 @@ const config: HardhatUserConfig = { }, }, { - network: 'a8Main', - chainId: 888888888, - urls: { - apiURL: 'https://scan.ancient8.gg/api', - browserURL: 'https://scan.ancient8.gg', - }, - }, - { - network: 'u2uMain', - chainId: 39, - urls: { - apiURL: 'https://u2uscan.xyz/api', - browserURL: 'https://u2uscan.xyz', - }, - }, - { - network: 'u2uTest', - chainId: 2484, - urls: { - apiURL: 'https://testnet.u2uscan.xyz/api', - browserURL: 'https://testnet.u2uscan.xyz', - }, - }, - { - network: 'zircuit', - chainId: 48900, - urls: { - apiURL: 'https://explorer.zircuit.com/api/contractVerifyHardhat', - browserURL: 'https://explorer.zircuit.com', - }, - }, - { - network: 'xLayerMain', + network: 'mainnetXLayer', chainId: 196, urls: { apiURL: 'https://www.oklink.com/api/v5/explorer/contract/verify-source-code-plugin/XLAYER', @@ -391,31 +361,26 @@ const config: HardhatUserConfig = { }, }, { - network: 'scrollMain', - chainId: 534352, - urls: { - apiURL: 'https://api.scrollscan.com/api', - browserURL: 'https://scrollscan.com/', - }, - }, - { - network: 'lightlinkMain', - chainId: 1890, + network: 'mainnetZircuit', + chainId: 48900, urls: { - apiURL: 'https://phoenix.lightlink.io/api', - browserURL: 'https://phoenix.lightlink.io', + apiURL: 'https://explorer.zircuit.com/api/contractVerifyHardhat', + browserURL: 'https://explorer.zircuit.com', }, }, { - network: 'stravoTest', - chainId: 93747, + network: 'mainnetEtherLink', + chainId: 42793, urls: { - apiURL: 'https://explorer.stratovm.io/api', - browserURL: 'https://explorer.stratovm.io/', + apiURL: 'https://explorer.etherlink.com/api', + browserURL: 'https://explorer.etherlink.com', }, }, ], }, + solidity: { + compilers, + }, }; export default config; diff --git a/helpers/functions.ts b/helpers/functions.ts index 3217328..d94c23b 100644 --- a/helpers/functions.ts +++ b/helpers/functions.ts @@ -115,3 +115,7 @@ export async function printAllEvents(tx: ContractTransactionResponse) { export async function getCurrentBlockTimestamp(hre: HardhatRuntimeEnvironment): Promise { return ((await hre.ethers.provider.getBlock('latest')) || { timestamp: 0 }).timestamp; } + +export function packDataTokenBatchMint(amount: bigint, address: string): bigint { + return (amount << 160n) | BigInt(address); +} diff --git a/tasks/deploy-dice-game-v3-zk.ts b/tasks/deploy-dice-game-v3-zk.ts deleted file mode 100644 index def4d68..0000000 --- a/tasks/deploy-dice-game-v3-zk.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* eslint-disable no-await-in-loop */ -import '@nomicfoundation/hardhat-ethers'; -import { task } from 'hardhat/config'; -import { HardhatRuntimeEnvironment } from 'hardhat/types'; -import { env } from '../env'; -import { Provider, Wallet } from 'zksync-ethers'; -import { Deployer } from '@matterlabs/hardhat-zksync-deploy'; - -task('deploy:dice-game-v3-zk', 'Deploy dice game contracts with zkSolc').setAction( - async (_taskArgs: any, hre: HardhatRuntimeEnvironment) => { - const provider = new Provider(hre.network.config.url); - - if (!env.WALLET_PRIVATE_KEY) { - throw new Error('Not found wallet private key'); - } - const wallet = new Wallet(env.WALLET_PRIVATE_KEY, provider); - const deployer = new Deployer(hre, wallet); - const DiceGameV3Artifact = await deployer.loadArtifact('DiceGameV3'); - - const contract = await deployer.deploy(DiceGameV3Artifact, [ - '0xf9338096bb1bCdBDB83E5a237F198A60A48395a2', // Provider - '0xb0b5fFeF72c6ea620689CF947C0458fAD5cF58da', //Orocle - ]); - await contract.waitForDeployment(); - console.log('Dice game V3: ', await contract.getAddress()); - }, -); - -export default {}; diff --git a/tasks/deploy-dice-game-v3.ts b/tasks/deploy-dice-game-v3.ts index 6032929..da544d4 100644 --- a/tasks/deploy-dice-game-v3.ts +++ b/tasks/deploy-dice-game-v3.ts @@ -4,21 +4,33 @@ import { task } from 'hardhat/config'; import { HardhatRuntimeEnvironment } from 'hardhat/types'; import { Deployer } from '../helpers'; import { DiceGameV3 } from '../typechain-types'; -import { getWallet } from '../helpers/wallet'; +import { getWallet, getZkSyncWallet } from '../helpers/wallet'; +import { env } from '../env'; +import { Provider } from 'zksync-ethers'; +import { Deployer as zkDeployer } from '@matterlabs/hardhat-zksync'; + +const OROCLE_ADDRESS = '0x544FE7b51EF279c15f82B2037e524eeCa1E610C3'; +const ORAND_PROVIDER_ADDRESS = '0x219Eed0551cB8BCf55b61e1CFB353f4Ad1F5bcF7'; task('deploy:dice-game-v3', 'Deploy dice game contracts').setAction( async (_taskArgs: any, hre: HardhatRuntimeEnvironment) => { + console.log('Using zkSolc =', env.USE_ZKSOLC); const { chainId } = await hre.ethers.provider.getNetwork(); const account = await getWallet(hre, chainId); - //0x3ECb21f2c6A5a57C57634036777730bb6E87F281 - const deployer: Deployer = Deployer.getInstance(hre).connect(account); - await deployer.contractDeploy( - 'orochi/DiceGameV3', - [], - '0xD7a2643c1d9C3E6069f90DbAabd9D58825C7A2b9', // provider - '0xd26Ea014930305B498C5826cF0712F877CCAF93f', // orocle - ); - await deployer.printReport(); + + if (env.USE_ZKSOLC) { + const provider = new Provider(hre.network.config.url); + const wallet = getZkSyncWallet(account, provider); + const deployer = new zkDeployer(hre, wallet); + const diceGameArtifact = await deployer.loadArtifact('DiceGameV3'); + const diceGame = await deployer.deploy(diceGameArtifact, [ORAND_PROVIDER_ADDRESS, OROCLE_ADDRESS]); + await diceGame.waitForDeployment(); + console.log('DiceGame contract address:', await diceGame.getAddress()); + } else { + const deployer: Deployer = Deployer.getInstance(hre).connect(account); + await deployer.contractDeploy('orochi/DiceGameV3', [], ORAND_PROVIDER_ADDRESS, OROCLE_ADDRESS); + await deployer.printReport(); + } }, ); diff --git a/tasks/deploy-multicast.ts b/tasks/deploy-multicast.ts index db194dc..4be2c4c 100644 --- a/tasks/deploy-multicast.ts +++ b/tasks/deploy-multicast.ts @@ -11,9 +11,9 @@ import { Deployer as zkDeployer } from '@matterlabs/hardhat-zksync'; task('deploy:multicast', 'Deploy Multicast contracts').setAction( async (_taskArgs: any, hre: HardhatRuntimeEnvironment) => { + console.log('Using zkSolc =', env.USE_ZKSOLC); const { chainId } = await hre.ethers.provider.getNetwork(); const account = await getWallet(hre, chainId); - console.log('Using zkSolc =', env.USE_ZKSOLC); // If this blockchain need to use zkSolc if (env.USE_ZKSOLC) { diff --git a/tasks/deploy-test-token.ts b/tasks/deploy-test-token.ts index d770e7a..b40f961 100644 --- a/tasks/deploy-test-token.ts +++ b/tasks/deploy-test-token.ts @@ -1,10 +1,14 @@ /* eslint-disable no-await-in-loop */ +import { Deployer as zkDeployer } from '@matterlabs/hardhat-zksync'; import '@nomicfoundation/hardhat-ethers'; import { task } from 'hardhat/config'; import { HardhatRuntimeEnvironment } from 'hardhat/types'; -import { getWallet } from '../helpers/wallet'; +import { Provider } from 'zksync-ethers'; +import { env } from '../env'; +import { getWallet, getZkSyncWallet } from '../helpers/wallet'; +import { packDataTokenBatchMint } from '../helpers'; -const OUR_PARTNER_WALLET = [ +const TEST_RECEIVER_ADDRESS = [ '0x778346778c2d1278e918fbefebabf987b27c44ff', '0xA055fC33232Ced24ed58d00296050f07513478ad', '0xB290caE8652d7Dd291CD1E63fe1FAd522324DCd4', @@ -12,19 +16,31 @@ const OUR_PARTNER_WALLET = [ ]; const AMOUNT = 10n ** 9n * 10n ** 18n; -export const packData = (amount: bigint, address: string): bigint => (amount << 160n) | BigInt(address); +const TOKEN_NAME = 'Orochi Test Token'; +const TOKEN_SYMBOL = 'OT'; -task('deploy:test-token', 'Deploy our token for our partner testing').setAction( - async (_, hre: HardhatRuntimeEnvironment) => { - const { chainId } = await hre.ethers.provider.getNetwork(); - const account = await getWallet(hre, chainId); - const TestERCFactory = await hre.ethers.getContractFactory('TestERC20', account); - const token = await (await TestERCFactory.deploy('Orochi Test Token', 'OT')).waitForDeployment(); - - const packedArray = OUR_PARTNER_WALLET.map((item) => packData(AMOUNT, item)); - console.log('TestERC20 token contract address:', await token.getAddress()); +task('deploy:test-token', 'Deploy test token').setAction(async (_, hre: HardhatRuntimeEnvironment) => { + console.log('Using zkSolc =', env.USE_ZKSOLC); + const { chainId } = await hre.ethers.provider.getNetwork(); + const account = await getWallet(hre, chainId); + const packedArray = TEST_RECEIVER_ADDRESS.map((item) => packDataTokenBatchMint(AMOUNT, item)); + let tokenAddress: string; + if (env.USE_ZKSOLC) { + const provider = new Provider(hre.network.config.url); + const wallet = getZkSyncWallet(account, provider); + const deployer = new zkDeployer(hre, wallet); + const testERC20Artifact = await deployer.loadArtifact('TestERC20'); + const token = await deployer.deploy(testERC20Artifact, [TOKEN_NAME, TOKEN_SYMBOL]); + await token.waitForDeployment(); + await token.batchMint(packedArray); + tokenAddress = await token.getAddress(); + } else { + const testERC20Factory = await hre.ethers.getContractFactory('TestERC20', account); + const token = await testERC20Factory.deploy(TOKEN_NAME, TOKEN_SYMBOL); await token.batchMint(packedArray); - console.log('Successfully mint token to our partner'); - }, -); + tokenAddress = await token.getAddress(); + } + + console.log('TestERC20 token contract address:', tokenAddress); +}); diff --git a/tasks/mint-x-oro-token.ts b/tasks/mint-x-oro-token.ts deleted file mode 100644 index bd29469..0000000 --- a/tasks/mint-x-oro-token.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* eslint-disable no-await-in-loop */ -import '@nomicfoundation/hardhat-ethers'; -import { task } from 'hardhat/config'; -import { HardhatRuntimeEnvironment } from 'hardhat/types'; -import { getWallet } from '../helpers/wallet'; -import { XOroV2 } from '../typechain-types'; - -const CONTRACT_ADDRESS = '0x21651badF158a42CF84A051aE69409B10a933F19'; - -task('mint:x-oro-token', 'Mint Soul bound token X-OROV2').setAction(async (_, hre: HardhatRuntimeEnvironment) => { - const receiver = '0x10A0031781971bd37504354BBa49299885aD5cd4'; - const { chainId } = await hre.ethers.provider.getNetwork(); - const account = await getWallet(hre, chainId); - const contract = (await hre.ethers.getContractAt('XOroV2', CONTRACT_ADDRESS, account)) as XOroV2; - const tx = await contract.mint(receiver, 20); - console.log('Successfully minted user token at', tx); -}); - -export default {};