Truffle

使用煉金術與不同的所有者部署相同的合約

  • March 30, 2022

我正在嘗試將契約部署到多邊形孟買測試網。它適用於第一個錢包地址,但是當我使用不同的錢包地址時它不起作用。我正在使用相同的煉金術 rpc url

truffle migrate --reset --network first_owner //works
truffle migrate --reset --network different_owner //doesn't work

第二個編譯正常,但沒有事務

//更新

松露配置文件

networks: {
matic_test: {
 provider: () => new HDWalletProvider({
   mnemonic: {
     phrase: process.env.MEMONIC
   },
   providerOrUrl: process.env.ALCHEMY_API_POLYGON_TEST
 }),
 network_id: 80001,
 confirmations: 2,
 timeoutBlocks: 200,
 skipDryRun: true,
 gas: 6000000,
 gasPrice: 10000000000,
 from : "WORKING_ADDRESS"
},
matic_test_staging: {
 provider: () => new HDWalletProvider({
   mnemonic: {
     phrase: process.env.MEMONIC_STAGING
   },
   providerOrUrl: process.env.ALCHEMY_API_POLYGON_TEST
 }),
 network_id: 80001,
 confirmations: 2,
 timeoutBlocks: 200,
 skipDryRun: true,
 gas: 6000000,
 gasPrice: 10000000000,
 from : "DIFFERENT_ADDRESS"
},
}

第二個只是編譯而不是部署任何想法?

已解決 從建構文件夾中刪除所有內容,然後建構它

引用自:https://ethereum.stackexchange.com/questions/124012