Skip to content

Commit cea77ac

Browse files
rackstarshark0der
authored andcommitted
docs: add/extend function annotation for create2 and governance scripts
1 parent 1f44def commit cea77ac

6 files changed

+23
-3
lines changed

scripts/create2/deploy.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ const { parseEther } = require('ethers/lib/utils');
88

99
const ADDRESS_REGEX = /^0x[a-f0-9]{40}$/i;
1010

11+
/**
12+
* Supports both mainnet and tenderly networks
13+
*/
1114
const usage = () => {
1215
console.log(`
1316
Usage:

scripts/create2/get-signer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const getSigner = async (kind = SIGNER_TYPE.LOCAL) => {
1212
const provider = ethers.provider;
1313
const { AWS_KMS_KEY_ID, AWS_REGION } = process.env;
1414

15-
// Use contract deployer address to closely imitate main-net deployment
15+
// Use contract deployer address to closely mimic main-net deployment
1616
if (kind === SIGNER_TYPE.LOCAL) {
1717
await provider.send('hardhat_impersonateAccount', [CONTRACT_DEPLOYER]);
1818
const signer = await provider.getSigner(CONTRACT_DEPLOYER);

scripts/governance/execute-createProposalWithSolution-txdata.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ const { ethers, network } = require('hardhat');
33
const { sendTransaction, prepareProposalTransaction } = require('./helpers');
44

55
/**
6-
* Generate and execute the tx data for the Governance.createProposalWithSolution transaction
6+
* Generates and executes the tx data for the Governance.createProposalWithSolution transaction
7+
*
8+
* node execute-createProposalWithSolution-txdata.js <PATH_PROPOSAL_JSON> <CATEGORY_ID> <ENCODED_ACTION_DATA>
9+
*
710
* @param proposalFilePath path for file of proposal data containing title, shortDescription, and description
811
* @param categoryId category id for the proposal
912
* @param actionParamsRaw action params for the proposal as stringified JSON

scripts/governance/get-decoded-action-data.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ const { defaultAbiCoder, toUtf8String } = ethers.utils;
77
// Prefixed and non-prefixed hex are both valid
88
const HEX_REGEX = /^(?:0x)?[a-f0-9]+$/i;
99

10+
/**
11+
* Decodes the given encoded hex action data according to the categoryId
12+
*
13+
* Execute command:
14+
* node scripts/governance/get-decoded-action-data -i <CATEGORY_ID> -d '<HEX_ENCODED_ACTION_DATA>'
15+
*/
1016
const usage = () => {
1117
console.log(`
1218
Usage:

scripts/governance/get-encoded-action-data.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ const { PROPOSAL_CATEGORY } = require('./constants');
44
const { defaultAbiCoder, toUtf8Bytes } = ethers.utils;
55
const ADDRESS_REGEX = /^0x[a-f0-9]{40}$/i;
66

7+
/**
8+
* Encodes the given actions params according to the categoryId
9+
*
10+
* node scripts/governance/get-encoded-action-data -i <CATEGORY_ID> -a '<ACTION_PARAMS_JSON_ARRAY>'
11+
*/
712
const usage = () => {
813
console.log(`
914
Usage:

scripts/governance/simulate-createProposalWithSolution-txdata.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ const { ethers, network } = require('hardhat');
44
const { simulateTransaction, prepareProposalTransaction, verifyDecodedCreateProposalTxInputs } = require('./helpers');
55

66
/**
7-
* Generate and simulate the tx data for the Governance.createProposalWithSolution transaction
7+
* Generates and simulates the tx data for the Governance.createProposalWithSolution transaction
8+
*
9+
* node simulate-createProposalWithSolution-txdata.js <PATH_PROPOSAL_JSON> <CATEGORY_ID> <ENCODED_ACTION_DATA>
10+
*
811
* @param proposalFilePath path for file of proposal data containing title, shortDescription, and description
912
* @param categoryId category id for the proposal
1013
* @param actionParamsRaw action params for the proposal as stringified JSON

0 commit comments

Comments
 (0)