Skip to content

Lesson 6: Error: incorrect number of arguments to constructor #6355

Discussion options

You must be logged in to vote

Found the fix to this. I found a similar problem here.

Due to the updated documentation of ethers to V6, all I had to do was change deployed() to waitForDeployment() as below:

async function main() {
    const SimpleStorageFactory = await ethers.getContractFactory(
        'SimpleStorage'
    )
    console.log('Deploying contract...')
    const simpleStorage = await SimpleStorageFactory.deploy()
    console.log('Waiting for contract to be deployed...')
    await simpleStorage.waitForDeployment()
    console.log(`Deployed contract to: ${simpleStorage.target``}`)
}

Also, note that the last line is .target instead of .address:

 console.log(`Deployed contract to: ${simpleStorage.target``}`)

S…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by themalaysianguy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant