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

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.

主站蜘蛛池模板: 黑龙江省| 江陵县| 敖汉旗| 斗六市| 玉龙| 绍兴市| 怀来县| 时尚| 维西| 饶平县| 岑溪市| 梅河口市| 凉山| 冕宁县| 丰镇市| 灵山县| 平陆县| 合川市| 武汉市| 循化| 兴山县| 彩票| 峨山| 昌平区| 祁门县| 陕西省| 扶风县| 宜川县| 苗栗市| 双城市| 青浦区| 安塞县| 繁昌县| 淳化县| 肇州县| 新昌县| 永年县| 龙里县| 托克逊县| 临武县| 民乐县|