Closed olivmath closed 2 years ago
Hey, You need to make sure that the "name" parameter of the push function is exactly the same name than the contract name.
I improved the file for this, now it works
import { ethernal, ethers } from "hardhat"
async function main() {
const [owner] = await ethers.getSigners()
const Lib = await ethers.getContractFactory("Array")
const Array = await Lib.deploy()
const AutoPay = await ethers.getContractFactory("AutoPay", {
libraries: { Array: Array.address }
})
const Pay = await AutoPay.deploy()
console.log("Library address:", Array.address)
console.log("Contract address:", Pay.address)
console.log("Owner address:", owner.address)
await ethernal.push({
name: "AutoPay",
address: Pay.address
})
}
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error)
process.exit(1)
})
This is my deploy script
This is my error log