log doesn't print anything #5127
-
Hello everyone, I have encountered strange bug? Below I'm showing you my deploy code for 2 contracts. Problem is that for first contract console is printing functions Printing is working for below: const { network } = require("hardhat")
const { verify } = require("../utils/verify")
const { developmentChains } = require("../helper-hardhat-config")
module.exports = async ({ getNamedAccounts, deployments }) => {
const { deploy, log } = deployments
const { deployer } = await getNamedAccounts()
log("----------------------------------------------------")
arguments = []
const abstractImpulseNFT = await deploy("AbstractImpulseNFT", {
from: deployer,
args: arguments,
log: true,
waitConfirmations: network.config.blockConfirmations || 1,
})
// Verify Contract
if (!developmentChains.includes(network.name) && process.env.ETHERSCAN_API_KEY) {
log("Verifying...")
await verify(abstractImpulseNFT.address, arguments)
}
}
module.exports.tags = ["all", "MaliciousContract", "AbstractImpulseNFT"] Printing is not working for this one, except const { network, ethers } = require("hardhat")
module.exports = async ({ getNamedAccounts, deployments }) => {
const { deploy, log } = deployments
const { user } = await getNamedAccounts()
await deployments.fixture(["AbstractImpulseNFT"])
const abstractImpulseNFT = await ethers.getContract("AbstractImpulseNFT")
const abstractImpulseNFTAddress = abstractImpulseNFT.address
log(abstractImpulseNFTAddress)
log("----------------------------------------------------") // print isn't working
arguments = [abstractImpulseNFTAddress]
const maliciousContract = await deploy("MaliciousContract", {
from: user,
args: arguments,
log: true, // this isnt working also as it using `log()`
waitConfirmations: network.config.blockConfirmations || 1,
})
console.log(`MalCo: ${maliciousContract.address}`) // this prints data normal to console
}
module.exports.tags = ["all", "MaliciousContractx"] Does anyone have any idea how can i fix it and why it is working for 1 deploying script and not for another? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 11 replies
-
Does anyone have any clue what might be the problem here? |
Beta Was this translation helpful? Give feedback.
-
@Neftyr Is the script itself triggering? Please leave the repo so I can test locally as well. |
Beta Was this translation helpful? Give feedback.
@Neftyr Is the script itself triggering? Please leave the repo so I can test locally as well.