Skip to content

Commit

Permalink
new changes
Browse files Browse the repository at this point in the history
  • Loading branch information
novaknole committed Nov 16, 2024
1 parent 9d9b72e commit d86f2ff
Show file tree
Hide file tree
Showing 5 changed files with 290 additions and 37 deletions.
227 changes: 197 additions & 30 deletions packages/contracts/docs/modules/api/pages/Multisig.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
:xref-Multisig-EXECUTE_PROPOSAL_PERMISSION_ID-bytes32: xref:Multisig.adoc#Multisig-EXECUTE_PROPOSAL_PERMISSION_ID-bytes32
:xref-Multisig-multisigSettings-struct-Multisig-MultisigSettings: xref:Multisig.adoc#Multisig-multisigSettings-struct-Multisig-MultisigSettings
:xref-Multisig-lastMultisigSettingsChange-uint64: xref:Multisig.adoc#Multisig-lastMultisigSettingsChange-uint64
:xref-Multisig-Approved-uint256-address-: xref:Multisig.adoc#Multisig-Approved-uint256-address-
:xref-Multisig-MultisigSettingsUpdated-bool-uint16-: xref:Multisig.adoc#Multisig-MultisigSettingsUpdated-bool-uint16-
:xref-MultisigSetup-constructor--: xref:Multisig.adoc#MultisigSetup-constructor--
:xref-MultisigSetup-prepareInstallation-address-bytes-: xref:Multisig.adoc#MultisigSetup-prepareInstallation-address-bytes-
:xref-MultisigSetup-prepareUpdate-address-uint16-struct-IPluginSetup-SetupPayload-: xref:Multisig.adoc#MultisigSetup-prepareUpdate-address-uint16-struct-IPluginSetup-SetupPayload-
Expand Down Expand Up @@ -119,51 +121,191 @@ v1.3 (Release 1, Build 3). For each upgrade, if the reinitialization step is req

[.contract-subindex-inherited]
.Addresslist
* link:github.com[isListedAtBlock]
* link:github.com[isListed]
* link:github.com[addresslistLengthAtBlock]
* link:github.com[addresslistLength]
* link:github.com[_addAddresses]
* link:github.com[_removeAddresses]
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/plugin/extensions/governance/Addresslist.sol[isListedAtBlock]
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/plugin/extensions/governance/Addresslist.sol[isListed]
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/plugin/extensions/governance/Addresslist.sol[addresslistLengthAtBlock]
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/plugin/extensions/governance/Addresslist.sol[addresslistLength]
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/plugin/extensions/governance/Addresslist.sol[_addAddresses]
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/plugin/extensions/governance/Addresslist.sol[_removeAddresses]

[.contract-subindex-inherited]
.ProposalUpgradeable
* link:github.com[proposalCount]
* link:github.com[_createProposalId]
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/plugin/extensions/proposal/ProposalUpgradeable.sol[proposalCount]
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/plugin/extensions/proposal/ProposalUpgradeable.sol[_createProposalId]

[.contract-subindex-inherited]
.PluginUUPSUpgradeable
* link:github.com[pluginType]
* link:github.com[getCurrentTargetConfig]
* link:github.com[getTargetConfig]
* link:github.com[__PluginUUPSUpgradeable_init]
* link:github.com[setTargetConfig]
* link:github.com[implementation]
* link:github.com[_setTargetConfig]
* link:github.com[_execute]
* link:github.com[_execute]
* link:github.com[_authorizeUpgrade]
* link:github.com[SET_TARGET_CONFIG_PERMISSION_ID]
* link:github.com[UPGRADE_PLUGIN_PERMISSION_ID]
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/plugin/PluginUUPSUpgradeable.sol[pluginType]
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/plugin/PluginUUPSUpgradeable.sol[getCurrentTargetConfig]
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/plugin/PluginUUPSUpgradeable.sol[getTargetConfig]
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/plugin/PluginUUPSUpgradeable.sol[__PluginUUPSUpgradeable_init]
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/plugin/PluginUUPSUpgradeable.sol[setTargetConfig]
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/plugin/PluginUUPSUpgradeable.sol[implementation]
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/plugin/PluginUUPSUpgradeable.sol[_setTargetConfig]
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/plugin/PluginUUPSUpgradeable.sol[_execute]
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/plugin/PluginUUPSUpgradeable.sol[_execute]
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/plugin/PluginUUPSUpgradeable.sol[_authorizeUpgrade]
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/plugin/PluginUUPSUpgradeable.sol[SET_TARGET_CONFIG_PERMISSION_ID]
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/plugin/PluginUUPSUpgradeable.sol[UPGRADE_PLUGIN_PERMISSION_ID]

[.contract-subindex-inherited]
.ProtocolVersion
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/utils/versioning/ProtocolVersion.sol[protocolVersion]

[.contract-subindex-inherited]
.IProtocolVersion

[.contract-subindex-inherited]
.MetadataExtensionUpgradeable
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/utils/metadata/MetadataExtensionUpgradeable.sol[setMetadata]
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/utils/metadata/MetadataExtensionUpgradeable.sol[getMetadata]
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/utils/metadata/MetadataExtensionUpgradeable.sol[_setMetadata]
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/utils/metadata/MetadataExtensionUpgradeable.sol[SET_METADATA_PERMISSION_ID]

[.contract-subindex-inherited]
.DaoAuthorizableUpgradeable
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/permission/auth/DaoAuthorizableUpgradeable.sol[__DaoAuthorizableUpgradeable_init]
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/permission/auth/DaoAuthorizableUpgradeable.sol[dao]

[.contract-subindex-inherited]
.ContextUpgradeable

[.contract-subindex-inherited]
.UUPSUpgradeable

[.contract-subindex-inherited]
.ERC1967UpgradeUpgradeable

[.contract-subindex-inherited]
.IERC1967Upgradeable

[.contract-subindex-inherited]
.IERC1822ProxiableUpgradeable

[.contract-subindex-inherited]
.ERC165Upgradeable

[.contract-subindex-inherited]
.IERC165Upgradeable

[.contract-subindex-inherited]
.Initializable

[.contract-subindex-inherited]
.IProposal

[.contract-subindex-inherited]
.IPlugin

[.contract-subindex-inherited]
.IMembership

[.contract-subindex-inherited]
.IMultisig

--

[.contract-index]
.Events
--
* {xref-Multisig-Approved-uint256-address-}[`++Approved(proposalId, approver)++`]
* {xref-Multisig-MultisigSettingsUpdated-bool-uint16-}[`++MultisigSettingsUpdated(onlyListed, minApprovals)++`]

[.contract-subindex-inherited]
.Addresslist

[.contract-subindex-inherited]
.ProposalUpgradeable

[.contract-subindex-inherited]
.PluginUUPSUpgradeable
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/plugin/PluginUUPSUpgradeable.sol[TargetSet]

[.contract-subindex-inherited]
.ProtocolVersion

[.contract-subindex-inherited]
.IProtocolVersion

[.contract-subindex-inherited]
.MetadataExtensionUpgradeable
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/utils/metadata/MetadataExtensionUpgradeable.sol[MetadataSet]

[.contract-subindex-inherited]
.DaoAuthorizableUpgradeable

[.contract-subindex-inherited]
.ContextUpgradeable

[.contract-subindex-inherited]
.UUPSUpgradeable

[.contract-subindex-inherited]
.ERC1967UpgradeUpgradeable

[.contract-subindex-inherited]
.IERC1967Upgradeable

[.contract-subindex-inherited]
.IERC1822ProxiableUpgradeable

[.contract-subindex-inherited]
.ERC165Upgradeable

[.contract-subindex-inherited]
.IERC165Upgradeable

[.contract-subindex-inherited]
.Initializable

[.contract-subindex-inherited]
.IProposal
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/plugin/extensions/proposal/IProposal.sol[ProposalCreated]
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/plugin/extensions/proposal/IProposal.sol[ProposalExecuted]

[.contract-subindex-inherited]
.IPlugin

[.contract-subindex-inherited]
.IMembership
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/plugin/extensions/membership/IMembership.sol[MembersAdded]
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/plugin/extensions/membership/IMembership.sol[MembersRemoved]
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/plugin/extensions/membership/IMembership.sol[MembershipContractAnnounced]

[.contract-subindex-inherited]
.IMultisig

--

[.contract-index]
.Errors
--

[.contract-subindex-inherited]
.Addresslist
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/plugin/extensions/governance/Addresslist.sol[InvalidAddresslistUpdate]

[.contract-subindex-inherited]
.ProposalUpgradeable
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/plugin/extensions/proposal/ProposalUpgradeable.sol[FunctionDeprecated]

[.contract-subindex-inherited]
.PluginUUPSUpgradeable
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/plugin/PluginUUPSUpgradeable.sol[InvalidTargetConfig]
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/plugin/PluginUUPSUpgradeable.sol[DelegateCallFailed]
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/plugin/PluginUUPSUpgradeable.sol[AlreadyInitialized]

[.contract-subindex-inherited]
.ProtocolVersion
* link:github.com[protocolVersion]

[.contract-subindex-inherited]
.IProtocolVersion

[.contract-subindex-inherited]
.MetadataExtensionUpgradeable
* link:github.com[setMetadata]
* link:github.com[getMetadata]
* link:github.com[_setMetadata]
* link:github.com[SET_METADATA_PERMISSION_ID]

[.contract-subindex-inherited]
.DaoAuthorizableUpgradeable
* link:github.com[__DaoAuthorizableUpgradeable_init]
* link:github.com[dao]

[.contract-subindex-inherited]
.ContextUpgradeable
Expand Down Expand Up @@ -224,12 +366,37 @@ v1.3 (Release 1, Build 3)

[.contract-subindex-inherited]
.PluginUpgradeableSetup
* link:github.com[supportsInterface]
* link:github.com[implementation]
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/plugin/setup/PluginUpgradeableSetup.sol[supportsInterface]
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/plugin/setup/PluginUpgradeableSetup.sol[implementation]

[.contract-subindex-inherited]
.ProtocolVersion
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/utils/versioning/ProtocolVersion.sol[protocolVersion]

[.contract-subindex-inherited]
.IProtocolVersion

[.contract-subindex-inherited]
.IPluginSetup

[.contract-subindex-inherited]
.ERC165

[.contract-subindex-inherited]
.IERC165

--

[.contract-index]
.Errors
--

[.contract-subindex-inherited]
.PluginUpgradeableSetup
* link:https://github.com/aragon/osx-commons/tree/main/contracts/src/plugin/setup/PluginUpgradeableSetup.sol[InvalidUpdatePath]

[.contract-subindex-inherited]
.ProtocolVersion
* link:github.com[protocolVersion]

[.contract-subindex-inherited]
.IProtocolVersion
Expand Down
65 changes: 64 additions & 1 deletion packages/contracts/docs/templates/contract.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,22 @@

{{{natspec.dev}}}

{{!-- {{#if modifiers}}
[.contract-index]
.Modifiers
--
{{#if (isLocalContract contract.name)}}
{{#each modifiers}}
* {xref-{{anchor~}} }[`++{{name}}({{names params}})++`]
{{/each}}
{{else if (isAragonInherittedContract contract) }}
{{#each modifiers}}
* link:{{getExternalLink __item_context.file.absolutePath}}[{{name}}]
{{/each}}
{{/if}}
--
{{/if}} --}}

{{#if has-functions}}
[.contract-index]
.Functions
Expand All @@ -22,7 +38,7 @@
{{#each functions}}
* {xref-{{anchor~}} }[`++{{name}}({{names params}})++`]
{{/each}}
{{else if (isAragonInherittedContract contract) }}
{{else if (isAragonInherittedContract contract.__item_context.file.absolutePath) }}
{{#each functions}}
* link:{{getExternalLink __item_context.file.absolutePath}}[{{name}}]
{{/each}}
Expand All @@ -31,3 +47,50 @@
{{/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}}
21 changes: 18 additions & 3 deletions packages/contracts/docs/templates/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,29 @@ module.exports['isLocalContract'] = (name, options) => {
return allContracts.includes(name);
};

module.exports['isAragonInherittedContract'] = (contract, options) => {
return contract.__item_context.file.absolutePath.startsWith('@aragon');
module.exports['isAragonInherittedContract'] = (absolutePath, options) => {
return absolutePath.startsWith('@aragon');
};

module.exports['getExternalLink'] = path => {
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['isAragonInherittedContract1'] = contract => {
// console.log(contract, 'oe');
// };

// module.exports['getExternalLink1'] = item => {
// // console.log(item, 'oe');
// };

module.exports.names = params => params?.map(p => p.name).join(', ');

module.exports['typed-params'] = params => {
Expand Down
6 changes: 6 additions & 0 deletions packages/contracts/docs/templates/properties.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ module.exports.inheritance = function ({item, build}) {
throw new Error('used inherited-items on non-contract');
}

// console.log(
// item.linearizedBaseContracts
// .map(id => build.deref('ContractDefinition', id))
// .filter((c, i) => c.name !== 'Context' || i === 0),
// ' awesome'
// );
return item.linearizedBaseContracts
.map(id => build.deref('ContractDefinition', id))
.filter((c, i) => c.name !== 'Context' || i === 0);
Expand Down
Loading

0 comments on commit d86f2ff

Please sign in to comment.