官术网_书友最值得收藏!

Enums

Enums are fixed size lists with unique names that you define. You can use them as custom modifiers for specific objects, or to hold a specific state in your smart contract. This is ideal for controlling the state of ICOs.

You declare them as follows:

enum Trees { RedTree, BlueTree, GreenTree, YellowTree }

Then, you create the enum variable:

Trees public myFavoriteTree = Trees.RedTree;

Note that you don't have to add a semicolon at the end of the enum declaration, but you do have to add it for the variable with the enum type that you just created.

主站蜘蛛池模板: 蓬莱市| 凤翔县| 宁阳县| 宿迁市| 新邵县| 萍乡市| 满城县| 农安县| 松江区| 祁连县| 衢州市| 尤溪县| 交城县| 合作市| 滨海县| 定西市| 尤溪县| 巴林右旗| 无锡市| 鹰潭市| 舒城县| 花莲县| 镇康县| 民丰县| 柳林县| 西城区| 泸州市| 郸城县| 樟树市| 定兴县| 景谷| 新疆| 根河市| 钦州市| 东源县| 仁寿县| 柳州市| 伊川县| 台湾省| 顺昌县| 海口市|