如何在Solidity 6.0中使用松露?

问题描述 投票:0回答:1

阅读松露官方文档,我发现松露不支持Solidity 6.0

pragma solidity >=0.4.21 <0.6.0;

有没有办法在SOLIDITY 6.0中使用松露?

ethereum solidity truffle
1个回答
0
投票

是的,这适用于此迁移

pragma solidity >=0.4.21 <0.7.0;

contract Migrations {
  address public owner;
  uint public last_completed_migration;

  constructor() public {
    owner = msg.sender;
  }

  modifier restricted() {
    if (msg.sender == owner) _;
  }

  function setCompleted(uint completed) public restricted {
    last_completed_migration = completed;
  }
}

和此编译器设置

compilers: {
     solc: {
       version: "^0.6.0",

并且还需要重新安装松露)

© www.soinside.com 2019 - 2024. All rights reserved.