Skip to content

Commit

Permalink
Added NeuroERC20 setter script
Browse files Browse the repository at this point in the history
  • Loading branch information
u-hubar committed Dec 26, 2024
1 parent 94904c2 commit 98867a5
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions deploy/100_set_neuro_erc20.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const neuroERC20Exists = hre.helpers.inConfig('NeurowebERC20');
if (neuroERC20Exists) {
const hubAddress =
hre.helpers.contractDeployments.contracts['Hub'].evmAddress;
const Hub = await hre.ethers.getContractAt('Hub', hubAddress);

const tokenInHub = await Hub['isContract(string)']('NeurowebERC20');
if (!tokenInHub) {
hre.helpers.newContracts.push({
name: 'NeurowebERC20',
addr: hre.helpers.contractDeployments.contracts['NeurowebERC20']
.evmAddress,
});
}
}
};
export default func;
func.tags = ['Neuro'];
func.dependencies = ['Hub'];

0 comments on commit 98867a5

Please sign in to comment.