2019年5月16日 星期四

Ethereum- Learn Solidity step by step

  1. Common Function Types:

  • public: Anyone can call this function,but it isn't really used for any type of security per se.
  • private: Only contract can call this function.
  • view: This function returns data and doesn't modify the contract's data.
  • constant: the same function type as "view".
  • pure: Function will not modify or not even read the contract's data.
  • payable: We might attempt to call it and send money to the contract at the same time.

 Ex:
contract Indox{
String public message;
 *Function format
 function getMessage() public view returns (String){
 return message; }

    2.What is Gas?:

  • GasPrice: Amount of Wei the sender is willing to pay per unit gas to get this transaction processed
  • StartGas/GasUnits: Units of gas that transaction can be consumed.


Ethereum- Learn Solidity step by step

Common Function Types: public: Anyone can call this function,but it isn't really used for any type of security per se. priv...