Blockchain 在Ropsten网络上部署智能合约

Blockchain 在Ropsten网络上部署智能合约,blockchain,ethereum,solidity,truffle,Blockchain,Ethereum,Solidity,Truffle,我正在尝试在Ropsten网络上部署测试契约。我正在使用metamask、infura和truffle创建和测试合同。我的文件夹结构如下所示 const HDWalletProvider = require('truffle-hdwallet-provider') module.exports = { networks: { ropsten: { provider: function() { return n

我正在尝试在Ropsten网络上部署测试契约。我正在使用metamask、infura和truffle创建和测试合同。我的文件夹结构如下所示

    const HDWalletProvider = require('truffle-hdwallet-provider')
module.exports = {
    networks: {
        ropsten: {
            provider: function() {
                return new HDWalletProvider("Mnemonic key", "https://ropsten.infura.io/v3/API_KEY")
            },
            network_id: 3,
            gas: 4000000
        }
    },
    contracts_directory: './src/contracts/',
    contracts_build_directory: './src/abis/',
    compilers: {
        solc: {
            optimizer: {
                enabled: true,
                runs: 200
            }
        }
    }
}

我的迁移文件有以下代码

const TestContract = artifacts.require("TestContract");

module.exports = function(deployer) {
  deployer.deploy(TestContract);
};
当我运行truffle迁移时,我遇到以下错误 找不到任何源迁移的工件

我的truffle-config.js如下所示

    const HDWalletProvider = require('truffle-hdwallet-provider')
module.exports = {
    networks: {
        ropsten: {
            provider: function() {
                return new HDWalletProvider("Mnemonic key", "https://ropsten.infura.io/v3/API_KEY")
            },
            network_id: 3,
            gas: 4000000
        }
    },
    contracts_directory: './src/contracts/',
    contracts_build_directory: './src/abis/',
    compilers: {
        solc: {
            optimizer: {
                enabled: true,
                runs: 200
            }
        }
    }
}

您需要在contracts文件夹中有
迁移
合同:

pragma-solidity>=0.4.25