我正在运行SimpleStorage example中的一段简单代码,只是在上面添加了几行代码,用于我的其他合同。这份合约是用松露做成的。但在Cakeshop集成IDE上,它显示编译错误。
pragma solidity ^0.4.24;
pragma experimental ABIEncoderV2;
contract SimpleStorage {
uint public storedData;
event Change(string message, uint newVal);
function SimpleStorage(uint initVal) {
Change("initialized", initVal);
storedData = initVal;
}
function set(uint x) {
Change("set", x);
storedData = x;
}
function get() constant returns (uint retVal) {
return storedData;
}
}它应该像在本地计算机上编译一样在cakeshop web UI上进行编译
发布于 2018-12-20 13:47:32
使用Remix,您的合同可能存在以下潜在问题:
constructor关键字。public修饰符,包括应该使用emit关键字调用的constructor.emit Change("set", x);https://stackoverflow.com/questions/53859098
复制相似问题