Skip to content

Commit

Permalink
docs: add more comments to generator script
Browse files Browse the repository at this point in the history
  • Loading branch information
bowd committed Aug 18, 2024
1 parent b7755b6 commit 27139eb
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions bin/gen-array-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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++) {
Expand Down

0 comments on commit 27139eb

Please sign in to comment.