solidity - 在 Remix - Solidity IDE 中,如何传递参数?
问题描述
我正在研究关于可靠性的智能合约,但遇到了问题。每次我尝试创建这个合同时,我的论点都没有得到证实。
我希望在选择名称时会出现“OreOreCoin”,但我得到的是一个空字符串。
和
这是我的代码:
pragma solidity ^0.4.8;
contract OreOreCoin{
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
mapping (address => uint256) public balanceOf;
event Transfer(address indexed from, address indexed to, uint256 value);
function OreOreCoin(uint256 _supply, string _name, string _symbol, uint8
_demicals){
balanceOf[msg.sender] = _supply;
name = _name;
symbol = _symbol;
decimals = _demicals;
totalSupply = _supply;
}
function transfer(address _to, uint256 _value){
if(balanceOf[msg.sender] < _value) throw;
if(balanceOf[_to] + _value < balanceOf[_to]) throw;
balanceOf[msg.sender] -= _value;
balanceOf[_to] += _value;
Transfer(msg.sender,_to,_value);
}
}
可能是什么问题呢?
解决方案
推荐阅读
- python - 如何在 python 包中添加/更改导入的函数?
- mysql - MySQL查询返回空结果
- android - Kotlin 服务应用程序图标
- python - 具有不同和相关步骤的嵌套循环
- python - 如何在 Django 中创建一定时间后删除记录?
- kubernetes - Kubernetes Traefik Ingress 使用 WebSockets 发送 500 个
- excel - 将整行(首先复制 A,然后复制 B,然后复制 C)复制到其特定单元格中的另一张纸上
- sql - 如何防止实体为空
- typescript - 从外部库导入的抽象类的受保护属性在扩展类中看不到
- android - ViewPager2 和 PageTransformer 随机选择错误页面