小编aan*_*ain的帖子

在 Solidity 中,pure 修饰符和 view 修饰符有什么区别?

该代码产生相同的输出。

pragma solidity ^0.5.0;
contract mycontract
{

   function add(uint c, uint d) public pure returns(uint)
  { uint e=c+d;


   return e;

  } 
   function add(uint j, uint k) public view returns(uint)
  { uint f=j+k;


   return f;

  } 

}
Run Code Online (Sandbox Code Playgroud)

functional-programming blockchain ethereum solidity smartcontracts

10
推荐指数
2
解决办法
6947
查看次数