Is there a way to do comparison using enums in Sway?

If you want to compare an enum, one option would be to use a match expression:

You could also implement the Eq trait for your enum like the example below:

impl core::ops::Eq for MyEnum {
	fn eq(self, other: Self) -> bool {
		match (self, other) {
	       (MyEnum::First, MyEnum::First) => true,
	       (MyEnum::Second, MyEnum::Second) => true,
	       (MyEnum::Third, MyEnum::Third) => true,
	        _ => false,