diff --git a/bin/gen-array-helpers.ts b/bin/gen-array-helpers.ts index a7fdacb..3e0645e 100644 --- a/bin/gen-array-helpers.ts +++ b/bin/gen-array-helpers.ts @@ -6,15 +6,10 @@ import fs from 'fs'; -const HEADER = ` -// AUTOGENERATED FILE (bin/gen-array-helpers.ts) DON'T MODIFY DIRECTLY -// SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity <0.9.0; -` - +// @dev Add more types to the TARGETS object to generate more functions const TARGETS = { - uints: { - type: "uint256" + uints: { // function name + type: "uint256" // type }, addresses: { type: 'address' @@ -26,8 +21,16 @@ const TARGETS = { type: 'bytes32' } } as const; +// @dev MAX_SIZE controls the maximum size of the array that can be generated +// the script will create overloaded functions with 1 to MAX_SIZE arguments. const MAX_SIZE = 8; +const HEADER = ` +// AUTOGENERATED FILE (bin/gen-array-helpers.ts) DON'T MODIFY DIRECTLY +// SPDX-License-Identifier: GPL-3.0-or-later +pragma solidity ^0.8; +` + const templateFnAssignments = (size: number): string => { let content = ''; for (let j = 0; j < size; j++) {