Lesson 5: Outline
Lesson 5 introduction and outline
Lesson 5: Advanced Data Types in Solidity
Part 1: Enums
pragma solidity ^0.8.0;
contract Example {
enum State { Waiting, Ready, Active }
State public state;
constructor() {
state = State.Waiting;
}
function activate() public {
state = State.Active;
}
function isReady() public view returns(bool) {
return state == State.Ready;
}
}Part 2: Structs
Part 3: Mappings
Part 4: Arrays
Last updated