ethereum(以太坊)(一)】的更多相关文章

从这周开始,开始学习以太坊开发--solidity,开始决定往区块链方向发展,毕竟区块链技术应用广泛.一开始接触solidity开发语言不太习惯,毕竟一直在学习python语法,有很多都不能接受.有难度,我喜欢!! 成功者往往会选择走人少走的,更艰难的路,只有做别人都很难实现的事,再加上个人加倍付出的努力,成功才更有意义!!! pragma solidity ^0.4.0; contract Test{ string str1; uint8 _age; uint8 _height; uint8…
pragma solidity ^0.4.10; contract Safebuy{ uint public price; address public seller; address public buyer; constructor() public payable{ seller = msg.sender; //uint value = msg.value / 2 ; //require(value *2 ==msg.value); price = msg.value; } enum St…
说真的,刚开始接触这个竞拍案例--“简单的公开竞拍”,我就抱着简单的心态去查看这个实例,但是自我感觉并不简单.应该是我实力不到家的原因吧!!!233333...不过经过大半天的努力,自己理解完之后,觉得是有那么点简单.(代码是官网上的,不过解释不太清楚.我加了自己的实践和理解,希望能帮助到大家) pragma solidity ^0.4.10; contract Bid{ //0x14723a09acff6d2a60dcdf7aa4aff308fddc160c,100 //0x4b0897b05…
pragma solidity ^0.4.10; contract Delete{ /* delete可用于任何变量(除mapping),将其设置成默认值 bytes/string:删除所有元素,其长度变为0 bytes32:重置所有索引的值 mapping:什么都不会发生 mapping(key=>value)中的key:删除与该键相关的值 */ string public str1 ='nihao'; function deletstr() public{ delete str1; } fu…
pragma solidity ^0.4.10; contract Byte{ bytes [] public T=new bytes[](3); function setLeng(uint len) public{ T.length=len; T.push('0x11'); } //bytes [5] public T1=new bytes[](5); //Type bytes memory[] memory is not implicitly convertible to //expecte…
pragma solidity ^0.4.0; contract EMath{ string public _a="lin"; function f() public{ modify(_a); } //function modify(string storage name) private{ function modify(string memory name) private{ //string storage c = name;Type string memory is not i…
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…
pragma solidity ^0.4.4; contract Students{ uint[] data= new uint[](4); address _owner = msg.sender; function get() constant returns(bool,uint,string,uint){ return(true,1,'eilinge',3); } function f() constant returns(uint[]){ (,data[2],,) = get(); ret…
编写应用合约之前,先弄清它的逻辑,有助于我们更好的部署合约 pragma solidity ^0.4.21; pragma experimental ABIEncoderV2; contract voter1{ //voter candidate //["eilinge", "lin" ,"meimei"] //admin 0x4B0897b0513fdC7C541B6d9D7E929C4e5364D2dB //0x14723a09acff6d2…
pragma solidity ^0.4.4; contract funder{ //0xca35b7d915458ef540ade6068dfe2f44e8fa733c //0x14723a09acff6d2a60dcdf7aa4aff308fddc160c :10 //0x583031d1113ad414f02576bd6afabfb302140225 :20 struct Funder{ address addr; uint amount; } struct Campaign{ addre…