Skip to content

Commit 2722e05

Browse files
authored
Update ABI spec (#14)
The [updated ABI spec](https://docs.soliditylang.org/en/latest/abi-spec.html) no longer includes the `constant` and `payable` fields. This has caused some confusion for students (example: https://discord.com/channels/872804414107312158/920317342028824637/975053564953112727)
1 parent 74cae44 commit 2722e05

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

README.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -234,28 +234,23 @@ For `setMood`, we describe each field below:
234234

235235
- name: `setMood`, self explanatory
236236
- type: `function`, self explanatory
237-
- constant: should be `false` because this is a function that updates data
238237
- outputs: should be `[]` because this does not return anything
239238
- stateMutability: This is `nonpayable` because this function does not accept Ether
240-
- payable: 'false` since this does not accept Ether
241239
- inputs: this is an array of inputs to the function. Each object in the array should have `internalType`, `name` and `type`, and these are `string`, `_mood` and `string` respectively
242240

243241
For `getMood`, we describe each field below:
244242

245243
- name: `getMood`, self explanatory
246244
- type: `function`, self explanatory
247-
- constant: should be `true` because this is a function that retrieves data. Even though this is a function, it is basically a getter
248245
- outputs: this has the same type as `inputs` in `setMood`. For `internalType`, `name` and `type`, this should be `string`, `""`, and `string` respectively
249246
- stateMutability: This is `view` because this is a view function
250-
- payable: 'false` since this does not accept Ether
251247
- inputs: this has no arguments so this should be `[]`
252248

253249
Your end result should look like this:
254250

255251
```
256252
const MoodContractABI = [
257253
{
258-
"constant": true,
259254
"inputs": [],
260255
"name": "getMood",
261256
"outputs": [
@@ -265,12 +260,10 @@ const MoodContractABI = [
265260
"type": "string"
266261
}
267262
],
268-
"payable": false,
269263
"stateMutability": "view",
270264
"type": "function"
271265
},
272266
{
273-
"constant": false,
274267
"inputs": [
275268
{
276269
"internalType": "string",
@@ -280,7 +273,6 @@ const MoodContractABI = [
280273
],
281274
"name": "setMood",
282275
"outputs": [],
283-
"payable": false,
284276
"stateMutability": "nonpayable",
285277
"type": "function"
286278
}

0 commit comments

Comments
 (0)