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

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.

主站蜘蛛池模板: 黄陵县| 京山县| 九江县| 中卫市| 贵德县| 定日县| 通许县| 平原县| 南投县| 崇义县| 扎鲁特旗| 怀仁县| 天水市| 普陀区| 桃园县| 廉江市| 浮山县| 巴中市| 体育| 吴堡县| 江阴市| 兰考县| 加查县| 忻州市| 舒兰市| 神农架林区| 宁武县| 海城市| 小金县| 土默特左旗| 湾仔区| 万荣县| 诸暨市| 巩义市| 江永县| 盐池县| 阿克苏市| 凤翔县| 双柏县| 本溪| 岑溪市|