Questions tagged [enum]
A data type consisting of a set of named values called elements, members or enumerators of the type.
4
questions
0
votes
1answer
41 views
If I pass an enum as a parameter does it get stored in the blockchain?
I'm developing a Rock/Paper/Scissors Smart Contract (with a Commit-Reveal scheme).
I have this enum: enum Move {rock, paper, scissors}
I want to pass it to a function, without storing it to the ...
1
vote
0answers
24 views
Mapping shared between contracts
I have enums that I use in many contracts of one project. Sometimes, they need to be mapped to a uint256. Their uint256 values do not relate to their positions in the enum list, so I can't just cast ...
2
votes
1answer
152 views
What size is an enum member inside of a struct
Let's consider the following code:
pragma solidity ^0.4.18;
contract Test {
enum EnumTest {
Test0,
Test1
}
struct StructTest {
EnumTest Foo;
uint256 Bar;
}
}
Not taking ...
1
vote
1answer
233 views
Possible to get enum length / count in solidity contract?
Is it possible to access the length of an enum in solidity?
E.g.
pragma solidity >=0.4.16 <0.6.0;
contract test {
enum ActionChoices { GoLeft, GoRight, GoStraight, SitStill }
function ...