Parsing browser/ballot.sol:102:18:parserror:Expected';{';但得到的标识符契约令牌是ERC20Interface,Owned,SafeMath{^----^
我在尝试编译时收到错误消息Parsing browser/ballot.sol:102:18:parserror:Expected';{';但得到的标识符契约令牌是ERC20Interface,Owned,SafeMath{^----^,parsing,solidity,Parsing,Solidity,我在尝试编译时收到错误消息 ParserError: Expected '{' but got identifier contract token is ERC20Interface, Owned, SafeMath { ^----^ 在代码的第102行 pragma solidity ^0.4.19; // --------------------------------------------------------------------
ParserError: Expected '{' but got identifier
contract token is ERC20Interface, Owned, SafeMath {
^----^
在代码的第102行
pragma solidity ^0.4.19;
// --------------------------------------------------------------------
--------
// 'reSTEEM Reward token' token contract
//
// Deployed to : 0xC03fBB28Ce8280B97ecFa7b9a62112d507BA4c0a
// Symbol : rRt
// Name : reSTEEM Reward token
// Total supply: 300000000000000000000000
// Decimals : 18
//
//
// (c) by Moritz Neto with BokkyPooBah / Bok Consulting Pty Ltd Au 2017. The MIT Licence.
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// Safe maths
// ----------------------------------------------------------------------------
contract SafeMath {
function safeAdd(uint a, uint b) public pure returns (uint c) {
c = a + b;
require(c >= a);
}
function safeSub(uint a, uint b) public pure returns (uint c) {
require(b <= a);
c = a - b;
}
function safeMul(uint a, uint b) public pure returns (uint c) {
c = a * b;
require(a == 0 || c / a == b);
}
function safeDiv(uint a, uint b) public pure returns (uint c) {
require(b > 0);
c = a / b;
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
contract ERC20Interface {
function totalSupply() public constant returns (uint);
function balanceOf(address tokenOwner) public constant returns (uint balance);
function allowance(address tokenOwner, address spender) public constant returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
// ----------------------------------------------------------------------------
// Contract function to receive approval and execute function in one call
//
// Borrowed from MiniMeToken
// ----------------------------------------------------------------------------
contract ApproveAndCallFallBack {
function receiveApproval(address from, uint256 tokens, address token, bytes data) public;
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed _from, address indexed _to);
function Owned() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address _newOwner) public onlyOwner {
newOwner = _newOwner;
}
function acceptOwnership() public {
require(msg.sender == newOwner);
OwnershipTransferred(owner, newOwner);
owner = newOwner;
newOwner = address(0);
}
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract reSTEEM Reward token is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
function reSTEEM Reward token() public {
symbol = "rRt";
name = "reSTEEM Reward token";
decimals = 18;
_totalSupply = 300000000000000000000000;
balances[0xC03fBB28Ce8280B97ecFa7b9a62112d507BA4c0a] = _totalSupply;
Transfer(address(0), 0xC03fBB28Ce8280B97ecFa7b9a62112d507BA4c0a, _totalSupply);
}
// ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------
function totalSupply() public constant returns (uint) {
return _totalSupply - balances[address(0)];
}
// ------------------------------------------------------------------------
// Get the token balance for account tokenOwner
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public constant returns (uint balance) {
return balances[tokenOwner];
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to to account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint tokens) public returns (bool success) {
balances[msg.sender] = safeSub(balances[msg.sender], tokens);
balances[to] = safeAdd(balances[to], tokens);
Transfer(msg.sender, to, tokens);
return true;
}
// ------------------------------------------------------------------------
// Token owner can approve for spender to transferFrom(...) tokens
// from the token owner's account
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// recommends that there are no checks for the approval double-spend attack
// as this should be implemented in user interfaces
// ------------------------------------------------------------------------
function approve(address spender, uint tokens) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
Approval(msg.sender, spender, tokens);
return true;
}
// ------------------------------------------------------------------------
// Transfer tokens from the from account to the to account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the from account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint tokens) public returns (bool success) {
balances[from] = safeSub(balances[from], tokens);
allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens);
balances[to] = safeAdd(balances[to], tokens);
Transfer(from, to, tokens);
return true;
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public constant returns (uint remaining) {
return allowed[tokenOwner][spender];
}
// ------------------------------------------------------------------------
// Token owner can approve for spender to transferFrom(...) tokens
// from the token owner's account. The spender contract function
// receiveApproval(...) is then executed
// ------------------------------------------------------------------------
function approveAndCall(address spender, uint tokens, bytes data) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
Approval(msg.sender, spender, tokens);
ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, this, data);
return true;
}
// ------------------------------------------------------------------------
// Don't accept ETH
// ------------------------------------------------------------------------
function () public payable {
revert();
}
// ------------------------------------------------------------------------
// Owner can transfer out any accidentally sent ERC20 tokens
// ------------------------------------------------------------------------
function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) {
return ERC20Interface(tokenAddress).transfer(owner, tokens);
}
}
pragma-solidity^0.4.19;
// --------------------------------------------------------------------
--------
//“reSTEEM奖励代币”代币合同
//
//部署到:0xC03fBB28Ce8280B97ecFa7b9a62112d507BA4c0a
//符号:rRt
//名称:reSTEEM奖励令牌
//总供应量:3000000000000
//小数:18
//
//
//(c)由Moritz Neto与BokkyPooBah/Bok Consulting Pty Ltd于2017年在Au签订。麻省理工学院许可证。
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
//安全数学
// ----------------------------------------------------------------------------
合同安全数学{
函数safeAdd(uint a,uint b)公共纯返回(uint c){
c=a+b;
要求(c>=a);
}
函数safeSub(uint a,uint b)公共纯返回(uint c){
要求(b0);
c=a/b;
}
}
// ----------------------------------------------------------------------------
//ERC令牌标准#20接口
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
合同接口{
函数totalSupply()公共常量返回(uint);
函数余额(地址令牌所有者)公共常量返回(uint余额);
功能津贴(地址令牌所有者、地址支出者)公共固定收益(剩余uint);
函数传输(地址到,uint令牌)公共返回(bool成功);
职能部门批准(地址支出者、uint代币)公共返还(bool成功);
函数transferFrom(地址from、地址to、uint令牌)公共返回(bool success);
事件传输(地址索引自、地址索引至、uint令牌);
事件批准(地址索引令牌所有者、地址索引支出者、uint令牌);
}
// ----------------------------------------------------------------------------
//合同功能在一次调用中接收批准并执行功能
//
//从MiniMeToken借来的
// ----------------------------------------------------------------------------
合同批准和回退{
功能接收批准(地址来源、uint256令牌、地址令牌、字节数据)公共;
}
// ----------------------------------------------------------------------------
//自有合同
// ----------------------------------------------------------------------------
合同所有{
向公众所有人致辞;
向公众发表演说;
事件所有权转移(地址索引从,地址索引到);
函数Owned()public{
所有者=msg.sender;
}
仅修改器所有者{
要求(msg.sender==所有者);
_;
}
功能转移所有权(地址_newOwner)仅限公共所有者{
newOwner=_newOwner;
}
函数acceptOwnership()public{
require(msg.sender==newOwner);
所有权转让(所有者、新所有者);
所有者=新所有者;
newOwner=地址(0);
}
}
// ----------------------------------------------------------------------------
//ERC20令牌,添加符号、名称和小数,并辅助
//代币转账
// ----------------------------------------------------------------------------
合同恢复期奖励令牌为ERC20Interface,拥有,SafeMath{
字符串公共符号;
字符串公共名称;
uint8公共小数;
单位公共总供给;
映射(地址=>uint)余额;
允许映射(地址=>mapping(地址=>uint));
// ------------------------------------------------------------------------
//建造师
// ------------------------------------------------------------------------
函数reSTEEM Reward token()public{
symbol=“rRt”;
name=“reSTEEM奖励令牌”;
小数=18;
_总供应量=3000000000000000000;
余额[0xC03FBB28CE8280B97ECFA7B9A621212D507BA4C0A]=总供应量;
传输(地址(0),0xC03fBB28Ce8280B97ecFa7b9a62112d507BA4c0a,总电源);
}
// ------------------------------------------------------------------------
//总供给
// ------------------------------------------------------------------------
函数totalSupply()公共常量返回(uint){
返回_totalSupply-余额[地址(0)];
}
// ------------------------------------------------------------------------
//获取帐户令牌所有者的令牌余额
// ------------------------------------------------------------------------
函数余额(地址令牌所有者)公共常量返回(uint余额){
返回余额[令牌所有者];
}
// ------------------------------------------------------------------------
//将令牌所有者帐户的余额转移到令牌所有者帐户
//-业主账户必须有足够的余额进行转账
//允许-0值传输
// ------------------------------------------------------------------------
函数传输(地址到,uint令牌)公共返回(bool成功){
余额[msg.sender]=safeSub(余额[msg.sender],令牌);
余额[至]=安全添加(余额[至]、代币);
转账(msg.sender、to、tokens);
返回true;
}
// ------------------------------------------------------------------------
//令牌所有者可以批准spender从(…)令牌转移
//来自令牌所有者的帐户
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
//建议不检查批准双倍支出攻击
//因为这是
browser/Untitled3.sol:101:18: ParserError: Expected '{' but got identifier
contract reSTEEM Reward token is ERC20Interface, Owned, SafeMath {
^----^
contract reSTEEMRewardToken is ...