mirror of openzeppelin-contracts
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openzeppelin-contracts/test/helpers/enums.js

28 lines
417 B

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',
),
3 years ago
Rounding: Enum(
'Down',
'Up',
'Zero',
),
};