如何修改Truffle的Solidity版本【solc编译器版本】?

参考:https://blog.csdn.net/xuecuilan/article/details/95481199

官方文档配置:https://www.trufflesuite.com/docs/truffle/reference/configuration

如何修改Truffle的Solidity版本【solc编译器版本】?_第1张图片

truffle-config.js配置文件

module.exports = {
    networks: {
        development: {
            host: '127.0.0.1',
            port: 8545,
            network_id: '*', // Match any network id
        },
    },
    compilers: {
        solc: {
            version: "0.5.2", // A version or constraint - Ex. "^0.5.0"
            // Can also be set to "native" to use a native solc
            parser: "solcjs", // Leverages solc-js purely for speedy parsing
        }
    }
};

你可能感兴趣的:(如何修改Truffle的Solidity版本【solc编译器版本】?)