Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
novaknole committed Nov 21, 2024
1 parent 11d10ab commit 121a979
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 34 deletions.
6 changes: 5 additions & 1 deletion contracts/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

This is the reference guide for the link:https://github.com/aragon/osx-commons[osx-commons-contracts] package.

== Core
== Core12123

{{gio}}

{{gio2}}

{{IDAO}}

Expand Down
8 changes: 5 additions & 3 deletions contracts/docs/config.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
const path = require('path');
const fs = require('fs');

const {version, repository} = require('../package.json');
const { version, repository } = require('../package.json');

const helpers = require(path.resolve(__dirname, './templates/helpers'));

// overwrite the functions.
helpers.version = () => version;

// Tags on `osx-commons-contracts` are created as below.
helpers.version = () => `${version}-contracts/contracts`;

helpers.githubURI = () => repository.url;

/** @type import('solidity-docgen/dist/config').UserConfig */
module.exports = {
outputDir: 'docs/modules/api/pages',
templates: 'docs/templates',
Expand Down
1 change: 0 additions & 1 deletion contracts/docs/modules/ROOT/nav.adoc

This file was deleted.

3 changes: 0 additions & 3 deletions contracts/docs/modules/ROOT/pages/index.adoc

This file was deleted.

42 changes: 22 additions & 20 deletions contracts/docs/modules/api/pages/osx-commons.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@

This is the reference guide for the link:https://github.com/aragon/osx-commons[osx-commons-contracts] package.

== Core
== Core12123

:hasPermission: pass:normal[xref:#IDAO-hasPermission-address-address-bytes32-bytes-[`++hasPermission++`]]
:setMetadata: pass:normal[xref:#IDAO-setMetadata-bytes-[`++setMetadata++`]]
Expand All @@ -166,7 +166,7 @@ This is the reference guide for the link:https://github.com/aragon/osx-commons[o

[.contract]
[[IDAO]]
=== `++IDAO++` link:https://github.com/aragon/osx-commons.git/blob/v1.4.0-alpha.6/src/dao/IDAO.sol[{github-icon},role=heading-link]
=== `++IDAO++` link:https://github.com/aragon/osx-commons/blob/1.4.0-alpha.6-contracts/contracts/src/dao/IDAO.sol[{github-icon},role=heading-link]

[.contract-index]
.Functions
Expand Down Expand Up @@ -275,6 +275,8 @@ This event is intended to be emitted in the `receive` function and is

Emitted when a new TrustedForwarder is set on the DAO.

Requires {UPDATE_STAGES_PERMISSION_ID}

:MAX_ACTIONS: pass:normal[xref:#Executor-MAX_ACTIONS-uint256[`++MAX_ACTIONS++`]]
:TooManyActions: pass:normal[xref:#Executor-TooManyActions--[`++TooManyActions++`]]
:InsufficientGas: pass:normal[xref:#Executor-InsufficientGas--[`++InsufficientGas++`]]
Expand All @@ -287,7 +289,7 @@ Emitted when a new TrustedForwarder is set on the DAO.

[.contract]
[[Executor]]
=== `++Executor++` link:https://github.com/aragon/osx-commons.git/blob/v1.4.0-alpha.6/src/executors/Executor.sol[{github-icon},role=heading-link]
=== `++Executor++` link:https://github.com/aragon/osx-commons/blob/1.4.0-alpha.6-contracts/contracts/src/executors/Executor.sol[{github-icon},role=heading-link]

This doesn't use any type of permission for execution and can be called by anyone.
Most useful use-case is to deploy it as non-upgradeable and call from another contract via delegatecall.
Expand Down Expand Up @@ -431,7 +433,7 @@ The internal constant storing the maximal action array length.

[.contract]
[[PermissionLib]]
=== `++PermissionLib++` link:https://github.com/aragon/osx-commons.git/blob/v1.4.0-alpha.6/src/permission/PermissionLib.sol[{github-icon},role=heading-link]
=== `++PermissionLib++` link:https://github.com/aragon/osx-commons/blob/1.4.0-alpha.6-contracts/contracts/src/permission/PermissionLib.sol[{github-icon},role=heading-link]

[.contract-index]
.Functions
Expand Down Expand Up @@ -464,7 +466,7 @@ A constant expressing that no condition is applied to a permission.

[.contract]
[[Plugin]]
=== `++Plugin++` link:https://github.com/aragon/osx-commons.git/blob/v1.4.0-alpha.6/src/plugin/Plugin.sol[{github-icon},role=heading-link]
=== `++Plugin++` link:https://github.com/aragon/osx-commons/blob/1.4.0-alpha.6-contracts/contracts/src/plugin/Plugin.sol[{github-icon},role=heading-link]

[.contract-index]
.Functions
Expand Down Expand Up @@ -649,7 +651,7 @@ Thrown when `delegatecall` fails.

[.contract]
[[PluginCloneable]]
=== `++PluginCloneable++` link:https://github.com/aragon/osx-commons.git/blob/v1.4.0-alpha.6/src/plugin/PluginCloneable.sol[{github-icon},role=heading-link]
=== `++PluginCloneable++` link:https://github.com/aragon/osx-commons/blob/1.4.0-alpha.6-contracts/contracts/src/plugin/PluginCloneable.sol[{github-icon},role=heading-link]

[.contract-index]
.Functions
Expand Down Expand Up @@ -865,7 +867,7 @@ Thrown when `delegatecall` fails.

[.contract]
[[PluginUUPSUpgradeable]]
=== `++PluginUUPSUpgradeable++` link:https://github.com/aragon/osx-commons.git/blob/v1.4.0-alpha.6/src/plugin/PluginUUPSUpgradeable.sol[{github-icon},role=heading-link]
=== `++PluginUUPSUpgradeable++` link:https://github.com/aragon/osx-commons/blob/1.4.0-alpha.6-contracts/contracts/src/plugin/PluginUUPSUpgradeable.sol[{github-icon},role=heading-link]

[.contract-index]
.Modifiers
Expand Down Expand Up @@ -1146,7 +1148,7 @@ Thrown when initialize is called after it has already been executed.

[.contract]
[[PluginSetup]]
=== `++PluginSetup++` link:https://github.com/aragon/osx-commons.git/blob/v1.4.0-alpha.6/src/plugin/setup/PluginSetup.sol[{github-icon},role=heading-link]
=== `++PluginSetup++` link:https://github.com/aragon/osx-commons/blob/1.4.0-alpha.6-contracts/contracts/src/plugin/setup/PluginSetup.sol[{github-icon},role=heading-link]

[.contract-index]
.Functions
Expand Down Expand Up @@ -1267,7 +1269,7 @@ The address of the plugin implementation contract for initial block explorer ver

[.contract]
[[Proposal]]
=== `++Proposal++` link:https://github.com/aragon/osx-commons.git/blob/v1.4.0-alpha.6/src/plugin/extensions/proposal/Proposal.sol[{github-icon},role=heading-link]
=== `++Proposal++` link:https://github.com/aragon/osx-commons/blob/1.4.0-alpha.6-contracts/contracts/src/plugin/extensions/proposal/Proposal.sol[{github-icon},role=heading-link]

[.contract-index]
.Functions
Expand Down Expand Up @@ -1362,7 +1364,7 @@ In addition to the current interfaceId, also support previous version of the int

[.contract]
[[ProposalUpgradeable]]
=== `++ProposalUpgradeable++` link:https://github.com/aragon/osx-commons.git/blob/v1.4.0-alpha.6/src/plugin/extensions/proposal/ProposalUpgradeable.sol[{github-icon},role=heading-link]
=== `++ProposalUpgradeable++` link:https://github.com/aragon/osx-commons/blob/1.4.0-alpha.6-contracts/contracts/src/plugin/extensions/proposal/ProposalUpgradeable.sol[{github-icon},role=heading-link]

[.contract-index]
.Functions
Expand Down Expand Up @@ -1466,7 +1468,7 @@ In addition to the current interfaceId, also support previous version of the int

[.contract]
[[IMembership]]
=== `++IMembership++` link:https://github.com/aragon/osx-commons.git/blob/v1.4.0-alpha.6/src/plugin/extensions/membership/IMembership.sol[{github-icon},role=heading-link]
=== `++IMembership++` link:https://github.com/aragon/osx-commons/blob/1.4.0-alpha.6-contracts/contracts/src/plugin/extensions/membership/IMembership.sol[{github-icon},role=heading-link]

[.contract-index]
.Functions
Expand Down Expand Up @@ -1520,7 +1522,7 @@ Emitted to announce the membership being defined by a contract.

[.contract]
[[Addresslist]]
=== `++Addresslist++` link:https://github.com/aragon/osx-commons.git/blob/v1.4.0-alpha.6/src/plugin/extensions/governance/Addresslist.sol[{github-icon},role=heading-link]
=== `++Addresslist++` link:https://github.com/aragon/osx-commons/blob/1.4.0-alpha.6-contracts/contracts/src/plugin/extensions/governance/Addresslist.sol[{github-icon},role=heading-link]

This contract inherits from `MajorityVotingBase` and implements the `IMajorityVoting` interface.

Expand Down Expand Up @@ -1595,7 +1597,7 @@ Thrown when the address list update is invalid, which can be caused by the addit

[.contract]
[[MetadataExtension]]
=== `++MetadataExtension++` link:https://github.com/aragon/osx-commons.git/blob/v1.4.0-alpha.6/src/utils/metadata/MetadataExtension.sol[{github-icon},role=heading-link]
=== `++MetadataExtension++` link:https://github.com/aragon/osx-commons/blob/1.4.0-alpha.6-contracts/contracts/src/utils/metadata/MetadataExtension.sol[{github-icon},role=heading-link]

[.contract-index]
.Functions
Expand Down Expand Up @@ -1680,7 +1682,7 @@ Emitted when metadata is set.

[.contract]
[[MetadataExtensionUpgradeable]]
=== `++MetadataExtensionUpgradeable++` link:https://github.com/aragon/osx-commons.git/blob/v1.4.0-alpha.6/src/utils/metadata/MetadataExtensionUpgradeable.sol[{github-icon},role=heading-link]
=== `++MetadataExtensionUpgradeable++` link:https://github.com/aragon/osx-commons/blob/1.4.0-alpha.6-contracts/contracts/src/utils/metadata/MetadataExtensionUpgradeable.sol[{github-icon},role=heading-link]

Due to the requirements that already existing upgradeable plugins need to start inheritting from this,
we're required to use hardcoded/specific slots for storage instead of sequential slots with gaps.
Expand Down Expand Up @@ -1775,7 +1777,7 @@ Emitted when metadata is updated.

[.contract]
[[ProtocolVersion]]
=== `++ProtocolVersion++` link:https://github.com/aragon/osx-commons.git/blob/v1.4.0-alpha.6/src/utils/versioning/ProtocolVersion.sol[{github-icon},role=heading-link]
=== `++ProtocolVersion++` link:https://github.com/aragon/osx-commons/blob/1.4.0-alpha.6-contracts/contracts/src/utils/versioning/ProtocolVersion.sol[{github-icon},role=heading-link]

Do not add any new variables to this contract that would shift down storage in the inheritance chain.

Expand Down Expand Up @@ -1806,7 +1808,7 @@ This version number is not to be confused with the `release` and &#x60

[.contract]
[[ProxyFactory]]
=== `++ProxyFactory++` link:https://github.com/aragon/osx-commons.git/blob/v1.4.0-alpha.6/src/utils/deployment/ProxyFactory.sol[{github-icon},role=heading-link]
=== `++ProxyFactory++` link:https://github.com/aragon/osx-commons/blob/1.4.0-alpha.6-contracts/contracts/src/utils/deployment/ProxyFactory.sol[{github-icon},role=heading-link]

[.contract-index]
.Functions
Expand Down Expand Up @@ -1878,7 +1880,7 @@ The immutable logic contract address.

[.contract]
[[ProxyLib]]
=== `++ProxyLib++` link:https://github.com/aragon/osx-commons.git/blob/v1.4.0-alpha.6/src/utils/deployment/ProxyLib.sol[{github-icon},role=heading-link]
=== `++ProxyLib++` link:https://github.com/aragon/osx-commons/blob/1.4.0-alpha.6-contracts/contracts/src/utils/deployment/ProxyLib.sol[{github-icon},role=heading-link]

[.contract-index]
.Functions
Expand Down Expand Up @@ -1910,7 +1912,7 @@ If `_initCalldata` is non-empty, it is used in a call to the clone con

[.contract]
[[PermissionCondition]]
=== `++PermissionCondition++` link:https://github.com/aragon/osx-commons.git/blob/v1.4.0-alpha.6/src/permission/condition/PermissionCondition.sol[{github-icon},role=heading-link]
=== `++PermissionCondition++` link:https://github.com/aragon/osx-commons/blob/1.4.0-alpha.6-contracts/contracts/src/permission/condition/PermissionCondition.sol[{github-icon},role=heading-link]

[.contract-index]
.Functions
Expand Down Expand Up @@ -1946,7 +1948,7 @@ Checks if an interface is supported by this or its parent contract.

[.contract]
[[PermissionConditionUpgradeable]]
=== `++PermissionConditionUpgradeable++` link:https://github.com/aragon/osx-commons.git/blob/v1.4.0-alpha.6/src/permission/condition/PermissionConditionUpgradeable.sol[{github-icon},role=heading-link]
=== `++PermissionConditionUpgradeable++` link:https://github.com/aragon/osx-commons/blob/1.4.0-alpha.6-contracts/contracts/src/permission/condition/PermissionConditionUpgradeable.sol[{github-icon},role=heading-link]

[.contract-index]
.Functions
Expand Down Expand Up @@ -2026,7 +2028,7 @@ Checks if an interface is supported by this or its parent contract.

[.contract]
[[RuledCondition]]
=== `++RuledCondition++` link:https://github.com/aragon/osx-commons.git/blob/v1.4.0-alpha.6/src/permission/condition/extensions/RuledCondition.sol[{github-icon},role=heading-link]
=== `++RuledCondition++` link:https://github.com/aragon/osx-commons/blob/1.4.0-alpha.6-contracts/contracts/src/permission/condition/extensions/RuledCondition.sol[{github-icon},role=heading-link]

[.contract-index]
.Functions
Expand Down
2 changes: 1 addition & 1 deletion contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
},
"repository": {
"type": "git",
"url": "https://github.com/aragon/osx-commons.git"
"url": "https://github.com/aragon/osx-commons"
},
"files": [
"src/{dao,permission,plugin,utils}/**/*.sol"
Expand Down
6 changes: 1 addition & 5 deletions contracts/scripts/prepare-docs.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/usr/bin/env bash

set -euo pipefail
# shopt -s globstar


PACKAGE_NAME="@aragon/osx-commons-configs"
PACKAGE_PATH=$(node -p "require.resolve('$PACKAGE_NAME')")
Expand All @@ -18,10 +16,8 @@ fi

rm -rf "$OUTDIR"

echo $OUTDIR

hardhat docgen

node scripts/gen-nav.js "$OUTDIR" > "$OUTDIR/../nav.adoc"

rm -rf ./docs/templates
rm -rf ./docs/templates/
1 change: 1 addition & 0 deletions contracts/src/dao/IDAO.sol
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ interface IDAO {
function getTrustedForwarder() external view returns (address);

/// @notice Emitted when a new TrustedForwarder is set on the DAO.
/// @dev Requires {UPDATE_STAGES_PERMISSION_ID}
/// @param forwarder the new forwarder address.
event TrustedForwarderSet(address forwarder);

Expand Down

0 comments on commit 121a979

Please sign in to comment.