mirror of
https://github.com/cerc-io/watcher-ts
synced 2025-01-24 20:10:34 +00:00
17 lines
481 B
Solidity
17 lines
481 B
Solidity
|
// SPDX-License-Identifier: MIT
|
||
|
pragma solidity ^0.7.0;
|
||
|
|
||
|
contract TestEnums {
|
||
|
// Variables of this enum type will need 1 byte for storage.
|
||
|
enum Choices { Choice0, Choice1, Choice2, Choice3 }
|
||
|
|
||
|
// Enum type variables are packed together in a slot as they occupy less than 32 bytes together.
|
||
|
Choices choicesEnum1;
|
||
|
Choices choicesEnum2;
|
||
|
|
||
|
// Set variable choicesEnum1.
|
||
|
function setChoicesEnum1(Choices value) external {
|
||
|
choicesEnum1 = value;
|
||
|
}
|
||
|
}
|