美文网首页
solidity base

solidity base

作者: 遥望泰山 | 来源:发表于2018-02-26 11:22 被阅读0次

历史

pragma solidity ^0.4.0;


contract Evidence{
    
     event getArrEvent(uint[] cc);
     event getLength(uint vvLength);
     
     function f() {
        //创建一个memory的数组
        uint[] memory a = new uint[](7);
        
        //不能修改长度
        //Error: Expression has to be an lvalue.
        //a.length = 100;
    }
    
    //storage
    uint[] b;
    
    function g(){
        b = new uint[](7);
        //可以修改storage的数组
        b.length = 10;
        b[9] = 100;
    }
    function v()returns (string ,uint){
        uint[3] memory vv = [uint(1),2,3];
        b = vv;
        getLength(b.push(4));
     return ("查看返回参数参数",b.push(4);
    }
  function getArr(){
      getArrEvent(b);
  }
   
}
pragma solidity ^0.4.0;
import "./Exteral0.sol";
import "./Exteral1.sol";
contract Exteral2 {


function useSetName(){

Exteral0 e = new Exteral0();
  
 Exteral0.SetName();



     

}
    function dddd() { 

    }

}

相关文章

网友评论

      本文标题:solidity base

      本文链接:https://www.haomeiwen.com/subject/dwbexftx.html