Open nicexe opened 4 years ago
So. I modified networks.js
to this:
rinkeby_local: {
provider: () => new HDWalletProvider(
mnemonic, `http://172.27.96.1:8545`, 2 // <-- added 1 more argument
),
networkId: 4,
gasPrice: 10e9
}
I did this so that HDWalletProvider starts generating accounts from 2 (zero indexed). I then selected account 0 and deployed.
This whole thing worked and the contract was deployed from the correct account.
I'm not really sure what the culprit is. I'm thinking it might be @truffle/hdwallet-provider
or even @openzeppelin/cli
Hi @nicexe! I’m sorry that you had this issue.
We have been able to reproduce this issue by following these steps:
$ npx oz session
? Pick a network rinkeby
? Enter a timeout in seconds to use for http-based web3 transactions 750
? Enter a timeout in blocks to use for websocket-based web3 transactions 50
? Choose the account to send transactions from (1) 0x059aE37646900CaA1680473d1280246AfCCC3114
? Enter an expiration time for this session (in seconds) 3600
Using network rinkeby, sender address 0x059aE37646900CaA1680473d1280246AfCCC3114, timeout 750 seconds, blockTimeout 50 blocks by default.
$ npx oz deploy --network rinkeby
Nothing to compile, all contracts are up to date.
? Choose the kind of deployment regular
Using session with network rinkeby, sender address 0x059aE37646900CaA1680473d1280246AfCCC3114, timeout 750 seconds, blockTimeout 50 blocks
? Pick a contract to deploy Box
✓ Deployed instance of Box
0x3FaFDb81B9DAC664B4e1F2b276865AC6bC94eC65
But the contract is actually deployed from the default account. See: https://rinkeby.etherscan.io/address/0x3FaFDb81B9DAC664B4e1F2b276865AC6bC94eC65
$ npx oz accounts
Using session with network rinkeby, sender address 0x059aE37646900CaA1680473d1280246AfCCC3114, timeout 750 seconds, blockTimeout 50 blocks
Accounts for rinkeby:
Default: 0x77737a65C296012C67F8c7f656d1Df81827c9541
All:
- 0: 0x77737a65C296012C67F8c7f656d1Df81827c9541
- 1: 0x059aE37646900CaA1680473d1280246AfCCC3114
Thanks so much for reporting it! The project owner will review and triage this issue as soon as they can. In the meantime, you can try the following workaround:
Instead of session
you can use oz deploy --from
to specify the account (as I suspect that the new deploy
doesn't appropriately use `session)
https://docs.openzeppelin.com/cli/2.8/commands#deploy
$ npx oz deploy --network rinkeby --from 0x059aE37646900CaA1680473d1280246AfCCC3114
Nothing to compile, all contracts are up to date.
? Choose the kind of deployment regular
Using session with network rinkeby, sender address 0x059aE37646900CaA1680473d1280246AfCCC3114, timeout 750 seconds, blockTimeout 50 blocks
? Pick a contract to deploy Box
✓ Deployed instance of Box
0x0d0FE29b73793370cF54c4Cb549d683c985C2B48
The contract is deployed using the specified account: https://rinkeby.etherscan.io/address/0x0d0FE29b73793370cF54c4Cb549d683c985C2B48
I noticed an odd behavior while using openzeppelin-cli where it uses the account in the list that @truffle/hdwallet-provider provides no matter what account was actually selected.
I'm using
@openzeppelin/cli
version2.8.2
and@truffle/hdwallet-provider
version1.0.42
Here is my
networks.js
:Here is how I deploy a contract This is what the node says:
And this is what etherscan says:
I don't really know if the issue is with openzeppelin-cli or with @truffle/hdwallet-provider