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

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.

主站蜘蛛池模板: 涿州市| 南乐县| 江陵县| 南郑县| 安西县| 黔西县| 共和县| 乐山市| 云阳县| 北碚区| 成都市| 铜陵市| 三明市| 厦门市| 崇文区| 东兰县| 莲花县| 文山县| 临夏县| 周口市| 阿尔山市| 云南省| 松阳县| 延津县| 尚义县| 远安县| 平南县| 塔城市| 新乐市| 齐齐哈尔市| 乌什县| 平顺县| 开封县| 潜山县| 新沂市| 岢岚县| 杭州市| 巴林右旗| 新民市| 武清区| 会同县|