From 59ffafacfeca6d16a471633c5d415eec19a3fa11 Mon Sep 17 00:00:00 2001 From: Giorgi Lagidze Date: Tue, 19 Nov 2024 11:02:30 +0400 Subject: [PATCH] push --- packages/contracts/docs/config.js | 13 +- packages/contracts/docs/modules/api/nav.adoc | 2 +- .../pages/{TokenVoting.adoc => multisig.adoc} | 190 +++++++++--------- .../contracts/docs/templates/contract.hbs | 174 ---------------- packages/contracts/docs/templates/helpers.js | 80 -------- packages/contracts/docs/templates/page.hbs | 4 - .../contracts/docs/templates/properties.js | 85 -------- packages/contracts/package.json | 4 + packages/contracts/scripts/prepare-docs.sh | 12 +- 9 files changed, 119 insertions(+), 445 deletions(-) rename packages/contracts/docs/modules/api/pages/{TokenVoting.adoc => multisig.adoc} (85%) delete mode 100644 packages/contracts/docs/templates/contract.hbs delete mode 100644 packages/contracts/docs/templates/helpers.js delete mode 100644 packages/contracts/docs/templates/page.hbs delete mode 100644 packages/contracts/docs/templates/properties.js diff --git a/packages/contracts/docs/config.js b/packages/contracts/docs/config.js index f3b2c914..63448870 100644 --- a/packages/contracts/docs/config.js +++ b/packages/contracts/docs/config.js @@ -1,6 +1,14 @@ const path = require('path'); const fs = require('fs'); +const {version, repository} = require('../package.json'); + +const helpers = require(path.resolve(__dirname, './templates/helpers')); + +// overwrite the functions. +helpers.version = () => version; +helpers.githubURI = () => repository.url; + /** @type import('solidity-docgen/dist/config').UserConfig */ module.exports = { outputDir: 'docs/modules/api/pages', @@ -9,9 +17,6 @@ module.exports = { pageExtension: '.adoc', collapseNewlines: true, pages: (_, file, config) => { - const sourcesDir = path.resolve(config.root, config.sourcesDir); - let dir = path.resolve(config.root, file.absolutePath); - - return 'TokenVoting' + config.pageExtension; + return 'multisig' + config.pageExtension; }, }; diff --git a/packages/contracts/docs/modules/api/nav.adoc b/packages/contracts/docs/modules/api/nav.adoc index 59834feb..d57dc282 100644 --- a/packages/contracts/docs/modules/api/nav.adoc +++ b/packages/contracts/docs/modules/api/nav.adoc @@ -1,2 +1,2 @@ .API -* xref:TokenVoting.adoc[Token Voting] +* xref:multisig.adoc[Multisig] diff --git a/packages/contracts/docs/modules/api/pages/TokenVoting.adoc b/packages/contracts/docs/modules/api/pages/multisig.adoc similarity index 85% rename from packages/contracts/docs/modules/api/pages/TokenVoting.adoc rename to packages/contracts/docs/modules/api/pages/multisig.adoc index 9b006851..f1b5978f 100644 --- a/packages/contracts/docs/modules/api/pages/TokenVoting.adoc +++ b/packages/contracts/docs/modules/api/pages/multisig.adoc @@ -1,95 +1,95 @@ :github-icon: pass:[] -:xref-TokenVoting-initialize-contract-IDAO-struct-MajorityVotingBase-VotingSettings-contract-IVotesUpgradeable-struct-IPlugin-TargetConfig-uint256-bytes-: xref:TokenVoting.adoc#TokenVoting-initialize-contract-IDAO-struct-MajorityVotingBase-VotingSettings-contract-IVotesUpgradeable-struct-IPlugin-TargetConfig-uint256-bytes- -:xref-TokenVoting-initializeFrom-uint16-bytes-: xref:TokenVoting.adoc#TokenVoting-initializeFrom-uint16-bytes- -:xref-TokenVoting-supportsInterface-bytes4-: xref:TokenVoting.adoc#TokenVoting-supportsInterface-bytes4- -:xref-TokenVoting-getVotingToken--: xref:TokenVoting.adoc#TokenVoting-getVotingToken-- -:xref-TokenVoting-totalVotingPower-uint256-: xref:TokenVoting.adoc#TokenVoting-totalVotingPower-uint256- -:xref-TokenVoting-createProposal-bytes-struct-Action---uint256-uint64-uint64-enum-IMajorityVoting-VoteOption-bool-: xref:TokenVoting.adoc#TokenVoting-createProposal-bytes-struct-Action---uint256-uint64-uint64-enum-IMajorityVoting-VoteOption-bool- -:xref-TokenVoting-createProposal-bytes-struct-Action---uint64-uint64-bytes-: xref:TokenVoting.adoc#TokenVoting-createProposal-bytes-struct-Action---uint64-uint64-bytes- -:xref-TokenVoting-customProposalParamsABI--: xref:TokenVoting.adoc#TokenVoting-customProposalParamsABI-- -:xref-TokenVoting-isMember-address-: xref:TokenVoting.adoc#TokenVoting-isMember-address- -:xref-TokenVoting-_vote-uint256-enum-IMajorityVoting-VoteOption-address-bool-: xref:TokenVoting.adoc#TokenVoting-_vote-uint256-enum-IMajorityVoting-VoteOption-address-bool- -:xref-TokenVoting-_canVote-uint256-address-enum-IMajorityVoting-VoteOption-: xref:TokenVoting.adoc#TokenVoting-_canVote-uint256-address-enum-IMajorityVoting-VoteOption- -:xref-MajorityVotingBase-__MajorityVotingBase_init-contract-IDAO-struct-MajorityVotingBase-VotingSettings-struct-IPlugin-TargetConfig-uint256-bytes-: xref:TokenVoting.adoc#MajorityVotingBase-__MajorityVotingBase_init-contract-IDAO-struct-MajorityVotingBase-VotingSettings-struct-IPlugin-TargetConfig-uint256-bytes- -:xref-MajorityVotingBase-vote-uint256-enum-IMajorityVoting-VoteOption-bool-: xref:TokenVoting.adoc#MajorityVotingBase-vote-uint256-enum-IMajorityVoting-VoteOption-bool- -:xref-MajorityVotingBase-execute-uint256-: xref:TokenVoting.adoc#MajorityVotingBase-execute-uint256- -:xref-MajorityVotingBase-getVoteOption-uint256-address-: xref:TokenVoting.adoc#MajorityVotingBase-getVoteOption-uint256-address- -:xref-MajorityVotingBase-canVote-uint256-address-enum-IMajorityVoting-VoteOption-: xref:TokenVoting.adoc#MajorityVotingBase-canVote-uint256-address-enum-IMajorityVoting-VoteOption- -:xref-MajorityVotingBase-canExecute-uint256-: xref:TokenVoting.adoc#MajorityVotingBase-canExecute-uint256- -:xref-MajorityVotingBase-hasSucceeded-uint256-: xref:TokenVoting.adoc#MajorityVotingBase-hasSucceeded-uint256- -:xref-MajorityVotingBase-isSupportThresholdReached-uint256-: xref:TokenVoting.adoc#MajorityVotingBase-isSupportThresholdReached-uint256- -:xref-MajorityVotingBase-isSupportThresholdReachedEarly-uint256-: xref:TokenVoting.adoc#MajorityVotingBase-isSupportThresholdReachedEarly-uint256- -:xref-MajorityVotingBase-isMinParticipationReached-uint256-: xref:TokenVoting.adoc#MajorityVotingBase-isMinParticipationReached-uint256- -:xref-MajorityVotingBase-isMinApprovalReached-uint256-: xref:TokenVoting.adoc#MajorityVotingBase-isMinApprovalReached-uint256- -:xref-MajorityVotingBase-minApproval--: xref:TokenVoting.adoc#MajorityVotingBase-minApproval-- -:xref-MajorityVotingBase-supportThreshold--: xref:TokenVoting.adoc#MajorityVotingBase-supportThreshold-- -:xref-MajorityVotingBase-minParticipation--: xref:TokenVoting.adoc#MajorityVotingBase-minParticipation-- -:xref-MajorityVotingBase-minDuration--: xref:TokenVoting.adoc#MajorityVotingBase-minDuration-- -:xref-MajorityVotingBase-minProposerVotingPower--: xref:TokenVoting.adoc#MajorityVotingBase-minProposerVotingPower-- -:xref-MajorityVotingBase-votingMode--: xref:TokenVoting.adoc#MajorityVotingBase-votingMode-- -:xref-MajorityVotingBase-getProposal-uint256-: xref:TokenVoting.adoc#MajorityVotingBase-getProposal-uint256- -:xref-MajorityVotingBase-updateVotingSettings-struct-MajorityVotingBase-VotingSettings-: xref:TokenVoting.adoc#MajorityVotingBase-updateVotingSettings-struct-MajorityVotingBase-VotingSettings- -:xref-MajorityVotingBase-updateMinApprovals-uint256-: xref:TokenVoting.adoc#MajorityVotingBase-updateMinApprovals-uint256- -:xref-MajorityVotingBase-_execute-uint256-: xref:TokenVoting.adoc#MajorityVotingBase-_execute-uint256- -:xref-MajorityVotingBase-_hasSucceeded-uint256-: xref:TokenVoting.adoc#MajorityVotingBase-_hasSucceeded-uint256- -:xref-MajorityVotingBase-_canExecute-uint256-: xref:TokenVoting.adoc#MajorityVotingBase-_canExecute-uint256- -:xref-MajorityVotingBase-_isProposalOpen-struct-MajorityVotingBase-Proposal-: xref:TokenVoting.adoc#MajorityVotingBase-_isProposalOpen-struct-MajorityVotingBase-Proposal- -:xref-MajorityVotingBase-_updateVotingSettings-struct-MajorityVotingBase-VotingSettings-: xref:TokenVoting.adoc#MajorityVotingBase-_updateVotingSettings-struct-MajorityVotingBase-VotingSettings- -:xref-MajorityVotingBase-_updateMinApprovals-uint256-: xref:TokenVoting.adoc#MajorityVotingBase-_updateMinApprovals-uint256- -:xref-MajorityVotingBase-_validateProposalDates-uint64-uint64-: xref:TokenVoting.adoc#MajorityVotingBase-_validateProposalDates-uint64-uint64- -:xref-MajorityVotingBase-UPDATE_VOTING_SETTINGS_PERMISSION_ID-bytes32: xref:TokenVoting.adoc#MajorityVotingBase-UPDATE_VOTING_SETTINGS_PERMISSION_ID-bytes32 -:xref-MajorityVotingBase-CREATE_PROPOSAL_PERMISSION_ID-bytes32: xref:TokenVoting.adoc#MajorityVotingBase-CREATE_PROPOSAL_PERMISSION_ID-bytes32 -:xref-MajorityVotingBase-EXECUTE_PROPOSAL_PERMISSION_ID-bytes32: xref:TokenVoting.adoc#MajorityVotingBase-EXECUTE_PROPOSAL_PERMISSION_ID-bytes32 -:xref-MajorityVotingBase-VotingSettingsUpdated-enum-MajorityVotingBase-VotingMode-uint32-uint32-uint64-uint256-: xref:TokenVoting.adoc#MajorityVotingBase-VotingSettingsUpdated-enum-MajorityVotingBase-VotingMode-uint32-uint32-uint64-uint256- -:xref-MajorityVotingBase-VotingMinApprovalUpdated-uint256-: xref:TokenVoting.adoc#MajorityVotingBase-VotingMinApprovalUpdated-uint256- -:xref-IMajorityVoting-VoteCast-uint256-address-enum-IMajorityVoting-VoteOption-uint256-: xref:TokenVoting.adoc#IMajorityVoting-VoteCast-uint256-address-enum-IMajorityVoting-VoteOption-uint256- -:xref-MajorityVotingBase-__MajorityVotingBase_init-contract-IDAO-struct-MajorityVotingBase-VotingSettings-struct-IPlugin-TargetConfig-uint256-bytes-: xref:TokenVoting.adoc#MajorityVotingBase-__MajorityVotingBase_init-contract-IDAO-struct-MajorityVotingBase-VotingSettings-struct-IPlugin-TargetConfig-uint256-bytes- -:xref-MajorityVotingBase-supportsInterface-bytes4-: xref:TokenVoting.adoc#MajorityVotingBase-supportsInterface-bytes4- -:xref-MajorityVotingBase-vote-uint256-enum-IMajorityVoting-VoteOption-bool-: xref:TokenVoting.adoc#MajorityVotingBase-vote-uint256-enum-IMajorityVoting-VoteOption-bool- -:xref-MajorityVotingBase-execute-uint256-: xref:TokenVoting.adoc#MajorityVotingBase-execute-uint256- -:xref-MajorityVotingBase-getVoteOption-uint256-address-: xref:TokenVoting.adoc#MajorityVotingBase-getVoteOption-uint256-address- -:xref-MajorityVotingBase-canVote-uint256-address-enum-IMajorityVoting-VoteOption-: xref:TokenVoting.adoc#MajorityVotingBase-canVote-uint256-address-enum-IMajorityVoting-VoteOption- -:xref-MajorityVotingBase-canExecute-uint256-: xref:TokenVoting.adoc#MajorityVotingBase-canExecute-uint256- -:xref-MajorityVotingBase-hasSucceeded-uint256-: xref:TokenVoting.adoc#MajorityVotingBase-hasSucceeded-uint256- -:xref-MajorityVotingBase-isSupportThresholdReached-uint256-: xref:TokenVoting.adoc#MajorityVotingBase-isSupportThresholdReached-uint256- -:xref-MajorityVotingBase-isSupportThresholdReachedEarly-uint256-: xref:TokenVoting.adoc#MajorityVotingBase-isSupportThresholdReachedEarly-uint256- -:xref-MajorityVotingBase-isMinParticipationReached-uint256-: xref:TokenVoting.adoc#MajorityVotingBase-isMinParticipationReached-uint256- -:xref-MajorityVotingBase-isMinApprovalReached-uint256-: xref:TokenVoting.adoc#MajorityVotingBase-isMinApprovalReached-uint256- -:xref-MajorityVotingBase-minApproval--: xref:TokenVoting.adoc#MajorityVotingBase-minApproval-- -:xref-MajorityVotingBase-supportThreshold--: xref:TokenVoting.adoc#MajorityVotingBase-supportThreshold-- -:xref-MajorityVotingBase-minParticipation--: xref:TokenVoting.adoc#MajorityVotingBase-minParticipation-- -:xref-MajorityVotingBase-minDuration--: xref:TokenVoting.adoc#MajorityVotingBase-minDuration-- -:xref-MajorityVotingBase-minProposerVotingPower--: xref:TokenVoting.adoc#MajorityVotingBase-minProposerVotingPower-- -:xref-MajorityVotingBase-votingMode--: xref:TokenVoting.adoc#MajorityVotingBase-votingMode-- -:xref-MajorityVotingBase-totalVotingPower-uint256-: xref:TokenVoting.adoc#MajorityVotingBase-totalVotingPower-uint256- -:xref-MajorityVotingBase-getProposal-uint256-: xref:TokenVoting.adoc#MajorityVotingBase-getProposal-uint256- -:xref-MajorityVotingBase-updateVotingSettings-struct-MajorityVotingBase-VotingSettings-: xref:TokenVoting.adoc#MajorityVotingBase-updateVotingSettings-struct-MajorityVotingBase-VotingSettings- -:xref-MajorityVotingBase-updateMinApprovals-uint256-: xref:TokenVoting.adoc#MajorityVotingBase-updateMinApprovals-uint256- -:xref-MajorityVotingBase-createProposal-bytes-struct-Action---uint256-uint64-uint64-enum-IMajorityVoting-VoteOption-bool-: xref:TokenVoting.adoc#MajorityVotingBase-createProposal-bytes-struct-Action---uint256-uint64-uint64-enum-IMajorityVoting-VoteOption-bool- -:xref-MajorityVotingBase-_vote-uint256-enum-IMajorityVoting-VoteOption-address-bool-: xref:TokenVoting.adoc#MajorityVotingBase-_vote-uint256-enum-IMajorityVoting-VoteOption-address-bool- -:xref-MajorityVotingBase-_execute-uint256-: xref:TokenVoting.adoc#MajorityVotingBase-_execute-uint256- -:xref-MajorityVotingBase-_canVote-uint256-address-enum-IMajorityVoting-VoteOption-: xref:TokenVoting.adoc#MajorityVotingBase-_canVote-uint256-address-enum-IMajorityVoting-VoteOption- -:xref-MajorityVotingBase-_hasSucceeded-uint256-: xref:TokenVoting.adoc#MajorityVotingBase-_hasSucceeded-uint256- -:xref-MajorityVotingBase-_canExecute-uint256-: xref:TokenVoting.adoc#MajorityVotingBase-_canExecute-uint256- -:xref-MajorityVotingBase-_isProposalOpen-struct-MajorityVotingBase-Proposal-: xref:TokenVoting.adoc#MajorityVotingBase-_isProposalOpen-struct-MajorityVotingBase-Proposal- -:xref-MajorityVotingBase-_updateVotingSettings-struct-MajorityVotingBase-VotingSettings-: xref:TokenVoting.adoc#MajorityVotingBase-_updateVotingSettings-struct-MajorityVotingBase-VotingSettings- -:xref-MajorityVotingBase-_updateMinApprovals-uint256-: xref:TokenVoting.adoc#MajorityVotingBase-_updateMinApprovals-uint256- -:xref-MajorityVotingBase-_validateProposalDates-uint64-uint64-: xref:TokenVoting.adoc#MajorityVotingBase-_validateProposalDates-uint64-uint64- -:xref-MajorityVotingBase-UPDATE_VOTING_SETTINGS_PERMISSION_ID-bytes32: xref:TokenVoting.adoc#MajorityVotingBase-UPDATE_VOTING_SETTINGS_PERMISSION_ID-bytes32 -:xref-MajorityVotingBase-CREATE_PROPOSAL_PERMISSION_ID-bytes32: xref:TokenVoting.adoc#MajorityVotingBase-CREATE_PROPOSAL_PERMISSION_ID-bytes32 -:xref-MajorityVotingBase-EXECUTE_PROPOSAL_PERMISSION_ID-bytes32: xref:TokenVoting.adoc#MajorityVotingBase-EXECUTE_PROPOSAL_PERMISSION_ID-bytes32 -:xref-MajorityVotingBase-VotingSettingsUpdated-enum-MajorityVotingBase-VotingMode-uint32-uint32-uint64-uint256-: xref:TokenVoting.adoc#MajorityVotingBase-VotingSettingsUpdated-enum-MajorityVotingBase-VotingMode-uint32-uint32-uint64-uint256- -:xref-MajorityVotingBase-VotingMinApprovalUpdated-uint256-: xref:TokenVoting.adoc#MajorityVotingBase-VotingMinApprovalUpdated-uint256- -:xref-IMajorityVoting-VoteCast-uint256-address-enum-IMajorityVoting-VoteOption-uint256-: xref:TokenVoting.adoc#IMajorityVoting-VoteCast-uint256-address-enum-IMajorityVoting-VoteOption-uint256- -:xref-TokenVotingSetup-constructor-contract-GovernanceERC20-contract-GovernanceWrappedERC20-: xref:TokenVoting.adoc#TokenVotingSetup-constructor-contract-GovernanceERC20-contract-GovernanceWrappedERC20- -:xref-TokenVotingSetup-prepareInstallation-address-bytes-: xref:TokenVoting.adoc#TokenVotingSetup-prepareInstallation-address-bytes- -:xref-TokenVotingSetup-prepareUpdate-address-uint16-struct-IPluginSetup-SetupPayload-: xref:TokenVoting.adoc#TokenVotingSetup-prepareUpdate-address-uint16-struct-IPluginSetup-SetupPayload- -:xref-TokenVotingSetup-prepareUninstallation-address-struct-IPluginSetup-SetupPayload-: xref:TokenVoting.adoc#TokenVotingSetup-prepareUninstallation-address-struct-IPluginSetup-SetupPayload- -:xref-TokenVotingSetup-supportsIVotesInterface-address-: xref:TokenVoting.adoc#TokenVotingSetup-supportsIVotesInterface-address- -:xref-TokenVotingSetup-governanceERC20Base-address: xref:TokenVoting.adoc#TokenVotingSetup-governanceERC20Base-address -:xref-TokenVotingSetup-governanceWrappedERC20Base-address: xref:TokenVoting.adoc#TokenVotingSetup-governanceWrappedERC20Base-address -:xref-VotingPowerCondition-constructor-address-: xref:TokenVoting.adoc#VotingPowerCondition-constructor-address- -:xref-VotingPowerCondition-isGranted-address-address-bytes32-bytes-: xref:TokenVoting.adoc#VotingPowerCondition-isGranted-address-address-bytes32-bytes- +:xref-TokenVoting-initialize-contract-IDAO-struct-MajorityVotingBase-VotingSettings-contract-IVotesUpgradeable-struct-IPlugin-TargetConfig-uint256-bytes-: xref:multisig.adoc#TokenVoting-initialize-contract-IDAO-struct-MajorityVotingBase-VotingSettings-contract-IVotesUpgradeable-struct-IPlugin-TargetConfig-uint256-bytes- +:xref-TokenVoting-initializeFrom-uint16-bytes-: xref:multisig.adoc#TokenVoting-initializeFrom-uint16-bytes- +:xref-TokenVoting-supportsInterface-bytes4-: xref:multisig.adoc#TokenVoting-supportsInterface-bytes4- +:xref-TokenVoting-getVotingToken--: xref:multisig.adoc#TokenVoting-getVotingToken-- +:xref-TokenVoting-totalVotingPower-uint256-: xref:multisig.adoc#TokenVoting-totalVotingPower-uint256- +:xref-TokenVoting-createProposal-bytes-struct-Action---uint256-uint64-uint64-enum-IMajorityVoting-VoteOption-bool-: xref:multisig.adoc#TokenVoting-createProposal-bytes-struct-Action---uint256-uint64-uint64-enum-IMajorityVoting-VoteOption-bool- +:xref-TokenVoting-createProposal-bytes-struct-Action---uint64-uint64-bytes-: xref:multisig.adoc#TokenVoting-createProposal-bytes-struct-Action---uint64-uint64-bytes- +:xref-TokenVoting-customProposalParamsABI--: xref:multisig.adoc#TokenVoting-customProposalParamsABI-- +:xref-TokenVoting-isMember-address-: xref:multisig.adoc#TokenVoting-isMember-address- +:xref-TokenVoting-_vote-uint256-enum-IMajorityVoting-VoteOption-address-bool-: xref:multisig.adoc#TokenVoting-_vote-uint256-enum-IMajorityVoting-VoteOption-address-bool- +:xref-TokenVoting-_canVote-uint256-address-enum-IMajorityVoting-VoteOption-: xref:multisig.adoc#TokenVoting-_canVote-uint256-address-enum-IMajorityVoting-VoteOption- +:xref-MajorityVotingBase-__MajorityVotingBase_init-contract-IDAO-struct-MajorityVotingBase-VotingSettings-struct-IPlugin-TargetConfig-uint256-bytes-: xref:multisig.adoc#MajorityVotingBase-__MajorityVotingBase_init-contract-IDAO-struct-MajorityVotingBase-VotingSettings-struct-IPlugin-TargetConfig-uint256-bytes- +:xref-MajorityVotingBase-vote-uint256-enum-IMajorityVoting-VoteOption-bool-: xref:multisig.adoc#MajorityVotingBase-vote-uint256-enum-IMajorityVoting-VoteOption-bool- +:xref-MajorityVotingBase-execute-uint256-: xref:multisig.adoc#MajorityVotingBase-execute-uint256- +:xref-MajorityVotingBase-getVoteOption-uint256-address-: xref:multisig.adoc#MajorityVotingBase-getVoteOption-uint256-address- +:xref-MajorityVotingBase-canVote-uint256-address-enum-IMajorityVoting-VoteOption-: xref:multisig.adoc#MajorityVotingBase-canVote-uint256-address-enum-IMajorityVoting-VoteOption- +:xref-MajorityVotingBase-canExecute-uint256-: xref:multisig.adoc#MajorityVotingBase-canExecute-uint256- +:xref-MajorityVotingBase-hasSucceeded-uint256-: xref:multisig.adoc#MajorityVotingBase-hasSucceeded-uint256- +:xref-MajorityVotingBase-isSupportThresholdReached-uint256-: xref:multisig.adoc#MajorityVotingBase-isSupportThresholdReached-uint256- +:xref-MajorityVotingBase-isSupportThresholdReachedEarly-uint256-: xref:multisig.adoc#MajorityVotingBase-isSupportThresholdReachedEarly-uint256- +:xref-MajorityVotingBase-isMinParticipationReached-uint256-: xref:multisig.adoc#MajorityVotingBase-isMinParticipationReached-uint256- +:xref-MajorityVotingBase-isMinApprovalReached-uint256-: xref:multisig.adoc#MajorityVotingBase-isMinApprovalReached-uint256- +:xref-MajorityVotingBase-minApproval--: xref:multisig.adoc#MajorityVotingBase-minApproval-- +:xref-MajorityVotingBase-supportThreshold--: xref:multisig.adoc#MajorityVotingBase-supportThreshold-- +:xref-MajorityVotingBase-minParticipation--: xref:multisig.adoc#MajorityVotingBase-minParticipation-- +:xref-MajorityVotingBase-minDuration--: xref:multisig.adoc#MajorityVotingBase-minDuration-- +:xref-MajorityVotingBase-minProposerVotingPower--: xref:multisig.adoc#MajorityVotingBase-minProposerVotingPower-- +:xref-MajorityVotingBase-votingMode--: xref:multisig.adoc#MajorityVotingBase-votingMode-- +:xref-MajorityVotingBase-getProposal-uint256-: xref:multisig.adoc#MajorityVotingBase-getProposal-uint256- +:xref-MajorityVotingBase-updateVotingSettings-struct-MajorityVotingBase-VotingSettings-: xref:multisig.adoc#MajorityVotingBase-updateVotingSettings-struct-MajorityVotingBase-VotingSettings- +:xref-MajorityVotingBase-updateMinApprovals-uint256-: xref:multisig.adoc#MajorityVotingBase-updateMinApprovals-uint256- +:xref-MajorityVotingBase-_execute-uint256-: xref:multisig.adoc#MajorityVotingBase-_execute-uint256- +:xref-MajorityVotingBase-_hasSucceeded-uint256-: xref:multisig.adoc#MajorityVotingBase-_hasSucceeded-uint256- +:xref-MajorityVotingBase-_canExecute-uint256-: xref:multisig.adoc#MajorityVotingBase-_canExecute-uint256- +:xref-MajorityVotingBase-_isProposalOpen-struct-MajorityVotingBase-Proposal-: xref:multisig.adoc#MajorityVotingBase-_isProposalOpen-struct-MajorityVotingBase-Proposal- +:xref-MajorityVotingBase-_updateVotingSettings-struct-MajorityVotingBase-VotingSettings-: xref:multisig.adoc#MajorityVotingBase-_updateVotingSettings-struct-MajorityVotingBase-VotingSettings- +:xref-MajorityVotingBase-_updateMinApprovals-uint256-: xref:multisig.adoc#MajorityVotingBase-_updateMinApprovals-uint256- +:xref-MajorityVotingBase-_validateProposalDates-uint64-uint64-: xref:multisig.adoc#MajorityVotingBase-_validateProposalDates-uint64-uint64- +:xref-MajorityVotingBase-UPDATE_VOTING_SETTINGS_PERMISSION_ID-bytes32: xref:multisig.adoc#MajorityVotingBase-UPDATE_VOTING_SETTINGS_PERMISSION_ID-bytes32 +:xref-MajorityVotingBase-CREATE_PROPOSAL_PERMISSION_ID-bytes32: xref:multisig.adoc#MajorityVotingBase-CREATE_PROPOSAL_PERMISSION_ID-bytes32 +:xref-MajorityVotingBase-EXECUTE_PROPOSAL_PERMISSION_ID-bytes32: xref:multisig.adoc#MajorityVotingBase-EXECUTE_PROPOSAL_PERMISSION_ID-bytes32 +:xref-MajorityVotingBase-VotingSettingsUpdated-enum-MajorityVotingBase-VotingMode-uint32-uint32-uint64-uint256-: xref:multisig.adoc#MajorityVotingBase-VotingSettingsUpdated-enum-MajorityVotingBase-VotingMode-uint32-uint32-uint64-uint256- +:xref-MajorityVotingBase-VotingMinApprovalUpdated-uint256-: xref:multisig.adoc#MajorityVotingBase-VotingMinApprovalUpdated-uint256- +:xref-IMajorityVoting-VoteCast-uint256-address-enum-IMajorityVoting-VoteOption-uint256-: xref:multisig.adoc#IMajorityVoting-VoteCast-uint256-address-enum-IMajorityVoting-VoteOption-uint256- +:xref-MajorityVotingBase-__MajorityVotingBase_init-contract-IDAO-struct-MajorityVotingBase-VotingSettings-struct-IPlugin-TargetConfig-uint256-bytes-: xref:multisig.adoc#MajorityVotingBase-__MajorityVotingBase_init-contract-IDAO-struct-MajorityVotingBase-VotingSettings-struct-IPlugin-TargetConfig-uint256-bytes- +:xref-MajorityVotingBase-supportsInterface-bytes4-: xref:multisig.adoc#MajorityVotingBase-supportsInterface-bytes4- +:xref-MajorityVotingBase-vote-uint256-enum-IMajorityVoting-VoteOption-bool-: xref:multisig.adoc#MajorityVotingBase-vote-uint256-enum-IMajorityVoting-VoteOption-bool- +:xref-MajorityVotingBase-execute-uint256-: xref:multisig.adoc#MajorityVotingBase-execute-uint256- +:xref-MajorityVotingBase-getVoteOption-uint256-address-: xref:multisig.adoc#MajorityVotingBase-getVoteOption-uint256-address- +:xref-MajorityVotingBase-canVote-uint256-address-enum-IMajorityVoting-VoteOption-: xref:multisig.adoc#MajorityVotingBase-canVote-uint256-address-enum-IMajorityVoting-VoteOption- +:xref-MajorityVotingBase-canExecute-uint256-: xref:multisig.adoc#MajorityVotingBase-canExecute-uint256- +:xref-MajorityVotingBase-hasSucceeded-uint256-: xref:multisig.adoc#MajorityVotingBase-hasSucceeded-uint256- +:xref-MajorityVotingBase-isSupportThresholdReached-uint256-: xref:multisig.adoc#MajorityVotingBase-isSupportThresholdReached-uint256- +:xref-MajorityVotingBase-isSupportThresholdReachedEarly-uint256-: xref:multisig.adoc#MajorityVotingBase-isSupportThresholdReachedEarly-uint256- +:xref-MajorityVotingBase-isMinParticipationReached-uint256-: xref:multisig.adoc#MajorityVotingBase-isMinParticipationReached-uint256- +:xref-MajorityVotingBase-isMinApprovalReached-uint256-: xref:multisig.adoc#MajorityVotingBase-isMinApprovalReached-uint256- +:xref-MajorityVotingBase-minApproval--: xref:multisig.adoc#MajorityVotingBase-minApproval-- +:xref-MajorityVotingBase-supportThreshold--: xref:multisig.adoc#MajorityVotingBase-supportThreshold-- +:xref-MajorityVotingBase-minParticipation--: xref:multisig.adoc#MajorityVotingBase-minParticipation-- +:xref-MajorityVotingBase-minDuration--: xref:multisig.adoc#MajorityVotingBase-minDuration-- +:xref-MajorityVotingBase-minProposerVotingPower--: xref:multisig.adoc#MajorityVotingBase-minProposerVotingPower-- +:xref-MajorityVotingBase-votingMode--: xref:multisig.adoc#MajorityVotingBase-votingMode-- +:xref-MajorityVotingBase-totalVotingPower-uint256-: xref:multisig.adoc#MajorityVotingBase-totalVotingPower-uint256- +:xref-MajorityVotingBase-getProposal-uint256-: xref:multisig.adoc#MajorityVotingBase-getProposal-uint256- +:xref-MajorityVotingBase-updateVotingSettings-struct-MajorityVotingBase-VotingSettings-: xref:multisig.adoc#MajorityVotingBase-updateVotingSettings-struct-MajorityVotingBase-VotingSettings- +:xref-MajorityVotingBase-updateMinApprovals-uint256-: xref:multisig.adoc#MajorityVotingBase-updateMinApprovals-uint256- +:xref-MajorityVotingBase-createProposal-bytes-struct-Action---uint256-uint64-uint64-enum-IMajorityVoting-VoteOption-bool-: xref:multisig.adoc#MajorityVotingBase-createProposal-bytes-struct-Action---uint256-uint64-uint64-enum-IMajorityVoting-VoteOption-bool- +:xref-MajorityVotingBase-_vote-uint256-enum-IMajorityVoting-VoteOption-address-bool-: xref:multisig.adoc#MajorityVotingBase-_vote-uint256-enum-IMajorityVoting-VoteOption-address-bool- +:xref-MajorityVotingBase-_execute-uint256-: xref:multisig.adoc#MajorityVotingBase-_execute-uint256- +:xref-MajorityVotingBase-_canVote-uint256-address-enum-IMajorityVoting-VoteOption-: xref:multisig.adoc#MajorityVotingBase-_canVote-uint256-address-enum-IMajorityVoting-VoteOption- +:xref-MajorityVotingBase-_hasSucceeded-uint256-: xref:multisig.adoc#MajorityVotingBase-_hasSucceeded-uint256- +:xref-MajorityVotingBase-_canExecute-uint256-: xref:multisig.adoc#MajorityVotingBase-_canExecute-uint256- +:xref-MajorityVotingBase-_isProposalOpen-struct-MajorityVotingBase-Proposal-: xref:multisig.adoc#MajorityVotingBase-_isProposalOpen-struct-MajorityVotingBase-Proposal- +:xref-MajorityVotingBase-_updateVotingSettings-struct-MajorityVotingBase-VotingSettings-: xref:multisig.adoc#MajorityVotingBase-_updateVotingSettings-struct-MajorityVotingBase-VotingSettings- +:xref-MajorityVotingBase-_updateMinApprovals-uint256-: xref:multisig.adoc#MajorityVotingBase-_updateMinApprovals-uint256- +:xref-MajorityVotingBase-_validateProposalDates-uint64-uint64-: xref:multisig.adoc#MajorityVotingBase-_validateProposalDates-uint64-uint64- +:xref-MajorityVotingBase-UPDATE_VOTING_SETTINGS_PERMISSION_ID-bytes32: xref:multisig.adoc#MajorityVotingBase-UPDATE_VOTING_SETTINGS_PERMISSION_ID-bytes32 +:xref-MajorityVotingBase-CREATE_PROPOSAL_PERMISSION_ID-bytes32: xref:multisig.adoc#MajorityVotingBase-CREATE_PROPOSAL_PERMISSION_ID-bytes32 +:xref-MajorityVotingBase-EXECUTE_PROPOSAL_PERMISSION_ID-bytes32: xref:multisig.adoc#MajorityVotingBase-EXECUTE_PROPOSAL_PERMISSION_ID-bytes32 +:xref-MajorityVotingBase-VotingSettingsUpdated-enum-MajorityVotingBase-VotingMode-uint32-uint32-uint64-uint256-: xref:multisig.adoc#MajorityVotingBase-VotingSettingsUpdated-enum-MajorityVotingBase-VotingMode-uint32-uint32-uint64-uint256- +:xref-MajorityVotingBase-VotingMinApprovalUpdated-uint256-: xref:multisig.adoc#MajorityVotingBase-VotingMinApprovalUpdated-uint256- +:xref-IMajorityVoting-VoteCast-uint256-address-enum-IMajorityVoting-VoteOption-uint256-: xref:multisig.adoc#IMajorityVoting-VoteCast-uint256-address-enum-IMajorityVoting-VoteOption-uint256- +:xref-TokenVotingSetup-constructor-contract-GovernanceERC20-contract-GovernanceWrappedERC20-: xref:multisig.adoc#TokenVotingSetup-constructor-contract-GovernanceERC20-contract-GovernanceWrappedERC20- +:xref-TokenVotingSetup-prepareInstallation-address-bytes-: xref:multisig.adoc#TokenVotingSetup-prepareInstallation-address-bytes- +:xref-TokenVotingSetup-prepareUpdate-address-uint16-struct-IPluginSetup-SetupPayload-: xref:multisig.adoc#TokenVotingSetup-prepareUpdate-address-uint16-struct-IPluginSetup-SetupPayload- +:xref-TokenVotingSetup-prepareUninstallation-address-struct-IPluginSetup-SetupPayload-: xref:multisig.adoc#TokenVotingSetup-prepareUninstallation-address-struct-IPluginSetup-SetupPayload- +:xref-TokenVotingSetup-supportsIVotesInterface-address-: xref:multisig.adoc#TokenVotingSetup-supportsIVotesInterface-address- +:xref-TokenVotingSetup-governanceERC20Base-address: xref:multisig.adoc#TokenVotingSetup-governanceERC20Base-address +:xref-TokenVotingSetup-governanceWrappedERC20Base-address: xref:multisig.adoc#TokenVotingSetup-governanceWrappedERC20Base-address +:xref-VotingPowerCondition-constructor-address-: xref:multisig.adoc#VotingPowerCondition-constructor-address- +:xref-VotingPowerCondition-isGranted-address-address-bytes32-bytes-: xref:multisig.adoc#VotingPowerCondition-isGranted-address-address-bytes32-bytes- = The title here This is for testing purposes. @@ -112,7 +112,7 @@ This is for testing purposes. [.contract] [[TokenVoting]] -=== `++TokenVoting++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v/src/TokenVoting.sol[{github-icon},role=heading-link] +=== `++TokenVoting++` link:https://github.com/aragon/token-voting-plugin/blob/v/src/TokenVoting.sol[{github-icon},role=heading-link] v1.3 (Release 1, Build 3). For each upgrade, if the reinitialization step is required, increment the version numbers in the modifier for both the initialize and initializeFrom functions. @@ -597,7 +597,7 @@ The [ERC-165](https://eips.ethereum.org/EIPS/eip-165) interface ID of the contra [.contract] [[MajorityVotingBase]] -=== `++MajorityVotingBase++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v/src/MajorityVotingBase.sol[{github-icon},role=heading-link] +=== `++MajorityVotingBase++` link:https://github.com/aragon/token-voting-plugin/blob/v/src/MajorityVotingBase.sol[{github-icon},role=heading-link] This contract implements the `IMajorityVoting` interface. @@ -1228,7 +1228,7 @@ A mapping between proposal IDs and proposal information. [.contract] [[TokenVotingSetup]] -=== `++TokenVotingSetup++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v/src/TokenVotingSetup.sol[{github-icon},role=heading-link] +=== `++TokenVotingSetup++` link:https://github.com/aragon/token-voting-plugin/blob/v/src/TokenVotingSetup.sol[{github-icon},role=heading-link] v1.3 (Release 1, Build 3) @@ -1355,7 +1355,7 @@ Thrown if token address is not ERC20. [.contract] [[VotingPowerCondition]] -=== `++VotingPowerCondition++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v/src/VotingPowerCondition.sol[{github-icon},role=heading-link] +=== `++VotingPowerCondition++` link:https://github.com/aragon/token-voting-plugin/blob/v/src/VotingPowerCondition.sol[{github-icon},role=heading-link] [.contract-index] .Functions diff --git a/packages/contracts/docs/templates/contract.hbs b/packages/contracts/docs/templates/contract.hbs deleted file mode 100644 index 4503cb56..00000000 --- a/packages/contracts/docs/templates/contract.hbs +++ /dev/null @@ -1,174 +0,0 @@ -{{#each items}} -:{{name}}: pass:normal[xref:#{{anchor}}[`++{{name}}++`]] -{{/each}} - -[.contract] -[[{{anchor}}]] -=== `++{{name}}++` link:https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v{{oz-version}}/{{__item_context.file.absolutePath}}[{github-icon},role=heading-link] - - -{{{natspec.dev}}} - -{{#if modifiers}} -[.contract-index] -.Modifiers --- -{{#each modifiers}} -{{#if (isLocalContract __item_context.contract.name)}} -* {xref-{{anchor~}} }[`++{{name}}({{names params}})++`] -{{else if (isAragonInherittedContract __item_context.file.absolutePath) }} -* link:{{getExternalLink __item_context.file.absolutePath}}[{{name}}] -{{/if}} -{{/each}} - --- -{{/if}} - -{{#if has-functions}} -[.contract-index] -.Functions --- -{{#each inherited-functions}} -{{#unless @first}} -[.contract-subindex-inherited] -.{{contract.name}} -{{/unless}} -{{#if (isLocalContract contract.name)}} -{{#each functions}} -* {xref-{{anchor~}} }[`++{{name}}({{names params}})++`] -{{/each}} -{{else if (isAragonInherittedContract contract.__item_context.file.absolutePath) }} -{{#each functions}} -* link:{{getExternalLink __item_context.file.absolutePath}}[{{name}}] -{{/each}} -{{/if}} - -{{/each}} --- -{{/if}} - - -{{#if has-events}} -[.contract-index] -.Events --- -{{#each inheritance}} -{{#unless @first}} -[.contract-subindex-inherited] -.{{name}} -{{/unless}} -{{#if (isLocalContract name)}} -{{#each events}} -* {xref-{{anchor~}} }[`++{{name}}({{names params}})++`] -{{/each}} -{{else if (isAragonInherittedContract __item_context.file.absolutePath) }} -{{#each events}} -* link:{{getExternalLink __item_context.file.absolutePath}}[{{name}}] -{{/each}} -{{/if}} - -{{/each}} --- -{{/if}} - -{{#if has-errors}} -[.contract-index] -.Errors --- -{{#each inheritance}} -{{#unless @first}} -[.contract-subindex-inherited] -.{{name}} -{{/unless}} -{{#if (isLocalContract contract.name)}} -{{#each errors}} -* {xref-{{anchor~}} }[`++{{name}}({{names params}})++`] -{{/each}} -{{else if (isAragonInherittedContract __item_context.file.absolutePath) }} -{{#each errors}} -* link:{{getExternalLink __item_context.file.absolutePath}}[{{name}}] -{{/each}} -{{/if}} - -{{/each}} --- -{{/if}} - - -{{#if has-internal-variables}} -[.contract-index] -.Internal Variables --- -{{#each inheritance}} -{{#unless @first}} -[.contract-subindex-inherited] -.{{name}} -{{/unless}} -{{#if (isLocalContract contract.name)}} -{{#each internal-variables}} -* {xref-{{anchor~}} }[`++{{typeDescriptions.typeString}} {{#if constant}}constant{{/if}} {{name}}++`] -{{/each}} -{{else if (isAragonInherittedContract __item_context.file.absolutePath) }} -{{#each errors}} -* link:{{getExternalLink __item_context.file.absolutePath}}[{{name}}] -{{/each}} -{{/if}} - -{{/each}} --- -{{/if}} - -{{#each modifiers}} -[.contract-item] -[[{{anchor}}]] -==== `[.contract-item-name]#++{{name}}++#++({{typed-params params}})++` [.item-kind]#modifier# - -{{natspec.notice}} - -{{natspec.dev}} - -{{/each}} - -{{#each functions}} -[.contract-item] -[[{{anchor}}]] -==== `[.contract-item-name]#++{{name}}++#++({{typed-params params}}){{#if returns2}} → {{typed-params returns2}}{{/if}}++` [.item-kind]#{{visibility}}# - -{{natspec.notice}} - -{{natspec.dev}} - -{{/each}} - -{{#each events}} -[.contract-item] -[[{{anchor}}]] -==== `[.contract-item-name]#++{{name}}++#++({{typed-params params}})++` [.item-kind]#event# - -{{natspec.notice}} - -{{natspec.dev}} - -{{/each}} - -{{#each errors}} -[.contract-item] -[[{{anchor}}]] -==== `[.contract-item-name]#++{{name}}++#++({{typed-params params}})++` [.item-kind]#error# - -{{natspec.notice}} - -{{natspec.dev}} - -{{/each}} - -{{#each internal-variables}} -[.contract-item] -[[{{anchor}}]] -==== `{{typeDescriptions.typeString}} [.contract-item-name]#++{{name}}++#` [.item-kind]#internal{{#if constant}} constant{{/if}}# - -{{natspec.notice}} - -{{natspec.dev}} - -{{/each}} diff --git a/packages/contracts/docs/templates/helpers.js b/packages/contracts/docs/templates/helpers.js deleted file mode 100644 index f4969300..00000000 --- a/packages/contracts/docs/templates/helpers.js +++ /dev/null @@ -1,80 +0,0 @@ -const {version} = require('../../package.json'); - -module.exports['multisig-version'] = () => version; - -module.exports['readme-path'] = opts => { - return 'README.adoc'; -}; - -module.exports['isLocalContract'] = (name, options) => { - const allContracts = options.data.site.items - .filter(output => output.nodeType === 'ContractDefinition') - .map(contract => contract.name); - - return allContracts.includes(name); -}; - -module.exports['isAragonInherittedContract'] = (absolutePath, options) => { - return absolutePath.startsWith('@aragon'); -}; - -module.exports['getExternalLink'] = absolutePath => { - if (absolutePath.startsWith('@aragon/osx-commons-contracts')) { - return absolutePath.replace( - '@aragon/osx-commons-contracts', - 'https://github.com/aragon/osx-commons/tree/main/contracts' - ); - } - - return 'github.com'; -}; - -module.exports.names = params => params?.map(p => p.name).join(', '); - -module.exports['typed-params'] = params => { - return params - ?.map( - p => - `${p.type}${p.indexed ? ' indexed' : ''}${p.name ? ' ' + p.name : ''}` - ) - .join(', '); -}; - -const slug = (module.exports.slug = str => { - if (str === undefined) { - throw new Error('Missing argument'); - } - return str.replace(/\W/g, '-'); -}); - -const linksCache = new WeakMap(); - -function getAllLinks(items) { - if (linksCache.has(items)) { - return linksCache.get(items); - } - const res = {}; - linksCache.set(items, res); - - // items only contain what is inside `src`. - for (const item of items) { - res[ - `xref-${item.anchor}` - ] = `xref:${item.__item_context.page}#${item.anchor}`; - res[ - slug(item.fullName) - ] = `pass:normal[xref:${item.__item_context.page}#${item.anchor}[\`${item.fullName}\`]]`; - } - return res; -} - -module.exports['with-prelude'] = opts => { - const links = getAllLinks(opts.data.site.items); - const contents = opts.fn(); - const neededLinks = contents - .match(/\{[-._a-z0-9]+\}/gi) - .map(m => m.replace(/^\{(.+)\}$/, '$1')) - .filter(k => k in links); - const prelude = neededLinks.map(k => `:${k}: ${links[k]}`).join('\n'); - return prelude + '\n' + contents; -}; diff --git a/packages/contracts/docs/templates/page.hbs b/packages/contracts/docs/templates/page.hbs deleted file mode 100644 index cab050ac..00000000 --- a/packages/contracts/docs/templates/page.hbs +++ /dev/null @@ -1,4 +0,0 @@ -:github-icon: pass:[] -{{#with-prelude}} -{{readme (readme-path)}} -{{/with-prelude}} diff --git a/packages/contracts/docs/templates/properties.js b/packages/contracts/docs/templates/properties.js deleted file mode 100644 index a086d26f..00000000 --- a/packages/contracts/docs/templates/properties.js +++ /dev/null @@ -1,85 +0,0 @@ -const {isNodeType, findAll} = require('solidity-ast/utils'); -const {slug} = require('./helpers'); - -module.exports.anchor = function anchor({item, contract}) { - let res = ''; - if (contract) { - res += contract.name + '-'; - } - res += item.name; - if ('parameters' in item) { - const signature = item.parameters.parameters - .map(v => v.typeName.typeDescriptions.typeString) - .join(','); - res += slug('(' + signature + ')'); - } - if (isNodeType('VariableDeclaration', item)) { - res += '-' + slug(item.typeName.typeDescriptions.typeString); - } - return res; -}; - -module.exports.inheritance = function ({item, build}) { - if (!isNodeType('ContractDefinition', item)) { - throw new Error('used inherited-items on non-contract'); - } - - return item.linearizedBaseContracts - .map(id => build.deref('ContractDefinition', id)) - .filter((c, i) => c.name !== 'Context' || i === 0); -}; - -module.exports['has-functions'] = function ({item}) { - return item.inheritance.some(c => c.functions.length > 0); -}; - -module.exports['has-events'] = function ({item}) { - return item.inheritance.some(c => c.events.length > 0); -}; - -module.exports['has-errors'] = function ({item}) { - return item.inheritance.some(c => c.errors.length > 0); -}; - -module.exports['internal-variables'] = function ({item}) { - return item.variables.filter(({visibility}) => visibility === 'internal'); -}; - -module.exports['has-internal-variables'] = function ({item}) { - return module.exports['internal-variables']({item}).length > 0; -}; - -module.exports.functions = function ({item}) { - return [ - ...[...findAll('FunctionDefinition', item)].filter( - f => f.visibility !== 'private' - ), - ...[...findAll('VariableDeclaration', item)].filter( - f => f.visibility === 'public' - ), - ]; -}; - -module.exports.returns2 = function ({item}) { - if (isNodeType('VariableDeclaration', item)) { - return [{type: item.typeDescriptions.typeString}]; - } else { - return item.returns; - } -}; - -module.exports['inherited-functions'] = function ({item}) { - const {inheritance} = item; - const baseFunctions = new Set( - inheritance.flatMap(c => c.functions.flatMap(f => f.baseFunctions ?? [])) - ); - - let d = inheritance.map((contract, i) => ({ - contract, - functions: contract.functions.filter( - f => !baseFunctions.has(f.id) && (f.name !== 'constructor' || i === 0) - ), - })); - - return d; -}; diff --git a/packages/contracts/package.json b/packages/contracts/package.json index 4ba77acc..553aeb88 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -58,6 +58,10 @@ "typescript": "^5.2.2", "lodash.startcase": "^4.4.0" }, + "repository": { + "type": "git", + "url": "https://github.com/aragon/token-voting-plugin" + }, "files": [ "/src" ], diff --git a/packages/contracts/scripts/prepare-docs.sh b/packages/contracts/scripts/prepare-docs.sh index ada79608..d7b33346 100755 --- a/packages/contracts/scripts/prepare-docs.sh +++ b/packages/contracts/scripts/prepare-docs.sh @@ -3,6 +3,12 @@ set -euo pipefail # shopt -s globstar +PACKAGE_NAME="@aragon/osx-commons-configs" +PACKAGE_PATH=$(node -p "require.resolve('$PACKAGE_NAME')") +TEMPLATES_PATH=$(dirname "$PACKAGE_PATH")/docs/templates + +cp -r "$TEMPLATES_PATH" "./docs" + OUTDIR="$(node -p 'require("./docs/config.js").outputDir')" if [ ! -d node_modules ]; then @@ -11,8 +17,10 @@ fi rm -rf "$OUTDIR" +echo $OUTDIR + hardhat docgen -echo $OUTDIR +node scripts/gen-nav.js "$OUTDIR" > "$OUTDIR/../nav.adoc" -node scripts/gen-nav.js "$OUTDIR" > "$OUTDIR/../nav.adoc" \ No newline at end of file +rm -rf ./docs/templates \ No newline at end of file