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.
19 lines
436 B
19 lines
436 B
1 year ago
|
const mapType = str => (str == 'uint256' ? 'Uint' : `${str.charAt(0).toUpperCase()}${str.slice(1)}`);
|
||
|
const formatType = (keyType, valueType) => ({
|
||
|
name: `${mapType(keyType)}To${mapType(valueType)}Map`,
|
||
|
keyType,
|
||
|
valueType,
|
||
|
});
|
||
|
|
||
|
const TYPES = [
|
||
|
['uint256', 'uint256'],
|
||
|
['uint256', 'address'],
|
||
|
['address', 'uint256'],
|
||
|
['bytes32', 'uint256'],
|
||
|
].map(args => formatType(...args));
|
||
|
|
||
|
module.exports = {
|
||
|
TYPES,
|
||
|
formatType,
|
||
|
};
|