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/scripts/generate/templates/EnumerableSet.opts.js

16 lines
548 B

const { capitalize } = require('../../helpers');
const mapType = ({ type, size }) => [type == 'uint256' ? 'Uint' : capitalize(type), size].filter(Boolean).join('x');
const formatType = ({ type, size = undefined }) => ({
name: `${mapType({ type, size })}Set`,
type: size != undefined ? `${type}[${size}]` : type,
base: size != undefined ? type : undefined,
size,
});
const TYPES = [{ type: 'bytes32' }, { type: 'bytes32', size: 2 }, { type: 'address' }, { type: 'uint256' }].map(
formatType,
);
module.exports = { TYPES, formatType };