Files
openzeppelin-contracts/test/helpers/enums.js
Ernesto García b425a72240 Replace revert strings with custom errors (#4261)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Co-authored-by: Francisco <fg@frang.io>
2023-06-12 23:41:52 +00:00

12 lines
404 B
JavaScript

function Enum(...options) {
return Object.fromEntries(options.map((key, i) => [key, web3.utils.toBN(i)]));
}
module.exports = {
Enum,
ProposalState: Enum('Pending', 'Active', 'Canceled', 'Defeated', 'Succeeded', 'Queued', 'Expired', 'Executed'),
VoteType: Enum('Against', 'For', 'Abstain'),
Rounding: Enum('Down', 'Up', 'Zero'),
OperationState: Enum('Unset', 'Pending', 'Ready', 'Done'),
};