Skip to content

Instantly share code, notes, and snippets.

@Ankarrr
Last active February 26, 2018 03:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ankarrr/899e914701233cc4ddb26f211c2a1731 to your computer and use it in GitHub Desktop.
Save Ankarrr/899e914701233cc4ddb26f211c2a1731 to your computer and use it in GitHub Desktop.
  1. name:a string,function 名稱

  2. type:a string,"function", "constructor", or "fallback"

  3. inputs:an array,function 輸入的參數,包含:

    • name:a string,參數名稱

    • type:a string,參數的 data type(e.g. uint256)

    • components:an array,如果輸入的參數是 tuple(struct) type 才會有這個欄位。描述 struct 中包含的資料型態

  4. outputs:an array,function 的回傳值,和 inputs 使用相同表示方式。如果沒有回傳值可忽略,值為 []

  5. payabletrue,如果 function 可收 Ether,預設為 false

  6. constanttrue,如果 function 不會改寫區塊鏈的狀態,反之為 false

  7. stateMutability:a string,其值可能為以下其中之一:"pure"(不會讀和寫區塊鏈狀態)、"view"(會讀區塊鏈狀態,但不會改寫區塊鏈狀態)、"payable" and "nonpayable"(會改寫區塊鏈狀態,且如可收 Ether 為 "payable",反之為 "nonpayable")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment