Skip to content

Instantly share code, notes, and snippets.

@Jesserc
Created August 5, 2022 01:47
Show Gist options
  • Save Jesserc/8d5dbe40a2456ce214a7eea4cf5d0548 to your computer and use it in GitHub Desktop.
Save Jesserc/8d5dbe40a2456ce214a7eea4cf5d0548 to your computer and use it in GitHub Desktop.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract Enum {
enum Status {
Done,
AlmostDone,
Failed
}
Status public status = Status.AlmostDone;
function setStatus() public {
status = Status.Failed;
}
function set(Status _index) external returns (Status) {
return status = _index;
}
function reset() external {
delete status;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment