ethereum(以太坊)(基础)--容易忽略的坑(一)
pragma solidity ^0.4.0;
contract base{
address public _owner=msg.sender;
uint _a;
string internal _b ;
uint private _c;
//uint external _d;ParserError: Expected identifier but got 'external'
function base() {
_a =10;
//uint _d public;Expected ';' but got 'public'
string _f;
}
function getA() public view returns (uint){
return _a;
}
function setA(uint c) internal{
_a=c;
}
//modifier OnlyAdmin() private{Expected '{' but got 'private'
modifier OnlyAdmin(){
require(_owner == msg.sender);
_;
}
function kill() OnlyAdmin() external{
setA(6);
this.getA();
selfdestruct(msg.sender);
}
}
contract base1 is base{
function getA() public view returns(uint){
//return _c;DeclarationError: Undeclared identifier. Did you mean "_a" or "_b"?
//return _b;Overriding function return types differ:覆盖函数返回类型不同
return _a;
}
function getE(){
this.kill();
this.getA();
//this.setA(20);Member "setA" not found or not visible after argument-dependent lookup in contract base1
}
}
contract base2{
uint public _e;
function getE(){
//this.getA();Member "getA" not found or not visible after argument-dependent lookup in contract base2
}
}
//contract base2 is base1,base{ Linearization of inheritance graph impossible:继承图的线性化是不可能的
contract base3 is base,base1{
uint public _e;
}
ethereum(以太坊)(基础)--容易忽略的坑(一)的更多相关文章
- ethereum(以太坊)(基础)--容易忽略的坑(三)
pragma solidity ^0.4.10; contract Byte{ bytes [] public T=new bytes[](3); function setLeng(uint len) ...
- ethereum(以太坊)(基础)--容易忽略的坑(二)
pragma solidity ^0.4.0; contract EMath{ string public _a="lin"; function f() public{ modif ...
- C#以太坊基础入门
在这一部分,我们将使用C#开发一个最简单的.Net控制台应用,来接入以太坊节点,并打印 所连接节点旳版本信息.通过这一部分的学习,你将掌握以下技能: 如何使用节点仿真器 如何在命令行访问以太坊节点 如 ...
- ethereum(以太坊)(一)
从这周开始,开始学习以太坊开发--solidity,开始决定往区块链方向发展,毕竟区块链技术应用广泛.一开始接触solidity开发语言不太习惯,毕竟一直在学习python语法,有很多都不能接受.有难 ...
- ethereum(以太坊)(十二)--应用(二)__投票(基础总和)
编写应用合约之前,先弄清它的逻辑,有助于我们更好的部署合约 pragma solidity ^0.4.21; pragma experimental ABIEncoderV2; contract vo ...
- ethereum(以太坊)(实例)--"安全的远程购买"
pragma solidity ^0.4.10; contract Safebuy{ uint public price; address public seller; address public ...
- ethereum(以太坊)(实例)--"简单的公开竞拍"
说真的,刚开始接触这个竞拍案例--“简单的公开竞拍”,我就抱着简单的心态去查看这个实例,但是自我感觉并不简单.应该是我实力不到家的原因吧!!!233333...不过经过大半天的努力,自己理解完之后,觉 ...
- ethereum(以太坊)(十四)--Delete
pragma solidity ^0.4.10; contract Delete{ /* delete可用于任何变量(除mapping),将其设置成默认值 bytes/string:删除所有元素,其长 ...
- ethereum(以太坊)(十三)--异常处理/元祖
pragma solidity ^0.4.4; contract Students{ uint[] data= new uint[](4); address _owner = msg.sender; ...
随机推荐
- Win10系统安装iis的方法【图文教程】
1.在win10系统中的开始按钮点击右键,选择控制面板: 2.从控制面板选择“程序”: 然后选择“启用或关闭windows功能” 3.从列表中选择Internet Infomation Service ...
- Apache Flume
An Event is a unit of data that flows through a Flume agent. The Event flows from Source to Channel ...
- CSS样式编写案例
1.制作如图三角形效果: 步骤一:将右侧盒子设置为相对定位 步骤二:在右侧盒子里面新建个子盒子,设置宽高相等,为正方形,绝对定位 步骤三:将绝对定位的盒子用CSS3旋转属性旋转 2.制定如图的序列号 ...
- linux 安装和卸载软件
安装: apt-get install cups-pdf 卸载:apt -get remove cups
- 国家与大洲对应关系json数据
[ { "continent_cname": "欧洲", "continent_name": "EU", "c ...
- 服务器bios&raid管理
新服务器配置流程 https://github.com/alces-software/knowledgebase/wiki/server-dell-rseries-r630 dell DTK(sysc ...
- SQL 创建自定义方法,匹配正则
C#代码 using System.Text.RegularExpressions; public class FunctionRegex { [Microsoft.SqlServer.Server. ...
- Struts2的学习-属性驱动和模型驱动
1.新建空项目,并托管到码云 2.设立maven 3.设置pom.xml 4.建包 5.在java包里建立两个类 package com.nf.entity; public class User { ...
- centos6.5升级python2.7
请看我的有道云笔记链接: http://note.youdao.com/noteshare?id=777179c98876147537288489e963b7db&sub=71D56E2269 ...
- HDU 1298 T9【字典树增加||查询】
任意门:http://acm.hdu.edu.cn/showproblem.php?pid=1298 T9 Time Limit: 2000/1000 MS (Java/Others) Memo ...