can anyone help me? I'm doing a simple Escrow (day10) tutorial, and trying to deploy the smart contract to Rinkeby Network, but I'm getting that error:

Dec 26, 2021, 3:52 AM
that's the deploy file that I'm using:
when deploying on Ganache local network the deployment works fine with that code
but if I try to deploy on Rinkeby Network placing the wallet addresses in the arguments directly, it works fine:
I don't want put the wallet address directly because it causes an error when testing with truffle test, I'd prefer to do it using 'accounts' object
Dec 26, 2021, 3:54 AM
Are you using the right names for your account arguments? Your comments say account[1] and account[2] but you are passing accounts[1] and accounts[2] to the deploy function
Dec 26, 2021, 4:08 AM
yes it was the right name, that singular name was a miswritten in the omment
I changed the code, so now it works in rinkeby deployment and truffle test:
Dec 26, 2021, 4:19 AM
First if statement should be && i think
Dec 26, 2021, 4:40 AM
oh yes, I changed it, thanks
the first if is to work on ganache local network, and the second if (else) is to work on Rinkeby network
Dec 26, 2021, 4:42 AM

© 2024 Draquery.com All rights reserved.