From 2685f9084b0143f0fb02c8e1a669558891f18d12 Mon Sep 17 00:00:00 2001 From: banasa44 Date: Mon, 22 Apr 2024 16:17:29 +0200 Subject: [PATCH] feat: add version 1.3.0 snapshot, hide current (/docs) from site --- .../01-core/dao-plugin.drawio.svg | 313 +------ .../plugin-repo-overview.drawio.svg | 352 +------- .../plugin-installation.drawio.svg | 448 +--------- .../plugin-uninstallation.drawio.svg | 469 +--------- .../02-plugin-setup/plugin-update.drawio.svg | 524 +---------- .../plugin-version.drawio.svg | 156 +--- ...os-infrastructure-core-overview.drawio.svg | 823 +----------------- .../aragon-os-framework-overview.drawio.svg | 516 +---------- .../reference-guide/directives/deprecated.mdx | 2 +- .../reference-guide/directives/include.mdx | 2 +- .../reference-guide/directives/skip.mdx | 2 +- .../directives/specified-by.mdx | 2 +- .../enums/permission-operation.mdx | 2 +- .../enums/plugin-preparation-state.mdx | 2 +- .../enums/plugin-preparation-type.mdx | 2 +- .../reference-guide/enums/transfer-type.mdx | 2 +- .../reference-guide/enums/vote-option.mdx | 2 +- .../reference-guide/enums/voting-mode.mdx | 2 +- .../reference-guide/interfaces/iplugin.mdx | 12 +- .../reference-guide/interfaces/iproposal.mdx | 28 +- .../interfaces/token-balance.mdx | 10 +- .../interfaces/token-transfer.mdx | 20 +- .../reference-guide/interfaces/token.mdx | 10 +- .../reference-guide/objects/action.mdx | 16 +- .../objects/addresslist-voting-plugin.mdx | 28 +- .../objects/addresslist-voting-proposal.mdx | 66 +- .../objects/addresslist-voting-vote.mdx | 18 +- .../objects/addresslist-voting-voter.mdx | 10 +- .../reference-guide/objects/admin-plugin.mdx | 16 +- .../objects/admin-proposal.mdx | 34 +- .../objects/administrator-admin-plugin.mdx | 8 +- .../reference-guide/objects/administrator.mdx | 10 +- docs/subgraph/reference-guide/objects/dao.mdx | 34 +- .../objects/erc1155-balance.mdx | 16 +- .../objects/erc1155-contract.mdx | 10 +- .../objects/erc1155-token-id-balance.mdx | 12 +- .../objects/erc1155-transfer.mdx | 26 +- .../reference-guide/objects/erc20-balance.mdx | 12 +- .../objects/erc20-contract.mdx | 12 +- .../objects/erc20-transfer.mdx | 22 +- .../objects/erc20-wrapper-contract.mdx | 12 +- .../objects/erc721-balance.mdx | 12 +- .../objects/erc721-contract.mdx | 10 +- .../objects/erc721-transfer.mdx | 22 +- .../objects/multisig-approver.mdx | 10 +- .../objects/multisig-plugin.mdx | 22 +- .../objects/multisig-proposal-approver.mdx | 10 +- .../objects/multisig-proposal.mdx | 50 +- .../objects/native-balance.mdx | 10 +- .../objects/native-transfer.mdx | 22 +- .../reference-guide/objects/permission.mdx | 18 +- .../objects/plugin-installation.mdx | 20 +- .../objects/plugin-permission.mdx | 16 +- .../objects/plugin-preparation.mdx | 26 +- .../objects/plugin-release.mdx | 12 +- .../reference-guide/objects/plugin-repo.mdx | 14 +- .../reference-guide/objects/plugin-setup.mdx | 6 +- .../objects/plugin-version.mdx | 18 +- .../reference-guide/objects/query.mdx | 2 +- .../objects/standard-callback.mdx | 12 +- .../objects/token-voting-member.mdx | 16 +- .../objects/token-voting-plugin.mdx | 30 +- .../objects/token-voting-proposal.mdx | 66 +- .../objects/token-voting-vote.mdx | 18 +- .../objects/token-voting-voter.mdx | 12 +- .../objects/transaction-actions-proposal.mdx | 26 +- .../reference-guide/scalars/big-int.mdx | 2 +- .../reference-guide/scalars/boolean.mdx | 2 +- .../reference-guide/scalars/bytes.mdx | 2 +- docs/subgraph/reference-guide/scalars/id.mdx | 2 +- docs/subgraph/reference-guide/scalars/int.mdx | 2 +- .../reference-guide/scalars/string.mdx | 2 +- docusaurus.config.js | 18 +- sidebars.js | 1 - static/subgraph/sidebar-schema.js | 10 - .../01-core/01-dao/01-actions.md | 138 +++ .../01-how-it-works/01-core/01-dao/index.md | 62 ++ .../01-core/02-permissions/01-conditions.md | 210 +++++ .../01-core/02-permissions/index.md | 157 ++++ .../01-core/03-plugins/index.md | 51 ++ .../01-core/dao-plugin.drawio.svg | 33 + .../osx/01-how-it-works/01-core/index.md | 44 + .../02-framework/01-dao-creation/index.md | 55 ++ .../01-plugin-repo/01-plugin-repo-creation.md | 65 ++ .../01-plugin-repo/index.md | 57 ++ .../plugin-repo-overview.drawio.svg | 41 + .../01-security-risk-mitigation.md | 63 ++ .../02-plugin-setup/index.md | 98 +++ .../plugin-installation.drawio.svg | 45 + .../plugin-uninstallation.drawio.svg | 47 + .../02-plugin-setup/plugin-update.drawio.svg | 53 ++ .../02-plugin-management/index.md | 53 ++ .../plugin-version.drawio.svg | 19 + .../02-framework/03-ens-names.md | 21 + ...os-infrastructure-core-overview.drawio.svg | 89 ++ .../osx/01-how-it-works/02-framework/index.md | 29 + .../osx/01-how-it-works/03-framwork-dao.md | 11 + .../aragon-os-framework-overview.drawio.svg | 51 ++ .../osx/01-how-it-works/index.md | 29 + .../01-dao/01-best-practices.md | 22 + .../01-dao/02-action-execution.md | 150 ++++ .../01-dao/03-protocol-upgrades.md | 13 + .../01-dao/04-managing-plugins/index.md | 50 ++ .../osx/02-how-to-guides/01-dao/index.md | 27 + .../01-best-practices.md | 30 + .../02-plugin-development/02-plugin-types.md | 73 ++ .../01-initialization.md | 81 ++ .../02-implementation.md | 81 ++ .../03-non-upgradeable-plugin/03-setup.md | 338 +++++++ .../03-non-upgradeable-plugin/index.md | 351 ++++++++ .../01-initialization.md | 76 ++ .../02-implementation.md | 44 + .../04-upgradeable-plugin/03-setup.md | 204 +++++ .../04-subsequent-builds.md | 150 ++++ .../05-updating-versions.md | 360 ++++++++ .../04-upgradeable-plugin/index.md | 33 + .../05-governance-plugins/01-proposals.md | 43 + .../05-governance-plugins/02-membership.md | 44 + .../05-governance-plugins/index.md | 41 + .../06-meta-tx-plugins.md | 46 + .../07-publication/01-versioning.md | 59 ++ .../07-publication/02-metadata.md | 122 +++ .../07-publication/index.md | 132 +++ .../02-plugin-development/index.md | 211 +++++ .../osx/02-how-to-guides/index.md | 49 ++ .../osx/03-reference-guide/core/dao/DAO.md | 442 ++++++++++ .../03-reference-guide/core/dao/IEIP4824.md | 19 + .../core/permission/PermissionManager.md | 404 +++++++++ .../core/utils/CallbackHandler.md | 82 ++ .../framework/dao/DAOFactory.md | 123 +++ .../framework/dao/DAORegistry.md | 82 ++ .../framework/plugin/repo/IPluginRepo.md | 35 + .../framework/plugin/repo/PluginRepo.md | 332 +++++++ .../plugin/repo/PluginRepoFactory.md | 110 +++ .../plugin/repo/PluginRepoRegistry.md | 86 ++ .../repo/placeholder/PlaceholderSetup.md | 60 ++ .../plugin/setup/PluginSetupProcessor.md | 475 ++++++++++ .../setup/PluginSetupProcessorHelpers.md | 91 ++ .../framework/utils/InterfaceBasedRegistry.md | 106 +++ .../framework/utils/RegistryUtils.md | 20 + .../framework/utils/ens/ENSMigration.md | 5 + .../utils/ens/ENSSubdomainRegistrar.md | 137 +++ .../osx/03-reference-guide/index.md | 7 + versioned_docs/version-1.3.0/osx/index.md | 61 ++ .../01-examples/01-client/01-create-dao.md | 111 +++ .../01-examples/01-client/02-deposit-eth.md | 56 ++ .../01-examples/01-client/03-deposit-erc20.md | 85 ++ .../01-client/04-deposit-erc721.md | 73 ++ .../01-client/05-deposit-erc1155.md | 78 ++ .../sdk/01-examples/01-client/06-get-dao.md | 54 ++ .../sdk/01-examples/01-client/07-get-daos.md | 82 ++ .../01-examples/01-client/08-get-balances.md | 47 + .../01-examples/01-client/09-get-transfers.md | 85 ++ .../01-examples/01-client/10-set-allowance.md | 60 ++ .../01-examples/01-client/11-pin-metadata.md | 38 + .../01-client/12-prepare-installation.md | 81 ++ .../01-client/13-get-protocol-version.md | 35 + .../01-client/14-prepare-uninstallation.md | 90 ++ .../01-client/15-prepare-update.md | 101 +++ .../01-client/16-is-plugin-update-valid.md | 38 + .../01-client/17-is-plugin-update-proposal.md | 31 + .../01-client/18-is-dao-update-valid.md | 36 + .../01-client/19-is-dao-update-proposal.md | 31 + .../01-client/20-get-plugin-preparations.md | 74 ++ .../sdk/01-examples/01-client/index.md | 24 + .../02-multisig-client/01-installation.md | 100 +++ .../02-multisig-client/02-create-proposal.md | 83 ++ .../03-create-proposal-with-actions.md | 97 +++ .../02-multisig-client/04-can-approve.md | 31 + .../02-multisig-client/05-approve-proposal.md | 51 ++ .../02-multisig-client/06-can-execute.md | 28 + .../02-multisig-client/07-execute-proposal.md | 44 + .../02-multisig-client/08-get-proposal.md | 67 ++ .../02-multisig-client/09-get-proposals.md | 68 ++ .../10-get-voting-settings.md | 30 + .../02-multisig-client/11-get-members.md | 33 + .../02-multisig-client/12-pin-metadata.md | 46 + .../13-prepare-installation.md | 71 ++ .../02-multisig-client/14-prepare-update.md | 100 +++ .../02-multisig-client/15-is-member.md | 29 + .../01-examples/02-multisig-client/index.md | 21 + .../03-tokenVoting-client/01-installation.md | 139 +++ .../02-create-proposal.md | 90 ++ .../03-create-proposal-with-actions.md | 98 +++ .../03-tokenVoting-client/04-can-vote.md | 38 + .../05-vote-on-proposal.md | 53 ++ .../03-tokenVoting-client/06-can-execute.md | 30 + .../07-execute-proposal.md | 44 + .../03-tokenVoting-client/08-get-proposal.md | 105 +++ .../03-tokenVoting-client/09-get-proposals.md | 97 +++ .../10-get-voting-settings.md | 36 + .../03-tokenVoting-client/11-get-members.md | 58 ++ .../03-tokenVoting-client/12-get-token.md | 65 ++ .../03-tokenVoting-client/13-pin-metadata.md | 51 ++ .../14-prepare-installation.md | 83 ++ .../03-tokenVoting-client/15-wrap-tokens.md | 76 ++ .../03-tokenVoting-client/16-unwrap-tokens.md | 45 + .../17-delegate-tokens.md | 50 ++ .../18-undelegate-tokens.md | 43 + .../03-tokenVoting-client/19-get-delegate.md | 31 + .../20-is-governance-token-compatible.md | 34 + .../21-prepare-update.md | 100 +++ .../03-tokenVoting-client/22-is-member.md | 29 + .../03-tokenVoting-client/index.md | 24 + .../01-installation.md | 106 +++ .../02-create-proposal.md | 89 ++ .../03-create-proposal-with-actions.md | 107 +++ .../04-can-vote.md | 37 + .../05-vote-proposal.md | 53 ++ .../06-can-execute.md | 30 + .../07-execute-proposal.md | 44 + .../08-get-proposal.md | 94 ++ .../09-get-proposals.md | 82 ++ .../10-get-voting-settings.md | 35 + .../11-get-members.md | 38 + .../12-pin-metadata.md | 46 + .../13-prepare-installation.md | 75 ++ .../14-prepare-update.md | 100 +++ .../15-is-member.md | 29 + .../04-addresslistVoting-client/index.md | 19 + .../05-encoders-decoders/01-find-interface.md | 32 + .../02-grant-permission.md | 72 ++ .../03-grant-with-condition.md | 76 ++ .../04-revoke-permissions.md | 76 ++ .../05-register-standard-callback.md | 71 ++ .../05-encoders-decoders/06-withdraw.md | 226 +++++ .../07-update-metadata.md | 115 +++ .../05-encoders-decoders/08-set-dao-uri.md | 57 ++ .../09-set-signature-validator.md | 56 ++ .../05-encoders-decoders/10-upgrade-to.md | 53 ++ .../11-upgrade-to-and-call.md | 65 ++ .../12-apply-installation.md | 122 +++ .../12-multisig/01-find-interface.md | 30 + .../12-multisig/02-add-addresses.md | 74 ++ .../12-multisig/03-remove-addresses.md | 75 ++ .../12-multisig/04-update-plugin-settings.md | 66 ++ .../05-encoders-decoders/12-multisig/index.md | 18 + .../01-find-interface.md | 29 + .../13-addresslist-voting/02-add-members.md | 61 ++ .../03-remove-members.md | 63 ++ .../04-update-plugin-settings.md | 65 ++ .../13-addresslist-voting/index.md | 22 + .../13-apply-uninstallation.md | 106 +++ .../14-initialize-from.md | 60 ++ .../14-token-voting/01-find-interface.md | 30 + .../14-token-voting/02-mint-token.md | 62 ++ .../03-update-plugin-settings.md | 69 ++ .../14-token-voting/index.md | 22 + .../05-encoders-decoders/15-apply-update.md | 110 +++ .../05-encoders-decoders/16-dao-update.md | 69 ++ .../01-examples/05-encoders-decoders/index.md | 22 + .../version-1.3.0/sdk/01-examples/index.md | 99 +++ .../sdk/02-reference-guide/01-client.md | 757 ++++++++++++++++ .../sdk/02-reference-guide/02-multisig.md | 404 +++++++++ .../sdk/02-reference-guide/03-token-voting.md | 463 ++++++++++ .../04-addresslist-voting.md | 381 ++++++++ .../sdk/02-reference-guide/index.md | 12 + .../sdk/03-update-security-check/index.md | 179 ++++ versioned_docs/version-1.3.0/sdk/index.md | 84 ++ .../version-1.3.0-sidebars.json | 14 + versions.json | 3 + 261 files changed, 16797 insertions(+), 3897 deletions(-) delete mode 100644 static/subgraph/sidebar-schema.js create mode 100644 versioned_docs/version-1.3.0/osx/01-how-it-works/01-core/01-dao/01-actions.md create mode 100644 versioned_docs/version-1.3.0/osx/01-how-it-works/01-core/01-dao/index.md create mode 100644 versioned_docs/version-1.3.0/osx/01-how-it-works/01-core/02-permissions/01-conditions.md create mode 100644 versioned_docs/version-1.3.0/osx/01-how-it-works/01-core/02-permissions/index.md create mode 100644 versioned_docs/version-1.3.0/osx/01-how-it-works/01-core/03-plugins/index.md create mode 100644 versioned_docs/version-1.3.0/osx/01-how-it-works/01-core/dao-plugin.drawio.svg create mode 100644 versioned_docs/version-1.3.0/osx/01-how-it-works/01-core/index.md create mode 100644 versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/01-dao-creation/index.md create mode 100644 versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/02-plugin-management/01-plugin-repo/01-plugin-repo-creation.md create mode 100644 versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/02-plugin-management/01-plugin-repo/index.md create mode 100644 versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/02-plugin-management/01-plugin-repo/plugin-repo-overview.drawio.svg create mode 100644 versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/02-plugin-management/02-plugin-setup/01-security-risk-mitigation.md create mode 100644 versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/02-plugin-management/02-plugin-setup/index.md create mode 100644 versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/02-plugin-management/02-plugin-setup/plugin-installation.drawio.svg create mode 100644 versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/02-plugin-management/02-plugin-setup/plugin-uninstallation.drawio.svg create mode 100644 versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/02-plugin-management/02-plugin-setup/plugin-update.drawio.svg create mode 100644 versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/02-plugin-management/index.md create mode 100644 versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/02-plugin-management/plugin-version.drawio.svg create mode 100644 versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/03-ens-names.md create mode 100644 versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/aragon-os-infrastructure-core-overview.drawio.svg create mode 100644 versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/index.md create mode 100644 versioned_docs/version-1.3.0/osx/01-how-it-works/03-framwork-dao.md create mode 100644 versioned_docs/version-1.3.0/osx/01-how-it-works/aragon-os-framework-overview.drawio.svg create mode 100644 versioned_docs/version-1.3.0/osx/01-how-it-works/index.md create mode 100644 versioned_docs/version-1.3.0/osx/02-how-to-guides/01-dao/01-best-practices.md create mode 100644 versioned_docs/version-1.3.0/osx/02-how-to-guides/01-dao/02-action-execution.md create mode 100644 versioned_docs/version-1.3.0/osx/02-how-to-guides/01-dao/03-protocol-upgrades.md create mode 100644 versioned_docs/version-1.3.0/osx/02-how-to-guides/01-dao/04-managing-plugins/index.md create mode 100644 versioned_docs/version-1.3.0/osx/02-how-to-guides/01-dao/index.md create mode 100644 versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/01-best-practices.md create mode 100644 versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/02-plugin-types.md create mode 100644 versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/03-non-upgradeable-plugin/01-initialization.md create mode 100644 versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/03-non-upgradeable-plugin/02-implementation.md create mode 100644 versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/03-non-upgradeable-plugin/03-setup.md create mode 100644 versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/03-non-upgradeable-plugin/index.md create mode 100644 versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/04-upgradeable-plugin/01-initialization.md create mode 100644 versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/04-upgradeable-plugin/02-implementation.md create mode 100644 versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/04-upgradeable-plugin/03-setup.md create mode 100644 versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/04-upgradeable-plugin/04-subsequent-builds.md create mode 100644 versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/04-upgradeable-plugin/05-updating-versions.md create mode 100644 versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/04-upgradeable-plugin/index.md create mode 100644 versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/05-governance-plugins/01-proposals.md create mode 100644 versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/05-governance-plugins/02-membership.md create mode 100644 versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/05-governance-plugins/index.md create mode 100644 versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/06-meta-tx-plugins.md create mode 100644 versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/07-publication/01-versioning.md create mode 100644 versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/07-publication/02-metadata.md create mode 100644 versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/07-publication/index.md create mode 100644 versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/index.md create mode 100644 versioned_docs/version-1.3.0/osx/02-how-to-guides/index.md create mode 100644 versioned_docs/version-1.3.0/osx/03-reference-guide/core/dao/DAO.md create mode 100644 versioned_docs/version-1.3.0/osx/03-reference-guide/core/dao/IEIP4824.md create mode 100644 versioned_docs/version-1.3.0/osx/03-reference-guide/core/permission/PermissionManager.md create mode 100644 versioned_docs/version-1.3.0/osx/03-reference-guide/core/utils/CallbackHandler.md create mode 100644 versioned_docs/version-1.3.0/osx/03-reference-guide/framework/dao/DAOFactory.md create mode 100644 versioned_docs/version-1.3.0/osx/03-reference-guide/framework/dao/DAORegistry.md create mode 100644 versioned_docs/version-1.3.0/osx/03-reference-guide/framework/plugin/repo/IPluginRepo.md create mode 100644 versioned_docs/version-1.3.0/osx/03-reference-guide/framework/plugin/repo/PluginRepo.md create mode 100644 versioned_docs/version-1.3.0/osx/03-reference-guide/framework/plugin/repo/PluginRepoFactory.md create mode 100644 versioned_docs/version-1.3.0/osx/03-reference-guide/framework/plugin/repo/PluginRepoRegistry.md create mode 100644 versioned_docs/version-1.3.0/osx/03-reference-guide/framework/plugin/repo/placeholder/PlaceholderSetup.md create mode 100644 versioned_docs/version-1.3.0/osx/03-reference-guide/framework/plugin/setup/PluginSetupProcessor.md create mode 100644 versioned_docs/version-1.3.0/osx/03-reference-guide/framework/plugin/setup/PluginSetupProcessorHelpers.md create mode 100644 versioned_docs/version-1.3.0/osx/03-reference-guide/framework/utils/InterfaceBasedRegistry.md create mode 100644 versioned_docs/version-1.3.0/osx/03-reference-guide/framework/utils/RegistryUtils.md create mode 100644 versioned_docs/version-1.3.0/osx/03-reference-guide/framework/utils/ens/ENSMigration.md create mode 100644 versioned_docs/version-1.3.0/osx/03-reference-guide/framework/utils/ens/ENSSubdomainRegistrar.md create mode 100644 versioned_docs/version-1.3.0/osx/03-reference-guide/index.md create mode 100644 versioned_docs/version-1.3.0/osx/index.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/01-client/01-create-dao.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/01-client/02-deposit-eth.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/01-client/03-deposit-erc20.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/01-client/04-deposit-erc721.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/01-client/05-deposit-erc1155.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/01-client/06-get-dao.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/01-client/07-get-daos.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/01-client/08-get-balances.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/01-client/09-get-transfers.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/01-client/10-set-allowance.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/01-client/11-pin-metadata.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/01-client/12-prepare-installation.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/01-client/13-get-protocol-version.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/01-client/14-prepare-uninstallation.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/01-client/15-prepare-update.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/01-client/16-is-plugin-update-valid.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/01-client/17-is-plugin-update-proposal.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/01-client/18-is-dao-update-valid.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/01-client/19-is-dao-update-proposal.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/01-client/20-get-plugin-preparations.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/01-client/index.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/01-installation.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/02-create-proposal.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/03-create-proposal-with-actions.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/04-can-approve.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/05-approve-proposal.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/06-can-execute.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/07-execute-proposal.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/08-get-proposal.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/09-get-proposals.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/10-get-voting-settings.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/11-get-members.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/12-pin-metadata.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/13-prepare-installation.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/14-prepare-update.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/15-is-member.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/index.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/01-installation.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/02-create-proposal.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/03-create-proposal-with-actions.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/04-can-vote.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/05-vote-on-proposal.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/06-can-execute.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/07-execute-proposal.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/08-get-proposal.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/09-get-proposals.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/10-get-voting-settings.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/11-get-members.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/12-get-token.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/13-pin-metadata.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/14-prepare-installation.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/15-wrap-tokens.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/16-unwrap-tokens.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/17-delegate-tokens.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/18-undelegate-tokens.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/19-get-delegate.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/20-is-governance-token-compatible.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/21-prepare-update.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/22-is-member.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/index.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/01-installation.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/02-create-proposal.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/03-create-proposal-with-actions.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/04-can-vote.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/05-vote-proposal.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/06-can-execute.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/07-execute-proposal.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/08-get-proposal.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/09-get-proposals.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/10-get-voting-settings.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/11-get-members.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/12-pin-metadata.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/13-prepare-installation.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/14-prepare-update.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/15-is-member.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/index.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/01-find-interface.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/02-grant-permission.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/03-grant-with-condition.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/04-revoke-permissions.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/05-register-standard-callback.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/06-withdraw.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/07-update-metadata.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/08-set-dao-uri.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/09-set-signature-validator.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/10-upgrade-to.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/11-upgrade-to-and-call.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-apply-installation.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-multisig/01-find-interface.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-multisig/02-add-addresses.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-multisig/03-remove-addresses.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-multisig/04-update-plugin-settings.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-multisig/index.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/01-find-interface.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/02-add-members.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/03-remove-members.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/04-update-plugin-settings.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/index.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-apply-uninstallation.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/14-initialize-from.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/14-token-voting/01-find-interface.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/14-token-voting/02-mint-token.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/14-token-voting/03-update-plugin-settings.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/14-token-voting/index.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/15-apply-update.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/16-dao-update.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/index.md create mode 100644 versioned_docs/version-1.3.0/sdk/01-examples/index.md create mode 100644 versioned_docs/version-1.3.0/sdk/02-reference-guide/01-client.md create mode 100644 versioned_docs/version-1.3.0/sdk/02-reference-guide/02-multisig.md create mode 100644 versioned_docs/version-1.3.0/sdk/02-reference-guide/03-token-voting.md create mode 100644 versioned_docs/version-1.3.0/sdk/02-reference-guide/04-addresslist-voting.md create mode 100644 versioned_docs/version-1.3.0/sdk/02-reference-guide/index.md create mode 100644 versioned_docs/version-1.3.0/sdk/03-update-security-check/index.md create mode 100644 versioned_docs/version-1.3.0/sdk/index.md create mode 100644 versioned_sidebars/version-1.3.0-sidebars.json create mode 100644 versions.json diff --git a/docs/osx/01-how-it-works/01-core/dao-plugin.drawio.svg b/docs/osx/01-how-it-works/01-core/dao-plugin.drawio.svg index 2ffa18af..c4d8f137 100644 --- a/docs/osx/01-how-it-works/01-core/dao-plugin.drawio.svg +++ b/docs/osx/01-how-it-works/01-core/dao-plugin.drawio.svg @@ -1,312 +1,33 @@ - - - - - - - -
-
-
- DAO -
-
-
-
- +
DAO
DAO - -
-
- - - - - -
-
-
- execute() -
-
-
-
- +
execute()
execute() - -
-
- - - - -
-
-
- Token Voting -
- Plugin -
-
-
-
- +
Token Voting
Plugin
Token Voting... - -
-
- - - - -
-
-
- Permission -
- Manager -
-
-
-
- +
Permission
Manager
Permission... - -
-
- - - - - - - -
-
-
- createProposal() -
-
-
-
- +
createProposal()
createProposal() - -
-
- - - - -
-
-
-

- - - - 🧑‍💼 - -

-
-
-
-
- +

🧑‍💼

🧑‍💼 - -
-
- - - - - -
-
-
- changeSettings() -
-
-
- - +
changeSettings()
changeSettings() - -
- - - - - -
-
-
- - - - 🧑‍🔧 - -
-
-
-
- +
🧑‍🔧
🧑‍🔧 - -
-
- - - - - - -
-
-
- DeFi -
- Plugin -
-
-
-
- +
DeFi
Plugin
DeFi... - -
-
- - - - -
-
-
- - hasPermission() - -
-
-
-
- +
hasPermission()
hasPermission() - -
-
- - - - - -
-
-
- invest() -
-
-
-
- +
invest()
invest() - -
-
- - - - - - -
-
-
- - - - - 🧑‍🌾 - - -
-
-
-
- +
🧑‍🌾
🧑‍🌾 - -
-
- - - - - -
-
-
- depositTokens() -
-
-
-
- +
depositTokens()
depositTokens() - -
-
- - - - -
-
-
-

- - - - 🛡 - -

-
-
-
-
- +

🛡

🛡 - -
-
- - - - -
-
-
- - external contract - -
-
-
-
- +
external contract
external cont... - -
-
- - - - - - + Text is not SVG - cannot display - - - - \ No newline at end of file + \ No newline at end of file diff --git a/docs/osx/01-how-it-works/02-framework/02-plugin-management/01-plugin-repo/plugin-repo-overview.drawio.svg b/docs/osx/01-how-it-works/02-framework/02-plugin-management/01-plugin-repo/plugin-repo-overview.drawio.svg index 62793afc..ab6bba1f 100644 --- a/docs/osx/01-how-it-works/02-framework/02-plugin-management/01-plugin-repo/plugin-repo-overview.drawio.svg +++ b/docs/osx/01-how-it-works/02-framework/02-plugin-management/01-plugin-repo/plugin-repo-overview.drawio.svg @@ -1,351 +1,41 @@ - - - - - - - - -
-
-
- PluginRepoRegistry -
-
-
-
- +
PluginRepoRegistry
PluginRepoRegistry - -
-
- - - - - -
-
-
- 0x54... -
-
-
-
- +
0x54...
0x54... - -
-
- - - - - -
-
-
- PluginRepo -
- - - ENS name - - -
-
-
-
- +
PluginRepo
ENS name
PluginRepo... - -
-
- - - - - -
-
-
- 1.2 -
-
-
-
- +
1.2
1.2 - -
-
- - - - -
-
-
- 1.3 -
-
-
-
- +
1.3
1.3 - -
-
- - - - -
-
-
- 2.1 -
-
-
-
- +
2.1
2.1 - -
-
- - - - -
-
-
- ... -
-
-
-
- +
...
... - -
-
- - - - -
-
-
- 1.1 -
-
-
-
- +
1.1
1.1 - -
-
- - - - -
-
-
- 0xf2... -
-
-
-
- +
0xf2...
0xf2... - -
-
- - - - -
-
-
- 0x1a... -
-
-
-
- +
0x1a...
0x1a... - -
-
- - - - -
-
-
- ... -
-
-
-
- +
...
... - -
-
- - - - -
-
-
- Version -
-
-
-
- +
Version
Version - -
-
- - - - -
-
-
- Plugin -
-
-
-
- +
Plugin
Plugin - -
-
- - - - -
-
-
- PluginSetup -
-
-
-
- +
PluginSetup
PluginSetup - -
-
- - - - -
-
-
- 1.1 -
-
-
-
- +
1.1
1.1 - -
-
- - - - -
-
-
- Metadata -
-
-
-
- +
Metadata
Metadata - -
-
- - - -
-
-
- - Tag - -
-
-
-
- +
Tag
Tag - -
-
- - - -
-
-
- - Build - -
-
-
-
- +
Build
Build - -
-
- - - -
-
-
- - Release - -
-
-
-
- +
Release
Release - -
-
- - -
- - - - + Text is not SVG - cannot display - - - -
\ No newline at end of file + \ No newline at end of file diff --git a/docs/osx/01-how-it-works/02-framework/02-plugin-management/02-plugin-setup/plugin-installation.drawio.svg b/docs/osx/01-how-it-works/02-framework/02-plugin-management/02-plugin-setup/plugin-installation.drawio.svg index d25b3446..74fa7144 100644 --- a/docs/osx/01-how-it-works/02-framework/02-plugin-management/02-plugin-setup/plugin-installation.drawio.svg +++ b/docs/osx/01-how-it-works/02-framework/02-plugin-management/02-plugin-setup/plugin-installation.drawio.svg @@ -1,447 +1,45 @@ - - - - - - - - -
-
-
- - 1c. - - createProposal() -
-
-
-
- +
1c.createProposal()
1c. createProposal() - -
-
- - - - -
-
-
- Plugin Repository -
-
-
-
- +
Plugin Repository
Plugin Repository - -
-
- - - - - - -
-
-
- - 1b. - - - prepareInstallation() - -
-
-
-
- +
1b.prepareInstallation()
1b. prepareInstallation() - -
-
- - - - -
-
-
- DAO -
-
-
-
- +
DAO
DAO - -
-
- - - - - - - - -
-
-
- doSomething() ✨ -
-
-
-
- +
doSomething() ✨
doSomething() ✨ - -
-
- - - - - -
-
-
- Plugin Logic -
-
-
-
- +
Plugin Logic
Plugin Logic - -
-
- - - - - - - - -
-
-
- - 1a. - - prepareInstallation(repo, version) -
-
-
-
- +
1a.prepareInstallation(repo, version)
1a. prepareInstallation(repo, version) - -
-
- - - - - -
-
-
- - - 2c. - - grant() - -
-
-
-
- +
2c.grant()
2c. grant() - -
-
- - - - -
-
-
- Permission -
- Manager -
-
-
-
- +
Permission
Manager
Permission... - -
-
- - - - -
-
-
- Plugin -
-
-
-
- +
Plugin
Plugin - -
-
- - - - -
-
-
- 1.2 -
-
-
-
- +
1.2
1.2 - -
-
- - - - -
-
-
- - 1.1 -
-
-
-
-
-
- +
1.1
1.1 - -
-
- - - - -
-
-
- 1.2 -
-
-
-
- +
1.2
1.2 - -
-
- - - - - - -
-
-
- - - 2a. - - - execute() - - -
-
-
-
- +
2a.execute()
2a. execute() - -
-
- - - - - - -
-
-
-
- - - - Proposal - - : - - -
-
- - - grant permissions - - -
-
-
-
-
- +
Proposal:
grant permissions
Proposal:... - -
-
- - - - - - -
-
-
- - - 2b. - - applyInstallation() - -
-
-
-
- +
2b.applyInstallation()
2b. applyInstallation() - -
-
- - - - -
-
-
- Plugin Setup Processor -
-
-
-
- +
Plugin Setup Processor
Plugin Setup Process... - -
-
- - - - -
-
-
- Plugin Setup -
-
-
-
- +
Plugin Setup
Plugin Setup - -
-
- - - - -
-
-
- - 🗳 - -
-
-
-
- +
🗳
🗳 - -
-
- - - - - -
-
-
- - 🧑‍🔧 - -
-
-
-
- +
🧑‍🔧
🧑‍🔧 - -
-
- - - -
-
-
- - Proposal -
- Creator -
-
-
-
-
-
- +
Proposal
Creator
Proposal... - -
-
-
- - - - + Text is not SVG - cannot display - - - -
\ No newline at end of file + \ No newline at end of file diff --git a/docs/osx/01-how-it-works/02-framework/02-plugin-management/02-plugin-setup/plugin-uninstallation.drawio.svg b/docs/osx/01-how-it-works/02-framework/02-plugin-management/02-plugin-setup/plugin-uninstallation.drawio.svg index dfb2ef57..a6eace35 100644 --- a/docs/osx/01-how-it-works/02-framework/02-plugin-management/02-plugin-setup/plugin-uninstallation.drawio.svg +++ b/docs/osx/01-how-it-works/02-framework/02-plugin-management/02-plugin-setup/plugin-uninstallation.drawio.svg @@ -1,468 +1,47 @@ - - - - - - - - - -
-
-
- - doSomething() - -
-
-
-
- +
doSomething()
doSomething() - -
-
- - - - -
-
-
- Plugin Repository -
-
-
-
- +
Plugin Repository
Plugin Repository - -
-
- - - - -
-
-
- DAO -
-
-
-
- +
DAO
DAO - -
-
- - - - - - - -
-
-
- Plugin Logic -
-
-
-
- +
Plugin Logic
Plugin Logic - -
-
- - - - - - - - -
-
-
- - 1a. - - prepareUninstallation(repo, version) -
-
-
-
- +
1a.prepareUninstallation(repo, version)
1a. prepareUninstallation(repo, version) - -
-
- - - - - -
-
-
- - - 2c. - - revoke() - -
-
-
-
- +
2c.revoke()
2c. revoke() - -
-
- - - - -
-
-
- Permission -
- Manager -
-
-
-
- +
Permission
Manager
Permission... - -
-
- - - - -
-
-
- Plugin -
-
-
-
- +
Plugin
Plugin - -
-
- - - - -
-
-
- 1.2 -
-
-
-
- +
1.2
1.2 - -
-
- - - - -
-
-
- - 1.1 - -
-
-
-
- +
1.1
1.1 - -
-
- - - - -
-
-
- 1.2 -
-
-
-
- +
1.2
1.2 - -
-
- - - - - - - -
-
-
- - - 2a. - - - execute() - - -
-
-
-
- +
2a.execute()
2a. execute() - -
-
- - - - - - -
-
-
- - 1c. - - createProposal() -
-
-
-
- +
1c.createProposal()
1c. createProposal() - -
-
- - - - - - -
-
-
-
- - - - Proposal - - : - - -
-
- - - revoke permissions - - -
-
-
-
-
- +
Proposal:
revoke permissions
Proposal:... - -
-
- - - - - - -
-
-
- - - 2b. - - applyUninstallation() - -
-
-
-
- +
2b.applyUninstallation()
2b. applyUninstallation() - -
-
- - - - -
-
-
- Plugin Setup Processor -
-
-
-
- +
Plugin Setup Processor
Plugin Setup Process... - -
-
- - - - -
-
-
- - ✂️ - -
-
-
-
- +
✂️
✂️ - -
-
- - - - -
-
-
- Plugin Setup -
-
-
-
- +
Plugin Setup
Plugin Setup - -
-
- - - - - - - -
-
-
- - 🗳 - -
-
-
-
- +
🗳
🗳 - -
-
- - - - -
-
-
- - 🧑‍🔧 - -
-
-
-
- +
🧑‍🔧
🧑‍🔧 - -
-
- - - -
-
-
- - Proposal -
- Creator -
-
-
-
-
-
- +
Proposal
Creator
Proposal... - -
-
- - - -
-
-
- - 1b. - - - prepareUnnstallation() - -
-
-
-
- +
1b.prepareUnnstallation()
1b. prepareUnnstallation() - -
-
-
- - - - + Text is not SVG - cannot display - - - -
\ No newline at end of file + \ No newline at end of file diff --git a/docs/osx/01-how-it-works/02-framework/02-plugin-management/02-plugin-setup/plugin-update.drawio.svg b/docs/osx/01-how-it-works/02-framework/02-plugin-management/02-plugin-setup/plugin-update.drawio.svg index e92a3b12..b18ed2a5 100644 --- a/docs/osx/01-how-it-works/02-framework/02-plugin-management/02-plugin-setup/plugin-update.drawio.svg +++ b/docs/osx/01-how-it-works/02-framework/02-plugin-management/02-plugin-setup/plugin-update.drawio.svg @@ -1,523 +1,53 @@ - - - - - - - - - -
-
-
- doSomething() -
-
-
-
- +
doSomething()
doSomething() - -
-
- - - - - -
-
-
- doSomethingNew() ✨ -
-
-
-
- +
doSomethingNew() ✨
doSomethingNew() ✨ - -
-
- - - - -
-
-
- Plugin -
-
-
-
- +
Plugin
Plugin - -
-
- - - - -
-
-
- Plugin Repository -
-
-
-
- +
Plugin Repository
Plugin Repository - -
-
- - - - -
-
-
- DAO -
-
-
-
- +
DAO
DAO - -
-
- - - - - - -
-
-
- - 2a. - - - execute() - -
-
-
-
- +
2a.execute()
2a. execute() - -
-
- - - - - - - -
-
-
- - - 2c. - - grant/revoke() - -
-
-
-
- +
2c.grant/revoke()
2c. grant/revoke() - -
-
- - - - -
-
-
- Permission -
- Manager -
-
-
-
- +
Permission
Manager
Permission... - -
-
- - - - - - -
-
-
- - - 2b. - - applyUpdate() - -
-
-
-
- +
2b.applyUpdate()
2b. applyUpdate() - -
-
- - - - - - -
-
-
- - 1c. - - createProposal() -
-
-
-
- +
1c.createProposal()
1c. createProposal() - -
-
- - - - - - -
-
-
-
- - - - Proposal - - : - - -
-
- - - modify permissions - - -
-
-
-
-
- +
Proposal:
modify permissions
Proposal:... - -
-
- - - - - - -
-
-
- - 1.2 - -
-
-
-
- +
1.2
1.2 - -
-
- - - - -
-
-
- 1.3 -
-
-
-
- +
1.3
1.3 - -
-
- - - - - - - - -
-
-
- Plugin Logic -
-
-
-
- +
Plugin Logic
Plugin Logic - -
-
- - - - - - - - -
-
-
- Plugin Setup -
-
-
-
- +
Plugin Setup
Plugin Setup - -
-
- - - - -
-
-
- - 1.1 - -
-
-
-
- +
1.1
1.1 - -
-
- - - - -
-
-
- - 1.2 - -
-
-
-
- +
1.2
1.2 - -
-
- - - - -
-
-
- 1.3 -
-
-
-
- +
1.3
1.3 - -
-
- - - - - -
-
-
- - 1a. - - prepareUpdate(plugin, newVersion) -
-
-
-
- +
1a.prepareUpdate(plugin, newVersion)
1a. prepareUpdate(plugin, newVersion) - -
-
- - - - -
-
-
- Plugin Setup Processor -
-
-
-
- +
Plugin Setup Processor
Plugin Setup Process... - -
-
- - - - -
-
-
- - ✨ - -
-
-
-
- +
✨ - -
-
- - - - -
-
-
- - 🗳 - -
-
-
-
- +
🗳
🗳 - -
-
- - - - - -
-
-
- - 🧑‍🔧 - -
-
-
-
- +
🧑‍🔧
🧑‍🔧 - -
-
- - - -
-
-
- - Proposal -
- Creator -
-
-
-
-
-
- +
Proposal
Creator
Proposal... - -
-
- - - -
-
-
- - 1b. - - - prepareUpdate() - -
-
-
-
- +
1b.prepareUpdate()
1b. prepareUpdate() - -
-
-
- - - - + Text is not SVG - cannot display - - - -
\ No newline at end of file + \ No newline at end of file diff --git a/docs/osx/01-how-it-works/02-framework/02-plugin-management/plugin-version.drawio.svg b/docs/osx/01-how-it-works/02-framework/02-plugin-management/plugin-version.drawio.svg index 05d6c84c..d6d314aa 100644 --- a/docs/osx/01-how-it-works/02-framework/02-plugin-management/plugin-version.drawio.svg +++ b/docs/osx/01-how-it-works/02-framework/02-plugin-management/plugin-version.drawio.svg @@ -1,155 +1,19 @@ - - - - - - - -
-
-
- Version -
-
-
-
- +
Version
Version - -
-
- - - - -
-
-
- Plugin -
-
-
-
- +
Plugin
Plugin - -
-
- - - - -
-
-
- PluginSetup -
-
-
-
- +
PluginSetup
PluginSetup - -
-
- - - - -
-
-
- 1.1 -
-
-
-
- +
1.1
1.1 - -
-
- - - - -
-
-
- Metadata -
-
-
-
- +
Metadata
Metadata - -
-
- - - - -
-
-
- Tag -
-
-
-
- +
Tag
Tag - -
-
- - - - -
-
-
- - Build - -
-
-
-
- +
Build
Build - -
-
- - - - -
-
-
- - Release - -
-
-
-
- +
Release
Release - -
-
- - -
- - - - + Text is not SVG - cannot display - - - -
\ No newline at end of file + \ No newline at end of file diff --git a/docs/osx/01-how-it-works/02-framework/aragon-os-infrastructure-core-overview.drawio.svg b/docs/osx/01-how-it-works/02-framework/aragon-os-infrastructure-core-overview.drawio.svg index 23595b18..562f5051 100644 --- a/docs/osx/01-how-it-works/02-framework/aragon-os-infrastructure-core-overview.drawio.svg +++ b/docs/osx/01-how-it-works/02-framework/aragon-os-infrastructure-core-overview.drawio.svg @@ -1,822 +1,89 @@ - - - - - - - -
-
-
- - Framework - -
-
-
-
- +
Framework
Framework - -
-
- - - - -
-
-
- - Plugin Management - -
-
-
-
- +
Plugin Management
Plugin Management - -
-
- - - - -
-
-
- - DAO Creation - -
-
-
-
- +
DAO Creation
DAO Creation - -
-
- - - - -
-
-
- - Core - -
-
-
-
- +
Core
Core - -
-
- - - - -
-
-
- - Plugin - -
-
-
-
- +
Plugin
Plugin - -
-
- - - - -
-
-
- IPlugin -
-
-
-
- +
IPlugin
IPlugin - -
-
- - - - -
-
-
- - DAO - -
-
-
-
- +
DAO
DAO - -
-
- - - - -
-
-
- PermissionManager -
-
-
-
- +
PermissionManager
PermissionManager - -
-
- - - - -
-
-
- CallbackHandler -
-
-
-
- +
CallbackHandler
CallbackHandler - -
-
- - - - -
-
-
- DaoAuthorizable -
-
-
-
- +
DaoAuthorizable
DaoAuthorizable - -
-
- - - - -
-
-
- PluginRepo -
- Registry -
-
-
-
- +
PluginRepo
Registry
PluginRepo... - -
-
- - - - - -
-
-
- versions -
-
-
-
- +
versions
versions - -
-
- - - - -
-
-
- PluginRepo -
-
-
-
- +
PluginRepo
PluginRepo - -
-
- - - - - -
-
-
- processes -
-
-
-
- +
processes
processes - -
-
- - - - -
-
-
- PluginSetup -
- Procesor -
-
-
-
- +
PluginSetup
Procesor
PluginSetup... - -
-
- - - - - -
-
-
- registers -
-
-
-
- +
registers
registers - -
-
- - - - - -
-
-
- creates & manages -
-
-
-
- +
creates & manages
creates & manages - -
-
- - - - -
-
-
- PluginSetup -
-
-
-
- +
PluginSetup
PluginSetup - -
-
- - - - -
-
-
- PluginRepoFactory -
-
-
-
- +
PluginRepoFactory
PluginRepoFactory - -
-
- - - - - -
-
-
- registers -
-
-
-
- +
registers
registers - -
-
- - - - - - -
-
-
- - - - 👷 - - - -
-
-
-
- +
👷
👷 - -
-
- - - - - - -
-
-
- - Non-upgradeable - -
-
-
-
- +
Non-upgradeable
Non-upgradeable - -
-
- - - - - - -
-
-
- - Upgradeable - -
-
-
-
- +
Upgradeable
Upgradeable - -
-
- - - - - - -
-
-
- DaoAuthorizable -
- Upgradeable -
-
-
-
- +
DaoAuthorizable
Upgradeable
DaoAuthorizable... - -
-
- - - - - -
-
-
- connects -
-
-
-
- +
connects
connects - -
-
- - - - - - - - - - -
-
-
- ERC-1271 -
- SignatureValidator -
-
-
-
- +
ERC-1271
SignatureValidator
ERC-1271... - -
-
- - - - - -
-
-
- select Plugins -
-
-
-
- +
select Plugins
select Plugins - -
-
- - - - - -
-
-
- creates -
-
-
-
- +
creates
creates - -
-
- - - -
-
-
- - creates - -
-
-
-
- +
creates
creates - -
-
- - - - - - -
-
-
- DAOFactory -
-
-
-
- +
DAOFactory
DAOFactory - -
-
- - - - -
-
-
- DAORegistry -
-
-
-
- +
DAORegistry
DAORegistry - -
-
- - - - - -
-
-
- creates -
-
-
-
- +
creates
creates - -
-
- - - - - - -
-
-
- PluginCloneable -
-
-
-
- +
PluginCloneable
PluginCloneable - -
-
- - - - -
-
-
- Plugin -
-
-
-
- +
Plugin
Plugin - -
-
- - - - -
-
-
- PluginUUPS Upgradeable -
-
-
-
- +
PluginUUPS Upgradeable
PluginUUPS Upgradeab... - -
-
- - - - - -
-
-
- - Creation - -
-
-
-
- +
Creation
Creation - -
-
- - - - - -
-
-
- - Curation - -
-
-
-
- +
Curation
Curation - -
-
- - - - - -
-
-
- - Setup - -
-
-
-
- +
Setup
Setup - -
-
- - - - -
-
-
- IMembeship -
-
-
-
- +
IMembeship
IMembeship - -
-
- - - - -
-
-
- IProposal -
-
-
-
- +
IProposal
IProposal - -
-
- - - - -
-
-
- ERC-4824 -
- DAO Interface -
-
-
-
- +
ERC-4824
DAO Interface
ERC-4824... - -
-
- - - - - - - -
-
-
- provides -
- data -
-
-
-
- +
provides
data
provides... - -
-
- - - - - -
-
-
- - Upgradeable - -
-
-
-
- +
Upgradeable
Upgradeable - -
-
- -
- - - - + Text is not SVG - cannot display - - - -
\ No newline at end of file + \ No newline at end of file diff --git a/docs/osx/01-how-it-works/aragon-os-framework-overview.drawio.svg b/docs/osx/01-how-it-works/aragon-os-framework-overview.drawio.svg index e16654ec..e101a296 100644 --- a/docs/osx/01-how-it-works/aragon-os-framework-overview.drawio.svg +++ b/docs/osx/01-how-it-works/aragon-os-framework-overview.drawio.svg @@ -1,515 +1,51 @@ - - - - - - - -
-
-
- External -
-
-
-
- +
External
External - -
-
- - - - -
-
-
- Code Layer -
-
-
-
- +
Code Layer
Code Layer - -
-
- - - - - -
-
-
- - - - decide strategy - -
-
-
-
-
-
- +
- decide strategy
- decide strategy - -
-
- - - - - -
-
-
-
- - - set parameters - -
-
-
- - - - manage permissions - - -
-
-
-
-
- +
- set parameters
- manage permissions
- set parameters... - -
-
- - - - - -
-
-
- - - - - - create DAOs - -
- - - - manage plugins - -
-
-
-
-
-
-
- +
-create DAOs
-manage plugins

- create DAOs... - -
-
- - - - - - - - -
-
-
- - - - provide - - basic - - and -
- - custom - - - - functionalities -
-
-
-
-
-
-
- +
- providebasicand
customfunctionalities
- provide basic and... - -
-
- - - - - -
-
-
- - - Responsibilities - - -
-
-
- - +
Responsibilities
Responsibilities - -
- - - - - - -
-
-
- - - - provide secure -
- primitives -
-
-
-
-
-
-
- +
- provide secure
primitives

- provide secure... - -
-
- - - - - -
-
-
- - - - Aragon OSx - - - -
-
-
-
-
-
-
- +
Aragon OSx
Aragon OSx - -
-
- - - - -
-
-
- Governance Layer -
-
-
-
- +
Governance Layer
Governance Layer - -
-
- - - - - -
-
-
- governs -
-
-
-
- +
governs
governs - -
-
- - - - -
-
-
- Aragon OSx -
- - Framework DAO - -
-
-
-
- +
Aragon OSx
Framework DAO
Aragon OSx... - -
-
- - - - - -
-
-
- governs -
-
-
-
- +
governs
governs - -
-
- - - - -
-
-
- Aragon DAO -
-
-
-
- +
Aragon DAO
Aragon DAO - -
-
- - - - - -
-
-
- manages / deploys -
-
-
-
- +
manages / deploys
manages / deploys - -
-
- - - - -
-
-
- OpenZeppelin Contracts -
-
-
-
- +
OpenZeppelin Contracts
OpenZeppelin... - -
-
- - - - - -
-
-
- uses -
-
-
-
- +
uses
uses - -
-
- - - - -
-
-
- - Core - -
-
-
-
- +
Core
Core - -
-
- - - - -
-
-
- DAO -
-
-
-
- +
DAO
DAO - -
-
- - - - -
-
-
- Plugin -
-
-
-
- +
Plugin
Plugin - -
-
- - - - -
-
-
- - Framework - -
-
-
-
- +
Framework
Framework - -
-
- - - - -
-
-
- DAO Creation -
-
-
-
- +
DAO Creation
DAO Creation - -
-
- - - - -
-
-
- Plugin -
- Management -
-
-
-
- +
Plugin
Management
Plugin... - -
-
- - - - -
-
-
-

- - ENS - -

-
-
-
-
- +

ENS

ENS - -
-
- - - - - + Text is not SVG - cannot display - - - - \ No newline at end of file + \ No newline at end of file diff --git a/docs/subgraph/reference-guide/directives/deprecated.mdx b/docs/subgraph/reference-guide/directives/deprecated.mdx index edfb13cd..801379d2 100644 --- a/docs/subgraph/reference-guide/directives/deprecated.mdx +++ b/docs/subgraph/reference-guide/directives/deprecated.mdx @@ -57,7 +57,7 @@ directive @deprecated( ### Arguments -#### [deprecated.reason](#)[`String`](/docs/subgraph/reference-guide/scalars/string) +#### [deprecated.reason](#)[`String`](/docs/next/subgraph/reference-guide/scalars/string) > > > Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/). diff --git a/docs/subgraph/reference-guide/directives/include.mdx b/docs/subgraph/reference-guide/directives/include.mdx index 9b34d5b5..cd4c85a4 100644 --- a/docs/subgraph/reference-guide/directives/include.mdx +++ b/docs/subgraph/reference-guide/directives/include.mdx @@ -56,7 +56,7 @@ directive @include( ### Arguments -#### [include.if](#)[`Boolean!`](/docs/subgraph/reference-guide/scalars/boolean) +#### [include.if](#)[`Boolean!`](/docs/next/subgraph/reference-guide/scalars/boolean) > > > Included when true. diff --git a/docs/subgraph/reference-guide/directives/skip.mdx b/docs/subgraph/reference-guide/directives/skip.mdx index 327e9e10..f9601e4e 100644 --- a/docs/subgraph/reference-guide/directives/skip.mdx +++ b/docs/subgraph/reference-guide/directives/skip.mdx @@ -56,7 +56,7 @@ directive @skip( ### Arguments -#### [skip.if](#)[`Boolean!`](/docs/subgraph/reference-guide/scalars/boolean) +#### [skip.if](#)[`Boolean!`](/docs/next/subgraph/reference-guide/scalars/boolean) > > > Skipped when true. diff --git a/docs/subgraph/reference-guide/directives/specified-by.mdx b/docs/subgraph/reference-guide/directives/specified-by.mdx index 0c72d885..5d2bce73 100644 --- a/docs/subgraph/reference-guide/directives/specified-by.mdx +++ b/docs/subgraph/reference-guide/directives/specified-by.mdx @@ -53,7 +53,7 @@ directive @specifiedBy( ### Arguments -#### [specifiedBy.url](#)[`String!`](/docs/subgraph/reference-guide/scalars/string) +#### [specifiedBy.url](#)[`String!`](/docs/next/subgraph/reference-guide/scalars/string) > > > The URL that specifies the behavior of this scalar. diff --git a/docs/subgraph/reference-guide/enums/permission-operation.mdx b/docs/subgraph/reference-guide/enums/permission-operation.mdx index fa610fb8..bc2d2c03 100644 --- a/docs/subgraph/reference-guide/enums/permission-operation.mdx +++ b/docs/subgraph/reference-guide/enums/permission-operation.mdx @@ -79,5 +79,5 @@ enum PermissionOperation { ### Member Of -[`PluginPermission`](/docs/subgraph/reference-guide/objects/plugin-permission) +[`PluginPermission`](/docs/next/subgraph/reference-guide/objects/plugin-permission) diff --git a/docs/subgraph/reference-guide/enums/plugin-preparation-state.mdx b/docs/subgraph/reference-guide/enums/plugin-preparation-state.mdx index e2bfb16f..86786911 100644 --- a/docs/subgraph/reference-guide/enums/plugin-preparation-state.mdx +++ b/docs/subgraph/reference-guide/enums/plugin-preparation-state.mdx @@ -93,5 +93,5 @@ enum PluginPreparationState { ### Member Of -[`PluginInstallation`](/docs/subgraph/reference-guide/objects/plugin-installation) +[`PluginInstallation`](/docs/next/subgraph/reference-guide/objects/plugin-installation) diff --git a/docs/subgraph/reference-guide/enums/plugin-preparation-type.mdx b/docs/subgraph/reference-guide/enums/plugin-preparation-type.mdx index a3ef2988..fc90fcb3 100644 --- a/docs/subgraph/reference-guide/enums/plugin-preparation-type.mdx +++ b/docs/subgraph/reference-guide/enums/plugin-preparation-type.mdx @@ -79,5 +79,5 @@ enum PluginPreparationType { ### Member Of -[`PluginPreparation`](/docs/subgraph/reference-guide/objects/plugin-preparation) +[`PluginPreparation`](/docs/next/subgraph/reference-guide/objects/plugin-preparation) diff --git a/docs/subgraph/reference-guide/enums/transfer-type.mdx b/docs/subgraph/reference-guide/enums/transfer-type.mdx index 0be2b4b5..3c7cf61e 100644 --- a/docs/subgraph/reference-guide/enums/transfer-type.mdx +++ b/docs/subgraph/reference-guide/enums/transfer-type.mdx @@ -81,5 +81,5 @@ enum TransferType { ### Member Of -[`ERC1155Transfer`](/docs/subgraph/reference-guide/objects/erc1155-transfer) [`ERC20Transfer`](/docs/subgraph/reference-guide/objects/erc20-transfer) [`ERC721Transfer`](/docs/subgraph/reference-guide/objects/erc721-transfer) [`NativeTransfer`](/docs/subgraph/reference-guide/objects/native-transfer) [`TokenTransfer`](/docs/subgraph/reference-guide/interfaces/token-transfer) +[`ERC1155Transfer`](/docs/next/subgraph/reference-guide/objects/erc1155-transfer) [`ERC20Transfer`](/docs/next/subgraph/reference-guide/objects/erc20-transfer) [`ERC721Transfer`](/docs/next/subgraph/reference-guide/objects/erc721-transfer) [`NativeTransfer`](/docs/next/subgraph/reference-guide/objects/native-transfer) [`TokenTransfer`](/docs/next/subgraph/reference-guide/interfaces/token-transfer) diff --git a/docs/subgraph/reference-guide/enums/vote-option.mdx b/docs/subgraph/reference-guide/enums/vote-option.mdx index e4e10efc..6339c6f8 100644 --- a/docs/subgraph/reference-guide/enums/vote-option.mdx +++ b/docs/subgraph/reference-guide/enums/vote-option.mdx @@ -86,5 +86,5 @@ enum VoteOption { ### Member Of -[`AddresslistVotingVote`](/docs/subgraph/reference-guide/objects/addresslist-voting-vote) [`TokenVotingVote`](/docs/subgraph/reference-guide/objects/token-voting-vote) +[`AddresslistVotingVote`](/docs/next/subgraph/reference-guide/objects/addresslist-voting-vote) [`TokenVotingVote`](/docs/next/subgraph/reference-guide/objects/token-voting-vote) diff --git a/docs/subgraph/reference-guide/enums/voting-mode.mdx b/docs/subgraph/reference-guide/enums/voting-mode.mdx index 37f9256a..42d6facd 100644 --- a/docs/subgraph/reference-guide/enums/voting-mode.mdx +++ b/docs/subgraph/reference-guide/enums/voting-mode.mdx @@ -79,5 +79,5 @@ enum VotingMode { ### Member Of -[`AddresslistVotingPlugin`](/docs/subgraph/reference-guide/objects/addresslist-voting-plugin) [`AddresslistVotingProposal`](/docs/subgraph/reference-guide/objects/addresslist-voting-proposal) [`TokenVotingPlugin`](/docs/subgraph/reference-guide/objects/token-voting-plugin) [`TokenVotingProposal`](/docs/subgraph/reference-guide/objects/token-voting-proposal) +[`AddresslistVotingPlugin`](/docs/next/subgraph/reference-guide/objects/addresslist-voting-plugin) [`AddresslistVotingProposal`](/docs/next/subgraph/reference-guide/objects/addresslist-voting-proposal) [`TokenVotingPlugin`](/docs/next/subgraph/reference-guide/objects/token-voting-plugin) [`TokenVotingProposal`](/docs/next/subgraph/reference-guide/objects/token-voting-proposal) diff --git a/docs/subgraph/reference-guide/interfaces/iplugin.mdx b/docs/subgraph/reference-guide/interfaces/iplugin.mdx index 91383aa4..05e1a905 100644 --- a/docs/subgraph/reference-guide/interfaces/iplugin.mdx +++ b/docs/subgraph/reference-guide/interfaces/iplugin.mdx @@ -56,25 +56,25 @@ interface IPlugin { ### Fields -#### [IPlugin.dao](#)[`Dao!`](/docs/subgraph/reference-guide/objects/dao) +#### [IPlugin.dao](#)[`Dao!`](/docs/next/subgraph/reference-guide/objects/dao) > > > > -#### [IPlugin.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [IPlugin.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > > -#### [IPlugin.installations](#)[`[PluginInstallation!]!`](/docs/subgraph/reference-guide/objects/plugin-installation) +#### [IPlugin.installations](#)[`[PluginInstallation!]!`](/docs/next/subgraph/reference-guide/objects/plugin-installation) > > > > -#### [IPlugin.pluginAddress](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [IPlugin.pluginAddress](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > @@ -86,9 +86,9 @@ interface IPlugin { ### Member Of -[`PluginInstallation`](/docs/subgraph/reference-guide/objects/plugin-installation) +[`PluginInstallation`](/docs/next/subgraph/reference-guide/objects/plugin-installation) ### Implemented By -[`AddresslistVotingPlugin`](/docs/subgraph/reference-guide/objects/addresslist-voting-plugin) [`AdminPlugin`](/docs/subgraph/reference-guide/objects/admin-plugin) [`MultisigPlugin`](/docs/subgraph/reference-guide/objects/multisig-plugin) [`TokenVotingPlugin`](/docs/subgraph/reference-guide/objects/token-voting-plugin) +[`AddresslistVotingPlugin`](/docs/next/subgraph/reference-guide/objects/addresslist-voting-plugin) [`AdminPlugin`](/docs/next/subgraph/reference-guide/objects/admin-plugin) [`MultisigPlugin`](/docs/next/subgraph/reference-guide/objects/multisig-plugin) [`TokenVotingPlugin`](/docs/next/subgraph/reference-guide/objects/token-voting-plugin) diff --git a/docs/subgraph/reference-guide/interfaces/iproposal.mdx b/docs/subgraph/reference-guide/interfaces/iproposal.mdx index 4c6dd838..bb88aa18 100644 --- a/docs/subgraph/reference-guide/interfaces/iproposal.mdx +++ b/docs/subgraph/reference-guide/interfaces/iproposal.mdx @@ -64,73 +64,73 @@ interface IProposal { ### Fields -#### [IProposal.actions](#)[`[Action!]!`](/docs/subgraph/reference-guide/objects/action) +#### [IProposal.actions](#)[`[Action!]!`](/docs/next/subgraph/reference-guide/objects/action) > > > > -#### [IProposal.allowFailureMap](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [IProposal.allowFailureMap](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [IProposal.createdAt](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [IProposal.createdAt](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [IProposal.creator](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [IProposal.creator](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > > -#### [IProposal.dao](#)[`Dao!`](/docs/subgraph/reference-guide/objects/dao) +#### [IProposal.dao](#)[`Dao!`](/docs/next/subgraph/reference-guide/objects/dao) > > > > -#### [IProposal.endDate](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [IProposal.endDate](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [IProposal.executed](#)[`Boolean!`](/docs/subgraph/reference-guide/scalars/boolean) +#### [IProposal.executed](#)[`Boolean!`](/docs/next/subgraph/reference-guide/scalars/boolean) > > > > -#### [IProposal.executionTxHash](#)[`Bytes`](/docs/subgraph/reference-guide/scalars/bytes) +#### [IProposal.executionTxHash](#)[`Bytes`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > > -#### [IProposal.failureMap](#)[`BigInt`](/docs/subgraph/reference-guide/scalars/big-int) +#### [IProposal.failureMap](#)[`BigInt`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [IProposal.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [IProposal.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > > -#### [IProposal.metadata](#)[`String`](/docs/subgraph/reference-guide/scalars/string) +#### [IProposal.metadata](#)[`String`](/docs/next/subgraph/reference-guide/scalars/string) > > > > -#### [IProposal.startDate](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [IProposal.startDate](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > @@ -142,9 +142,9 @@ interface IProposal { ### Member Of -[`Action`](/docs/subgraph/reference-guide/objects/action) [`Dao`](/docs/subgraph/reference-guide/objects/dao) [`ERC1155Transfer`](/docs/subgraph/reference-guide/objects/erc1155-transfer) [`ERC20Transfer`](/docs/subgraph/reference-guide/objects/erc20-transfer) [`ERC721Transfer`](/docs/subgraph/reference-guide/objects/erc721-transfer) [`NativeTransfer`](/docs/subgraph/reference-guide/objects/native-transfer) [`TokenTransfer`](/docs/subgraph/reference-guide/interfaces/token-transfer) +[`Action`](/docs/next/subgraph/reference-guide/objects/action) [`Dao`](/docs/next/subgraph/reference-guide/objects/dao) [`ERC1155Transfer`](/docs/next/subgraph/reference-guide/objects/erc1155-transfer) [`ERC20Transfer`](/docs/next/subgraph/reference-guide/objects/erc20-transfer) [`ERC721Transfer`](/docs/next/subgraph/reference-guide/objects/erc721-transfer) [`NativeTransfer`](/docs/next/subgraph/reference-guide/objects/native-transfer) [`TokenTransfer`](/docs/next/subgraph/reference-guide/interfaces/token-transfer) ### Implemented By -[`AddresslistVotingProposal`](/docs/subgraph/reference-guide/objects/addresslist-voting-proposal) [`AdminProposal`](/docs/subgraph/reference-guide/objects/admin-proposal) [`MultisigProposal`](/docs/subgraph/reference-guide/objects/multisig-proposal) [`TokenVotingProposal`](/docs/subgraph/reference-guide/objects/token-voting-proposal) [`TransactionActionsProposal`](/docs/subgraph/reference-guide/objects/transaction-actions-proposal) +[`AddresslistVotingProposal`](/docs/next/subgraph/reference-guide/objects/addresslist-voting-proposal) [`AdminProposal`](/docs/next/subgraph/reference-guide/objects/admin-proposal) [`MultisigProposal`](/docs/next/subgraph/reference-guide/objects/multisig-proposal) [`TokenVotingProposal`](/docs/next/subgraph/reference-guide/objects/token-voting-proposal) [`TransactionActionsProposal`](/docs/next/subgraph/reference-guide/objects/transaction-actions-proposal) diff --git a/docs/subgraph/reference-guide/interfaces/token-balance.mdx b/docs/subgraph/reference-guide/interfaces/token-balance.mdx index 7207259d..7bbe9760 100644 --- a/docs/subgraph/reference-guide/interfaces/token-balance.mdx +++ b/docs/subgraph/reference-guide/interfaces/token-balance.mdx @@ -55,19 +55,19 @@ interface TokenBalance { ### Fields -#### [TokenBalance.dao](#)[`Dao!`](/docs/subgraph/reference-guide/objects/dao) +#### [TokenBalance.dao](#)[`Dao!`](/docs/next/subgraph/reference-guide/objects/dao) > > > The DAO that holds the Tokens > -#### [TokenBalance.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [TokenBalance.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > The concatenation of DAO Smart contract address and Token Smart Contract address. Joined by '_'. > -#### [TokenBalance.lastUpdated](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [TokenBalance.lastUpdated](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > The block timestamp of the last update (transfer) for this token balance. @@ -79,9 +79,9 @@ interface TokenBalance { ### Member Of -[`Dao`](/docs/subgraph/reference-guide/objects/dao) +[`Dao`](/docs/next/subgraph/reference-guide/objects/dao) ### Implemented By -[`ERC1155Balance`](/docs/subgraph/reference-guide/objects/erc1155-balance) [`ERC20Balance`](/docs/subgraph/reference-guide/objects/erc20-balance) [`ERC721Balance`](/docs/subgraph/reference-guide/objects/erc721-balance) [`NativeBalance`](/docs/subgraph/reference-guide/objects/native-balance) +[`ERC1155Balance`](/docs/next/subgraph/reference-guide/objects/erc1155-balance) [`ERC20Balance`](/docs/next/subgraph/reference-guide/objects/erc20-balance) [`ERC721Balance`](/docs/next/subgraph/reference-guide/objects/erc721-balance) [`NativeBalance`](/docs/next/subgraph/reference-guide/objects/native-balance) diff --git a/docs/subgraph/reference-guide/interfaces/token-transfer.mdx b/docs/subgraph/reference-guide/interfaces/token-transfer.mdx index 4ace49dc..8963eaa1 100644 --- a/docs/subgraph/reference-guide/interfaces/token-transfer.mdx +++ b/docs/subgraph/reference-guide/interfaces/token-transfer.mdx @@ -60,49 +60,49 @@ interface TokenTransfer { ### Fields -#### [TokenTransfer.createdAt](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [TokenTransfer.createdAt](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > The timestamp of the block including transfer. > -#### [TokenTransfer.dao](#)[`Dao!`](/docs/subgraph/reference-guide/objects/dao) +#### [TokenTransfer.dao](#)[`Dao!`](/docs/next/subgraph/reference-guide/objects/dao) > > > The DAO that manages the transfer. > -#### [TokenTransfer.from](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [TokenTransfer.from](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > The Ethereum address from which the tokens are being transferred. > -#### [TokenTransfer.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [TokenTransfer.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > The concatenation of the transfer transaction hash, the log index and the action index. Joined by '_'. > -#### [TokenTransfer.proposal](#)[`IProposal`](/docs/subgraph/reference-guide/interfaces/iproposal) +#### [TokenTransfer.proposal](#)[`IProposal`](/docs/next/subgraph/reference-guide/interfaces/iproposal) > > > The associated DAO proposal, if applicable. Using the DAO `deposit` function there's no need for proposal. > -#### [TokenTransfer.to](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [TokenTransfer.to](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > The Ethereum address receiving the transfer. > -#### [TokenTransfer.txHash](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [TokenTransfer.txHash](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > The hash of the transfer to track the transaction. > -#### [TokenTransfer.type](#)[`TransferType!`](/docs/subgraph/reference-guide/enums/transfer-type) +#### [TokenTransfer.type](#)[`TransferType!`](/docs/next/subgraph/reference-guide/enums/transfer-type) > > > The type of transfer (External, Withdraw, Deposit) from the DAO's POV. @@ -114,9 +114,9 @@ interface TokenTransfer { ### Member Of -[`Dao`](/docs/subgraph/reference-guide/objects/dao) +[`Dao`](/docs/next/subgraph/reference-guide/objects/dao) ### Implemented By -[`ERC1155Transfer`](/docs/subgraph/reference-guide/objects/erc1155-transfer) [`ERC20Transfer`](/docs/subgraph/reference-guide/objects/erc20-transfer) [`ERC721Transfer`](/docs/subgraph/reference-guide/objects/erc721-transfer) [`NativeTransfer`](/docs/subgraph/reference-guide/objects/native-transfer) +[`ERC1155Transfer`](/docs/next/subgraph/reference-guide/objects/erc1155-transfer) [`ERC20Transfer`](/docs/next/subgraph/reference-guide/objects/erc20-transfer) [`ERC721Transfer`](/docs/next/subgraph/reference-guide/objects/erc721-transfer) [`NativeTransfer`](/docs/next/subgraph/reference-guide/objects/native-transfer) diff --git a/docs/subgraph/reference-guide/interfaces/token.mdx b/docs/subgraph/reference-guide/interfaces/token.mdx index 969d79a6..fcfb8694 100644 --- a/docs/subgraph/reference-guide/interfaces/token.mdx +++ b/docs/subgraph/reference-guide/interfaces/token.mdx @@ -55,19 +55,19 @@ interface Token { ### Fields -#### [Token.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [Token.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > The address of the Token Smart Contract. > -#### [Token.name](#)[`String`](/docs/subgraph/reference-guide/scalars/string) +#### [Token.name](#)[`String`](/docs/next/subgraph/reference-guide/scalars/string) > > > The name of the token, mirrored from the smart contract. > -#### [Token.symbol](#)[`String`](/docs/subgraph/reference-guide/scalars/string) +#### [Token.symbol](#)[`String`](/docs/next/subgraph/reference-guide/scalars/string) > > > The symbol of the token, mirrored from the smart contract. @@ -79,9 +79,9 @@ interface Token { ### Member Of -[`ERC20Transfer`](/docs/subgraph/reference-guide/objects/erc20-transfer) [`TokenVotingPlugin`](/docs/subgraph/reference-guide/objects/token-voting-plugin) +[`ERC20Transfer`](/docs/next/subgraph/reference-guide/objects/erc20-transfer) [`TokenVotingPlugin`](/docs/next/subgraph/reference-guide/objects/token-voting-plugin) ### Implemented By -[`ERC1155Contract`](/docs/subgraph/reference-guide/objects/erc1155-contract) [`ERC20Contract`](/docs/subgraph/reference-guide/objects/erc20-contract) [`ERC20WrapperContract`](/docs/subgraph/reference-guide/objects/erc20-wrapper-contract) [`ERC721Contract`](/docs/subgraph/reference-guide/objects/erc721-contract) +[`ERC1155Contract`](/docs/next/subgraph/reference-guide/objects/erc1155-contract) [`ERC20Contract`](/docs/next/subgraph/reference-guide/objects/erc20-contract) [`ERC20WrapperContract`](/docs/next/subgraph/reference-guide/objects/erc20-wrapper-contract) [`ERC721Contract`](/docs/next/subgraph/reference-guide/objects/erc721-contract) diff --git a/docs/subgraph/reference-guide/objects/action.mdx b/docs/subgraph/reference-guide/objects/action.mdx index 10f574cd..7f300b9a 100644 --- a/docs/subgraph/reference-guide/objects/action.mdx +++ b/docs/subgraph/reference-guide/objects/action.mdx @@ -59,43 +59,43 @@ type Action { ### Fields -#### [Action.dao](#)[`Dao!`](/docs/subgraph/reference-guide/objects/dao) +#### [Action.dao](#)[`Dao!`](/docs/next/subgraph/reference-guide/objects/dao) > > > The DAO that will `execute` the function. > -#### [Action.data](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [Action.data](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > The bytes-encoded function selector and calldata for the call. > -#### [Action.execResult](#)[`Bytes`](/docs/subgraph/reference-guide/scalars/bytes) +#### [Action.execResult](#)[`Bytes`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > The result obtained from the executed action in `bytes`. > -#### [Action.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [Action.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > Concatenation of the proposalID and the index of the action. Joined by '_'. > -#### [Action.proposal](#)[`IProposal!`](/docs/subgraph/reference-guide/interfaces/iproposal) +#### [Action.proposal](#)[`IProposal!`](/docs/next/subgraph/reference-guide/interfaces/iproposal) > > > The proposal of the DAO containing the action to be executed. > -#### [Action.to](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [Action.to](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > The address to call. > -#### [Action.value](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [Action.value](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > The native token value to be sent with the call. @@ -107,5 +107,5 @@ type Action { ### Member Of -[`AddresslistVotingProposal`](/docs/subgraph/reference-guide/objects/addresslist-voting-proposal) [`AdminProposal`](/docs/subgraph/reference-guide/objects/admin-proposal) [`Dao`](/docs/subgraph/reference-guide/objects/dao) [`IProposal`](/docs/subgraph/reference-guide/interfaces/iproposal) [`MultisigProposal`](/docs/subgraph/reference-guide/objects/multisig-proposal) [`TokenVotingProposal`](/docs/subgraph/reference-guide/objects/token-voting-proposal) [`TransactionActionsProposal`](/docs/subgraph/reference-guide/objects/transaction-actions-proposal) +[`AddresslistVotingProposal`](/docs/next/subgraph/reference-guide/objects/addresslist-voting-proposal) [`AdminProposal`](/docs/next/subgraph/reference-guide/objects/admin-proposal) [`Dao`](/docs/next/subgraph/reference-guide/objects/dao) [`IProposal`](/docs/next/subgraph/reference-guide/interfaces/iproposal) [`MultisigProposal`](/docs/next/subgraph/reference-guide/objects/multisig-proposal) [`TokenVotingProposal`](/docs/next/subgraph/reference-guide/objects/token-voting-proposal) [`TransactionActionsProposal`](/docs/next/subgraph/reference-guide/objects/transaction-actions-proposal) diff --git a/docs/subgraph/reference-guide/objects/addresslist-voting-plugin.mdx b/docs/subgraph/reference-guide/objects/addresslist-voting-plugin.mdx index 8c1c325c..da914208 100644 --- a/docs/subgraph/reference-guide/objects/addresslist-voting-plugin.mdx +++ b/docs/subgraph/reference-guide/objects/addresslist-voting-plugin.mdx @@ -64,73 +64,73 @@ type AddresslistVotingPlugin implements IPlugin { ### Fields -#### [AddresslistVotingPlugin.dao](#)[`Dao!`](/docs/subgraph/reference-guide/objects/dao) +#### [AddresslistVotingPlugin.dao](#)[`Dao!`](/docs/next/subgraph/reference-guide/objects/dao) > > > > -#### [AddresslistVotingPlugin.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [AddresslistVotingPlugin.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > TODO: attributes should be appended to Plugin once plugin is seperated from Aragon OSx > -#### [AddresslistVotingPlugin.installations](#)[`[PluginInstallation!]!`](/docs/subgraph/reference-guide/objects/plugin-installation) +#### [AddresslistVotingPlugin.installations](#)[`[PluginInstallation!]!`](/docs/next/subgraph/reference-guide/objects/plugin-installation) > > > > -#### [AddresslistVotingPlugin.members](#)[`[AddresslistVotingVoter!]!`](/docs/subgraph/reference-guide/objects/addresslist-voting-voter) +#### [AddresslistVotingPlugin.members](#)[`[AddresslistVotingVoter!]!`](/docs/next/subgraph/reference-guide/objects/addresslist-voting-voter) > > > > -#### [AddresslistVotingPlugin.minDuration](#)[`BigInt`](/docs/subgraph/reference-guide/scalars/big-int) +#### [AddresslistVotingPlugin.minDuration](#)[`BigInt`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [AddresslistVotingPlugin.minParticipation](#)[`BigInt`](/docs/subgraph/reference-guide/scalars/big-int) +#### [AddresslistVotingPlugin.minParticipation](#)[`BigInt`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [AddresslistVotingPlugin.minProposerVotingPower](#)[`BigInt`](/docs/subgraph/reference-guide/scalars/big-int) +#### [AddresslistVotingPlugin.minProposerVotingPower](#)[`BigInt`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [AddresslistVotingPlugin.pluginAddress](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [AddresslistVotingPlugin.pluginAddress](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > > -#### [AddresslistVotingPlugin.proposalCount](#)[`BigInt`](/docs/subgraph/reference-guide/scalars/big-int) +#### [AddresslistVotingPlugin.proposalCount](#)[`BigInt`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [AddresslistVotingPlugin.proposals](#)[`[AddresslistVotingProposal!]!`](/docs/subgraph/reference-guide/objects/addresslist-voting-proposal) +#### [AddresslistVotingPlugin.proposals](#)[`[AddresslistVotingProposal!]!`](/docs/next/subgraph/reference-guide/objects/addresslist-voting-proposal) > > > > -#### [AddresslistVotingPlugin.supportThreshold](#)[`BigInt`](/docs/subgraph/reference-guide/scalars/big-int) +#### [AddresslistVotingPlugin.supportThreshold](#)[`BigInt`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [AddresslistVotingPlugin.votingMode](#)[`VotingMode`](/docs/subgraph/reference-guide/enums/voting-mode) +#### [AddresslistVotingPlugin.votingMode](#)[`VotingMode`](/docs/next/subgraph/reference-guide/enums/voting-mode) > > > @@ -138,7 +138,7 @@ type AddresslistVotingPlugin implements IPlugin { ### Interfaces -#### [`IPlugin`](/docs/subgraph/reference-guide/interfaces/iplugin) +#### [`IPlugin`](/docs/next/subgraph/reference-guide/interfaces/iplugin) > > > @@ -150,5 +150,5 @@ type AddresslistVotingPlugin implements IPlugin { ### Member Of -[`AddresslistVotingProposal`](/docs/subgraph/reference-guide/objects/addresslist-voting-proposal) [`AddresslistVotingVoter`](/docs/subgraph/reference-guide/objects/addresslist-voting-voter) +[`AddresslistVotingProposal`](/docs/next/subgraph/reference-guide/objects/addresslist-voting-proposal) [`AddresslistVotingVoter`](/docs/next/subgraph/reference-guide/objects/addresslist-voting-voter) diff --git a/docs/subgraph/reference-guide/objects/addresslist-voting-proposal.mdx b/docs/subgraph/reference-guide/objects/addresslist-voting-proposal.mdx index d6d25829..ae2a0daa 100644 --- a/docs/subgraph/reference-guide/objects/addresslist-voting-proposal.mdx +++ b/docs/subgraph/reference-guide/objects/addresslist-voting-proposal.mdx @@ -83,187 +83,187 @@ type AddresslistVotingProposal implements IProposal { ### Fields -#### [AddresslistVotingProposal.abstain](#)[`BigInt`](/docs/subgraph/reference-guide/scalars/big-int) +#### [AddresslistVotingProposal.abstain](#)[`BigInt`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [AddresslistVotingProposal.actions](#)[`[Action!]!`](/docs/subgraph/reference-guide/objects/action) +#### [AddresslistVotingProposal.actions](#)[`[Action!]!`](/docs/next/subgraph/reference-guide/objects/action) > > > > -#### [AddresslistVotingProposal.allowFailureMap](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [AddresslistVotingProposal.allowFailureMap](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [AddresslistVotingProposal.approvalReached](#)[`Boolean!`](/docs/subgraph/reference-guide/scalars/boolean) +#### [AddresslistVotingProposal.approvalReached](#)[`Boolean!`](/docs/next/subgraph/reference-guide/scalars/boolean) > > > > -#### [AddresslistVotingProposal.castedVotingPower](#)[`BigInt`](/docs/subgraph/reference-guide/scalars/big-int) +#### [AddresslistVotingProposal.castedVotingPower](#)[`BigInt`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [AddresslistVotingProposal.createdAt](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [AddresslistVotingProposal.createdAt](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [AddresslistVotingProposal.creationBlockNumber](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [AddresslistVotingProposal.creationBlockNumber](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [AddresslistVotingProposal.creator](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [AddresslistVotingProposal.creator](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > > -#### [AddresslistVotingProposal.dao](#)[`Dao!`](/docs/subgraph/reference-guide/objects/dao) +#### [AddresslistVotingProposal.dao](#)[`Dao!`](/docs/next/subgraph/reference-guide/objects/dao) > > > > -#### [AddresslistVotingProposal.earlyExecutable](#)[`Boolean`](/docs/subgraph/reference-guide/scalars/boolean) +#### [AddresslistVotingProposal.earlyExecutable](#)[`Boolean`](/docs/next/subgraph/reference-guide/scalars/boolean) > > > > -#### [AddresslistVotingProposal.endDate](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [AddresslistVotingProposal.endDate](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [AddresslistVotingProposal.executed](#)[`Boolean!`](/docs/subgraph/reference-guide/scalars/boolean) +#### [AddresslistVotingProposal.executed](#)[`Boolean!`](/docs/next/subgraph/reference-guide/scalars/boolean) > > > > -#### [AddresslistVotingProposal.executionBlockNumber](#)[`BigInt`](/docs/subgraph/reference-guide/scalars/big-int) +#### [AddresslistVotingProposal.executionBlockNumber](#)[`BigInt`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [AddresslistVotingProposal.executionDate](#)[`BigInt`](/docs/subgraph/reference-guide/scalars/big-int) +#### [AddresslistVotingProposal.executionDate](#)[`BigInt`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [AddresslistVotingProposal.executionTxHash](#)[`Bytes`](/docs/subgraph/reference-guide/scalars/bytes) +#### [AddresslistVotingProposal.executionTxHash](#)[`Bytes`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > > -#### [AddresslistVotingProposal.failureMap](#)[`BigInt`](/docs/subgraph/reference-guide/scalars/big-int) +#### [AddresslistVotingProposal.failureMap](#)[`BigInt`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [AddresslistVotingProposal.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [AddresslistVotingProposal.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > > -#### [AddresslistVotingProposal.isSignaling](#)[`Boolean!`](/docs/subgraph/reference-guide/scalars/boolean) +#### [AddresslistVotingProposal.isSignaling](#)[`Boolean!`](/docs/next/subgraph/reference-guide/scalars/boolean) > > > > -#### [AddresslistVotingProposal.metadata](#)[`String`](/docs/subgraph/reference-guide/scalars/string) +#### [AddresslistVotingProposal.metadata](#)[`String`](/docs/next/subgraph/reference-guide/scalars/string) > > > > -#### [AddresslistVotingProposal.minVotingPower](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [AddresslistVotingProposal.minVotingPower](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [AddresslistVotingProposal.no](#)[`BigInt`](/docs/subgraph/reference-guide/scalars/big-int) +#### [AddresslistVotingProposal.no](#)[`BigInt`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [AddresslistVotingProposal.open](#)[`Boolean!`](/docs/subgraph/reference-guide/scalars/boolean) +#### [AddresslistVotingProposal.open](#)[`Boolean!`](/docs/next/subgraph/reference-guide/scalars/boolean) > > > > -#### [AddresslistVotingProposal.plugin](#)[`AddresslistVotingPlugin!`](/docs/subgraph/reference-guide/objects/addresslist-voting-plugin) +#### [AddresslistVotingProposal.plugin](#)[`AddresslistVotingPlugin!`](/docs/next/subgraph/reference-guide/objects/addresslist-voting-plugin) > > > > -#### [AddresslistVotingProposal.pluginProposalId](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [AddresslistVotingProposal.pluginProposalId](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [AddresslistVotingProposal.snapshotBlock](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [AddresslistVotingProposal.snapshotBlock](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [AddresslistVotingProposal.startDate](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [AddresslistVotingProposal.startDate](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [AddresslistVotingProposal.supportThreshold](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [AddresslistVotingProposal.supportThreshold](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [AddresslistVotingProposal.totalVotingPower](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [AddresslistVotingProposal.totalVotingPower](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [AddresslistVotingProposal.voters](#)[`[AddresslistVotingVote!]!`](/docs/subgraph/reference-guide/objects/addresslist-voting-vote) +#### [AddresslistVotingProposal.voters](#)[`[AddresslistVotingVote!]!`](/docs/next/subgraph/reference-guide/objects/addresslist-voting-vote) > > > > -#### [AddresslistVotingProposal.votingMode](#)[`VotingMode!`](/docs/subgraph/reference-guide/enums/voting-mode) +#### [AddresslistVotingProposal.votingMode](#)[`VotingMode!`](/docs/next/subgraph/reference-guide/enums/voting-mode) > > > > -#### [AddresslistVotingProposal.yes](#)[`BigInt`](/docs/subgraph/reference-guide/scalars/big-int) +#### [AddresslistVotingProposal.yes](#)[`BigInt`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > @@ -271,7 +271,7 @@ type AddresslistVotingProposal implements IProposal { ### Interfaces -#### [`IProposal`](/docs/subgraph/reference-guide/interfaces/iproposal) +#### [`IProposal`](/docs/next/subgraph/reference-guide/interfaces/iproposal) > > > @@ -283,5 +283,5 @@ type AddresslistVotingProposal implements IProposal { ### Member Of -[`AddresslistVotingPlugin`](/docs/subgraph/reference-guide/objects/addresslist-voting-plugin) [`AddresslistVotingVote`](/docs/subgraph/reference-guide/objects/addresslist-voting-vote) +[`AddresslistVotingPlugin`](/docs/next/subgraph/reference-guide/objects/addresslist-voting-plugin) [`AddresslistVotingVote`](/docs/next/subgraph/reference-guide/objects/addresslist-voting-vote) diff --git a/docs/subgraph/reference-guide/objects/addresslist-voting-vote.mdx b/docs/subgraph/reference-guide/objects/addresslist-voting-vote.mdx index ae0d91cd..1afdb39c 100644 --- a/docs/subgraph/reference-guide/objects/addresslist-voting-vote.mdx +++ b/docs/subgraph/reference-guide/objects/addresslist-voting-vote.mdx @@ -60,49 +60,49 @@ type AddresslistVotingVote { ### Fields -#### [AddresslistVotingVote.createdAt](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [AddresslistVotingVote.createdAt](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [AddresslistVotingVote.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [AddresslistVotingVote.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > VoterProposal for Many-to-Many > -#### [AddresslistVotingVote.proposal](#)[`AddresslistVotingProposal!`](/docs/subgraph/reference-guide/objects/addresslist-voting-proposal) +#### [AddresslistVotingVote.proposal](#)[`AddresslistVotingProposal!`](/docs/next/subgraph/reference-guide/objects/addresslist-voting-proposal) > > > > -#### [AddresslistVotingVote.updatedAt](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [AddresslistVotingVote.updatedAt](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [AddresslistVotingVote.voteOption](#)[`VoteOption!`](/docs/subgraph/reference-guide/enums/vote-option) +#### [AddresslistVotingVote.voteOption](#)[`VoteOption!`](/docs/next/subgraph/reference-guide/enums/vote-option) > > > > -#### [AddresslistVotingVote.voteReplaced](#)[`Boolean!`](/docs/subgraph/reference-guide/scalars/boolean) +#### [AddresslistVotingVote.voteReplaced](#)[`Boolean!`](/docs/next/subgraph/reference-guide/scalars/boolean) > > > > -#### [AddresslistVotingVote.voter](#)[`AddresslistVotingVoter!`](/docs/subgraph/reference-guide/objects/addresslist-voting-voter) +#### [AddresslistVotingVote.voter](#)[`AddresslistVotingVoter!`](/docs/next/subgraph/reference-guide/objects/addresslist-voting-voter) > > > > -#### [AddresslistVotingVote.votingPower](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [AddresslistVotingVote.votingPower](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > @@ -114,5 +114,5 @@ type AddresslistVotingVote { ### Member Of -[`AddresslistVotingProposal`](/docs/subgraph/reference-guide/objects/addresslist-voting-proposal) [`AddresslistVotingVoter`](/docs/subgraph/reference-guide/objects/addresslist-voting-voter) +[`AddresslistVotingProposal`](/docs/next/subgraph/reference-guide/objects/addresslist-voting-proposal) [`AddresslistVotingVoter`](/docs/next/subgraph/reference-guide/objects/addresslist-voting-voter) diff --git a/docs/subgraph/reference-guide/objects/addresslist-voting-voter.mdx b/docs/subgraph/reference-guide/objects/addresslist-voting-voter.mdx index aae85421..41077d27 100644 --- a/docs/subgraph/reference-guide/objects/addresslist-voting-voter.mdx +++ b/docs/subgraph/reference-guide/objects/addresslist-voting-voter.mdx @@ -56,25 +56,25 @@ type AddresslistVotingVoter { ### Fields -#### [AddresslistVotingVoter.address](#)[`String`](/docs/subgraph/reference-guide/scalars/string) +#### [AddresslistVotingVoter.address](#)[`String`](/docs/next/subgraph/reference-guide/scalars/string) > > > > -#### [AddresslistVotingVoter.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [AddresslistVotingVoter.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > > -#### [AddresslistVotingVoter.plugin](#)[`AddresslistVotingPlugin!`](/docs/subgraph/reference-guide/objects/addresslist-voting-plugin) +#### [AddresslistVotingVoter.plugin](#)[`AddresslistVotingPlugin!`](/docs/next/subgraph/reference-guide/objects/addresslist-voting-plugin) > > > > -#### [AddresslistVotingVoter.proposals](#)[`[AddresslistVotingVote!]!`](/docs/subgraph/reference-guide/objects/addresslist-voting-vote) +#### [AddresslistVotingVoter.proposals](#)[`[AddresslistVotingVote!]!`](/docs/next/subgraph/reference-guide/objects/addresslist-voting-vote) > > > @@ -86,5 +86,5 @@ type AddresslistVotingVoter { ### Member Of -[`AddresslistVotingPlugin`](/docs/subgraph/reference-guide/objects/addresslist-voting-plugin) [`AddresslistVotingVote`](/docs/subgraph/reference-guide/objects/addresslist-voting-vote) +[`AddresslistVotingPlugin`](/docs/next/subgraph/reference-guide/objects/addresslist-voting-plugin) [`AddresslistVotingVote`](/docs/next/subgraph/reference-guide/objects/addresslist-voting-vote) diff --git a/docs/subgraph/reference-guide/objects/admin-plugin.mdx b/docs/subgraph/reference-guide/objects/admin-plugin.mdx index 1594ee3b..de107904 100644 --- a/docs/subgraph/reference-guide/objects/admin-plugin.mdx +++ b/docs/subgraph/reference-guide/objects/admin-plugin.mdx @@ -58,37 +58,37 @@ type AdminPlugin implements IPlugin { ### Fields -#### [AdminPlugin.administrators](#)[`[AdministratorAdminPlugin!]!`](/docs/subgraph/reference-guide/objects/administrator-admin-plugin) +#### [AdminPlugin.administrators](#)[`[AdministratorAdminPlugin!]!`](/docs/next/subgraph/reference-guide/objects/administrator-admin-plugin) > > > > -#### [AdminPlugin.dao](#)[`Dao!`](/docs/subgraph/reference-guide/objects/dao) +#### [AdminPlugin.dao](#)[`Dao!`](/docs/next/subgraph/reference-guide/objects/dao) > > > > -#### [AdminPlugin.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [AdminPlugin.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > TODO: attributes should be appended to Plugin once plugin is separated from Aragon OSx > -#### [AdminPlugin.installations](#)[`[PluginInstallation!]!`](/docs/subgraph/reference-guide/objects/plugin-installation) +#### [AdminPlugin.installations](#)[`[PluginInstallation!]!`](/docs/next/subgraph/reference-guide/objects/plugin-installation) > > > > -#### [AdminPlugin.pluginAddress](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [AdminPlugin.pluginAddress](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > > -#### [AdminPlugin.proposals](#)[`[AdminProposal!]!`](/docs/subgraph/reference-guide/objects/admin-proposal) +#### [AdminPlugin.proposals](#)[`[AdminProposal!]!`](/docs/next/subgraph/reference-guide/objects/admin-proposal) > > > @@ -96,7 +96,7 @@ type AdminPlugin implements IPlugin { ### Interfaces -#### [`IPlugin`](/docs/subgraph/reference-guide/interfaces/iplugin) +#### [`IPlugin`](/docs/next/subgraph/reference-guide/interfaces/iplugin) > > > @@ -108,5 +108,5 @@ type AdminPlugin implements IPlugin { ### Member Of -[`AdministratorAdminPlugin`](/docs/subgraph/reference-guide/objects/administrator-admin-plugin) [`AdminProposal`](/docs/subgraph/reference-guide/objects/admin-proposal) +[`AdministratorAdminPlugin`](/docs/next/subgraph/reference-guide/objects/administrator-admin-plugin) [`AdminProposal`](/docs/next/subgraph/reference-guide/objects/admin-proposal) diff --git a/docs/subgraph/reference-guide/objects/admin-proposal.mdx b/docs/subgraph/reference-guide/objects/admin-proposal.mdx index e917d8d9..63ce42a0 100644 --- a/docs/subgraph/reference-guide/objects/admin-proposal.mdx +++ b/docs/subgraph/reference-guide/objects/admin-proposal.mdx @@ -67,91 +67,91 @@ type AdminProposal implements IProposal { ### Fields -#### [AdminProposal.actions](#)[`[Action!]!`](/docs/subgraph/reference-guide/objects/action) +#### [AdminProposal.actions](#)[`[Action!]!`](/docs/next/subgraph/reference-guide/objects/action) > > > > -#### [AdminProposal.administrator](#)[`Administrator!`](/docs/subgraph/reference-guide/objects/administrator) +#### [AdminProposal.administrator](#)[`Administrator!`](/docs/next/subgraph/reference-guide/objects/administrator) > > > > -#### [AdminProposal.allowFailureMap](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [AdminProposal.allowFailureMap](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [AdminProposal.createdAt](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [AdminProposal.createdAt](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [AdminProposal.creator](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [AdminProposal.creator](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > > -#### [AdminProposal.dao](#)[`Dao!`](/docs/subgraph/reference-guide/objects/dao) +#### [AdminProposal.dao](#)[`Dao!`](/docs/next/subgraph/reference-guide/objects/dao) > > > > -#### [AdminProposal.endDate](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [AdminProposal.endDate](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [AdminProposal.executed](#)[`Boolean!`](/docs/subgraph/reference-guide/scalars/boolean) +#### [AdminProposal.executed](#)[`Boolean!`](/docs/next/subgraph/reference-guide/scalars/boolean) > > > > -#### [AdminProposal.executionTxHash](#)[`Bytes`](/docs/subgraph/reference-guide/scalars/bytes) +#### [AdminProposal.executionTxHash](#)[`Bytes`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > > -#### [AdminProposal.failureMap](#)[`BigInt`](/docs/subgraph/reference-guide/scalars/big-int) +#### [AdminProposal.failureMap](#)[`BigInt`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [AdminProposal.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [AdminProposal.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > > -#### [AdminProposal.metadata](#)[`String`](/docs/subgraph/reference-guide/scalars/string) +#### [AdminProposal.metadata](#)[`String`](/docs/next/subgraph/reference-guide/scalars/string) > > > > -#### [AdminProposal.plugin](#)[`AdminPlugin!`](/docs/subgraph/reference-guide/objects/admin-plugin) +#### [AdminProposal.plugin](#)[`AdminPlugin!`](/docs/next/subgraph/reference-guide/objects/admin-plugin) > > > > -#### [AdminProposal.pluginProposalId](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [AdminProposal.pluginProposalId](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [AdminProposal.startDate](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [AdminProposal.startDate](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > @@ -159,7 +159,7 @@ type AdminProposal implements IProposal { ### Interfaces -#### [`IProposal`](/docs/subgraph/reference-guide/interfaces/iproposal) +#### [`IProposal`](/docs/next/subgraph/reference-guide/interfaces/iproposal) > > > @@ -171,5 +171,5 @@ type AdminProposal implements IProposal { ### Member Of -[`Administrator`](/docs/subgraph/reference-guide/objects/administrator) [`AdminPlugin`](/docs/subgraph/reference-guide/objects/admin-plugin) +[`Administrator`](/docs/next/subgraph/reference-guide/objects/administrator) [`AdminPlugin`](/docs/next/subgraph/reference-guide/objects/admin-plugin) diff --git a/docs/subgraph/reference-guide/objects/administrator-admin-plugin.mdx b/docs/subgraph/reference-guide/objects/administrator-admin-plugin.mdx index 454c285f..8c91a592 100644 --- a/docs/subgraph/reference-guide/objects/administrator-admin-plugin.mdx +++ b/docs/subgraph/reference-guide/objects/administrator-admin-plugin.mdx @@ -55,19 +55,19 @@ type AdministratorAdminPlugin { ### Fields -#### [AdministratorAdminPlugin.administrator](#)[`Administrator!`](/docs/subgraph/reference-guide/objects/administrator) +#### [AdministratorAdminPlugin.administrator](#)[`Administrator!`](/docs/next/subgraph/reference-guide/objects/administrator) > > > > -#### [AdministratorAdminPlugin.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [AdministratorAdminPlugin.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > for Many-to-Many > -#### [AdministratorAdminPlugin.plugin](#)[`AdminPlugin!`](/docs/subgraph/reference-guide/objects/admin-plugin) +#### [AdministratorAdminPlugin.plugin](#)[`AdminPlugin!`](/docs/next/subgraph/reference-guide/objects/admin-plugin) > > > @@ -79,5 +79,5 @@ type AdministratorAdminPlugin { ### Member Of -[`Administrator`](/docs/subgraph/reference-guide/objects/administrator) [`AdminPlugin`](/docs/subgraph/reference-guide/objects/admin-plugin) +[`Administrator`](/docs/next/subgraph/reference-guide/objects/administrator) [`AdminPlugin`](/docs/next/subgraph/reference-guide/objects/admin-plugin) diff --git a/docs/subgraph/reference-guide/objects/administrator.mdx b/docs/subgraph/reference-guide/objects/administrator.mdx index f77b40f5..15dec4a4 100644 --- a/docs/subgraph/reference-guide/objects/administrator.mdx +++ b/docs/subgraph/reference-guide/objects/administrator.mdx @@ -56,25 +56,25 @@ type Administrator { ### Fields -#### [Administrator.address](#)[`String`](/docs/subgraph/reference-guide/scalars/string) +#### [Administrator.address](#)[`String`](/docs/next/subgraph/reference-guide/scalars/string) > > > > -#### [Administrator.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [Administrator.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > > -#### [Administrator.plugins](#)[`[AdministratorAdminPlugin!]!`](/docs/subgraph/reference-guide/objects/administrator-admin-plugin) +#### [Administrator.plugins](#)[`[AdministratorAdminPlugin!]!`](/docs/next/subgraph/reference-guide/objects/administrator-admin-plugin) > > > > -#### [Administrator.proposals](#)[`[AdminProposal!]!`](/docs/subgraph/reference-guide/objects/admin-proposal) +#### [Administrator.proposals](#)[`[AdminProposal!]!`](/docs/next/subgraph/reference-guide/objects/admin-proposal) > > > @@ -86,5 +86,5 @@ type Administrator { ### Member Of -[`AdministratorAdminPlugin`](/docs/subgraph/reference-guide/objects/administrator-admin-plugin) [`AdminProposal`](/docs/subgraph/reference-guide/objects/admin-proposal) +[`AdministratorAdminPlugin`](/docs/next/subgraph/reference-guide/objects/administrator-admin-plugin) [`AdminProposal`](/docs/next/subgraph/reference-guide/objects/admin-proposal) diff --git a/docs/subgraph/reference-guide/objects/dao.mdx b/docs/subgraph/reference-guide/objects/dao.mdx index 8b02afcc..a736532c 100644 --- a/docs/subgraph/reference-guide/objects/dao.mdx +++ b/docs/subgraph/reference-guide/objects/dao.mdx @@ -68,97 +68,97 @@ type Dao { ### Fields -#### [Dao.actions](#)[`[Action!]!`](/docs/subgraph/reference-guide/objects/action) +#### [Dao.actions](#)[`[Action!]!`](/docs/next/subgraph/reference-guide/objects/action) > > > > -#### [Dao.balances](#)[`[TokenBalance!]!`](/docs/subgraph/reference-guide/interfaces/token-balance) +#### [Dao.balances](#)[`[TokenBalance!]!`](/docs/next/subgraph/reference-guide/interfaces/token-balance) > > > > -#### [Dao.createdAt](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [Dao.createdAt](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [Dao.creator](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [Dao.creator](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > > -#### [Dao.daoURI](#)[`String`](/docs/subgraph/reference-guide/scalars/string) +#### [Dao.daoURI](#)[`String`](/docs/next/subgraph/reference-guide/scalars/string) > > > > -#### [Dao.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [Dao.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > > -#### [Dao.metadata](#)[`String`](/docs/subgraph/reference-guide/scalars/string) +#### [Dao.metadata](#)[`String`](/docs/next/subgraph/reference-guide/scalars/string) > > > > -#### [Dao.permissions](#)[`[Permission!]!`](/docs/subgraph/reference-guide/objects/permission) +#### [Dao.permissions](#)[`[Permission!]!`](/docs/next/subgraph/reference-guide/objects/permission) > > > > -#### [Dao.plugins](#)[`[PluginInstallation!]!`](/docs/subgraph/reference-guide/objects/plugin-installation) +#### [Dao.plugins](#)[`[PluginInstallation!]!`](/docs/next/subgraph/reference-guide/objects/plugin-installation) > > > > -#### [Dao.proposals](#)[`[IProposal!]!`](/docs/subgraph/reference-guide/interfaces/iproposal) +#### [Dao.proposals](#)[`[IProposal!]!`](/docs/next/subgraph/reference-guide/interfaces/iproposal) > > > > -#### [Dao.signatureValidator](#)[`Bytes`](/docs/subgraph/reference-guide/scalars/bytes) +#### [Dao.signatureValidator](#)[`Bytes`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > > -#### [Dao.standardCallbacks](#)[`[StandardCallback!]!`](/docs/subgraph/reference-guide/objects/standard-callback) +#### [Dao.standardCallbacks](#)[`[StandardCallback!]!`](/docs/next/subgraph/reference-guide/objects/standard-callback) > > > > -#### [Dao.subdomain](#)[`String`](/docs/subgraph/reference-guide/scalars/string) +#### [Dao.subdomain](#)[`String`](/docs/next/subgraph/reference-guide/scalars/string) > > > > -#### [Dao.token](#)[`ERC20Contract`](/docs/subgraph/reference-guide/objects/erc20-contract) +#### [Dao.token](#)[`ERC20Contract`](/docs/next/subgraph/reference-guide/objects/erc20-contract) > > > > -#### [Dao.transfers](#)[`[TokenTransfer!]!`](/docs/subgraph/reference-guide/interfaces/token-transfer) +#### [Dao.transfers](#)[`[TokenTransfer!]!`](/docs/next/subgraph/reference-guide/interfaces/token-transfer) > > > > -#### [Dao.trustedForwarder](#)[`Bytes`](/docs/subgraph/reference-guide/scalars/bytes) +#### [Dao.trustedForwarder](#)[`Bytes`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > @@ -170,5 +170,5 @@ type Dao { ### Member Of -[`Action`](/docs/subgraph/reference-guide/objects/action) [`AddresslistVotingPlugin`](/docs/subgraph/reference-guide/objects/addresslist-voting-plugin) [`AddresslistVotingProposal`](/docs/subgraph/reference-guide/objects/addresslist-voting-proposal) [`AdminPlugin`](/docs/subgraph/reference-guide/objects/admin-plugin) [`AdminProposal`](/docs/subgraph/reference-guide/objects/admin-proposal) [`ERC1155Balance`](/docs/subgraph/reference-guide/objects/erc1155-balance) [`ERC1155Transfer`](/docs/subgraph/reference-guide/objects/erc1155-transfer) [`ERC20Balance`](/docs/subgraph/reference-guide/objects/erc20-balance) [`ERC20Transfer`](/docs/subgraph/reference-guide/objects/erc20-transfer) [`ERC721Balance`](/docs/subgraph/reference-guide/objects/erc721-balance) [`ERC721Transfer`](/docs/subgraph/reference-guide/objects/erc721-transfer) [`IPlugin`](/docs/subgraph/reference-guide/interfaces/iplugin) [`IProposal`](/docs/subgraph/reference-guide/interfaces/iproposal) [`MultisigPlugin`](/docs/subgraph/reference-guide/objects/multisig-plugin) [`MultisigProposal`](/docs/subgraph/reference-guide/objects/multisig-proposal) [`NativeBalance`](/docs/subgraph/reference-guide/objects/native-balance) [`NativeTransfer`](/docs/subgraph/reference-guide/objects/native-transfer) [`Permission`](/docs/subgraph/reference-guide/objects/permission) [`PluginInstallation`](/docs/subgraph/reference-guide/objects/plugin-installation) [`PluginPreparation`](/docs/subgraph/reference-guide/objects/plugin-preparation) [`StandardCallback`](/docs/subgraph/reference-guide/objects/standard-callback) [`TokenBalance`](/docs/subgraph/reference-guide/interfaces/token-balance) [`TokenTransfer`](/docs/subgraph/reference-guide/interfaces/token-transfer) [`TokenVotingPlugin`](/docs/subgraph/reference-guide/objects/token-voting-plugin) [`TokenVotingProposal`](/docs/subgraph/reference-guide/objects/token-voting-proposal) [`TransactionActionsProposal`](/docs/subgraph/reference-guide/objects/transaction-actions-proposal) +[`Action`](/docs/next/subgraph/reference-guide/objects/action) [`AddresslistVotingPlugin`](/docs/next/subgraph/reference-guide/objects/addresslist-voting-plugin) [`AddresslistVotingProposal`](/docs/next/subgraph/reference-guide/objects/addresslist-voting-proposal) [`AdminPlugin`](/docs/next/subgraph/reference-guide/objects/admin-plugin) [`AdminProposal`](/docs/next/subgraph/reference-guide/objects/admin-proposal) [`ERC1155Balance`](/docs/next/subgraph/reference-guide/objects/erc1155-balance) [`ERC1155Transfer`](/docs/next/subgraph/reference-guide/objects/erc1155-transfer) [`ERC20Balance`](/docs/next/subgraph/reference-guide/objects/erc20-balance) [`ERC20Transfer`](/docs/next/subgraph/reference-guide/objects/erc20-transfer) [`ERC721Balance`](/docs/next/subgraph/reference-guide/objects/erc721-balance) [`ERC721Transfer`](/docs/next/subgraph/reference-guide/objects/erc721-transfer) [`IPlugin`](/docs/next/subgraph/reference-guide/interfaces/iplugin) [`IProposal`](/docs/next/subgraph/reference-guide/interfaces/iproposal) [`MultisigPlugin`](/docs/next/subgraph/reference-guide/objects/multisig-plugin) [`MultisigProposal`](/docs/next/subgraph/reference-guide/objects/multisig-proposal) [`NativeBalance`](/docs/next/subgraph/reference-guide/objects/native-balance) [`NativeTransfer`](/docs/next/subgraph/reference-guide/objects/native-transfer) [`Permission`](/docs/next/subgraph/reference-guide/objects/permission) [`PluginInstallation`](/docs/next/subgraph/reference-guide/objects/plugin-installation) [`PluginPreparation`](/docs/next/subgraph/reference-guide/objects/plugin-preparation) [`StandardCallback`](/docs/next/subgraph/reference-guide/objects/standard-callback) [`TokenBalance`](/docs/next/subgraph/reference-guide/interfaces/token-balance) [`TokenTransfer`](/docs/next/subgraph/reference-guide/interfaces/token-transfer) [`TokenVotingPlugin`](/docs/next/subgraph/reference-guide/objects/token-voting-plugin) [`TokenVotingProposal`](/docs/next/subgraph/reference-guide/objects/token-voting-proposal) [`TransactionActionsProposal`](/docs/next/subgraph/reference-guide/objects/transaction-actions-proposal) diff --git a/docs/subgraph/reference-guide/objects/erc1155-balance.mdx b/docs/subgraph/reference-guide/objects/erc1155-balance.mdx index 0d0061a4..1aa70036 100644 --- a/docs/subgraph/reference-guide/objects/erc1155-balance.mdx +++ b/docs/subgraph/reference-guide/objects/erc1155-balance.mdx @@ -58,37 +58,37 @@ type ERC1155Balance implements TokenBalance { ### Fields -#### [ERC1155Balance.balances](#)[`[ERC1155TokenIdBalance!]!`](/docs/subgraph/reference-guide/objects/erc1155-token-id-balance) +#### [ERC1155Balance.balances](#)[`[ERC1155TokenIdBalance!]!`](/docs/next/subgraph/reference-guide/objects/erc1155-token-id-balance) > > > Balance for each token ID from an [ERC1155 Token Smart Contract](https://eips.ethereum.org/EIPS/eip-1155). > -#### [ERC1155Balance.dao](#)[`Dao!`](/docs/subgraph/reference-guide/objects/dao) +#### [ERC1155Balance.dao](#)[`Dao!`](/docs/next/subgraph/reference-guide/objects/dao) > > > The DAO that holds tokens from a [ERC1155 Token Smart Contract](https://eips.ethereum.org/EIPS/eip-1155). > -#### [ERC1155Balance.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [ERC1155Balance.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > The concatenation of DAO Smart Contract address and [ERC1155 Token Smart Contract](https://eips.ethereum.org/EIPS/eip-1155) address. Joined by '_'. > -#### [ERC1155Balance.lastUpdated](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [ERC1155Balance.lastUpdated](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > The block timestamp of the last update (transfer) for this token balance. > -#### [ERC1155Balance.metadataUri](#)[`String!`](/docs/subgraph/reference-guide/scalars/string) +#### [ERC1155Balance.metadataUri](#)[`String!`](/docs/next/subgraph/reference-guide/scalars/string) > > > The URI of the [ERC1155 Token Smart Contract](https://eips.ethereum.org/EIPS/eip-1155). > -#### [ERC1155Balance.token](#)[`ERC1155Contract!`](/docs/subgraph/reference-guide/objects/erc1155-contract) +#### [ERC1155Balance.token](#)[`ERC1155Contract!`](/docs/next/subgraph/reference-guide/objects/erc1155-contract) > > > The [ERC1155 Token Smart Contract](https://eips.ethereum.org/EIPS/eip-1155) instance. @@ -96,7 +96,7 @@ type ERC1155Balance implements TokenBalance { ### Interfaces -#### [`TokenBalance`](/docs/subgraph/reference-guide/interfaces/token-balance) +#### [`TokenBalance`](/docs/next/subgraph/reference-guide/interfaces/token-balance) > > > Balance of the DAO for any kind of token. Each entity implementing this interface can be queried as TokenBalance. @@ -108,5 +108,5 @@ type ERC1155Balance implements TokenBalance { ### Member Of -[`ERC1155TokenIdBalance`](/docs/subgraph/reference-guide/objects/erc1155-token-id-balance) +[`ERC1155TokenIdBalance`](/docs/next/subgraph/reference-guide/objects/erc1155-token-id-balance) diff --git a/docs/subgraph/reference-guide/objects/erc1155-contract.mdx b/docs/subgraph/reference-guide/objects/erc1155-contract.mdx index 272c93e1..8809c7fc 100644 --- a/docs/subgraph/reference-guide/objects/erc1155-contract.mdx +++ b/docs/subgraph/reference-guide/objects/erc1155-contract.mdx @@ -56,19 +56,19 @@ type ERC1155Contract implements Token { ### Fields -#### [ERC1155Contract.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [ERC1155Contract.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > The address of the [ERC1155 Token Smart Contract](https://eips.ethereum.org/EIPS/eip-1155). > -#### [ERC1155Contract.name](#)[`String`](/docs/subgraph/reference-guide/scalars/string) +#### [ERC1155Contract.name](#)[`String`](/docs/next/subgraph/reference-guide/scalars/string) > > > The name of the [ERC1155 Token Smart Contract](https://eips.ethereum.org/EIPS/eip-1155). > -#### [ERC1155Contract.symbol](#)[`String`](/docs/subgraph/reference-guide/scalars/string) +#### [ERC1155Contract.symbol](#)[`String`](/docs/next/subgraph/reference-guide/scalars/string) > > > The symbol of the [ERC1155 Token Smart Contract](https://eips.ethereum.org/EIPS/eip-1155). @@ -76,7 +76,7 @@ type ERC1155Contract implements Token { ### Interfaces -#### [`Token`](/docs/subgraph/reference-guide/interfaces/token) +#### [`Token`](/docs/next/subgraph/reference-guide/interfaces/token) > > > Interface representing a generic token. Each entity implementing this interface can be queried as Token. @@ -88,5 +88,5 @@ type ERC1155Contract implements Token { ### Member Of -[`ERC1155Balance`](/docs/subgraph/reference-guide/objects/erc1155-balance) [`ERC1155Transfer`](/docs/subgraph/reference-guide/objects/erc1155-transfer) +[`ERC1155Balance`](/docs/next/subgraph/reference-guide/objects/erc1155-balance) [`ERC1155Transfer`](/docs/next/subgraph/reference-guide/objects/erc1155-transfer) diff --git a/docs/subgraph/reference-guide/objects/erc1155-token-id-balance.mdx b/docs/subgraph/reference-guide/objects/erc1155-token-id-balance.mdx index 098e4403..95f6610c 100644 --- a/docs/subgraph/reference-guide/objects/erc1155-token-id-balance.mdx +++ b/docs/subgraph/reference-guide/objects/erc1155-token-id-balance.mdx @@ -57,31 +57,31 @@ type ERC1155TokenIdBalance { ### Fields -#### [ERC1155TokenIdBalance.amount](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [ERC1155TokenIdBalance.amount](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > The number of tokens held by the DAO per [ERC1155 Token Smart Contract](https://eips.ethereum.org/EIPS/eip-1155) and token ID. > -#### [ERC1155TokenIdBalance.balance](#)[`ERC1155Balance!`](/docs/subgraph/reference-guide/objects/erc1155-balance) +#### [ERC1155TokenIdBalance.balance](#)[`ERC1155Balance!`](/docs/next/subgraph/reference-guide/objects/erc1155-balance) > > > One to Many relationship linking with ERC1155Balance entity. > -#### [ERC1155TokenIdBalance.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [ERC1155TokenIdBalance.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > The concatenation of DAO Smart Contract address, [ERC1155 Token Smart Contract](https://eips.ethereum.org/EIPS/eip-1155) and token ID. Joined by '_'. > -#### [ERC1155TokenIdBalance.lastUpdated](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [ERC1155TokenIdBalance.lastUpdated](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > The block timestamp of the last update (transfer) for this token balance. > -#### [ERC1155TokenIdBalance.tokenId](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [ERC1155TokenIdBalance.tokenId](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > The ID for each different token in an [ERC1155 Token Smart Contract](https://eips.ethereum.org/EIPS/eip-1155) held by the DAO. @@ -93,5 +93,5 @@ type ERC1155TokenIdBalance { ### Member Of -[`ERC1155Balance`](/docs/subgraph/reference-guide/objects/erc1155-balance) +[`ERC1155Balance`](/docs/next/subgraph/reference-guide/objects/erc1155-balance) diff --git a/docs/subgraph/reference-guide/objects/erc1155-transfer.mdx b/docs/subgraph/reference-guide/objects/erc1155-transfer.mdx index d22c7b55..5d31b61d 100644 --- a/docs/subgraph/reference-guide/objects/erc1155-transfer.mdx +++ b/docs/subgraph/reference-guide/objects/erc1155-transfer.mdx @@ -64,73 +64,73 @@ type ERC1155Transfer implements TokenTransfer { ### Fields -#### [ERC1155Transfer.amount](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [ERC1155Transfer.amount](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > The amount of transferred tokens. > -#### [ERC1155Transfer.createdAt](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [ERC1155Transfer.createdAt](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > The timestamp of the block including the ERC1155 token transfer. > -#### [ERC1155Transfer.dao](#)[`Dao!`](/docs/subgraph/reference-guide/objects/dao) +#### [ERC1155Transfer.dao](#)[`Dao!`](/docs/next/subgraph/reference-guide/objects/dao) > > > The DAO that manages the transfer. > -#### [ERC1155Transfer.from](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [ERC1155Transfer.from](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > The Ethereum address from which the tokens are being transferred. > -#### [ERC1155Transfer.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [ERC1155Transfer.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > The concatenation of the transfer transaction hash, the log index and the action index. Joined by '_'. > -#### [ERC1155Transfer.operator](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [ERC1155Transfer.operator](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > The Ethereum address performing the token transfer. > -#### [ERC1155Transfer.proposal](#)[`IProposal`](/docs/subgraph/reference-guide/interfaces/iproposal) +#### [ERC1155Transfer.proposal](#)[`IProposal`](/docs/next/subgraph/reference-guide/interfaces/iproposal) > > > The associated DAO proposal, if applicable. Using the DAO `deposit` function there's no need for proposal. > -#### [ERC1155Transfer.to](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [ERC1155Transfer.to](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > The Ethereum address receiving the tokens. > -#### [ERC1155Transfer.token](#)[`ERC1155Contract!`](/docs/subgraph/reference-guide/objects/erc1155-contract) +#### [ERC1155Transfer.token](#)[`ERC1155Contract!`](/docs/next/subgraph/reference-guide/objects/erc1155-contract) > > > The ERC1155 Smart Contract Token entity involved in the transfer. > -#### [ERC1155Transfer.tokenId](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [ERC1155Transfer.tokenId](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > The ID of the transferred token. > -#### [ERC1155Transfer.txHash](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [ERC1155Transfer.txHash](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > The hash of the ERC1155 token transfer to track the transaction. > -#### [ERC1155Transfer.type](#)[`TransferType!`](/docs/subgraph/reference-guide/enums/transfer-type) +#### [ERC1155Transfer.type](#)[`TransferType!`](/docs/next/subgraph/reference-guide/enums/transfer-type) > > > The type of transfer (External, Withdraw, Deposit) from the DAO's POV. @@ -138,7 +138,7 @@ type ERC1155Transfer implements TokenTransfer { ### Interfaces -#### [`TokenTransfer`](/docs/subgraph/reference-guide/interfaces/token-transfer) +#### [`TokenTransfer`](/docs/next/subgraph/reference-guide/interfaces/token-transfer) > > > Interface representing a generic token transfer associated with the DAO. Each entity implementing this interface can be queried as TokenTransfer (refer to `Enum` `TransferType` for a better understanding of transfers associated with the DAO meaning). diff --git a/docs/subgraph/reference-guide/objects/erc20-balance.mdx b/docs/subgraph/reference-guide/objects/erc20-balance.mdx index 98643a22..62af41ce 100644 --- a/docs/subgraph/reference-guide/objects/erc20-balance.mdx +++ b/docs/subgraph/reference-guide/objects/erc20-balance.mdx @@ -57,31 +57,31 @@ type ERC20Balance implements TokenBalance { ### Fields -#### [ERC20Balance.balance](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [ERC20Balance.balance](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > The amount of ERC20 tokens held by the DAO. > -#### [ERC20Balance.dao](#)[`Dao!`](/docs/subgraph/reference-guide/objects/dao) +#### [ERC20Balance.dao](#)[`Dao!`](/docs/next/subgraph/reference-guide/objects/dao) > > > The DAO that holds the ERC20 token. > -#### [ERC20Balance.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [ERC20Balance.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > The concatenation of DAO Smart contract address and Token Smart contract address. Joined by '_'. > -#### [ERC20Balance.lastUpdated](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [ERC20Balance.lastUpdated](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > The block timestamp of the last update (transfer) for this token balance. > -#### [ERC20Balance.token](#)[`ERC20Contract!`](/docs/subgraph/reference-guide/objects/erc20-contract) +#### [ERC20Balance.token](#)[`ERC20Contract!`](/docs/next/subgraph/reference-guide/objects/erc20-contract) > > > The [ERC20 Token Smart Contract](https://eips.ethereum.org/EIPS/eip-20) instance. @@ -89,7 +89,7 @@ type ERC20Balance implements TokenBalance { ### Interfaces -#### [`TokenBalance`](/docs/subgraph/reference-guide/interfaces/token-balance) +#### [`TokenBalance`](/docs/next/subgraph/reference-guide/interfaces/token-balance) > > > Balance of the DAO for any kind of token. Each entity implementing this interface can be queried as TokenBalance. diff --git a/docs/subgraph/reference-guide/objects/erc20-contract.mdx b/docs/subgraph/reference-guide/objects/erc20-contract.mdx index f199ad89..5d93b206 100644 --- a/docs/subgraph/reference-guide/objects/erc20-contract.mdx +++ b/docs/subgraph/reference-guide/objects/erc20-contract.mdx @@ -56,25 +56,25 @@ type ERC20Contract implements Token { ### Fields -#### [ERC20Contract.decimals](#)[`Int!`](/docs/subgraph/reference-guide/scalars/int) +#### [ERC20Contract.decimals](#)[`Int!`](/docs/next/subgraph/reference-guide/scalars/int) > > > The number of decimals of the token, mirrored from the smart contract. > -#### [ERC20Contract.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [ERC20Contract.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > The address of the [ERC20 Token Smart Contract](https://eips.ethereum.org/EIPS/eip-20). > -#### [ERC20Contract.name](#)[`String`](/docs/subgraph/reference-guide/scalars/string) +#### [ERC20Contract.name](#)[`String`](/docs/next/subgraph/reference-guide/scalars/string) > > > The name of the token, mirrored from the smart contract. > -#### [ERC20Contract.symbol](#)[`String`](/docs/subgraph/reference-guide/scalars/string) +#### [ERC20Contract.symbol](#)[`String`](/docs/next/subgraph/reference-guide/scalars/string) > > > The symbol of the token, mirrored from the smart contract. @@ -82,7 +82,7 @@ type ERC20Contract implements Token { ### Interfaces -#### [`Token`](/docs/subgraph/reference-guide/interfaces/token) +#### [`Token`](/docs/next/subgraph/reference-guide/interfaces/token) > > > Interface representing a generic token. Each entity implementing this interface can be queried as Token. @@ -94,5 +94,5 @@ type ERC20Contract implements Token { ### Member Of -[`Dao`](/docs/subgraph/reference-guide/objects/dao) [`ERC20Balance`](/docs/subgraph/reference-guide/objects/erc20-balance) [`ERC20WrapperContract`](/docs/subgraph/reference-guide/objects/erc20-wrapper-contract) +[`Dao`](/docs/next/subgraph/reference-guide/objects/dao) [`ERC20Balance`](/docs/next/subgraph/reference-guide/objects/erc20-balance) [`ERC20WrapperContract`](/docs/next/subgraph/reference-guide/objects/erc20-wrapper-contract) diff --git a/docs/subgraph/reference-guide/objects/erc20-transfer.mdx b/docs/subgraph/reference-guide/objects/erc20-transfer.mdx index 9e0c82a6..f422e6f0 100644 --- a/docs/subgraph/reference-guide/objects/erc20-transfer.mdx +++ b/docs/subgraph/reference-guide/objects/erc20-transfer.mdx @@ -62,61 +62,61 @@ type ERC20Transfer implements TokenTransfer { ### Fields -#### [ERC20Transfer.amount](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [ERC20Transfer.amount](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > The amount of ERC20 token transferred. > -#### [ERC20Transfer.createdAt](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [ERC20Transfer.createdAt](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > The timestamp of the block including the ERC20 token transfer. > -#### [ERC20Transfer.dao](#)[`Dao!`](/docs/subgraph/reference-guide/objects/dao) +#### [ERC20Transfer.dao](#)[`Dao!`](/docs/next/subgraph/reference-guide/objects/dao) > > > The DAO that manages the transfer. > -#### [ERC20Transfer.from](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [ERC20Transfer.from](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > The Ethereum address from which the ERC20 tokens are being transferred. > -#### [ERC20Transfer.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [ERC20Transfer.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > The concatenation of the transfer transaction hash, the log index and the action index. Joined by '_'. > -#### [ERC20Transfer.proposal](#)[`IProposal`](/docs/subgraph/reference-guide/interfaces/iproposal) +#### [ERC20Transfer.proposal](#)[`IProposal`](/docs/next/subgraph/reference-guide/interfaces/iproposal) > > > The associated DAO proposal, if applicable. Using the DAO `deposit` function there's no need for proposal. > -#### [ERC20Transfer.to](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [ERC20Transfer.to](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > The Ethereum address receiving the ERC20 tokens. > -#### [ERC20Transfer.token](#)[`Token!`](/docs/subgraph/reference-guide/interfaces/token) +#### [ERC20Transfer.token](#)[`Token!`](/docs/next/subgraph/reference-guide/interfaces/token) > > > The ERC20 Smart Contract Token entity involved in the transfer. > -#### [ERC20Transfer.txHash](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [ERC20Transfer.txHash](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > The hash of the ERC20 token transfer to track the transaction. > -#### [ERC20Transfer.type](#)[`TransferType!`](/docs/subgraph/reference-guide/enums/transfer-type) +#### [ERC20Transfer.type](#)[`TransferType!`](/docs/next/subgraph/reference-guide/enums/transfer-type) > > > The type of transfer (External, Withdraw, Deposit) from the DAO's POV. @@ -124,7 +124,7 @@ type ERC20Transfer implements TokenTransfer { ### Interfaces -#### [`TokenTransfer`](/docs/subgraph/reference-guide/interfaces/token-transfer) +#### [`TokenTransfer`](/docs/next/subgraph/reference-guide/interfaces/token-transfer) > > > Interface representing a generic token transfer associated with the DAO. Each entity implementing this interface can be queried as TokenTransfer (refer to `Enum` `TransferType` for a better understanding of transfers associated with the DAO meaning). diff --git a/docs/subgraph/reference-guide/objects/erc20-wrapper-contract.mdx b/docs/subgraph/reference-guide/objects/erc20-wrapper-contract.mdx index 17850295..2a6c31b1 100644 --- a/docs/subgraph/reference-guide/objects/erc20-wrapper-contract.mdx +++ b/docs/subgraph/reference-guide/objects/erc20-wrapper-contract.mdx @@ -57,31 +57,31 @@ type ERC20WrapperContract implements Token { ### Fields -#### [ERC20WrapperContract.decimals](#)[`Int!`](/docs/subgraph/reference-guide/scalars/int) +#### [ERC20WrapperContract.decimals](#)[`Int!`](/docs/next/subgraph/reference-guide/scalars/int) > > > The number of decimals of the wrapped token, mirrored from the smart contract. > -#### [ERC20WrapperContract.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [ERC20WrapperContract.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > The address of the [ERC20 Token Smart Contract](https://eips.ethereum.org/EIPS/eip-20). > -#### [ERC20WrapperContract.name](#)[`String`](/docs/subgraph/reference-guide/scalars/string) +#### [ERC20WrapperContract.name](#)[`String`](/docs/next/subgraph/reference-guide/scalars/string) > > > The name of the wrapped token, mirrored from the smart contract. > -#### [ERC20WrapperContract.symbol](#)[`String`](/docs/subgraph/reference-guide/scalars/string) +#### [ERC20WrapperContract.symbol](#)[`String`](/docs/next/subgraph/reference-guide/scalars/string) > > > The symbol of the wrapped token, mirrored from the smart contract. > -#### [ERC20WrapperContract.underlyingToken](#)[`ERC20Contract!`](/docs/subgraph/reference-guide/objects/erc20-contract) +#### [ERC20WrapperContract.underlyingToken](#)[`ERC20Contract!`](/docs/next/subgraph/reference-guide/objects/erc20-contract) > > > The underlying [ERC20 Token Smart Contract](https://eips.ethereum.org/EIPS/eip-20) this wrapper represents. @@ -89,7 +89,7 @@ type ERC20WrapperContract implements Token { ### Interfaces -#### [`Token`](/docs/subgraph/reference-guide/interfaces/token) +#### [`Token`](/docs/next/subgraph/reference-guide/interfaces/token) > > > Interface representing a generic token. Each entity implementing this interface can be queried as Token. diff --git a/docs/subgraph/reference-guide/objects/erc721-balance.mdx b/docs/subgraph/reference-guide/objects/erc721-balance.mdx index 89ed59ac..ae45cf24 100644 --- a/docs/subgraph/reference-guide/objects/erc721-balance.mdx +++ b/docs/subgraph/reference-guide/objects/erc721-balance.mdx @@ -57,31 +57,31 @@ type ERC721Balance implements TokenBalance { ### Fields -#### [ERC721Balance.dao](#)[`Dao!`](/docs/subgraph/reference-guide/objects/dao) +#### [ERC721Balance.dao](#)[`Dao!`](/docs/next/subgraph/reference-guide/objects/dao) > > > The DAO that holds tokens from a [ERC721 Token Smart Contract](https://eips.ethereum.org/EIPS/eip-721). > -#### [ERC721Balance.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [ERC721Balance.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > The concatenation of DAO Smart Contract address and [ERC721 Token Smart Contract](https://eips.ethereum.org/EIPS/eip-721) address. Joined by '_'. > -#### [ERC721Balance.lastUpdated](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [ERC721Balance.lastUpdated](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > The block timestamp of the last update (transfer) for this token balance. > -#### [ERC721Balance.token](#)[`ERC721Contract!`](/docs/subgraph/reference-guide/objects/erc721-contract) +#### [ERC721Balance.token](#)[`ERC721Contract!`](/docs/next/subgraph/reference-guide/objects/erc721-contract) > > > The [ERC721 Token Smart Contract](https://eips.ethereum.org/EIPS/eip-721) instance. > -#### [ERC721Balance.tokenIds](#)[`[BigInt!]!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [ERC721Balance.tokenIds](#)[`[BigInt!]!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > The NFTs from one ERC721 Contract held by the DAO. @@ -89,7 +89,7 @@ type ERC721Balance implements TokenBalance { ### Interfaces -#### [`TokenBalance`](/docs/subgraph/reference-guide/interfaces/token-balance) +#### [`TokenBalance`](/docs/next/subgraph/reference-guide/interfaces/token-balance) > > > Balance of the DAO for any kind of token. Each entity implementing this interface can be queried as TokenBalance. diff --git a/docs/subgraph/reference-guide/objects/erc721-contract.mdx b/docs/subgraph/reference-guide/objects/erc721-contract.mdx index 75885461..97a15ea7 100644 --- a/docs/subgraph/reference-guide/objects/erc721-contract.mdx +++ b/docs/subgraph/reference-guide/objects/erc721-contract.mdx @@ -55,19 +55,19 @@ type ERC721Contract implements Token { ### Fields -#### [ERC721Contract.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [ERC721Contract.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > The address of the [ERC721 Token Smart Contract](https://eips.ethereum.org/EIPS/eip-721). > -#### [ERC721Contract.name](#)[`String`](/docs/subgraph/reference-guide/scalars/string) +#### [ERC721Contract.name](#)[`String`](/docs/next/subgraph/reference-guide/scalars/string) > > > The name of the token, mirrored from the smart contract. > -#### [ERC721Contract.symbol](#)[`String`](/docs/subgraph/reference-guide/scalars/string) +#### [ERC721Contract.symbol](#)[`String`](/docs/next/subgraph/reference-guide/scalars/string) > > > The symbol of the token, mirrored from the smart contract. @@ -75,7 +75,7 @@ type ERC721Contract implements Token { ### Interfaces -#### [`Token`](/docs/subgraph/reference-guide/interfaces/token) +#### [`Token`](/docs/next/subgraph/reference-guide/interfaces/token) > > > Interface representing a generic token. Each entity implementing this interface can be queried as Token. @@ -87,5 +87,5 @@ type ERC721Contract implements Token { ### Member Of -[`ERC721Balance`](/docs/subgraph/reference-guide/objects/erc721-balance) [`ERC721Transfer`](/docs/subgraph/reference-guide/objects/erc721-transfer) +[`ERC721Balance`](/docs/next/subgraph/reference-guide/objects/erc721-balance) [`ERC721Transfer`](/docs/next/subgraph/reference-guide/objects/erc721-transfer) diff --git a/docs/subgraph/reference-guide/objects/erc721-transfer.mdx b/docs/subgraph/reference-guide/objects/erc721-transfer.mdx index e897ca83..d1fe366c 100644 --- a/docs/subgraph/reference-guide/objects/erc721-transfer.mdx +++ b/docs/subgraph/reference-guide/objects/erc721-transfer.mdx @@ -62,61 +62,61 @@ type ERC721Transfer implements TokenTransfer { ### Fields -#### [ERC721Transfer.createdAt](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [ERC721Transfer.createdAt](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > The timestamp of the block including the ERC721 token transfer . > -#### [ERC721Transfer.dao](#)[`Dao!`](/docs/subgraph/reference-guide/objects/dao) +#### [ERC721Transfer.dao](#)[`Dao!`](/docs/next/subgraph/reference-guide/objects/dao) > > > The DAO that manages the transfer. > -#### [ERC721Transfer.from](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [ERC721Transfer.from](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > The Ethereum address from which the ERC721 token is being transferred. > -#### [ERC721Transfer.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [ERC721Transfer.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > The concatenation of the transfer transaction hash, the log index and the action index. Joined by '_'. > -#### [ERC721Transfer.proposal](#)[`IProposal`](/docs/subgraph/reference-guide/interfaces/iproposal) +#### [ERC721Transfer.proposal](#)[`IProposal`](/docs/next/subgraph/reference-guide/interfaces/iproposal) > > > The associated DAO proposal, if applicable. Using the DAO `deposit` function there's no need for proposal. > -#### [ERC721Transfer.to](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [ERC721Transfer.to](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > The Ethereum address receiving the ERC721 token. > -#### [ERC721Transfer.token](#)[`ERC721Contract!`](/docs/subgraph/reference-guide/objects/erc721-contract) +#### [ERC721Transfer.token](#)[`ERC721Contract!`](/docs/next/subgraph/reference-guide/objects/erc721-contract) > > > The ERC721 Smart Contract Token entity involved in the transfer. > -#### [ERC721Transfer.tokenId](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [ERC721Transfer.tokenId](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > The ID of the transferred token. > -#### [ERC721Transfer.txHash](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [ERC721Transfer.txHash](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > The hash of the ERC721 token transfer to track the transaction. > -#### [ERC721Transfer.type](#)[`TransferType!`](/docs/subgraph/reference-guide/enums/transfer-type) +#### [ERC721Transfer.type](#)[`TransferType!`](/docs/next/subgraph/reference-guide/enums/transfer-type) > > > The type of transfer (External, Withdraw, Deposit) from the DAO's POV. @@ -124,7 +124,7 @@ type ERC721Transfer implements TokenTransfer { ### Interfaces -#### [`TokenTransfer`](/docs/subgraph/reference-guide/interfaces/token-transfer) +#### [`TokenTransfer`](/docs/next/subgraph/reference-guide/interfaces/token-transfer) > > > Interface representing a generic token transfer associated with the DAO. Each entity implementing this interface can be queried as TokenTransfer (refer to `Enum` `TransferType` for a better understanding of transfers associated with the DAO meaning). diff --git a/docs/subgraph/reference-guide/objects/multisig-approver.mdx b/docs/subgraph/reference-guide/objects/multisig-approver.mdx index 8d57d1c0..08bed043 100644 --- a/docs/subgraph/reference-guide/objects/multisig-approver.mdx +++ b/docs/subgraph/reference-guide/objects/multisig-approver.mdx @@ -56,25 +56,25 @@ type MultisigApprover { ### Fields -#### [MultisigApprover.address](#)[`String`](/docs/subgraph/reference-guide/scalars/string) +#### [MultisigApprover.address](#)[`String`](/docs/next/subgraph/reference-guide/scalars/string) > > > > -#### [MultisigApprover.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [MultisigApprover.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > > -#### [MultisigApprover.plugin](#)[`MultisigPlugin!`](/docs/subgraph/reference-guide/objects/multisig-plugin) +#### [MultisigApprover.plugin](#)[`MultisigPlugin!`](/docs/next/subgraph/reference-guide/objects/multisig-plugin) > > > > -#### [MultisigApprover.proposals](#)[`[MultisigProposalApprover!]!`](/docs/subgraph/reference-guide/objects/multisig-proposal-approver) +#### [MultisigApprover.proposals](#)[`[MultisigProposalApprover!]!`](/docs/next/subgraph/reference-guide/objects/multisig-proposal-approver) > > > @@ -86,5 +86,5 @@ type MultisigApprover { ### Member Of -[`MultisigPlugin`](/docs/subgraph/reference-guide/objects/multisig-plugin) [`MultisigProposalApprover`](/docs/subgraph/reference-guide/objects/multisig-proposal-approver) +[`MultisigPlugin`](/docs/next/subgraph/reference-guide/objects/multisig-plugin) [`MultisigProposalApprover`](/docs/next/subgraph/reference-guide/objects/multisig-proposal-approver) diff --git a/docs/subgraph/reference-guide/objects/multisig-plugin.mdx b/docs/subgraph/reference-guide/objects/multisig-plugin.mdx index a37842db..99ebdd4b 100644 --- a/docs/subgraph/reference-guide/objects/multisig-plugin.mdx +++ b/docs/subgraph/reference-guide/objects/multisig-plugin.mdx @@ -61,55 +61,55 @@ type MultisigPlugin implements IPlugin { ### Fields -#### [MultisigPlugin.dao](#)[`Dao!`](/docs/subgraph/reference-guide/objects/dao) +#### [MultisigPlugin.dao](#)[`Dao!`](/docs/next/subgraph/reference-guide/objects/dao) > > > > -#### [MultisigPlugin.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [MultisigPlugin.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > TODO: attributes should be appended to Plugin once plugin is seperated from Aragon OSx > -#### [MultisigPlugin.installations](#)[`[PluginInstallation!]!`](/docs/subgraph/reference-guide/objects/plugin-installation) +#### [MultisigPlugin.installations](#)[`[PluginInstallation!]!`](/docs/next/subgraph/reference-guide/objects/plugin-installation) > > > > -#### [MultisigPlugin.members](#)[`[MultisigApprover!]!`](/docs/subgraph/reference-guide/objects/multisig-approver) +#### [MultisigPlugin.members](#)[`[MultisigApprover!]!`](/docs/next/subgraph/reference-guide/objects/multisig-approver) > > > > -#### [MultisigPlugin.minApprovals](#)[`Int`](/docs/subgraph/reference-guide/scalars/int) +#### [MultisigPlugin.minApprovals](#)[`Int`](/docs/next/subgraph/reference-guide/scalars/int) > > > > -#### [MultisigPlugin.onlyListed](#)[`Boolean`](/docs/subgraph/reference-guide/scalars/boolean) +#### [MultisigPlugin.onlyListed](#)[`Boolean`](/docs/next/subgraph/reference-guide/scalars/boolean) > > > > -#### [MultisigPlugin.pluginAddress](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [MultisigPlugin.pluginAddress](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > > -#### [MultisigPlugin.proposalCount](#)[`BigInt`](/docs/subgraph/reference-guide/scalars/big-int) +#### [MultisigPlugin.proposalCount](#)[`BigInt`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [MultisigPlugin.proposals](#)[`[MultisigProposal!]!`](/docs/subgraph/reference-guide/objects/multisig-proposal) +#### [MultisigPlugin.proposals](#)[`[MultisigProposal!]!`](/docs/next/subgraph/reference-guide/objects/multisig-proposal) > > > @@ -117,7 +117,7 @@ type MultisigPlugin implements IPlugin { ### Interfaces -#### [`IPlugin`](/docs/subgraph/reference-guide/interfaces/iplugin) +#### [`IPlugin`](/docs/next/subgraph/reference-guide/interfaces/iplugin) > > > @@ -129,5 +129,5 @@ type MultisigPlugin implements IPlugin { ### Member Of -[`MultisigApprover`](/docs/subgraph/reference-guide/objects/multisig-approver) [`MultisigProposal`](/docs/subgraph/reference-guide/objects/multisig-proposal) +[`MultisigApprover`](/docs/next/subgraph/reference-guide/objects/multisig-approver) [`MultisigProposal`](/docs/next/subgraph/reference-guide/objects/multisig-proposal) diff --git a/docs/subgraph/reference-guide/objects/multisig-proposal-approver.mdx b/docs/subgraph/reference-guide/objects/multisig-proposal-approver.mdx index e5423595..95fecad9 100644 --- a/docs/subgraph/reference-guide/objects/multisig-proposal-approver.mdx +++ b/docs/subgraph/reference-guide/objects/multisig-proposal-approver.mdx @@ -56,25 +56,25 @@ type MultisigProposalApprover { ### Fields -#### [MultisigProposalApprover.approver](#)[`MultisigApprover!`](/docs/subgraph/reference-guide/objects/multisig-approver) +#### [MultisigProposalApprover.approver](#)[`MultisigApprover!`](/docs/next/subgraph/reference-guide/objects/multisig-approver) > > > > -#### [MultisigProposalApprover.createdAt](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [MultisigProposalApprover.createdAt](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [MultisigProposalApprover.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [MultisigProposalApprover.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > ApproverProposal for Many-to-Many > -#### [MultisigProposalApprover.proposal](#)[`MultisigProposal!`](/docs/subgraph/reference-guide/objects/multisig-proposal) +#### [MultisigProposalApprover.proposal](#)[`MultisigProposal!`](/docs/next/subgraph/reference-guide/objects/multisig-proposal) > > > @@ -86,5 +86,5 @@ type MultisigProposalApprover { ### Member Of -[`MultisigApprover`](/docs/subgraph/reference-guide/objects/multisig-approver) [`MultisigProposal`](/docs/subgraph/reference-guide/objects/multisig-proposal) +[`MultisigApprover`](/docs/next/subgraph/reference-guide/objects/multisig-approver) [`MultisigProposal`](/docs/next/subgraph/reference-guide/objects/multisig-proposal) diff --git a/docs/subgraph/reference-guide/objects/multisig-proposal.mdx b/docs/subgraph/reference-guide/objects/multisig-proposal.mdx index 2eb99993..d993587b 100644 --- a/docs/subgraph/reference-guide/objects/multisig-proposal.mdx +++ b/docs/subgraph/reference-guide/objects/multisig-proposal.mdx @@ -75,139 +75,139 @@ type MultisigProposal implements IProposal { ### Fields -#### [MultisigProposal.actions](#)[`[Action!]!`](/docs/subgraph/reference-guide/objects/action) +#### [MultisigProposal.actions](#)[`[Action!]!`](/docs/next/subgraph/reference-guide/objects/action) > > > > -#### [MultisigProposal.allowFailureMap](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [MultisigProposal.allowFailureMap](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [MultisigProposal.approvalReached](#)[`Boolean!`](/docs/subgraph/reference-guide/scalars/boolean) +#### [MultisigProposal.approvalReached](#)[`Boolean!`](/docs/next/subgraph/reference-guide/scalars/boolean) > > > > -#### [MultisigProposal.approvals](#)[`Int`](/docs/subgraph/reference-guide/scalars/int) +#### [MultisigProposal.approvals](#)[`Int`](/docs/next/subgraph/reference-guide/scalars/int) > > > > -#### [MultisigProposal.approvers](#)[`[MultisigProposalApprover!]!`](/docs/subgraph/reference-guide/objects/multisig-proposal-approver) +#### [MultisigProposal.approvers](#)[`[MultisigProposalApprover!]!`](/docs/next/subgraph/reference-guide/objects/multisig-proposal-approver) > > > > -#### [MultisigProposal.createdAt](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [MultisigProposal.createdAt](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [MultisigProposal.creationBlockNumber](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [MultisigProposal.creationBlockNumber](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [MultisigProposal.creator](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [MultisigProposal.creator](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > > -#### [MultisigProposal.dao](#)[`Dao!`](/docs/subgraph/reference-guide/objects/dao) +#### [MultisigProposal.dao](#)[`Dao!`](/docs/next/subgraph/reference-guide/objects/dao) > > > > -#### [MultisigProposal.endDate](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [MultisigProposal.endDate](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [MultisigProposal.executed](#)[`Boolean!`](/docs/subgraph/reference-guide/scalars/boolean) +#### [MultisigProposal.executed](#)[`Boolean!`](/docs/next/subgraph/reference-guide/scalars/boolean) > > > > -#### [MultisigProposal.executionBlockNumber](#)[`BigInt`](/docs/subgraph/reference-guide/scalars/big-int) +#### [MultisigProposal.executionBlockNumber](#)[`BigInt`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [MultisigProposal.executionDate](#)[`BigInt`](/docs/subgraph/reference-guide/scalars/big-int) +#### [MultisigProposal.executionDate](#)[`BigInt`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [MultisigProposal.executionTxHash](#)[`Bytes`](/docs/subgraph/reference-guide/scalars/bytes) +#### [MultisigProposal.executionTxHash](#)[`Bytes`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > > -#### [MultisigProposal.failureMap](#)[`BigInt`](/docs/subgraph/reference-guide/scalars/big-int) +#### [MultisigProposal.failureMap](#)[`BigInt`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [MultisigProposal.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [MultisigProposal.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > > -#### [MultisigProposal.isSignaling](#)[`Boolean!`](/docs/subgraph/reference-guide/scalars/boolean) +#### [MultisigProposal.isSignaling](#)[`Boolean!`](/docs/next/subgraph/reference-guide/scalars/boolean) > > > > -#### [MultisigProposal.metadata](#)[`String`](/docs/subgraph/reference-guide/scalars/string) +#### [MultisigProposal.metadata](#)[`String`](/docs/next/subgraph/reference-guide/scalars/string) > > > > -#### [MultisigProposal.minApprovals](#)[`Int!`](/docs/subgraph/reference-guide/scalars/int) +#### [MultisigProposal.minApprovals](#)[`Int!`](/docs/next/subgraph/reference-guide/scalars/int) > > > > -#### [MultisigProposal.plugin](#)[`MultisigPlugin!`](/docs/subgraph/reference-guide/objects/multisig-plugin) +#### [MultisigProposal.plugin](#)[`MultisigPlugin!`](/docs/next/subgraph/reference-guide/objects/multisig-plugin) > > > > -#### [MultisigProposal.pluginProposalId](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [MultisigProposal.pluginProposalId](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [MultisigProposal.snapshotBlock](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [MultisigProposal.snapshotBlock](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [MultisigProposal.startDate](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [MultisigProposal.startDate](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > @@ -215,7 +215,7 @@ type MultisigProposal implements IProposal { ### Interfaces -#### [`IProposal`](/docs/subgraph/reference-guide/interfaces/iproposal) +#### [`IProposal`](/docs/next/subgraph/reference-guide/interfaces/iproposal) > > > @@ -227,5 +227,5 @@ type MultisigProposal implements IProposal { ### Member Of -[`MultisigPlugin`](/docs/subgraph/reference-guide/objects/multisig-plugin) [`MultisigProposalApprover`](/docs/subgraph/reference-guide/objects/multisig-proposal-approver) +[`MultisigPlugin`](/docs/next/subgraph/reference-guide/objects/multisig-plugin) [`MultisigProposalApprover`](/docs/next/subgraph/reference-guide/objects/multisig-proposal-approver) diff --git a/docs/subgraph/reference-guide/objects/native-balance.mdx b/docs/subgraph/reference-guide/objects/native-balance.mdx index 00b2d071..5c9a631a 100644 --- a/docs/subgraph/reference-guide/objects/native-balance.mdx +++ b/docs/subgraph/reference-guide/objects/native-balance.mdx @@ -57,25 +57,25 @@ type NativeBalance implements TokenBalance { ### Fields -#### [NativeBalance.balance](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [NativeBalance.balance](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > The amount of native tokens held by the DAO. > -#### [NativeBalance.dao](#)[`Dao!`](/docs/subgraph/reference-guide/objects/dao) +#### [NativeBalance.dao](#)[`Dao!`](/docs/next/subgraph/reference-guide/objects/dao) > > > The DAO that holds the native tokens > -#### [NativeBalance.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [NativeBalance.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > The concatenation of DAO Smart contract address and Token Smart contract address. Joined by '_'. > -#### [NativeBalance.lastUpdated](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [NativeBalance.lastUpdated](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > The block timestamp of the last update (transfer) for this native token balance. @@ -83,7 +83,7 @@ type NativeBalance implements TokenBalance { ### Interfaces -#### [`TokenBalance`](/docs/subgraph/reference-guide/interfaces/token-balance) +#### [`TokenBalance`](/docs/next/subgraph/reference-guide/interfaces/token-balance) > > > Balance of the DAO for any kind of token. Each entity implementing this interface can be queried as TokenBalance. diff --git a/docs/subgraph/reference-guide/objects/native-transfer.mdx b/docs/subgraph/reference-guide/objects/native-transfer.mdx index 315a7f88..fa5dc15f 100644 --- a/docs/subgraph/reference-guide/objects/native-transfer.mdx +++ b/docs/subgraph/reference-guide/objects/native-transfer.mdx @@ -62,61 +62,61 @@ type NativeTransfer implements TokenTransfer { ### Fields -#### [NativeTransfer.amount](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [NativeTransfer.amount](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > The amount of transferred native tokens . > -#### [NativeTransfer.createdAt](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [NativeTransfer.createdAt](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > The timestamp of the native token transfer block. > -#### [NativeTransfer.dao](#)[`Dao!`](/docs/subgraph/reference-guide/objects/dao) +#### [NativeTransfer.dao](#)[`Dao!`](/docs/next/subgraph/reference-guide/objects/dao) > > > The DAO that manages the transfer. > -#### [NativeTransfer.from](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [NativeTransfer.from](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > The Ethereum address from which the native tokens are being transferred. > -#### [NativeTransfer.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [NativeTransfer.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > The concatenation of the transfer transaction hash, the log index and the action index (set to 0). Joined by '_'. > -#### [NativeTransfer.proposal](#)[`IProposal`](/docs/subgraph/reference-guide/interfaces/iproposal) +#### [NativeTransfer.proposal](#)[`IProposal`](/docs/next/subgraph/reference-guide/interfaces/iproposal) > > > The associated DAO proposal, if applicable. Using the DAO `deposit` function there's no need for proposal. > -#### [NativeTransfer.reference](#)[`String!`](/docs/subgraph/reference-guide/scalars/string) +#### [NativeTransfer.reference](#)[`String!`](/docs/next/subgraph/reference-guide/scalars/string) > > > The reference describing the deposit reason. > -#### [NativeTransfer.to](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [NativeTransfer.to](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > The Ethereum address receiving the native tokens. > -#### [NativeTransfer.txHash](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [NativeTransfer.txHash](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > The hash of the native token transfer to track the transaction. > -#### [NativeTransfer.type](#)[`TransferType!`](/docs/subgraph/reference-guide/enums/transfer-type) +#### [NativeTransfer.type](#)[`TransferType!`](/docs/next/subgraph/reference-guide/enums/transfer-type) > > > The type of transfer (External, Withdraw, Deposit) from the DAO's POV. @@ -124,7 +124,7 @@ type NativeTransfer implements TokenTransfer { ### Interfaces -#### [`TokenTransfer`](/docs/subgraph/reference-guide/interfaces/token-transfer) +#### [`TokenTransfer`](/docs/next/subgraph/reference-guide/interfaces/token-transfer) > > > Interface representing a generic token transfer associated with the DAO. Each entity implementing this interface can be queried as TokenTransfer (refer to `Enum` `TransferType` for a better understanding of transfers associated with the DAO meaning). diff --git a/docs/subgraph/reference-guide/objects/permission.mdx b/docs/subgraph/reference-guide/objects/permission.mdx index 8908a5b5..7376d87e 100644 --- a/docs/subgraph/reference-guide/objects/permission.mdx +++ b/docs/subgraph/reference-guide/objects/permission.mdx @@ -60,49 +60,49 @@ type Permission { ### Fields -#### [Permission.actor](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [Permission.actor](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > > -#### [Permission.condition](#)[`Bytes`](/docs/subgraph/reference-guide/scalars/bytes) +#### [Permission.condition](#)[`Bytes`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > > -#### [Permission.dao](#)[`Dao`](/docs/subgraph/reference-guide/objects/dao) +#### [Permission.dao](#)[`Dao`](/docs/next/subgraph/reference-guide/objects/dao) > > > > -#### [Permission.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [Permission.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > > -#### [Permission.permissionId](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [Permission.permissionId](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > > -#### [Permission.pluginRepo](#)[`PluginRepo`](/docs/subgraph/reference-guide/objects/plugin-repo) +#### [Permission.pluginRepo](#)[`PluginRepo`](/docs/next/subgraph/reference-guide/objects/plugin-repo) > > > > -#### [Permission.where](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [Permission.where](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > > -#### [Permission.who](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [Permission.who](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > @@ -114,5 +114,5 @@ type Permission { ### Member Of -[`Dao`](/docs/subgraph/reference-guide/objects/dao) [`PluginRepo`](/docs/subgraph/reference-guide/objects/plugin-repo) +[`Dao`](/docs/next/subgraph/reference-guide/objects/dao) [`PluginRepo`](/docs/next/subgraph/reference-guide/objects/plugin-repo) diff --git a/docs/subgraph/reference-guide/objects/plugin-installation.mdx b/docs/subgraph/reference-guide/objects/plugin-installation.mdx index 93c88534..88c080ee 100644 --- a/docs/subgraph/reference-guide/objects/plugin-installation.mdx +++ b/docs/subgraph/reference-guide/objects/plugin-installation.mdx @@ -61,55 +61,55 @@ type PluginInstallation { ### Fields -#### [PluginInstallation.appliedPluginRepo](#)[`PluginRepo`](/docs/subgraph/reference-guide/objects/plugin-repo) +#### [PluginInstallation.appliedPluginRepo](#)[`PluginRepo`](/docs/next/subgraph/reference-guide/objects/plugin-repo) > > > > -#### [PluginInstallation.appliedPreparation](#)[`PluginPreparation`](/docs/subgraph/reference-guide/objects/plugin-preparation) +#### [PluginInstallation.appliedPreparation](#)[`PluginPreparation`](/docs/next/subgraph/reference-guide/objects/plugin-preparation) > > > > -#### [PluginInstallation.appliedSetupId](#)[`Bytes`](/docs/subgraph/reference-guide/scalars/bytes) +#### [PluginInstallation.appliedSetupId](#)[`Bytes`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > > -#### [PluginInstallation.appliedVersion](#)[`PluginVersion`](/docs/subgraph/reference-guide/objects/plugin-version) +#### [PluginInstallation.appliedVersion](#)[`PluginVersion`](/docs/next/subgraph/reference-guide/objects/plugin-version) > > > > -#### [PluginInstallation.dao](#)[`Dao!`](/docs/subgraph/reference-guide/objects/dao) +#### [PluginInstallation.dao](#)[`Dao!`](/docs/next/subgraph/reference-guide/objects/dao) > > > > -#### [PluginInstallation.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [PluginInstallation.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > > -#### [PluginInstallation.plugin](#)[`IPlugin`](/docs/subgraph/reference-guide/interfaces/iplugin) +#### [PluginInstallation.plugin](#)[`IPlugin`](/docs/next/subgraph/reference-guide/interfaces/iplugin) > > > > -#### [PluginInstallation.preparations](#)[`[PluginPreparation!]!`](/docs/subgraph/reference-guide/objects/plugin-preparation) +#### [PluginInstallation.preparations](#)[`[PluginPreparation!]!`](/docs/next/subgraph/reference-guide/objects/plugin-preparation) > > > > -#### [PluginInstallation.state](#)[`PluginPreparationState!`](/docs/subgraph/reference-guide/enums/plugin-preparation-state) +#### [PluginInstallation.state](#)[`PluginPreparationState!`](/docs/next/subgraph/reference-guide/enums/plugin-preparation-state) > > > @@ -121,5 +121,5 @@ type PluginInstallation { ### Member Of -[`AddresslistVotingPlugin`](/docs/subgraph/reference-guide/objects/addresslist-voting-plugin) [`AdminPlugin`](/docs/subgraph/reference-guide/objects/admin-plugin) [`Dao`](/docs/subgraph/reference-guide/objects/dao) [`IPlugin`](/docs/subgraph/reference-guide/interfaces/iplugin) [`MultisigPlugin`](/docs/subgraph/reference-guide/objects/multisig-plugin) [`PluginPreparation`](/docs/subgraph/reference-guide/objects/plugin-preparation) [`PluginRepo`](/docs/subgraph/reference-guide/objects/plugin-repo) [`PluginVersion`](/docs/subgraph/reference-guide/objects/plugin-version) [`TokenVotingPlugin`](/docs/subgraph/reference-guide/objects/token-voting-plugin) +[`AddresslistVotingPlugin`](/docs/next/subgraph/reference-guide/objects/addresslist-voting-plugin) [`AdminPlugin`](/docs/next/subgraph/reference-guide/objects/admin-plugin) [`Dao`](/docs/next/subgraph/reference-guide/objects/dao) [`IPlugin`](/docs/next/subgraph/reference-guide/interfaces/iplugin) [`MultisigPlugin`](/docs/next/subgraph/reference-guide/objects/multisig-plugin) [`PluginPreparation`](/docs/next/subgraph/reference-guide/objects/plugin-preparation) [`PluginRepo`](/docs/next/subgraph/reference-guide/objects/plugin-repo) [`PluginVersion`](/docs/next/subgraph/reference-guide/objects/plugin-version) [`TokenVotingPlugin`](/docs/next/subgraph/reference-guide/objects/token-voting-plugin) diff --git a/docs/subgraph/reference-guide/objects/plugin-permission.mdx b/docs/subgraph/reference-guide/objects/plugin-permission.mdx index 80e35d19..520c5508 100644 --- a/docs/subgraph/reference-guide/objects/plugin-permission.mdx +++ b/docs/subgraph/reference-guide/objects/plugin-permission.mdx @@ -59,43 +59,43 @@ type PluginPermission { ### Fields -#### [PluginPermission.condition](#)[`Bytes`](/docs/subgraph/reference-guide/scalars/bytes) +#### [PluginPermission.condition](#)[`Bytes`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > > -#### [PluginPermission.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [PluginPermission.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > > -#### [PluginPermission.operation](#)[`PermissionOperation!`](/docs/subgraph/reference-guide/enums/permission-operation) +#### [PluginPermission.operation](#)[`PermissionOperation!`](/docs/next/subgraph/reference-guide/enums/permission-operation) > > > > -#### [PluginPermission.permissionId](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [PluginPermission.permissionId](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > > -#### [PluginPermission.pluginPreparation](#)[`PluginPreparation!`](/docs/subgraph/reference-guide/objects/plugin-preparation) +#### [PluginPermission.pluginPreparation](#)[`PluginPreparation!`](/docs/next/subgraph/reference-guide/objects/plugin-preparation) > > > > -#### [PluginPermission.where](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [PluginPermission.where](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > > -#### [PluginPermission.who](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [PluginPermission.who](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > @@ -107,5 +107,5 @@ type PluginPermission { ### Member Of -[`PluginPreparation`](/docs/subgraph/reference-guide/objects/plugin-preparation) +[`PluginPreparation`](/docs/next/subgraph/reference-guide/objects/plugin-preparation) diff --git a/docs/subgraph/reference-guide/objects/plugin-preparation.mdx b/docs/subgraph/reference-guide/objects/plugin-preparation.mdx index 87c288c7..a48a4311 100644 --- a/docs/subgraph/reference-guide/objects/plugin-preparation.mdx +++ b/docs/subgraph/reference-guide/objects/plugin-preparation.mdx @@ -64,73 +64,73 @@ type PluginPreparation { ### Fields -#### [PluginPreparation.creator](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [PluginPreparation.creator](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > > -#### [PluginPreparation.dao](#)[`Dao!`](/docs/subgraph/reference-guide/objects/dao) +#### [PluginPreparation.dao](#)[`Dao!`](/docs/next/subgraph/reference-guide/objects/dao) > > > > -#### [PluginPreparation.data](#)[`Bytes`](/docs/subgraph/reference-guide/scalars/bytes) +#### [PluginPreparation.data](#)[`Bytes`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > > -#### [PluginPreparation.helpers](#)[`[Bytes!]!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [PluginPreparation.helpers](#)[`[Bytes!]!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > > -#### [PluginPreparation.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [PluginPreparation.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > > -#### [PluginPreparation.installation](#)[`PluginInstallation!`](/docs/subgraph/reference-guide/objects/plugin-installation) +#### [PluginPreparation.installation](#)[`PluginInstallation!`](/docs/next/subgraph/reference-guide/objects/plugin-installation) > > > > -#### [PluginPreparation.permissions](#)[`[PluginPermission!]!`](/docs/subgraph/reference-guide/objects/plugin-permission) +#### [PluginPreparation.permissions](#)[`[PluginPermission!]!`](/docs/next/subgraph/reference-guide/objects/plugin-permission) > > > > -#### [PluginPreparation.pluginAddress](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [PluginPreparation.pluginAddress](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > > -#### [PluginPreparation.pluginRepo](#)[`PluginRepo!`](/docs/subgraph/reference-guide/objects/plugin-repo) +#### [PluginPreparation.pluginRepo](#)[`PluginRepo!`](/docs/next/subgraph/reference-guide/objects/plugin-repo) > > > > -#### [PluginPreparation.pluginVersion](#)[`PluginVersion!`](/docs/subgraph/reference-guide/objects/plugin-version) +#### [PluginPreparation.pluginVersion](#)[`PluginVersion!`](/docs/next/subgraph/reference-guide/objects/plugin-version) > > > > -#### [PluginPreparation.preparedSetupId](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [PluginPreparation.preparedSetupId](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > > -#### [PluginPreparation.type](#)[`PluginPreparationType!`](/docs/subgraph/reference-guide/enums/plugin-preparation-type) +#### [PluginPreparation.type](#)[`PluginPreparationType!`](/docs/next/subgraph/reference-guide/enums/plugin-preparation-type) > > > @@ -142,5 +142,5 @@ type PluginPreparation { ### Member Of -[`PluginInstallation`](/docs/subgraph/reference-guide/objects/plugin-installation) [`PluginPermission`](/docs/subgraph/reference-guide/objects/plugin-permission) [`PluginRepo`](/docs/subgraph/reference-guide/objects/plugin-repo) [`PluginVersion`](/docs/subgraph/reference-guide/objects/plugin-version) +[`PluginInstallation`](/docs/next/subgraph/reference-guide/objects/plugin-installation) [`PluginPermission`](/docs/next/subgraph/reference-guide/objects/plugin-permission) [`PluginRepo`](/docs/next/subgraph/reference-guide/objects/plugin-repo) [`PluginVersion`](/docs/next/subgraph/reference-guide/objects/plugin-version) diff --git a/docs/subgraph/reference-guide/objects/plugin-release.mdx b/docs/subgraph/reference-guide/objects/plugin-release.mdx index 38abcea2..f90a0d31 100644 --- a/docs/subgraph/reference-guide/objects/plugin-release.mdx +++ b/docs/subgraph/reference-guide/objects/plugin-release.mdx @@ -57,31 +57,31 @@ type PluginRelease { ### Fields -#### [PluginRelease.builds](#)[`[PluginVersion!]!`](/docs/subgraph/reference-guide/objects/plugin-version) +#### [PluginRelease.builds](#)[`[PluginVersion!]!`](/docs/next/subgraph/reference-guide/objects/plugin-version) > > > > -#### [PluginRelease.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [PluginRelease.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > > -#### [PluginRelease.metadata](#)[`String!`](/docs/subgraph/reference-guide/scalars/string) +#### [PluginRelease.metadata](#)[`String!`](/docs/next/subgraph/reference-guide/scalars/string) > > > > -#### [PluginRelease.pluginRepo](#)[`PluginRepo!`](/docs/subgraph/reference-guide/objects/plugin-repo) +#### [PluginRelease.pluginRepo](#)[`PluginRepo!`](/docs/next/subgraph/reference-guide/objects/plugin-repo) > > > > -#### [PluginRelease.release](#)[`Int!`](/docs/subgraph/reference-guide/scalars/int) +#### [PluginRelease.release](#)[`Int!`](/docs/next/subgraph/reference-guide/scalars/int) > > > @@ -93,5 +93,5 @@ type PluginRelease { ### Member Of -[`PluginRepo`](/docs/subgraph/reference-guide/objects/plugin-repo) [`PluginVersion`](/docs/subgraph/reference-guide/objects/plugin-version) +[`PluginRepo`](/docs/next/subgraph/reference-guide/objects/plugin-repo) [`PluginVersion`](/docs/next/subgraph/reference-guide/objects/plugin-version) diff --git a/docs/subgraph/reference-guide/objects/plugin-repo.mdx b/docs/subgraph/reference-guide/objects/plugin-repo.mdx index 5c402e21..625d0225 100644 --- a/docs/subgraph/reference-guide/objects/plugin-repo.mdx +++ b/docs/subgraph/reference-guide/objects/plugin-repo.mdx @@ -58,37 +58,37 @@ type PluginRepo { ### Fields -#### [PluginRepo.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [PluginRepo.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > > -#### [PluginRepo.installations](#)[`[PluginInstallation!]`](/docs/subgraph/reference-guide/objects/plugin-installation) +#### [PluginRepo.installations](#)[`[PluginInstallation!]`](/docs/next/subgraph/reference-guide/objects/plugin-installation) > > > > -#### [PluginRepo.permissions](#)[`[Permission!]!`](/docs/subgraph/reference-guide/objects/permission) +#### [PluginRepo.permissions](#)[`[Permission!]!`](/docs/next/subgraph/reference-guide/objects/permission) > > > > -#### [PluginRepo.preparations](#)[`[PluginPreparation!]!`](/docs/subgraph/reference-guide/objects/plugin-preparation) +#### [PluginRepo.preparations](#)[`[PluginPreparation!]!`](/docs/next/subgraph/reference-guide/objects/plugin-preparation) > > > > -#### [PluginRepo.releases](#)[`[PluginRelease!]!`](/docs/subgraph/reference-guide/objects/plugin-release) +#### [PluginRepo.releases](#)[`[PluginRelease!]!`](/docs/next/subgraph/reference-guide/objects/plugin-release) > > > > -#### [PluginRepo.subdomain](#)[`String!`](/docs/subgraph/reference-guide/scalars/string) +#### [PluginRepo.subdomain](#)[`String!`](/docs/next/subgraph/reference-guide/scalars/string) > > > @@ -100,5 +100,5 @@ type PluginRepo { ### Member Of -[`Permission`](/docs/subgraph/reference-guide/objects/permission) [`PluginInstallation`](/docs/subgraph/reference-guide/objects/plugin-installation) [`PluginPreparation`](/docs/subgraph/reference-guide/objects/plugin-preparation) [`PluginRelease`](/docs/subgraph/reference-guide/objects/plugin-release) [`PluginVersion`](/docs/subgraph/reference-guide/objects/plugin-version) +[`Permission`](/docs/next/subgraph/reference-guide/objects/permission) [`PluginInstallation`](/docs/next/subgraph/reference-guide/objects/plugin-installation) [`PluginPreparation`](/docs/next/subgraph/reference-guide/objects/plugin-preparation) [`PluginRelease`](/docs/next/subgraph/reference-guide/objects/plugin-release) [`PluginVersion`](/docs/next/subgraph/reference-guide/objects/plugin-version) diff --git a/docs/subgraph/reference-guide/objects/plugin-setup.mdx b/docs/subgraph/reference-guide/objects/plugin-setup.mdx index 4f4f1c64..dafbc53f 100644 --- a/docs/subgraph/reference-guide/objects/plugin-setup.mdx +++ b/docs/subgraph/reference-guide/objects/plugin-setup.mdx @@ -54,13 +54,13 @@ type PluginSetup { ### Fields -#### [PluginSetup.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [PluginSetup.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > > -#### [PluginSetup.versions](#)[`[PluginVersion!]!`](/docs/subgraph/reference-guide/objects/plugin-version) +#### [PluginSetup.versions](#)[`[PluginVersion!]!`](/docs/next/subgraph/reference-guide/objects/plugin-version) > > > @@ -72,5 +72,5 @@ type PluginSetup { ### Member Of -[`PluginVersion`](/docs/subgraph/reference-guide/objects/plugin-version) +[`PluginVersion`](/docs/next/subgraph/reference-guide/objects/plugin-version) diff --git a/docs/subgraph/reference-guide/objects/plugin-version.mdx b/docs/subgraph/reference-guide/objects/plugin-version.mdx index 22e0a80d..cdbcf384 100644 --- a/docs/subgraph/reference-guide/objects/plugin-version.mdx +++ b/docs/subgraph/reference-guide/objects/plugin-version.mdx @@ -60,49 +60,49 @@ type PluginVersion { ### Fields -#### [PluginVersion.build](#)[`Int!`](/docs/subgraph/reference-guide/scalars/int) +#### [PluginVersion.build](#)[`Int!`](/docs/next/subgraph/reference-guide/scalars/int) > > > > -#### [PluginVersion.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [PluginVersion.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > > -#### [PluginVersion.installations](#)[`[PluginInstallation!]`](/docs/subgraph/reference-guide/objects/plugin-installation) +#### [PluginVersion.installations](#)[`[PluginInstallation!]`](/docs/next/subgraph/reference-guide/objects/plugin-installation) > > > > -#### [PluginVersion.metadata](#)[`String!`](/docs/subgraph/reference-guide/scalars/string) +#### [PluginVersion.metadata](#)[`String!`](/docs/next/subgraph/reference-guide/scalars/string) > > > > -#### [PluginVersion.pluginRepo](#)[`PluginRepo!`](/docs/subgraph/reference-guide/objects/plugin-repo) +#### [PluginVersion.pluginRepo](#)[`PluginRepo!`](/docs/next/subgraph/reference-guide/objects/plugin-repo) > > > > -#### [PluginVersion.pluginSetup](#)[`PluginSetup`](/docs/subgraph/reference-guide/objects/plugin-setup) +#### [PluginVersion.pluginSetup](#)[`PluginSetup`](/docs/next/subgraph/reference-guide/objects/plugin-setup) > > > > -#### [PluginVersion.preparations](#)[`[PluginPreparation!]!`](/docs/subgraph/reference-guide/objects/plugin-preparation) +#### [PluginVersion.preparations](#)[`[PluginPreparation!]!`](/docs/next/subgraph/reference-guide/objects/plugin-preparation) > > > > -#### [PluginVersion.release](#)[`PluginRelease!`](/docs/subgraph/reference-guide/objects/plugin-release) +#### [PluginVersion.release](#)[`PluginRelease!`](/docs/next/subgraph/reference-guide/objects/plugin-release) > > > @@ -114,5 +114,5 @@ type PluginVersion { ### Member Of -[`PluginInstallation`](/docs/subgraph/reference-guide/objects/plugin-installation) [`PluginPreparation`](/docs/subgraph/reference-guide/objects/plugin-preparation) [`PluginRelease`](/docs/subgraph/reference-guide/objects/plugin-release) [`PluginSetup`](/docs/subgraph/reference-guide/objects/plugin-setup) +[`PluginInstallation`](/docs/next/subgraph/reference-guide/objects/plugin-installation) [`PluginPreparation`](/docs/next/subgraph/reference-guide/objects/plugin-preparation) [`PluginRelease`](/docs/next/subgraph/reference-guide/objects/plugin-release) [`PluginSetup`](/docs/next/subgraph/reference-guide/objects/plugin-setup) diff --git a/docs/subgraph/reference-guide/objects/query.mdx b/docs/subgraph/reference-guide/objects/query.mdx index 7eabd824..66eb5d0c 100644 --- a/docs/subgraph/reference-guide/objects/query.mdx +++ b/docs/subgraph/reference-guide/objects/query.mdx @@ -54,7 +54,7 @@ type Query { ### Fields -#### [Query.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [Query.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > diff --git a/docs/subgraph/reference-guide/objects/standard-callback.mdx b/docs/subgraph/reference-guide/objects/standard-callback.mdx index 3909b010..de11de68 100644 --- a/docs/subgraph/reference-guide/objects/standard-callback.mdx +++ b/docs/subgraph/reference-guide/objects/standard-callback.mdx @@ -57,31 +57,31 @@ type StandardCallback { ### Fields -#### [StandardCallback.callbackSelector](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [StandardCallback.callbackSelector](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > The selector of the registered callback function. > -#### [StandardCallback.dao](#)[`Dao!`](/docs/subgraph/reference-guide/objects/dao) +#### [StandardCallback.dao](#)[`Dao!`](/docs/next/subgraph/reference-guide/objects/dao) > > > The DAO associated with the supported callback functions. > -#### [StandardCallback.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [StandardCallback.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > Concatenation of the DAO address and the interfaceID. Joined by '_'. > -#### [StandardCallback.interfaceId](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [StandardCallback.interfaceId](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > The interface identifier, as specified in [ERC-165](https://eips.ethereum.org/EIPS/eip-165) (XOR of all function selectors in the interface). > -#### [StandardCallback.magicNumber](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [StandardCallback.magicNumber](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > The magic number registered for the function signature. @@ -93,5 +93,5 @@ type StandardCallback { ### Member Of -[`Dao`](/docs/subgraph/reference-guide/objects/dao) +[`Dao`](/docs/next/subgraph/reference-guide/objects/dao) diff --git a/docs/subgraph/reference-guide/objects/token-voting-member.mdx b/docs/subgraph/reference-guide/objects/token-voting-member.mdx index 74128932..2464a6e0 100644 --- a/docs/subgraph/reference-guide/objects/token-voting-member.mdx +++ b/docs/subgraph/reference-guide/objects/token-voting-member.mdx @@ -59,43 +59,43 @@ type TokenVotingMember { ### Fields -#### [TokenVotingMember.address](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [TokenVotingMember.address](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > > -#### [TokenVotingMember.balance](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [TokenVotingMember.balance](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [TokenVotingMember.delegatee](#)[`TokenVotingMember`](/docs/subgraph/reference-guide/objects/token-voting-member) +#### [TokenVotingMember.delegatee](#)[`TokenVotingMember`](/docs/next/subgraph/reference-guide/objects/token-voting-member) > > > > -#### [TokenVotingMember.delegators](#)[`[TokenVotingMember!]!`](/docs/subgraph/reference-guide/objects/token-voting-member) +#### [TokenVotingMember.delegators](#)[`[TokenVotingMember!]!`](/docs/next/subgraph/reference-guide/objects/token-voting-member) > > > > -#### [TokenVotingMember.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [TokenVotingMember.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > > -#### [TokenVotingMember.plugin](#)[`TokenVotingPlugin!`](/docs/subgraph/reference-guide/objects/token-voting-plugin) +#### [TokenVotingMember.plugin](#)[`TokenVotingPlugin!`](/docs/next/subgraph/reference-guide/objects/token-voting-plugin) > > > > -#### [TokenVotingMember.votingPower](#)[`BigInt`](/docs/subgraph/reference-guide/scalars/big-int) +#### [TokenVotingMember.votingPower](#)[`BigInt`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > @@ -107,5 +107,5 @@ type TokenVotingMember { ### Member Of -[`TokenVotingMember`](/docs/subgraph/reference-guide/objects/token-voting-member) [`TokenVotingPlugin`](/docs/subgraph/reference-guide/objects/token-voting-plugin) +[`TokenVotingMember`](/docs/next/subgraph/reference-guide/objects/token-voting-member) [`TokenVotingPlugin`](/docs/next/subgraph/reference-guide/objects/token-voting-plugin) diff --git a/docs/subgraph/reference-guide/objects/token-voting-plugin.mdx b/docs/subgraph/reference-guide/objects/token-voting-plugin.mdx index e4132c63..cd556775 100644 --- a/docs/subgraph/reference-guide/objects/token-voting-plugin.mdx +++ b/docs/subgraph/reference-guide/objects/token-voting-plugin.mdx @@ -65,79 +65,79 @@ type TokenVotingPlugin implements IPlugin { ### Fields -#### [TokenVotingPlugin.dao](#)[`Dao!`](/docs/subgraph/reference-guide/objects/dao) +#### [TokenVotingPlugin.dao](#)[`Dao!`](/docs/next/subgraph/reference-guide/objects/dao) > > > > -#### [TokenVotingPlugin.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [TokenVotingPlugin.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > TODO: attributes should be appended to Plugins once plugin is separated from Aragon OSx > -#### [TokenVotingPlugin.installations](#)[`[PluginInstallation!]!`](/docs/subgraph/reference-guide/objects/plugin-installation) +#### [TokenVotingPlugin.installations](#)[`[PluginInstallation!]!`](/docs/next/subgraph/reference-guide/objects/plugin-installation) > > > > -#### [TokenVotingPlugin.members](#)[`[TokenVotingMember!]!`](/docs/subgraph/reference-guide/objects/token-voting-member) +#### [TokenVotingPlugin.members](#)[`[TokenVotingMember!]!`](/docs/next/subgraph/reference-guide/objects/token-voting-member) > > > > -#### [TokenVotingPlugin.minDuration](#)[`BigInt`](/docs/subgraph/reference-guide/scalars/big-int) +#### [TokenVotingPlugin.minDuration](#)[`BigInt`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [TokenVotingPlugin.minParticipation](#)[`BigInt`](/docs/subgraph/reference-guide/scalars/big-int) +#### [TokenVotingPlugin.minParticipation](#)[`BigInt`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [TokenVotingPlugin.minProposerVotingPower](#)[`BigInt`](/docs/subgraph/reference-guide/scalars/big-int) +#### [TokenVotingPlugin.minProposerVotingPower](#)[`BigInt`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [TokenVotingPlugin.pluginAddress](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [TokenVotingPlugin.pluginAddress](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > > -#### [TokenVotingPlugin.proposalCount](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [TokenVotingPlugin.proposalCount](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [TokenVotingPlugin.proposals](#)[`[TokenVotingProposal!]!`](/docs/subgraph/reference-guide/objects/token-voting-proposal) +#### [TokenVotingPlugin.proposals](#)[`[TokenVotingProposal!]!`](/docs/next/subgraph/reference-guide/objects/token-voting-proposal) > > > > -#### [TokenVotingPlugin.supportThreshold](#)[`BigInt`](/docs/subgraph/reference-guide/scalars/big-int) +#### [TokenVotingPlugin.supportThreshold](#)[`BigInt`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [TokenVotingPlugin.token](#)[`Token`](/docs/subgraph/reference-guide/interfaces/token) +#### [TokenVotingPlugin.token](#)[`Token`](/docs/next/subgraph/reference-guide/interfaces/token) > > > > -#### [TokenVotingPlugin.votingMode](#)[`VotingMode`](/docs/subgraph/reference-guide/enums/voting-mode) +#### [TokenVotingPlugin.votingMode](#)[`VotingMode`](/docs/next/subgraph/reference-guide/enums/voting-mode) > > > @@ -145,7 +145,7 @@ type TokenVotingPlugin implements IPlugin { ### Interfaces -#### [`IPlugin`](/docs/subgraph/reference-guide/interfaces/iplugin) +#### [`IPlugin`](/docs/next/subgraph/reference-guide/interfaces/iplugin) > > > @@ -157,5 +157,5 @@ type TokenVotingPlugin implements IPlugin { ### Member Of -[`TokenVotingMember`](/docs/subgraph/reference-guide/objects/token-voting-member) [`TokenVotingProposal`](/docs/subgraph/reference-guide/objects/token-voting-proposal) [`TokenVotingVoter`](/docs/subgraph/reference-guide/objects/token-voting-voter) +[`TokenVotingMember`](/docs/next/subgraph/reference-guide/objects/token-voting-member) [`TokenVotingProposal`](/docs/next/subgraph/reference-guide/objects/token-voting-proposal) [`TokenVotingVoter`](/docs/next/subgraph/reference-guide/objects/token-voting-voter) diff --git a/docs/subgraph/reference-guide/objects/token-voting-proposal.mdx b/docs/subgraph/reference-guide/objects/token-voting-proposal.mdx index 0c870aef..cf073d86 100644 --- a/docs/subgraph/reference-guide/objects/token-voting-proposal.mdx +++ b/docs/subgraph/reference-guide/objects/token-voting-proposal.mdx @@ -83,187 +83,187 @@ type TokenVotingProposal implements IProposal { ### Fields -#### [TokenVotingProposal.abstain](#)[`BigInt`](/docs/subgraph/reference-guide/scalars/big-int) +#### [TokenVotingProposal.abstain](#)[`BigInt`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [TokenVotingProposal.actions](#)[`[Action!]!`](/docs/subgraph/reference-guide/objects/action) +#### [TokenVotingProposal.actions](#)[`[Action!]!`](/docs/next/subgraph/reference-guide/objects/action) > > > > -#### [TokenVotingProposal.allowFailureMap](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [TokenVotingProposal.allowFailureMap](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [TokenVotingProposal.approvalReached](#)[`Boolean!`](/docs/subgraph/reference-guide/scalars/boolean) +#### [TokenVotingProposal.approvalReached](#)[`Boolean!`](/docs/next/subgraph/reference-guide/scalars/boolean) > > > > -#### [TokenVotingProposal.castedVotingPower](#)[`BigInt`](/docs/subgraph/reference-guide/scalars/big-int) +#### [TokenVotingProposal.castedVotingPower](#)[`BigInt`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [TokenVotingProposal.createdAt](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [TokenVotingProposal.createdAt](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [TokenVotingProposal.creationBlockNumber](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [TokenVotingProposal.creationBlockNumber](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [TokenVotingProposal.creator](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [TokenVotingProposal.creator](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > > -#### [TokenVotingProposal.dao](#)[`Dao!`](/docs/subgraph/reference-guide/objects/dao) +#### [TokenVotingProposal.dao](#)[`Dao!`](/docs/next/subgraph/reference-guide/objects/dao) > > > > -#### [TokenVotingProposal.earlyExecutable](#)[`Boolean`](/docs/subgraph/reference-guide/scalars/boolean) +#### [TokenVotingProposal.earlyExecutable](#)[`Boolean`](/docs/next/subgraph/reference-guide/scalars/boolean) > > > > -#### [TokenVotingProposal.endDate](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [TokenVotingProposal.endDate](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [TokenVotingProposal.executed](#)[`Boolean!`](/docs/subgraph/reference-guide/scalars/boolean) +#### [TokenVotingProposal.executed](#)[`Boolean!`](/docs/next/subgraph/reference-guide/scalars/boolean) > > > > -#### [TokenVotingProposal.executionBlockNumber](#)[`BigInt`](/docs/subgraph/reference-guide/scalars/big-int) +#### [TokenVotingProposal.executionBlockNumber](#)[`BigInt`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [TokenVotingProposal.executionDate](#)[`BigInt`](/docs/subgraph/reference-guide/scalars/big-int) +#### [TokenVotingProposal.executionDate](#)[`BigInt`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [TokenVotingProposal.executionTxHash](#)[`Bytes`](/docs/subgraph/reference-guide/scalars/bytes) +#### [TokenVotingProposal.executionTxHash](#)[`Bytes`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > > -#### [TokenVotingProposal.failureMap](#)[`BigInt`](/docs/subgraph/reference-guide/scalars/big-int) +#### [TokenVotingProposal.failureMap](#)[`BigInt`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [TokenVotingProposal.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [TokenVotingProposal.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > > -#### [TokenVotingProposal.isSignaling](#)[`Boolean!`](/docs/subgraph/reference-guide/scalars/boolean) +#### [TokenVotingProposal.isSignaling](#)[`Boolean!`](/docs/next/subgraph/reference-guide/scalars/boolean) > > > > -#### [TokenVotingProposal.metadata](#)[`String`](/docs/subgraph/reference-guide/scalars/string) +#### [TokenVotingProposal.metadata](#)[`String`](/docs/next/subgraph/reference-guide/scalars/string) > > > > -#### [TokenVotingProposal.minVotingPower](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [TokenVotingProposal.minVotingPower](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [TokenVotingProposal.no](#)[`BigInt`](/docs/subgraph/reference-guide/scalars/big-int) +#### [TokenVotingProposal.no](#)[`BigInt`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [TokenVotingProposal.open](#)[`Boolean!`](/docs/subgraph/reference-guide/scalars/boolean) +#### [TokenVotingProposal.open](#)[`Boolean!`](/docs/next/subgraph/reference-guide/scalars/boolean) > > > > -#### [TokenVotingProposal.plugin](#)[`TokenVotingPlugin!`](/docs/subgraph/reference-guide/objects/token-voting-plugin) +#### [TokenVotingProposal.plugin](#)[`TokenVotingPlugin!`](/docs/next/subgraph/reference-guide/objects/token-voting-plugin) > > > > -#### [TokenVotingProposal.pluginProposalId](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [TokenVotingProposal.pluginProposalId](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [TokenVotingProposal.snapshotBlock](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [TokenVotingProposal.snapshotBlock](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [TokenVotingProposal.startDate](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [TokenVotingProposal.startDate](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [TokenVotingProposal.supportThreshold](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [TokenVotingProposal.supportThreshold](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [TokenVotingProposal.totalVotingPower](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [TokenVotingProposal.totalVotingPower](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [TokenVotingProposal.voters](#)[`[TokenVotingVote!]!`](/docs/subgraph/reference-guide/objects/token-voting-vote) +#### [TokenVotingProposal.voters](#)[`[TokenVotingVote!]!`](/docs/next/subgraph/reference-guide/objects/token-voting-vote) > > > > -#### [TokenVotingProposal.votingMode](#)[`VotingMode!`](/docs/subgraph/reference-guide/enums/voting-mode) +#### [TokenVotingProposal.votingMode](#)[`VotingMode!`](/docs/next/subgraph/reference-guide/enums/voting-mode) > > > > -#### [TokenVotingProposal.yes](#)[`BigInt`](/docs/subgraph/reference-guide/scalars/big-int) +#### [TokenVotingProposal.yes](#)[`BigInt`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > @@ -271,7 +271,7 @@ type TokenVotingProposal implements IProposal { ### Interfaces -#### [`IProposal`](/docs/subgraph/reference-guide/interfaces/iproposal) +#### [`IProposal`](/docs/next/subgraph/reference-guide/interfaces/iproposal) > > > @@ -283,5 +283,5 @@ type TokenVotingProposal implements IProposal { ### Member Of -[`TokenVotingPlugin`](/docs/subgraph/reference-guide/objects/token-voting-plugin) [`TokenVotingVote`](/docs/subgraph/reference-guide/objects/token-voting-vote) +[`TokenVotingPlugin`](/docs/next/subgraph/reference-guide/objects/token-voting-plugin) [`TokenVotingVote`](/docs/next/subgraph/reference-guide/objects/token-voting-vote) diff --git a/docs/subgraph/reference-guide/objects/token-voting-vote.mdx b/docs/subgraph/reference-guide/objects/token-voting-vote.mdx index 03a74047..185996cb 100644 --- a/docs/subgraph/reference-guide/objects/token-voting-vote.mdx +++ b/docs/subgraph/reference-guide/objects/token-voting-vote.mdx @@ -60,49 +60,49 @@ type TokenVotingVote { ### Fields -#### [TokenVotingVote.createdAt](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [TokenVotingVote.createdAt](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [TokenVotingVote.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [TokenVotingVote.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > VoterProposal for Many-to-Many > -#### [TokenVotingVote.proposal](#)[`TokenVotingProposal!`](/docs/subgraph/reference-guide/objects/token-voting-proposal) +#### [TokenVotingVote.proposal](#)[`TokenVotingProposal!`](/docs/next/subgraph/reference-guide/objects/token-voting-proposal) > > > > -#### [TokenVotingVote.updatedAt](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [TokenVotingVote.updatedAt](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [TokenVotingVote.voteOption](#)[`VoteOption!`](/docs/subgraph/reference-guide/enums/vote-option) +#### [TokenVotingVote.voteOption](#)[`VoteOption!`](/docs/next/subgraph/reference-guide/enums/vote-option) > > > > -#### [TokenVotingVote.voteReplaced](#)[`Boolean!`](/docs/subgraph/reference-guide/scalars/boolean) +#### [TokenVotingVote.voteReplaced](#)[`Boolean!`](/docs/next/subgraph/reference-guide/scalars/boolean) > > > > -#### [TokenVotingVote.voter](#)[`TokenVotingVoter!`](/docs/subgraph/reference-guide/objects/token-voting-voter) +#### [TokenVotingVote.voter](#)[`TokenVotingVoter!`](/docs/next/subgraph/reference-guide/objects/token-voting-voter) > > > > -#### [TokenVotingVote.votingPower](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [TokenVotingVote.votingPower](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > @@ -114,5 +114,5 @@ type TokenVotingVote { ### Member Of -[`TokenVotingProposal`](/docs/subgraph/reference-guide/objects/token-voting-proposal) [`TokenVotingVoter`](/docs/subgraph/reference-guide/objects/token-voting-voter) +[`TokenVotingProposal`](/docs/next/subgraph/reference-guide/objects/token-voting-proposal) [`TokenVotingVoter`](/docs/next/subgraph/reference-guide/objects/token-voting-voter) diff --git a/docs/subgraph/reference-guide/objects/token-voting-voter.mdx b/docs/subgraph/reference-guide/objects/token-voting-voter.mdx index f2a37ae2..c5becdfa 100644 --- a/docs/subgraph/reference-guide/objects/token-voting-voter.mdx +++ b/docs/subgraph/reference-guide/objects/token-voting-voter.mdx @@ -57,31 +57,31 @@ type TokenVotingVoter { ### Fields -#### [TokenVotingVoter.address](#)[`String!`](/docs/subgraph/reference-guide/scalars/string) +#### [TokenVotingVoter.address](#)[`String!`](/docs/next/subgraph/reference-guide/scalars/string) > > > > -#### [TokenVotingVoter.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [TokenVotingVoter.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > > -#### [TokenVotingVoter.lastUpdated](#)[`BigInt`](/docs/subgraph/reference-guide/scalars/big-int) +#### [TokenVotingVoter.lastUpdated](#)[`BigInt`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [TokenVotingVoter.plugin](#)[`TokenVotingPlugin!`](/docs/subgraph/reference-guide/objects/token-voting-plugin) +#### [TokenVotingVoter.plugin](#)[`TokenVotingPlugin!`](/docs/next/subgraph/reference-guide/objects/token-voting-plugin) > > > > -#### [TokenVotingVoter.proposals](#)[`[TokenVotingVote!]!`](/docs/subgraph/reference-guide/objects/token-voting-vote) +#### [TokenVotingVoter.proposals](#)[`[TokenVotingVote!]!`](/docs/next/subgraph/reference-guide/objects/token-voting-vote) > > > @@ -93,5 +93,5 @@ type TokenVotingVoter { ### Member Of -[`TokenVotingVote`](/docs/subgraph/reference-guide/objects/token-voting-vote) +[`TokenVotingVote`](/docs/next/subgraph/reference-guide/objects/token-voting-vote) diff --git a/docs/subgraph/reference-guide/objects/transaction-actions-proposal.mdx b/docs/subgraph/reference-guide/objects/transaction-actions-proposal.mdx index 57631d1c..bfbfa16e 100644 --- a/docs/subgraph/reference-guide/objects/transaction-actions-proposal.mdx +++ b/docs/subgraph/reference-guide/objects/transaction-actions-proposal.mdx @@ -64,73 +64,73 @@ type TransactionActionsProposal implements IProposal { ### Fields -#### [TransactionActionsProposal.actions](#)[`[Action!]!`](/docs/subgraph/reference-guide/objects/action) +#### [TransactionActionsProposal.actions](#)[`[Action!]!`](/docs/next/subgraph/reference-guide/objects/action) > > > > -#### [TransactionActionsProposal.allowFailureMap](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [TransactionActionsProposal.allowFailureMap](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [TransactionActionsProposal.createdAt](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [TransactionActionsProposal.createdAt](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [TransactionActionsProposal.creator](#)[`Bytes!`](/docs/subgraph/reference-guide/scalars/bytes) +#### [TransactionActionsProposal.creator](#)[`Bytes!`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > > -#### [TransactionActionsProposal.dao](#)[`Dao!`](/docs/subgraph/reference-guide/objects/dao) +#### [TransactionActionsProposal.dao](#)[`Dao!`](/docs/next/subgraph/reference-guide/objects/dao) > > > > -#### [TransactionActionsProposal.endDate](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [TransactionActionsProposal.endDate](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [TransactionActionsProposal.executed](#)[`Boolean!`](/docs/subgraph/reference-guide/scalars/boolean) +#### [TransactionActionsProposal.executed](#)[`Boolean!`](/docs/next/subgraph/reference-guide/scalars/boolean) > > > > -#### [TransactionActionsProposal.executionTxHash](#)[`Bytes`](/docs/subgraph/reference-guide/scalars/bytes) +#### [TransactionActionsProposal.executionTxHash](#)[`Bytes`](/docs/next/subgraph/reference-guide/scalars/bytes) > > > > -#### [TransactionActionsProposal.failureMap](#)[`BigInt`](/docs/subgraph/reference-guide/scalars/big-int) +#### [TransactionActionsProposal.failureMap](#)[`BigInt`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > > -#### [TransactionActionsProposal.id](#)[`ID!`](/docs/subgraph/reference-guide/scalars/id) +#### [TransactionActionsProposal.id](#)[`ID!`](/docs/next/subgraph/reference-guide/scalars/id) > > > > -#### [TransactionActionsProposal.metadata](#)[`String`](/docs/subgraph/reference-guide/scalars/string) +#### [TransactionActionsProposal.metadata](#)[`String`](/docs/next/subgraph/reference-guide/scalars/string) > > > > -#### [TransactionActionsProposal.startDate](#)[`BigInt!`](/docs/subgraph/reference-guide/scalars/big-int) +#### [TransactionActionsProposal.startDate](#)[`BigInt!`](/docs/next/subgraph/reference-guide/scalars/big-int) > > > @@ -138,7 +138,7 @@ type TransactionActionsProposal implements IProposal { ### Interfaces -#### [`IProposal`](/docs/subgraph/reference-guide/interfaces/iproposal) +#### [`IProposal`](/docs/next/subgraph/reference-guide/interfaces/iproposal) > > > diff --git a/docs/subgraph/reference-guide/scalars/big-int.mdx b/docs/subgraph/reference-guide/scalars/big-int.mdx index 3888c98a..6a692d8c 100644 --- a/docs/subgraph/reference-guide/scalars/big-int.mdx +++ b/docs/subgraph/reference-guide/scalars/big-int.mdx @@ -55,5 +55,5 @@ scalar BigInt ### Member Of -[`Action`](/docs/subgraph/reference-guide/objects/action) [`AddresslistVotingPlugin`](/docs/subgraph/reference-guide/objects/addresslist-voting-plugin) [`AddresslistVotingProposal`](/docs/subgraph/reference-guide/objects/addresslist-voting-proposal) [`AddresslistVotingVote`](/docs/subgraph/reference-guide/objects/addresslist-voting-vote) [`AdminProposal`](/docs/subgraph/reference-guide/objects/admin-proposal) [`Dao`](/docs/subgraph/reference-guide/objects/dao) [`ERC1155Balance`](/docs/subgraph/reference-guide/objects/erc1155-balance) [`ERC1155TokenIdBalance`](/docs/subgraph/reference-guide/objects/erc1155-token-id-balance) [`ERC1155Transfer`](/docs/subgraph/reference-guide/objects/erc1155-transfer) [`ERC20Balance`](/docs/subgraph/reference-guide/objects/erc20-balance) [`ERC20Transfer`](/docs/subgraph/reference-guide/objects/erc20-transfer) [`ERC721Balance`](/docs/subgraph/reference-guide/objects/erc721-balance) [`ERC721Transfer`](/docs/subgraph/reference-guide/objects/erc721-transfer) [`IProposal`](/docs/subgraph/reference-guide/interfaces/iproposal) [`MultisigPlugin`](/docs/subgraph/reference-guide/objects/multisig-plugin) [`MultisigProposal`](/docs/subgraph/reference-guide/objects/multisig-proposal) [`MultisigProposalApprover`](/docs/subgraph/reference-guide/objects/multisig-proposal-approver) [`NativeBalance`](/docs/subgraph/reference-guide/objects/native-balance) [`NativeTransfer`](/docs/subgraph/reference-guide/objects/native-transfer) [`TokenBalance`](/docs/subgraph/reference-guide/interfaces/token-balance) [`TokenTransfer`](/docs/subgraph/reference-guide/interfaces/token-transfer) [`TokenVotingMember`](/docs/subgraph/reference-guide/objects/token-voting-member) [`TokenVotingPlugin`](/docs/subgraph/reference-guide/objects/token-voting-plugin) [`TokenVotingProposal`](/docs/subgraph/reference-guide/objects/token-voting-proposal) [`TokenVotingVote`](/docs/subgraph/reference-guide/objects/token-voting-vote) [`TokenVotingVoter`](/docs/subgraph/reference-guide/objects/token-voting-voter) [`TransactionActionsProposal`](/docs/subgraph/reference-guide/objects/transaction-actions-proposal) +[`Action`](/docs/next/subgraph/reference-guide/objects/action) [`AddresslistVotingPlugin`](/docs/next/subgraph/reference-guide/objects/addresslist-voting-plugin) [`AddresslistVotingProposal`](/docs/next/subgraph/reference-guide/objects/addresslist-voting-proposal) [`AddresslistVotingVote`](/docs/next/subgraph/reference-guide/objects/addresslist-voting-vote) [`AdminProposal`](/docs/next/subgraph/reference-guide/objects/admin-proposal) [`Dao`](/docs/next/subgraph/reference-guide/objects/dao) [`ERC1155Balance`](/docs/next/subgraph/reference-guide/objects/erc1155-balance) [`ERC1155TokenIdBalance`](/docs/next/subgraph/reference-guide/objects/erc1155-token-id-balance) [`ERC1155Transfer`](/docs/next/subgraph/reference-guide/objects/erc1155-transfer) [`ERC20Balance`](/docs/next/subgraph/reference-guide/objects/erc20-balance) [`ERC20Transfer`](/docs/next/subgraph/reference-guide/objects/erc20-transfer) [`ERC721Balance`](/docs/next/subgraph/reference-guide/objects/erc721-balance) [`ERC721Transfer`](/docs/next/subgraph/reference-guide/objects/erc721-transfer) [`IProposal`](/docs/next/subgraph/reference-guide/interfaces/iproposal) [`MultisigPlugin`](/docs/next/subgraph/reference-guide/objects/multisig-plugin) [`MultisigProposal`](/docs/next/subgraph/reference-guide/objects/multisig-proposal) [`MultisigProposalApprover`](/docs/next/subgraph/reference-guide/objects/multisig-proposal-approver) [`NativeBalance`](/docs/next/subgraph/reference-guide/objects/native-balance) [`NativeTransfer`](/docs/next/subgraph/reference-guide/objects/native-transfer) [`TokenBalance`](/docs/next/subgraph/reference-guide/interfaces/token-balance) [`TokenTransfer`](/docs/next/subgraph/reference-guide/interfaces/token-transfer) [`TokenVotingMember`](/docs/next/subgraph/reference-guide/objects/token-voting-member) [`TokenVotingPlugin`](/docs/next/subgraph/reference-guide/objects/token-voting-plugin) [`TokenVotingProposal`](/docs/next/subgraph/reference-guide/objects/token-voting-proposal) [`TokenVotingVote`](/docs/next/subgraph/reference-guide/objects/token-voting-vote) [`TokenVotingVoter`](/docs/next/subgraph/reference-guide/objects/token-voting-voter) [`TransactionActionsProposal`](/docs/next/subgraph/reference-guide/objects/transaction-actions-proposal) diff --git a/docs/subgraph/reference-guide/scalars/boolean.mdx b/docs/subgraph/reference-guide/scalars/boolean.mdx index 9eb5f92c..ba3f5b43 100644 --- a/docs/subgraph/reference-guide/scalars/boolean.mdx +++ b/docs/subgraph/reference-guide/scalars/boolean.mdx @@ -55,5 +55,5 @@ scalar Boolean ### Member Of -[`AddresslistVotingProposal`](/docs/subgraph/reference-guide/objects/addresslist-voting-proposal) [`AddresslistVotingVote`](/docs/subgraph/reference-guide/objects/addresslist-voting-vote) [`AdminProposal`](/docs/subgraph/reference-guide/objects/admin-proposal) [`include`](/docs/subgraph/reference-guide/directives/include) [`IProposal`](/docs/subgraph/reference-guide/interfaces/iproposal) [`MultisigPlugin`](/docs/subgraph/reference-guide/objects/multisig-plugin) [`MultisigProposal`](/docs/subgraph/reference-guide/objects/multisig-proposal) [`skip`](/docs/subgraph/reference-guide/directives/skip) [`TokenVotingProposal`](/docs/subgraph/reference-guide/objects/token-voting-proposal) [`TokenVotingVote`](/docs/subgraph/reference-guide/objects/token-voting-vote) [`TransactionActionsProposal`](/docs/subgraph/reference-guide/objects/transaction-actions-proposal) +[`AddresslistVotingProposal`](/docs/next/subgraph/reference-guide/objects/addresslist-voting-proposal) [`AddresslistVotingVote`](/docs/next/subgraph/reference-guide/objects/addresslist-voting-vote) [`AdminProposal`](/docs/next/subgraph/reference-guide/objects/admin-proposal) [`include`](/docs/next/subgraph/reference-guide/directives/include) [`IProposal`](/docs/next/subgraph/reference-guide/interfaces/iproposal) [`MultisigPlugin`](/docs/next/subgraph/reference-guide/objects/multisig-plugin) [`MultisigProposal`](/docs/next/subgraph/reference-guide/objects/multisig-proposal) [`skip`](/docs/next/subgraph/reference-guide/directives/skip) [`TokenVotingProposal`](/docs/next/subgraph/reference-guide/objects/token-voting-proposal) [`TokenVotingVote`](/docs/next/subgraph/reference-guide/objects/token-voting-vote) [`TransactionActionsProposal`](/docs/next/subgraph/reference-guide/objects/transaction-actions-proposal) diff --git a/docs/subgraph/reference-guide/scalars/bytes.mdx b/docs/subgraph/reference-guide/scalars/bytes.mdx index 27123b32..ca3626dd 100644 --- a/docs/subgraph/reference-guide/scalars/bytes.mdx +++ b/docs/subgraph/reference-guide/scalars/bytes.mdx @@ -55,5 +55,5 @@ scalar Bytes ### Member Of -[`Action`](/docs/subgraph/reference-guide/objects/action) [`AddresslistVotingPlugin`](/docs/subgraph/reference-guide/objects/addresslist-voting-plugin) [`AddresslistVotingProposal`](/docs/subgraph/reference-guide/objects/addresslist-voting-proposal) [`AdminPlugin`](/docs/subgraph/reference-guide/objects/admin-plugin) [`AdminProposal`](/docs/subgraph/reference-guide/objects/admin-proposal) [`Dao`](/docs/subgraph/reference-guide/objects/dao) [`ERC1155Transfer`](/docs/subgraph/reference-guide/objects/erc1155-transfer) [`ERC20Transfer`](/docs/subgraph/reference-guide/objects/erc20-transfer) [`ERC721Transfer`](/docs/subgraph/reference-guide/objects/erc721-transfer) [`IPlugin`](/docs/subgraph/reference-guide/interfaces/iplugin) [`IProposal`](/docs/subgraph/reference-guide/interfaces/iproposal) [`MultisigPlugin`](/docs/subgraph/reference-guide/objects/multisig-plugin) [`MultisigProposal`](/docs/subgraph/reference-guide/objects/multisig-proposal) [`NativeTransfer`](/docs/subgraph/reference-guide/objects/native-transfer) [`Permission`](/docs/subgraph/reference-guide/objects/permission) [`PluginInstallation`](/docs/subgraph/reference-guide/objects/plugin-installation) [`PluginPermission`](/docs/subgraph/reference-guide/objects/plugin-permission) [`PluginPreparation`](/docs/subgraph/reference-guide/objects/plugin-preparation) [`StandardCallback`](/docs/subgraph/reference-guide/objects/standard-callback) [`TokenTransfer`](/docs/subgraph/reference-guide/interfaces/token-transfer) [`TokenVotingMember`](/docs/subgraph/reference-guide/objects/token-voting-member) [`TokenVotingPlugin`](/docs/subgraph/reference-guide/objects/token-voting-plugin) [`TokenVotingProposal`](/docs/subgraph/reference-guide/objects/token-voting-proposal) [`TransactionActionsProposal`](/docs/subgraph/reference-guide/objects/transaction-actions-proposal) +[`Action`](/docs/next/subgraph/reference-guide/objects/action) [`AddresslistVotingPlugin`](/docs/next/subgraph/reference-guide/objects/addresslist-voting-plugin) [`AddresslistVotingProposal`](/docs/next/subgraph/reference-guide/objects/addresslist-voting-proposal) [`AdminPlugin`](/docs/next/subgraph/reference-guide/objects/admin-plugin) [`AdminProposal`](/docs/next/subgraph/reference-guide/objects/admin-proposal) [`Dao`](/docs/next/subgraph/reference-guide/objects/dao) [`ERC1155Transfer`](/docs/next/subgraph/reference-guide/objects/erc1155-transfer) [`ERC20Transfer`](/docs/next/subgraph/reference-guide/objects/erc20-transfer) [`ERC721Transfer`](/docs/next/subgraph/reference-guide/objects/erc721-transfer) [`IPlugin`](/docs/next/subgraph/reference-guide/interfaces/iplugin) [`IProposal`](/docs/next/subgraph/reference-guide/interfaces/iproposal) [`MultisigPlugin`](/docs/next/subgraph/reference-guide/objects/multisig-plugin) [`MultisigProposal`](/docs/next/subgraph/reference-guide/objects/multisig-proposal) [`NativeTransfer`](/docs/next/subgraph/reference-guide/objects/native-transfer) [`Permission`](/docs/next/subgraph/reference-guide/objects/permission) [`PluginInstallation`](/docs/next/subgraph/reference-guide/objects/plugin-installation) [`PluginPermission`](/docs/next/subgraph/reference-guide/objects/plugin-permission) [`PluginPreparation`](/docs/next/subgraph/reference-guide/objects/plugin-preparation) [`StandardCallback`](/docs/next/subgraph/reference-guide/objects/standard-callback) [`TokenTransfer`](/docs/next/subgraph/reference-guide/interfaces/token-transfer) [`TokenVotingMember`](/docs/next/subgraph/reference-guide/objects/token-voting-member) [`TokenVotingPlugin`](/docs/next/subgraph/reference-guide/objects/token-voting-plugin) [`TokenVotingProposal`](/docs/next/subgraph/reference-guide/objects/token-voting-proposal) [`TransactionActionsProposal`](/docs/next/subgraph/reference-guide/objects/transaction-actions-proposal) diff --git a/docs/subgraph/reference-guide/scalars/id.mdx b/docs/subgraph/reference-guide/scalars/id.mdx index f653b4c7..d28c00ad 100644 --- a/docs/subgraph/reference-guide/scalars/id.mdx +++ b/docs/subgraph/reference-guide/scalars/id.mdx @@ -55,5 +55,5 @@ scalar ID ### Member Of -[`Action`](/docs/subgraph/reference-guide/objects/action) [`AddresslistVotingPlugin`](/docs/subgraph/reference-guide/objects/addresslist-voting-plugin) [`AddresslistVotingProposal`](/docs/subgraph/reference-guide/objects/addresslist-voting-proposal) [`AddresslistVotingVote`](/docs/subgraph/reference-guide/objects/addresslist-voting-vote) [`AddresslistVotingVoter`](/docs/subgraph/reference-guide/objects/addresslist-voting-voter) [`Administrator`](/docs/subgraph/reference-guide/objects/administrator) [`AdministratorAdminPlugin`](/docs/subgraph/reference-guide/objects/administrator-admin-plugin) [`AdminPlugin`](/docs/subgraph/reference-guide/objects/admin-plugin) [`AdminProposal`](/docs/subgraph/reference-guide/objects/admin-proposal) [`Dao`](/docs/subgraph/reference-guide/objects/dao) [`ERC1155Balance`](/docs/subgraph/reference-guide/objects/erc1155-balance) [`ERC1155Contract`](/docs/subgraph/reference-guide/objects/erc1155-contract) [`ERC1155TokenIdBalance`](/docs/subgraph/reference-guide/objects/erc1155-token-id-balance) [`ERC1155Transfer`](/docs/subgraph/reference-guide/objects/erc1155-transfer) [`ERC20Balance`](/docs/subgraph/reference-guide/objects/erc20-balance) [`ERC20Contract`](/docs/subgraph/reference-guide/objects/erc20-contract) [`ERC20Transfer`](/docs/subgraph/reference-guide/objects/erc20-transfer) [`ERC20WrapperContract`](/docs/subgraph/reference-guide/objects/erc20-wrapper-contract) [`ERC721Balance`](/docs/subgraph/reference-guide/objects/erc721-balance) [`ERC721Contract`](/docs/subgraph/reference-guide/objects/erc721-contract) [`ERC721Transfer`](/docs/subgraph/reference-guide/objects/erc721-transfer) [`IPlugin`](/docs/subgraph/reference-guide/interfaces/iplugin) [`IProposal`](/docs/subgraph/reference-guide/interfaces/iproposal) [`MultisigApprover`](/docs/subgraph/reference-guide/objects/multisig-approver) [`MultisigPlugin`](/docs/subgraph/reference-guide/objects/multisig-plugin) [`MultisigProposal`](/docs/subgraph/reference-guide/objects/multisig-proposal) [`MultisigProposalApprover`](/docs/subgraph/reference-guide/objects/multisig-proposal-approver) [`NativeBalance`](/docs/subgraph/reference-guide/objects/native-balance) [`NativeTransfer`](/docs/subgraph/reference-guide/objects/native-transfer) [`Permission`](/docs/subgraph/reference-guide/objects/permission) [`PluginInstallation`](/docs/subgraph/reference-guide/objects/plugin-installation) [`PluginPermission`](/docs/subgraph/reference-guide/objects/plugin-permission) [`PluginPreparation`](/docs/subgraph/reference-guide/objects/plugin-preparation) [`PluginRelease`](/docs/subgraph/reference-guide/objects/plugin-release) [`PluginRepo`](/docs/subgraph/reference-guide/objects/plugin-repo) [`PluginSetup`](/docs/subgraph/reference-guide/objects/plugin-setup) [`PluginVersion`](/docs/subgraph/reference-guide/objects/plugin-version) [`Query`](/docs/subgraph/reference-guide/objects/query) [`StandardCallback`](/docs/subgraph/reference-guide/objects/standard-callback) [`Token`](/docs/subgraph/reference-guide/interfaces/token) [`TokenBalance`](/docs/subgraph/reference-guide/interfaces/token-balance) [`TokenTransfer`](/docs/subgraph/reference-guide/interfaces/token-transfer) [`TokenVotingMember`](/docs/subgraph/reference-guide/objects/token-voting-member) [`TokenVotingPlugin`](/docs/subgraph/reference-guide/objects/token-voting-plugin) [`TokenVotingProposal`](/docs/subgraph/reference-guide/objects/token-voting-proposal) [`TokenVotingVote`](/docs/subgraph/reference-guide/objects/token-voting-vote) [`TokenVotingVoter`](/docs/subgraph/reference-guide/objects/token-voting-voter) [`TransactionActionsProposal`](/docs/subgraph/reference-guide/objects/transaction-actions-proposal) +[`Action`](/docs/next/subgraph/reference-guide/objects/action) [`AddresslistVotingPlugin`](/docs/next/subgraph/reference-guide/objects/addresslist-voting-plugin) [`AddresslistVotingProposal`](/docs/next/subgraph/reference-guide/objects/addresslist-voting-proposal) [`AddresslistVotingVote`](/docs/next/subgraph/reference-guide/objects/addresslist-voting-vote) [`AddresslistVotingVoter`](/docs/next/subgraph/reference-guide/objects/addresslist-voting-voter) [`Administrator`](/docs/next/subgraph/reference-guide/objects/administrator) [`AdministratorAdminPlugin`](/docs/next/subgraph/reference-guide/objects/administrator-admin-plugin) [`AdminPlugin`](/docs/next/subgraph/reference-guide/objects/admin-plugin) [`AdminProposal`](/docs/next/subgraph/reference-guide/objects/admin-proposal) [`Dao`](/docs/next/subgraph/reference-guide/objects/dao) [`ERC1155Balance`](/docs/next/subgraph/reference-guide/objects/erc1155-balance) [`ERC1155Contract`](/docs/next/subgraph/reference-guide/objects/erc1155-contract) [`ERC1155TokenIdBalance`](/docs/next/subgraph/reference-guide/objects/erc1155-token-id-balance) [`ERC1155Transfer`](/docs/next/subgraph/reference-guide/objects/erc1155-transfer) [`ERC20Balance`](/docs/next/subgraph/reference-guide/objects/erc20-balance) [`ERC20Contract`](/docs/next/subgraph/reference-guide/objects/erc20-contract) [`ERC20Transfer`](/docs/next/subgraph/reference-guide/objects/erc20-transfer) [`ERC20WrapperContract`](/docs/next/subgraph/reference-guide/objects/erc20-wrapper-contract) [`ERC721Balance`](/docs/next/subgraph/reference-guide/objects/erc721-balance) [`ERC721Contract`](/docs/next/subgraph/reference-guide/objects/erc721-contract) [`ERC721Transfer`](/docs/next/subgraph/reference-guide/objects/erc721-transfer) [`IPlugin`](/docs/next/subgraph/reference-guide/interfaces/iplugin) [`IProposal`](/docs/next/subgraph/reference-guide/interfaces/iproposal) [`MultisigApprover`](/docs/next/subgraph/reference-guide/objects/multisig-approver) [`MultisigPlugin`](/docs/next/subgraph/reference-guide/objects/multisig-plugin) [`MultisigProposal`](/docs/next/subgraph/reference-guide/objects/multisig-proposal) [`MultisigProposalApprover`](/docs/next/subgraph/reference-guide/objects/multisig-proposal-approver) [`NativeBalance`](/docs/next/subgraph/reference-guide/objects/native-balance) [`NativeTransfer`](/docs/next/subgraph/reference-guide/objects/native-transfer) [`Permission`](/docs/next/subgraph/reference-guide/objects/permission) [`PluginInstallation`](/docs/next/subgraph/reference-guide/objects/plugin-installation) [`PluginPermission`](/docs/next/subgraph/reference-guide/objects/plugin-permission) [`PluginPreparation`](/docs/next/subgraph/reference-guide/objects/plugin-preparation) [`PluginRelease`](/docs/next/subgraph/reference-guide/objects/plugin-release) [`PluginRepo`](/docs/next/subgraph/reference-guide/objects/plugin-repo) [`PluginSetup`](/docs/next/subgraph/reference-guide/objects/plugin-setup) [`PluginVersion`](/docs/next/subgraph/reference-guide/objects/plugin-version) [`Query`](/docs/next/subgraph/reference-guide/objects/query) [`StandardCallback`](/docs/next/subgraph/reference-guide/objects/standard-callback) [`Token`](/docs/next/subgraph/reference-guide/interfaces/token) [`TokenBalance`](/docs/next/subgraph/reference-guide/interfaces/token-balance) [`TokenTransfer`](/docs/next/subgraph/reference-guide/interfaces/token-transfer) [`TokenVotingMember`](/docs/next/subgraph/reference-guide/objects/token-voting-member) [`TokenVotingPlugin`](/docs/next/subgraph/reference-guide/objects/token-voting-plugin) [`TokenVotingProposal`](/docs/next/subgraph/reference-guide/objects/token-voting-proposal) [`TokenVotingVote`](/docs/next/subgraph/reference-guide/objects/token-voting-vote) [`TokenVotingVoter`](/docs/next/subgraph/reference-guide/objects/token-voting-voter) [`TransactionActionsProposal`](/docs/next/subgraph/reference-guide/objects/transaction-actions-proposal) diff --git a/docs/subgraph/reference-guide/scalars/int.mdx b/docs/subgraph/reference-guide/scalars/int.mdx index b90fbd3b..b5eb9027 100644 --- a/docs/subgraph/reference-guide/scalars/int.mdx +++ b/docs/subgraph/reference-guide/scalars/int.mdx @@ -55,5 +55,5 @@ scalar Int ### Member Of -[`ERC20Contract`](/docs/subgraph/reference-guide/objects/erc20-contract) [`ERC20WrapperContract`](/docs/subgraph/reference-guide/objects/erc20-wrapper-contract) [`MultisigPlugin`](/docs/subgraph/reference-guide/objects/multisig-plugin) [`MultisigProposal`](/docs/subgraph/reference-guide/objects/multisig-proposal) [`PluginRelease`](/docs/subgraph/reference-guide/objects/plugin-release) [`PluginVersion`](/docs/subgraph/reference-guide/objects/plugin-version) +[`ERC20Contract`](/docs/next/subgraph/reference-guide/objects/erc20-contract) [`ERC20WrapperContract`](/docs/next/subgraph/reference-guide/objects/erc20-wrapper-contract) [`MultisigPlugin`](/docs/next/subgraph/reference-guide/objects/multisig-plugin) [`MultisigProposal`](/docs/next/subgraph/reference-guide/objects/multisig-proposal) [`PluginRelease`](/docs/next/subgraph/reference-guide/objects/plugin-release) [`PluginVersion`](/docs/next/subgraph/reference-guide/objects/plugin-version) diff --git a/docs/subgraph/reference-guide/scalars/string.mdx b/docs/subgraph/reference-guide/scalars/string.mdx index 6efe8f96..1702b761 100644 --- a/docs/subgraph/reference-guide/scalars/string.mdx +++ b/docs/subgraph/reference-guide/scalars/string.mdx @@ -55,5 +55,5 @@ scalar String ### Member Of -[`AddresslistVotingProposal`](/docs/subgraph/reference-guide/objects/addresslist-voting-proposal) [`AddresslistVotingVoter`](/docs/subgraph/reference-guide/objects/addresslist-voting-voter) [`Administrator`](/docs/subgraph/reference-guide/objects/administrator) [`AdminProposal`](/docs/subgraph/reference-guide/objects/admin-proposal) [`Dao`](/docs/subgraph/reference-guide/objects/dao) [`deprecated`](/docs/subgraph/reference-guide/directives/deprecated) [`ERC1155Balance`](/docs/subgraph/reference-guide/objects/erc1155-balance) [`ERC1155Contract`](/docs/subgraph/reference-guide/objects/erc1155-contract) [`ERC20Contract`](/docs/subgraph/reference-guide/objects/erc20-contract) [`ERC20WrapperContract`](/docs/subgraph/reference-guide/objects/erc20-wrapper-contract) [`ERC721Contract`](/docs/subgraph/reference-guide/objects/erc721-contract) [`IProposal`](/docs/subgraph/reference-guide/interfaces/iproposal) [`MultisigApprover`](/docs/subgraph/reference-guide/objects/multisig-approver) [`MultisigProposal`](/docs/subgraph/reference-guide/objects/multisig-proposal) [`NativeTransfer`](/docs/subgraph/reference-guide/objects/native-transfer) [`PluginRelease`](/docs/subgraph/reference-guide/objects/plugin-release) [`PluginRepo`](/docs/subgraph/reference-guide/objects/plugin-repo) [`PluginVersion`](/docs/subgraph/reference-guide/objects/plugin-version) [`specifiedBy`](/docs/subgraph/reference-guide/directives/specified-by) [`Token`](/docs/subgraph/reference-guide/interfaces/token) [`TokenVotingProposal`](/docs/subgraph/reference-guide/objects/token-voting-proposal) [`TokenVotingVoter`](/docs/subgraph/reference-guide/objects/token-voting-voter) [`TransactionActionsProposal`](/docs/subgraph/reference-guide/objects/transaction-actions-proposal) +[`AddresslistVotingProposal`](/docs/next/subgraph/reference-guide/objects/addresslist-voting-proposal) [`AddresslistVotingVoter`](/docs/next/subgraph/reference-guide/objects/addresslist-voting-voter) [`Administrator`](/docs/next/subgraph/reference-guide/objects/administrator) [`AdminProposal`](/docs/next/subgraph/reference-guide/objects/admin-proposal) [`Dao`](/docs/next/subgraph/reference-guide/objects/dao) [`deprecated`](/docs/next/subgraph/reference-guide/directives/deprecated) [`ERC1155Balance`](/docs/next/subgraph/reference-guide/objects/erc1155-balance) [`ERC1155Contract`](/docs/next/subgraph/reference-guide/objects/erc1155-contract) [`ERC20Contract`](/docs/next/subgraph/reference-guide/objects/erc20-contract) [`ERC20WrapperContract`](/docs/next/subgraph/reference-guide/objects/erc20-wrapper-contract) [`ERC721Contract`](/docs/next/subgraph/reference-guide/objects/erc721-contract) [`IProposal`](/docs/next/subgraph/reference-guide/interfaces/iproposal) [`MultisigApprover`](/docs/next/subgraph/reference-guide/objects/multisig-approver) [`MultisigProposal`](/docs/next/subgraph/reference-guide/objects/multisig-proposal) [`NativeTransfer`](/docs/next/subgraph/reference-guide/objects/native-transfer) [`PluginRelease`](/docs/next/subgraph/reference-guide/objects/plugin-release) [`PluginRepo`](/docs/next/subgraph/reference-guide/objects/plugin-repo) [`PluginVersion`](/docs/next/subgraph/reference-guide/objects/plugin-version) [`specifiedBy`](/docs/next/subgraph/reference-guide/directives/specified-by) [`Token`](/docs/next/subgraph/reference-guide/interfaces/token) [`TokenVotingProposal`](/docs/next/subgraph/reference-guide/objects/token-voting-proposal) [`TokenVotingVoter`](/docs/next/subgraph/reference-guide/objects/token-voting-voter) [`TransactionActionsProposal`](/docs/next/subgraph/reference-guide/objects/transaction-actions-proposal) diff --git a/docusaurus.config.js b/docusaurus.config.js index 00bbea8b..00749c1e 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -28,6 +28,15 @@ const config = { sidebarPath: require.resolve('./sidebars.js'), remarkPlugins: [math], rehypePlugins: [katex], + includeCurrentVersion: false, + // lastVersion: 'current', + // onlyIncludeVersions: ['1.3.0'], + // versions: { + // current: { + // label: '1.4.1', + // path: '1.4.1', + // }, + // }, }, theme: { customCss: [ @@ -61,6 +70,13 @@ const config = { alt: 'Aragon', src: 'img/logo-light.png', }, + items: [ + // { + // type: 'docsVersionDropdown', + // position: 'right', + // dropdownActiveClassDisabled: true, + // }, + ], }, metadata: [ {name: 'og:title', content: 'Aragon Developer Portal'}, @@ -152,7 +168,7 @@ const config = { rootPath: './docs', baseURL: 'subgraph/reference-guide', homepage: './static/subgraph/index.md', - linkRoot: '/docs', + linkRoot: '/docs/next', loaders: { JsonFileLoader: { module: '@graphql-tools/json-file-loader', diff --git a/sidebars.js b/sidebars.js index b5dea68c..d2cf27b1 100644 --- a/sidebars.js +++ b/sidebars.js @@ -5,7 +5,6 @@ const sidebars = { osxSidebar: [{type: 'autogenerated', dirName: 'osx'}], sdkSidebar: [{type: 'autogenerated', dirName: 'sdk'}], subgraphSidebar: [{type: 'autogenerated', dirName: 'subgraph'}], - ...require('./static/subgraph/sidebar-schema.js'), }; module.exports = sidebars; diff --git a/static/subgraph/sidebar-schema.js b/static/subgraph/sidebar-schema.js deleted file mode 100644 index 495cd802..00000000 --- a/static/subgraph/sidebar-schema.js +++ /dev/null @@ -1,10 +0,0 @@ -/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ - -module.exports = { - schemaSidebar: [ - { - type: 'autogenerated', - dirName: 'subgraph', - }, - ], -}; diff --git a/versioned_docs/version-1.3.0/osx/01-how-it-works/01-core/01-dao/01-actions.md b/versioned_docs/version-1.3.0/osx/01-how-it-works/01-core/01-dao/01-actions.md new file mode 100644 index 00000000..b9d83de3 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/01-how-it-works/01-core/01-dao/01-actions.md @@ -0,0 +1,138 @@ +--- +title: Advanced DAO Actions +--- + +## A Deep Dive into Actions and Execution + +The DAO's `execute` function is part of the `DAO.sol` contract and has the following function header: + +```solidity title="@aragon/osx/core/dao/DAO.sol" +function execute( + bytes32 _callId, + Action[] calldata _actions, + uint256 _allowFailureMap + ) + external + override + auth(address(this), EXECUTE_PERMISSION_ID) + returns (bytes[] memory execResults, uint256 failureMap) +``` + +It offers two features that we will dive into in this article: + +1. Execution of an array of arbitrary `Action` items. +2. Allowing failure of individual actions without reverting the entire transaction. + +### Actions + +In our framework, actions are represented by a solidity struct: + +```solidity title="@aragon/osx/core/dao/IDAO.sol" +/// @notice The action struct to be consumed by the DAO's `execute` function resulting in an external call. +/// @param to The address to call. +/// @param value The native token value to be sent with the call. +/// @param data The bytes-encoded function selector and calldata for the call. +struct Action { + address to; + uint256 value; + bytes data; +} +``` + +Actions can be + +- function calls to the DAO itself (e.g., to upgrade the DAO contract to a newer version of Aragon OSx) +- function calls to other contracts, such as + + - external services (e.g. Uniswap, Compound, etc.) + - Aragon OSx plugins (e.g., the DAO can be a member of a multisig installed in another DAO), + - Aragon OSx protocol infrastructure (e.g., to [setup a plugin](../../02-framework/02-plugin-management/02-plugin-setup/index.md)) + +- transfers of native tokens + +#### Example: Calling the wETH Contract + +We have an Aragon DAO deployed on the Goerli testnet. Now, we want to wrap `0.1 ETH` from the DAO treasury into `wETH` by depositing it into the [Goerli WETH contract](https://goerli.etherscan.io/token/0xb4fbf271143f4fbf7b91a5ded31805e42b2208d6#writeContract) deployed on the address `0xb4fbf271143f4fbf7b91a5ded31805e42b2208d6`. The corresponding `Action` and `execute` function call look as follows: + +```solidity + +IDAO.Action[] memory actions = new IDAO.Action[](1); + +actions[0] = IDAO.Action({ + to: address(0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6), // The address of the WETH contract on Goerli + value: 0.1 ether, // The Goerli ETH value to be sent with the function call + data: abi.encodeCall(IDAO.deposit, ()) // The calldata +}); + +dao().execute({_callId: '', _actions: actions, _allowFailureMap: 0}); + +``` + +For the `execute` call to work, the caller must have the required [`EXECUTE_PERMISSION_ID` permission](../02-permissions/index.md) on the DAO contract. + +### The Action Array + +The `Action[] calldata _actions` input argument allows you to execute an array of up to 256 `Action` items in a single transaction within the gas limitations of the Ethereum virtual machine (EVM). +This is important so that several calls can be executed in a strict order within a single transaction. + +Imagine a DAO is currently governed by a multisig (it has the `Multisig` plugin installed) and wants to transition the DAO governance to token voting. +To achieve this, one of the Multisig members creates a proposal in the plugin proposing to + +1. install the `TokenVoting` plugin +2. uninstall the `Multisig` plugin + +If enough multisig signers approve and the proposals passes, the action array can be executed and the transition happens. + +Here, it is important that the two actions happen in the specified order and both are required to succeed. +Otherwise, if the first action would fail or the second one would happen beforehand, the DAO could end up in a state without having a governance plugin enabled. + +Accordingly and by default, none of the atomic actions in the action array is allowed to revert. Otherwise, the entire action array is reverted. + +### Allowing For Failure + +In some scenarios, it makes sense to relax this requirement and allow specific actions in the array to revert. +Imagine a DAO wants to buy two NFTs A and B with DAI tokens. A proposal is scheduled in a governance plugin to + +1. set the DAI allowance to `125` +2. try to buy NFT A for `100` DAI +3. try to buy NFT B for `125` DAI +4. set the DAI allowance to `0` + +Once the proposal has passed, it might be that the NFT A or B was already bought by someone else so that action 2 or 3 would revert. +However, if the other NFT is still available, the DAO might still want to make at least the second trade. +Either way, the DAO needs to first approve `125` DAO tokens before the trade and wants to set it back to `0` after the potential trades have happened for security reasons. + +#### The `allowFailureMap` Input Argument + +This optionality can be achieved with the allow-failure feature available in the DAO's `execute` function. +To specify that failure is allowed for the actions 2 and 3, we provide the following `_allowFailureMap`: + +```solidity +uint256 _allowFailureMap = 6; +``` + +and explain why in the following: + +In binary representation a `uint256` value is a number with 256 digits that can be 0 or 1. In this representation, the value of `uint256(6)` translates into + +```solidity +... 0 0 0 1 1 0 // the value 6 in binary representation +... 5 4 3 2 1 0 // the indices of the action array items that are allowed to fail. +``` + +where we omitted 250 more leading zeros. This binary value encodes a map to be read from right to left encoding the indices of the action array that are allowed to revert. +Accordingly, the second and third array item (with the indices 1 and 2) are allowed to fail. +If we want that every atomic succeeds, we specify a `allowFailureMap` value of `0`. + +#### The `failureMap` Output Argument + +In analogy and after an action array with a provided allow-failure map was executed successfully in the DAO, the `execute` function returns a corresponding `uint256 failureMap` containing the actual failures that have happened. +If all actions succeeded, the value `uint256(0)` will be returned. +If the third action failed, for example, because the NFT was already sold or the DAO had not enough DAI, a failure map value `uint256(4)` is returned + +```solidity +... 0 0 0 1 0 0 // the value 4 in binary representation +... 5 4 3 2 1 0 // the indices of the action array items that are allowed to fail. +``` + +On the frontend, these conversions will be handled automatically. diff --git a/versioned_docs/version-1.3.0/osx/01-how-it-works/01-core/01-dao/index.md b/versioned_docs/version-1.3.0/osx/01-how-it-works/01-core/01-dao/index.md new file mode 100644 index 00000000..2938a7b1 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/01-how-it-works/01-core/01-dao/index.md @@ -0,0 +1,62 @@ +--- +title: DAO +--- + +## The DAO Contract: The Identity and Basis of Your Organization + +In this section, you will learn about the core functionality of every Aragon OSx DAO. + +The `DAO` contract is the identity and basis of your organization. It is the address carrying the DAO’s ENS name, metadata, and holding the funds. Furthermore, it has **six base functionalities** being commonly found in other DAO frameworks in the ecosystem. + +### 1. Execution of Arbitrary Actions + +The most important and basic functionality of your DAO is the **execution of arbitrary actions**, which allows you to execute the DAO's own functions as well as interacting with the rest of the world, i.e., calling methods in other contracts and sending assets to other addresses. + +:::note +Typically, actions are scheduled in a proposal in a governance [plugin installed to your DAO](../03-plugins/index.md). +::: + +Multiple `Action` structs can be put into one `Action[]` array and executed in a single transaction via the `execute` function. To learn more about actions and advanced features of the DAO executor, visit the [A Deep Dive Into Actions](./01-actions.md) section. + +### 2. Asset Management + +The DAO provides basic **asset management** functionality to deposit, withdraw, and keep track of + +- native +- [ERC-20 (Token Standard)](https://eips.ethereum.org/EIPS/eip-20), +- [ERC-721 (NFT Standard)](https://eips.ethereum.org/EIPS/eip-721), and +- [ERC-1155 (Multi Token Standard)](https://eips.ethereum.org/EIPS/eip-1155) + +tokens in the treasury. +In the future, more advanced asset management and finance functionality can be added to your DAO in the form of [plugins](../03-plugins/index.md). + +### 3. Upgradeability + +Your DAO contract has the ability to be upgraded to a newer version (see [Upgrade your DAO](../../../02-how-to-guides/01-dao/03-protocol-upgrades.md)) if a new version of Aragon OSx is released in the future. These upgrades allow your DAO to smoothly transition to a new protocol version unlocking new features. + + + +### 4. Callback Handling + +To interact with the DAO, external contracts might require certain callback functions to be present. +Examples are the `onERC721Received` and `onERC1155Received` / `onERC1155BatchReceived` functions required by the [ERC-721 (NFT Standard)](https://eips.ethereum.org/EIPS/eip-721) and [ERC-1155 (Multi Token Standard)](https://eips.ethereum.org/EIPS/eip-1155) tokens. +Our `CallbackHandler` allows to register the required callback responses dynamically so that the DAO contract does not need to be upgraded. + + + +### 5. Signature Validation + +Currently, externally owned accounts (EOAs) can sign messages with their associated private keys, but contracts cannot. +An exemplary use case is a decentralized exchange with an off-chain order book, where buy/sell orders are signed messages. +To accept such a request, both, the external service provider and caller need to follow a standard with which the signed message of the caller can be validated. + +By supporting the [ERC-1271](https://eips.ethereum.org/EIPS/eip-1271) standard, your DAO can validate signatures via its `isValidSignature` function that forwards the call to a signature validator contract. + + + +### 6. Permission Management + +Lastly, it is essential that only the right entities (e.g., the DAO itself or trusted addresses) have permission to use the above-mentioned functionalities. This is why Aragon OSx DAOs contain a flexible and battle-tested **permission manager** being able to assign permissions for the above functionalities to specific addresses. +Although possible, the permissions to execute arbitrary actions or upgrade the DAO should not be given to EOAs as this poses a security risk to the organization if the account is compromised or acts adversarial. Instead, the permissions for the above-mentioned functionalities are better restricted to the `DAO` contract itself and triggered through governance [plugins](../03-plugins/index.md) that you can install on your DAO. + +To learn more, visit the [permission manager](../02-permissions/index.md) section. diff --git a/versioned_docs/version-1.3.0/osx/01-how-it-works/01-core/02-permissions/01-conditions.md b/versioned_docs/version-1.3.0/osx/01-how-it-works/01-core/02-permissions/01-conditions.md new file mode 100644 index 00000000..8c38623d --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/01-how-it-works/01-core/02-permissions/01-conditions.md @@ -0,0 +1,210 @@ +--- +title: Permission Conditions +--- + +## Permission Conditions + +Permission conditions relay the decision if an authorized call is permitted to another contract. +This contract must inherit from `PermissionCondition` and implement the `IPermissionCondition` interface. + +```solidity title="@aragon/osx/core/permission/IPermissionCondition.sol" +interface IPermissionCondition { + /// @notice This method is used to check if a call is permitted. + /// @param _where The address of the target contract. + /// @param _who The address (EOA or contract) for which the permissions are checked. + /// @param _permissionId The permission identifier. + /// @param _data Optional data passed to the `PermissionCondition` implementation. + /// @return allowed Returns true if the call is permitted. + function isGranted( + address _where, + address _who, + bytes32 _permissionId, + bytes calldata _data + ) external view returns (bool allowed); +} +``` + +By implementing the `isGranted` function, any number of custom conditions can be added to the permission. +These conditions can be based on + +- The specific properties of + + - The caller `who` + - The target `where` + +- The calldata `_data` of the function such as + + - Function signature + - Parameter values + +- General on-chain data such as + + - Timestamps + - Token ownership + - Entries in curated registries + +- off-chain data being made available through oracle services (e.g., [chain.link](https://chain.link/), [witnet.io](https://witnet.io/)) such as + + - Market data + - Weather data + - Scientific data + - Sports data + +The following examples illustrate + +## Examples + +:::caution +The following code examples serve educational purposes and are not intended to be used in production. +::: + +Let’s assume we have an `Example` contract managed by a DAO `_dao` containing a `sendCoins` function allowing you to send an `_amount` to an address `_to` and being permissioned through the `auth` modifier: + +```solidity title="Example.sol" +contract Example is Plugin { + constructor(IDAO _dao) Plugin(_dao) {} + + function sendCoins(address _to, uint256 _amount) external auth(SEND_COINS_PERMISSION_ID) { + // logic to send `_amount` coins to the address `_to`... + } +} +``` + +Let's assume you own the private key to address `0x123456...` and the `Example` contract was deployed to address `0xabcdef...`. +Now, to be able to call the `sendCoins` function, you need to `grant` the `SEND_COINS_PERMISSION_ID` permission to your wallet address (`_who=0x123456...`) for the `Example` contract (`_where=0xabcdef...`). +If this is the case, the function call will succeed, otherwise it will revert. + +We can now add additional constraints to it by using the `grantWithCondition` function. +Below, we show four exemplary conditions for different 4 different use cases that we could attach to the permission. + +### Condition 1: Adding Parameter Constraints + +Let’s imagine that we want to make sure that `_amount` is not more than `1 ETH` without changing the code of `Example` contract. + +We can realize this requirement by deploying a `ParameterConstraintCondition` condition. + +```solidity title="ParameterConstraintCondition.sol" +contract ParameterConstraintCondition is PermissionCondition { + uint256 internal maxValue; + + constructor(uint256 _maxValue) { + maxValue = _maxValue; + } + + function isGranted( + address _where, + address _who, + bytes32 _permissionId, + bytes calldata _data + ) external view returns (bool) { + (_where, _who, _permissionId); // Prevent compiler warnings resulting from unused arguments. + + (address _to, uint256 _amount) = abi.decode(_data, (address, uint256)); + + return _amount <= _maxValue; +} +``` + +Now, after granting the `SEND_COINS_PERMISSION_ID` permission to `_where` and `_who` via the `grantWithCondition` function and pointing to the `ParameterConstraintCondition` condition contract, the `_who` address can only call the `sendCoins` of the `Example` contract deployed at address `_where` successfully if `_amount` is not larger than `_maxValue` stored in the condition contract. + +### Condition 2: Delaying a Call With a Timestamp + +In another use-case, we might want to make sure that the `sendCoins` can only be called after a certain date. This would look as following: + +```solidity title="TimeCondition.sol" +contract TimeCondition is PermissionCondition { + uint256 internal date; + + constructor(uint256 _date) { + date = _date; + } + + function isGranted( + address _where, + address _who, + bytes32 _permissionId, + bytes calldata _data + ) external view returns (bool) { + (_where, _who, _permissionId, _data); // Prevent compiler warnings resulting from unused arguments + + return block.timestamp > date; + } +} +``` + +Here, the permission condition will only allow the call the `_date` specified in the constructor has passed. + +### Condition 3: Using Curated Registries + +In another use-case, we might want to make sure that the `sendCoins` function can only be called by real humans to prevent sybil attacks. For this, let's say we use the [Proof of Humanity (PoH)](https://www.proofofhumanity.id/) registry providing a curated list of humans: + +```solidity title="IProofOfHumanity.sol" +interface IProofOfHumanity { + function isRegistered(address _submissionID) external view returns (bool); +} + +contract ProofOfHumanityCondition is PermissionCondition { + IProofOfHumanity internal registry; + + constructor(IProofOfHumanity _registry) { + registry = _registry; + } + + function isGranted( + address _where, + address _who, + bytes32 _permissionId, + bytes calldata _data + ) external view returns (bool) { + (_where, _permissionId, _data); // Prevent compiler warnings resulting from unused arguments + + return registry.isRegistered(_who); + } +} +``` + +Here, the permission condition will only allow the call if the PoH registry confirms that the `_who` address is registered and belongs to a real human. + +#### Condition 4: Using a Price Oracle + +In another use-case, we might want to make sure that the `sendCoins` function can only be called if the ETH price in USD is above a certain threshold: + + +```solidity title="PriceOracleCondition.sol" +import '@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol'; + +contract PriceOracleCondition is PermissionCondition { + AggregatorV3Interface internal priceFeed; + + // Network: Goerli + // Aggregator: ETH/USD + // Address: 0xD4a33860578De61DBAbDc8BFdb98FD742fA7028e + constructor() { + priceFeed = AggregatorV3Interface( + 0xD4a33860578De61DBAbDc8BFdb98FD742fA7028e + ); + } + + function isGranted( + address _where, + address _who, + bytes32 _permissionId, + bytes calldata _data + ) external view returns (bool) { + (_where, _who, _permissionId, _data); // Prevent compiler warnings resulting from unused arguments + + ( + /*uint80 roundID*/, + int256 price, + /*uint startedAt*/, + /*uint timeStamp*/, + /*uint80 answeredInRound*/ + ) = priceFeed.latestRoundData(); + + return price > 9000 * 10**18; // It's over 9000! + } +} + +Here, we use [a data feed from a Chainlink oracle](https://docs.chain.link/docs/data-feeds/) providing us with the latest ETH/USD price on the Goerli testnet and require that the call is only allowed if the ETH price is over $9000. + +```` diff --git a/versioned_docs/version-1.3.0/osx/01-how-it-works/01-core/02-permissions/index.md b/versioned_docs/version-1.3.0/osx/01-how-it-works/01-core/02-permissions/index.md new file mode 100644 index 00000000..96ca1d1a --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/01-how-it-works/01-core/02-permissions/index.md @@ -0,0 +1,157 @@ +--- +title: Permissions +--- + +## Managing Your DAO + +At Aragon, we believe that **DAOs are permission management systems**. +Permissions between contracts and wallets allow a DAO to manage and govern its actions. + +Here, you will learn how the permissions in Aragon OSx work, how they can be granted and revoked from wallets and contracts, and how they are managed through the DAO. + +As we mentioned earlier, it is essential that only the right person or contract can execute a certain action. As a developer, you might have seen or used [modifiers such as `onlyOwner`](https://docs.openzeppelin.com/contracts/2.x/api/ownership#Ownable) in contracts. This `onlyOwner` modifier provides basic access control to your DAO: only the `owner` address is permitted to execute the function to which the modifier is attached. + +In Aragon OSx, we follow the same approach but provide more advanced functionality: +Each `DAO` contracts includes a `PermissionManager` contract allowing to flexibly, securely, and collectively manage permissions through the DAO and, thus, govern its actions. +This `PermissionManager`, called `ACL` in previous Aragon OS versions, was one big reason why our protocol never got hacked. +The code and configuration of a DAO specifies which wallets or contracts (`who`) are allowed to call which authorized functions on a target contract (`where`). +Identifiers, permissions, and modifiers link everything together. + +### Permission Identifiers + +To differentiate between different permissions, permission **identifiers** are used that you will frequently find at the top of Aragon OSx contracts. They look something like this: + +```solidity title="@aragon/osx/core/dao/DAO.sol" +bytes32 public constant EXECUTE_PERMISSION_ID = keccak256("EXECUTE_PERMISSION"); +``` + +### Permissions + +A permission specifies an address `who` being allowed to call certain functions on a contract address `where`. In the `PermissionManager` contract, permissions are defined as the concatenation of the word `"PERMISSION"` with the `who` and `where` address, as well as the `bytes32` permission identifier `permissionId`. + +```solidity title="@aragon/osx/core/permission/PermissionManager.sol" +function permissionHash( + address _where, + address _who, + bytes32 _permissionId +) internal pure returns (bytes32) { + return keccak256(abi.encodePacked('PERMISSION', _who, _where, _permissionId)); +} +``` + +This concatenated information is then stored as `keccak256` hashes inside a mapping like this one: + +```solidity title="@aragon/osx/core/permission/PermissionManager.sol" +mapping(bytes32 => address) internal permissionsHashed; +``` + +Here, the `bytes32` keys are the permission hashes and the `address` values are either zero-address flags, such as `ALLOW_FLAG = address(2)` and `UNSET_FLAG = address(0)` indicating if the permission is set, or an actual address pointing to a `PermissionCondition` contract, which is discussed in the next section of this guide. + +### Authorization Modifiers + +Using **authorization modifiers** is how we make functions permissioned. Permissions are associated with functions by adding the `auth` modifier, which includes the permission identifier in the function’s definition header. + +For example, one can call the `execute` function in the DAO when the address making the call has been granted the `EXECUTE_PERMISSION_ID` permission. + +```solidity title="@aragon/osx/core/dao/DAO.sol" +function execute( + bytes32 callId, + Action[] calldata _actions, + uint256 allowFailureMap +) + external + override + auth(address(this), EXECUTE_PERMISSION_ID) + returns (bytes[] memory execResults, uint256 failureMap); +``` + +### Managing Permissions + +To manage permissions, the DAO contract has the `grant`, `revoke` and `grantWithCondition` functions in its public interface. + +#### Granting and Revoking Permissions + +The `grant` and `revoke` functions are the main functions we use to manage permissions. +Both receive the `_permissionId` identifier of the permission and the `_where` and `_who` addresses as arguments. + +```solidity title="@aragon/osx/core/permission/PermissionManager.sol" +function grant( + address _where, + address _who, + bytes32 _permissionId +) external auth(_where, ROOT_PERMISSION_ID); +``` + +To prevent these functions from being called by any address, they are themselves permissioned via the `auth` modifier and require the caller to have the `ROOT_PERMISSION_ID` permission in order to call them. + +:::note +Typically, the `ROOT_PERMISSION_ID` permission is granted only to the `DAO` contract itself. Contracts related to the Aragon infrastructure temporarily require it during the [DAO creation](../../02-framework/01-dao-creation/index.md) and [plugin setup ](../../02-framework/02-plugin-management/02-plugin-setup/index.md) processes. +:::note + +This means, that these functions can only be called through the DAO’s `execute` function that, in turn, requires the calling address to have the `EXECUTE_PERMISSION_ID` permission. + +:::note +Typically, the `EXECUTE_PERMISSION_ID` permission is granted to governance contracts (such as a majority voting plugin owned by the DAO or a multi-sig). Accordingly, a proposal is often required to change permissions. +Exceptions are, again, the [DAO creation](../../02-framework/01-dao-creation/index.md) and [plugin setup ](../../02-framework/02-plugin-management/02-plugin-setup/index.md) processes. +::: + +#### Granting Permission with Conditions + +Aragon OSx supports relaying the authorization of a function call to another contract inheriting from the `IPermissionCondition` interface. This works by granting the permission with the `grantWithCondition` function + +```solidity title="@aragon/osx/core/permission/PermissionManager.sol" +function grantWithCondition( + address _where, + address _who, + bytes32 _permissionId, + PermissionCondition _condition +) external auth(_where, ROOT_PERMISSION_ID) {} +``` + +and specifying the `_condition` contract address. This provides full flexibility to customize the conditions under which the function call is allowed. + +Typically, conditions are written specifically for and installed together with [plugins](../../01-core/03-plugins/index.md). + +To learn more about this advanced topic and possible applications, visit the [permission conditions](./01-conditions.md) section. + +#### Granting Permission to `ANY_ADDR` + +In combination with conditions, the arguments `_where` and `_who` can be set to `ANY_ADDR = address(type(uint160).max)`. +Granting a permission with `_who: ANY_ADDR` has the effect that any address can now call the function so that it behaves as if the `auth` modifier is not present. +Imagine, for example, you wrote a decentralized service + +```solidity +contract Service { + function use() external auth(USE_PERMISSION_ID); +} +``` + +Calling the `use()` function inside requires the caller to have the `USE_PERMISSION_ID` permission. Now, you want to make this service available to every user without uploading a new contract or requiring every user to ask for the permission. +By granting the `USE_PERMISSION_ID` to `_who: ANY_ADDR` on the contract `_where: serviceAddr` you allow everyone to call the `use()` function and you can add more conditions to it. If you later on decide that you want to be more selective about who is allowed to call it, you can revoke the permission to `ANY_ADDR`. + +Granting a permission with `_where: ANY_ADDR` to a condition has the effect that is granted on every contract. This is useful if you want to give an address `_who` permission over a large set of contracts that would be too costly or too much work to be granted on a per-contract basis. +Imagine, for example, that many instances of the `Service` contract exist, and a user should have the permission to use all of them. By granting the `USE_PERMISSION_ID` with `_where: ANY_ADDR`, to some user `_who: userAddr`, the user has access to all of them. If this should not be possible anymore, you can later revoke the permission. + +However, some restrictions apply. For security reasons, Aragon OSx does not allow you to use both, `_where: ANY_ADDR` and `_who: ANY_ADDR` in the same permission. Furthermore, the permission IDs of [permissions native to the `DAO` Contract](#permissions-native-to-the-dao-contract) cannot be used. +Moreover, if a condition is set, we return its `isGranted` result and do not fall back to a more generic one. The condition checks occur in the following order + +1. Condition with specific `_who` and specific `where`. +2. Condition with generic `_who: ANY_ADDR` and specific `_where`. +3. Condition with specific `_where` and generic `_who: ANY_ADDR`. + +### Permissions Native to the `DAO` Contract + +The following functions in the DAO are permissioned: + +| Functions | Permission Identifier | Description | +| --------------------------------------- | ------------------------------------------ | --------------------------------------------------------------------------------------------------------------- | +| `grant`, `grantWithCondition`, `revoke` | `ROOT_PERMISSION_ID` | Required to manage permissions of the DAO and associated plugins. | +| `execute` | `EXECUTE_PERMISSION_ID` | Required to execute arbitrary actions. | +| `_authorizeUpgrade` | `UPGRADE_DAO_PERMISSION_ID` | Required to upgrade the DAO (via the [UUPS](https://eips.ethereum.org/EIPS/eip-1822)). | +| `setMetadata` | `SET_METADATA_PERMISSION_ID` | Required to set the DAO’s metadata and [DAOstar.one DAO URI](https://eips.ethereum.org/EIPS/eip-4824). | +| `setTrustedForwarder` | `SET_TRUSTED_FORWARDER_PERMISSION_ID` | Required to set the DAO’s trusted forwarder for meta transactions. | +| `registerStandardCallback` | `REGISTER_STANDARD_CALLBACK_PERMISSION_ID` | Required to register a standard callback for an [ERC-165](https://eips.ethereum.org/EIPS/eip-165) interface ID. | + +Plugins installed on the DAO might introduce other permissions and associated permission identifiers. + +In the next section, you will learn how to customize your DAO by installing plugins. diff --git a/versioned_docs/version-1.3.0/osx/01-how-it-works/01-core/03-plugins/index.md b/versioned_docs/version-1.3.0/osx/01-how-it-works/01-core/03-plugins/index.md new file mode 100644 index 00000000..cfeadcd1 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/01-how-it-works/01-core/03-plugins/index.md @@ -0,0 +1,51 @@ +--- +title: Plugins +--- + +## Customizing your DAO + +To add features beyond the base functionality available, you can customize your Aragon OSx DAO by installing a wide variety of plugins. + +Plugins can be related to: + +- **Governance:** provides the DAO with different **decision-making** mechanisms such as token or address-based majority voting, conviction voting, optimistic governance, or direct execution from an admin address. They are characterized by requiring the `EXECUTE_PERMISSION_ID` permission on the DAO. + Advanced governance architectures are possible by having multiple governance plugins simultaneously. + +- **Asset Management:** allows the DAO to manage its **treasury** or use it to invest (e.g., in lending, staking, or NFT mints). + +- **Membership:** determines **who** will be a part of the DAO and what role they have. This can mean minting governance tokens like [ERC-20](https://eips.ethereum.org/EIPS/eip-20), NFTs, or any other token standard. Typically, membership-related plugins grant permissions based on token ownership or maintenance of a curated list of addresses. + +- And **anything** else that comes to mind! + +## Understanding Plugins + +Whenever a DAO installs a plugin, an instance of that plugin's base template is deployed using the configuration parameters defined by the DAO. For example, you may want to use a specific token for your DAO's voting process, which means you have to determine this within your plugin's configuration parameters. + +Each instance of a plugin is installed to a DAO through the granting of permissions. + +:::info +Lern more about the different [plugin types](../../../02-how-to-guides/02-plugin-development/02-plugin-types.md) in our How-to guide. +::: + +This raises questions on how the DAO manages plugins and who actually owns plugins. + +### How Does the DAO Manage a Plugin? + +A DAO manages plugins and interactions between them. In more detail, its permission manager: + +- enables the plugin installation process through the granting and revoking of permissions for the DAO +- authorizes calls to plugin functions carrying the `auth` modifier +- authorizes calls to DAO functions, for example the `execute` function, allowing to act as the DAO + +
+ +![Schematic depiction of the interaction between the DAO, the PermissionManager, and a Plugin contract.](../dao-plugin.drawio.svg) + +

+ An examplary DAO setup showing interactions between the three core contract pieces triggered by different user groups: The DAO contract in blue containing the PermissionManager in red, respectively, as well as two Plugin contracts in green. + Function calls are visualized as black arrows and require permission checks (red, dashed arrow). In this example, the permission manager determines whether the token voting plugin can execute actions on the DAO, a member can change its settings, or if a DeFi-related plugin is allowed to invest in a certain, external contract. +

+ +
+ +Whereas deployed plugin instances belong to the DAO, the developer of the original plugin implementation owns the implementation and setup contract of the plugin. The plugin developer is the maintainer of an Aragon OSx [plugin repo](../../02-framework/02-plugin-management/01-plugin-repo/index.md). Finally, the Aragon OSx protocol manages the registry in which the plugin repositories are listed, which is required to install a plugin using the Aragon OSx framework infrastructure to your DAO. diff --git a/versioned_docs/version-1.3.0/osx/01-how-it-works/01-core/dao-plugin.drawio.svg b/versioned_docs/version-1.3.0/osx/01-how-it-works/01-core/dao-plugin.drawio.svg new file mode 100644 index 00000000..c4d8f137 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/01-how-it-works/01-core/dao-plugin.drawio.svg @@ -0,0 +1,33 @@ +
DAO
+ DAO +
execute()
+ execute() +
Token Voting
Plugin
+ Token Voting... +
Permission
Manager
+ Permission... +
createProposal()
+ createProposal() +

🧑‍💼

+ 🧑‍💼 +
changeSettings()
+ changeSettings() +
🧑‍🔧
+ 🧑‍🔧 +
DeFi
Plugin
+ DeFi... +
hasPermission()
+ hasPermission() +
invest()
+ invest() +
🧑‍🌾
+ 🧑‍🌾 +
depositTokens()
+ depositTokens() +

🛡

+ 🛡 +
external contract
+ external cont... +
+ Text is not SVG - cannot display +
\ No newline at end of file diff --git a/versioned_docs/version-1.3.0/osx/01-how-it-works/01-core/index.md b/versioned_docs/version-1.3.0/osx/01-how-it-works/01-core/index.md new file mode 100644 index 00000000..e5d42bef --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/01-how-it-works/01-core/index.md @@ -0,0 +1,44 @@ +--- +title: The Smart Contracts behind DAOs +--- + +## The Contracts Constituting Your DAO + +In a nutshell, your Aragon OSx DAO consists of three pieces: + +1. **The DAO contract:** The DAO contract is where the **core functionality** of the protocol lies. It is in charge of: + + - Representing the identity of the DAO (ENS name, logo, description, other metadata) + - Keeping the treasury + - Executing arbitrary actions to + - Transfer assets + - Call its own functions + - Call functions in external contracts + - Providing general technical utilities (signature validation, callback handling) + +2. **The Permission Manager:** The permission manager is part of the DAO contract and the center of our protocol architecture. It **manages permissions for your DAO** by specifying which addresses have permission to call distinct functions on contracts associated with your DAO. + +3. **Plugins:** Any custom functionality can be added or removed through plugins, allowing you to **fully customize your DAO**. These plugins can be related to + + - Governance (e.g., token voting, one-person one-vote) + - Asset management (e.g., ERC-20 or NFT minting, token streaming, DeFi) + - Membership (governing budget allowances, gating access, curating a member list) + +The underlying smart contracts constitute **the core contracts** of the Aragon OSx DAO framework. + +
+ +![Schematic depiction of the interaction between the DAO, the PermissionManager, and a Plugin contract.](dao-plugin.drawio.svg) + +

+ An examplary DAO setup showing interactions between the three core contract pieces triggered by different user groups: The DAO contract in blue containing the PermissionManager in red, respectively, as well as two Plugin contracts in green. + Function calls are visualized as black arrows and require permission checks (red, dashed arrow). In this example, the permission manager determines whether the token voting plugin can execute actions on the DAO, a member can change its settings, or if a DeFi-related plugin is allowed to invest in a certain, external contract. +

+ +
+ +In the upcoming sections, you will learn about each of them in more depth. + +- [The DAO Contract: The Identity and Basis of Your Organization](./01-dao/index.md) +- [Permissions: Managing Your DAO](./02-permissions/index.md) +- [Plugins: Customizing your DAO](./03-plugins/index.md) diff --git a/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/01-dao-creation/index.md b/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/01-dao-creation/index.md new file mode 100644 index 00000000..8fcbb41d --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/01-dao-creation/index.md @@ -0,0 +1,55 @@ +--- +title: Creating a DAO +--- + +## The DAO Creation Process + +Two framework contracts manage the `DAO` contract creation process: + +- The [`DAOFactory`](../../../03-reference-guide/framework/dao/DAOFactory.md) +- The [`DAORegistry`](../../../03-reference-guide/framework/dao/DAORegistry.md). + + + +### `DAOFactory` + +The `DAOFactory` creates and sets up a `DAO` for you in four steps with the `createDao` function. The function requires the `DAOSettings` including + +- The trusted forwarder address for future [ERC-2771 (Meta Transaction)](https://eips.ethereum.org/EIPS/eip-2771) compatibility that is set to `address(0)` for now +- The ENS name (to be registered under the `dao.eth` domain) +- The [ERC-4824 (Common Interfaces for DAOs)](https://eips.ethereum.org/EIPS/eip-4824) `daoURI` +- Optional metadata + +as well as an array of `PluginSettings` containing `PluginSetup` contract references and respective setup data for the initial set of plugins to be installed on the DAO. + +The `DAOFactory` create the `DAO` in four steps and interacts with the `DAORegistry` and being also part of the Aragon OSx framework: + +1. Creates a new DAO by deploying an [ERC-1967](https://eips.ethereum.org/EIPS/eip-1967) proxy pointing to the latest Aragon OSx `DAO` impelementation and becomes the initial owner. + +2. Registers the new contract in the [`DAORegistry`](#daoregistry). + +3. Installs the plugins using the `PluginSetupProcessor` (see also the section about [the plugin setup process](../02-plugin-management/02-plugin-setup/index.md)). + +4. Sets the [native permissions](../../01-core/02-permissions/index.md#permissions-native-to-the-dao-contract) of the `DAO` and revokes its own ownership. + +For more details visit the [`DAOFactory` reference guide entry](../../../03-reference-guide/framework/dao/DAOFactory.md). + +### `DAORegistry` + +The `DAORegistry` is used by the `DAOFactory` and contains the `register` function + +```solidity title="@aragon/framework/dao/DAORegistry.sol" +function register( + IDAO dao, + address creator, + string calldata subdomain +) external auth(REGISTER_DAO_PERMISSION_ID); +``` + +requiring the `REGISTER_DAO_PERMISSION_ID` permission currently held only by the `DAOFactory`. + +If the requested ENS `subdomain` name [is valid](../03-ens-names.md) and not taken, the `DAORegistry` registers the subdomain and adds the `DAO` contract address to the `DAORegistry`. +If the `subdomain` parameter is non-empty (not `""`) and still available, the ENS name will be registered. +If the registration was successful, the DAO name, contract and creator addresses are emitted in an event. + +For more details visit the [`DAORegistry` reference guide entry](../../../03-reference-guide/framework/dao/DAORegistry.md). diff --git a/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/02-plugin-management/01-plugin-repo/01-plugin-repo-creation.md b/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/02-plugin-management/01-plugin-repo/01-plugin-repo-creation.md new file mode 100644 index 00000000..dcb875a8 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/02-plugin-management/01-plugin-repo/01-plugin-repo-creation.md @@ -0,0 +1,65 @@ +--- +title: Publishing a Plugin +--- + +## Start publishing your Plugin by creating a PluginRepo + +To be available for installation in the Aragon OSx framework, a `PluginRepo` must be created for each plugin. The `PluginRepo` creation process is handled by: + +- The [`PluginRepoFactory`](../../../../03-reference-guide/framework/plugin/repo/PluginRepoFactory.md): who creates the `PluginRepo` instance for each plugin to hold all plugin versions +- The [`PluginRepoRegistry`](../../../../03-reference-guide/framework/plugin/repo/PluginRepoRegistry.md): who registers the Plugin into the Protocol for DAOs to install. + + + +### The `PluginRepoFactory` Contract + +The `PluginRepoFactory` is the contract in charge of creating the first version of a plugin. It does this through the `createPluginRepoWithFirstVersion` function which creates a `PluginRepo` instance for the plugin with the first release and first build (`v1.1`). + +```solidity title="@aragon/framework/repo/PluginRepoFactory.sol" +/// @notice Creates and registers a `PluginRepo` with an ENS subdomain and publishes an initial version `1.1`. +/// @param _subdomain The plugin repository subdomain. +/// @param _pluginSetup The plugin factory contract associated with the plugin version. +/// @param _maintainer The plugin maintainer address. +/// @param _releaseMetadata The release metadata URI. +/// @param _buildMetadata The build metadata URI. +/// @dev After the creation of the `PluginRepo` and release of the first version by the factory, ownership is transferred to the `_maintainer` address. +function createPluginRepoWithFirstVersion( + string calldata _subdomain, + address _pluginSetup, + address _maintainer, + bytes memory _releaseMetadata, + bytes memory _buildMetadata +) external returns (PluginRepo pluginRepo); +``` + +It also registers the plugin in the Aragon OSx `PluginRepoRegistry`contract with an [ENS subdomain](../../03-ens-names.md) under the `plugin.dao.eth` domain managed by Aragon. + +Additional to the information required by the [`createVersion` function discussed earlier](./index.md#the-pluginrepo-contract), it receives: + +- A valid ENS `_subdomain` unique name composed of letters from a-z, all in lower caps, separated by a `-`. For ex: `token-voting-plugin`. +- The address of the plugin repo maintainer who ends up having the `ROOT_PERMISSION_ID`, `MAINTAINER_PERMISSION_ID`, and `UPGRADE_REPO_PERMISSION_ID` permissions. These permissions enable the maintainer to call the internal `PermissionManager`, the `createVersion` and `updateReleaseMetadata` functions as well as upgrading the plugin contract. + +For more details visit the [`PluginRepoFactory` Reference Guide entry](../../../../03-reference-guide/framework/plugin/repo/PluginRepoFactory.md). + +### The `PluginRepoRegistry` Contract + +The `PluginRepoRegistry` contract is the central contract listing all the plugins managed through the Aragon OSx protocol. The `PluginRepoFactory` calls on the `PluginRepoRegistry` to register the plugin in the Aragon OSx protocol. + +```solidity title="@aragon/framework/PluginRepoRegistry.sol" +/// @notice Registers a plugin repository with a subdomain and address. +/// @param subdomain The subdomain of the PluginRepo. +/// @param pluginRepo The address of the PluginRepo contract. +function registerPluginRepo( +string calldata subdomain, +address pluginRepo +) external auth(REGISTER_PLUGIN_REPO_PERMISSION_ID) { + ... +} +``` + +For more details visit the [`PluginRepoRegistry` reference guide entry](../../../../03-reference-guide/framework/plugin/repo/PluginRepoRegistry.md). diff --git a/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/02-plugin-management/01-plugin-repo/index.md b/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/02-plugin-management/01-plugin-repo/index.md new file mode 100644 index 00000000..fd58973e --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/02-plugin-management/01-plugin-repo/index.md @@ -0,0 +1,57 @@ +--- +title: Plugin Repositories +--- + +## What are Plugin Repositories? + +Each plugin has its own Plugin Repository, unique ENS name, and on-chain repository contract, the `PluginRepo`, in which different versions of the plugin are stored for reference using verstion tags constituted by a **release** and **build** number. + +Different versions might contain: + +- bug fixes +- new features +- breaking changes + +`PluginRepo` contracts themselves, each associated with a different plugin, are registered in the Aragon OSx [`PluginRepoRegistry`](./01-plugin-repo-creation.md#the-pluginreporegistry-contract) and carry their own [ENS name](../../03-ens-names.md) that the creator chooses. The [`PluginRepoRegistry` contract](./01-plugin-repo-creation.md#the-pluginreporegistry-contract) is described in the upcoming subsection. + +
+ +![Schematic depiction of the versioning taking place in the PluginRepoRegistry.](./plugin-repo-overview.drawio.svg) + +

+ Overview of the plugin versioning and registry in the Aragon OSx protocol. The `PluginRepoRegistry` contract, which is a curated list of ENS named `PluginRepo` contracts, is shown on the left. Each `PluginRepo` contract maintains a list of versions of the `PluginSetup` contract (internally referencing the `Plugin` implementation contract) and the associated UI building blocks as a URI, examplarily shown on the right. +

+ +
+ +### The `PluginRepo` Contract + +The `PluginRepo` contract versions the releases of a `Plugin`. The first version of a plugin is always published as release 1 and build 1 (version tag `1.1`). +When you publish the first plugin version, a new plugin repository is automatically created for you by the Aragon OSx protocol in which you are the maintainer. The creation process is described in the [plugin repo creation process](./01-plugin-repo-creation.md) section. + +The `PluginRepo` contract is [UUPS upgradeable](https://eips.ethereum.org/EIPS/eip-1822), inherits from the [`PermissionManager`](../../../01-core/02-permissions/index.md) and allows the maintainer of the repository to create new versions with the `createVersion` function: + +```solidity title="@aragon/framework/repo/PluginRepo.sol" +/// @notice Creates a new plugin version as the latest build for an existing release number or the first build for a new release number for the provided `PluginSetup` contract address and metadata. +/// @param _release The release number. +/// @param _pluginSetupAddress The address of the plugin setup contract. +/// @param _buildMetadata The build metadata URI. +/// @param _releaseMetadata The release metadata URI. +function createVersion( + uint8 _release, + address _pluginSetup, + bytes calldata _buildMetadata, + bytes calldata _releaseMetadata +) external auth(address(this), MAINTAINER_PERMISSION_ID); +``` + +The function receives four input arguments: + +1. The `_release` number to create the build for. If the release number exists already (e.g., release `1`), it is registered as the latest build (e.g., `1.3` if the previous build was `1.2`). If it is a new release number, the build number is `1` (e.g., `2.1`). +2. The address of `PluginSetup` contract internally referencing the implementation contract (to copy, proxy, or clone from it) and taking care of [installing, updating to, and uninstalling](../02-plugin-setup/index.md) this specific version. +3. The `_buildMetadata` URI pointing to a JSON file containing the UI data, setup data, and change description for this specific version. +4. The `_releaseMetadata` URI pointing to a JSON file containing the plugin name, description, as well as optional data such as images to be shown in the aragonApp frontend. + +Other functions present in the contract allow you to query previous versions and to update the release metadata. For more details visit the [`PluginRepo` reference guide entry](../../../../03-reference-guide/framework/plugin/repo/PluginRepo.md). + +The `PluginRepo` is created for you when you publish the `PluginSetup` contract of your first version to the Aragon OSx protocol, which is explained in the next section: [The Plugin Repo Creation Process](01-plugin-repo-creation.md). diff --git a/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/02-plugin-management/01-plugin-repo/plugin-repo-overview.drawio.svg b/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/02-plugin-management/01-plugin-repo/plugin-repo-overview.drawio.svg new file mode 100644 index 00000000..ab6bba1f --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/02-plugin-management/01-plugin-repo/plugin-repo-overview.drawio.svg @@ -0,0 +1,41 @@ +
PluginRepoRegistry
+ PluginRepoRegistry +
0x54...
+ 0x54... +
PluginRepo
ENS name
+ PluginRepo... +
1.2
+ 1.2 +
1.3
+ 1.3 +
2.1
+ 2.1 +
...
+ ... +
1.1
+ 1.1 +
0xf2...
+ 0xf2... +
0x1a...
+ 0x1a... +
...
+ ... +
Version
+ Version +
Plugin
+ Plugin +
PluginSetup
+ PluginSetup +
1.1
+ 1.1 +
Metadata
+ Metadata +
Tag
+ Tag +
Build
+ Build +
Release
+ Release +
+ Text is not SVG - cannot display +
\ No newline at end of file diff --git a/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/02-plugin-management/02-plugin-setup/01-security-risk-mitigation.md b/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/02-plugin-management/02-plugin-setup/01-security-risk-mitigation.md new file mode 100644 index 00000000..33015ebe --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/02-plugin-management/02-plugin-setup/01-security-risk-mitigation.md @@ -0,0 +1,63 @@ +--- +title: Plugin Security and Risks +--- + +## Risks and Their Mitigation + +Extending the functionality of your DAO in the form of plugins can introduce risks, particularly, if this code comes from unaudited and untrusted sources. + +### Risks + +If a plugin has a bug or vulnerability that can be exploited, this can result in loss of funds or compromise the DAO. + +Besides, standard vulnerabilities such as + +- Re-entrancy +- Default function visibility +- Leaving contracts uninitialized +- Time or oracle manipulation attacks +- Integer overflow & underflow + +that might be carelessly or intentionally caused, a malicious plugin can hide **backdoors** in its code or request **elevated permissions** in the installation, upgrade, or uninstallation process to the attacker. + +#### Backdoors + +- [metamorpic contracts](https://a16zcrypto.com/metamorphic-smart-contract-detector-tool/) (contracts, that can be redeployed with new code to the same address) +- malicious repurposing of storage in an update of an upgradeable plugin contract + + + +#### Permissions + +Examples for elevated permissions, are the [permissions native to the DAO contract](../../../01-core/02-permissions/index.md#permissions-native-to-the-dao-contract) such as + +- `ROOT_PERMISSION_ID` +- `EXECUTE_PERMISSION_ID` +- `UPGRADE_DAO_PERMISSION_ID` + +That should never be granted to untrusted addresses as they can be used to take control over your DAO. + +Likewise, one must be careful to not lock your DAO accidentally by + +- uninstalling the last governance plugin with `EXECUTE_PERMISSION_ID` permission +- revoking the `ROOT_PERMISSION_ID` permission from itself or +- choosing governance settings and execution criteria that most likely can never be met (e.g., requiring 100% participation for a token vote to pass) + +### Mitigation + +To mitigate the risks mentioned above, proposals requesting the setup of one or multiple plugins must be carefully examined and reviewed by inspecting + +- The implementation contract +- The setup contract, i.e., + - The installation and deployment logic + - The requested permission + - The helper contracts accompanying the plugin +- The UI components, i.e., + - Misleading (re-)naming of input fields, buttons, or other elements + +Generally, we recommend only installing plugins from trusted, verified sources such as those verified by Aragon. + +More information can be found in the How-to guides + +- [Operating your DAO](../../../../02-how-to-guides/01-dao/index.md) +- [Developing a Plugin](../../../../02-how-to-guides/02-plugin-development/index.md) diff --git a/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/02-plugin-management/02-plugin-setup/index.md b/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/02-plugin-management/02-plugin-setup/index.md new file mode 100644 index 00000000..330b81fa --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/02-plugin-management/02-plugin-setup/index.md @@ -0,0 +1,98 @@ +--- +title: Installing Plugins +--- + +## The Smart Contracts Behind Plugins + +A DAO can be set up and customized by the **installation, update, and uninstallation** of plugins. Plugins are composed of two key contracts: + +- **Plugin contract:** contains the plugin's implementation logic; everything needed to extend the functionality for DAOs. +- **Plugin Setup contract:** contains the instructions needed to install, update, and uninstall the plugin into the DAO. This is done through granting or revoking permissions, enabling plugins to perform actions within the scope of the DAO. + +![Aragon OSx Plugins](https://res.cloudinary.com/dacofvu8m/image/upload/v1683225098/Screen_Shot_2023-05-04_at_14.31.25_r0qqut.png) + +How this works: + +- Although a Plugin is composed by the `Plugin` and `PluginSetup` contracts, the Aragon OSx protocol only knows of the `PluginSetup` contract. +- Since the `PluginSetup` contract is the one containing the plugin installation instructions, it is the one in charge of deploying the Plugin instance. Each plugin instance is specific to that DAO, deployed with its own unique parameters. You can review how to build a `PluginSetup` contract [here](../../../../02-how-to-guides/02-plugin-development/index.md). +- The `PluginSetup` contract then interacts with the Aragon OSx framework's `PluginSetupProcessor` contract, which is in charge of applying the installion, update, or uninstallation of a plugin into a DAO. +- Publishing a Plugin into the Aragon OSx protocol is done through creating the first version of the plugin's `PluginRepo`. The plugin's `PluginRepo` instance stores all plugin versions. You can read more about that [here](../../../../02-how-to-guides/02-plugin-development/07-publication/index.md). +- Except for the gas costs required, plugins are completely free to install, unless decided otherwise by the developer. + +### How are Plugins installed in DAOs? + +The `PluginSetup` processing is **security critical** because the permissions it handles are granted to third-party contracts. + +**Safety is our top priority in the design of the whole protocol.** We want to make sure that the DAO members know exactly what permissions are granted to whom before any processing takes place. + +This is why we see the installation process in two phases: + +1. **Preparation:** Defining the parameters to be set on the new plugin instance and helpers, as well as requesting the permissions needed for it to work properly. The `PluginSetup` contains the setup script where developers can perform any unprivileged operations. These will need a privileged confirmation in the next step. +2. **Application:** The granting or revoking of the plugin's requested permissions (based on the preparation step above). This is a privileged action performed by Aragon's `PluginSetupProcessor` (you can understand it as the "installer"), so that the plugin becomes effectively installed or uninstalled. It gets executed whenever someone with `ROOT` privileges on the DAO applies it (most likely through a proposal). + +The `PluginSetupProcessor` is the Aragon contract in charge of invoking the `prepareInstallation()` function from your plugin's `PluginSetup` contract and use it to prepare the installation and (eventually) apply it once it has been approved by the DAO. + +#### What happens during the Plugin Preparation? + +The preparation of a `PluginSetup` contract proceeds as follows: + +1. A DAO builder selects a plugin to install, uninstall, or update. + +2. The DAO builder defines the parameters and settings that he/she wants for their DAO. Depending on the case, the `prepareInstallation`, `prepareUpdate`, or `prepareUninstallation` method in the `PluginSetup` contract is called through the `PluginSetupProcessor` (and creates a unique setup ID). + +3. The [`PluginSetup`](https://github.com/aragon/osx/blob/develop/packages/contracts/src/framework/plugin/setup/PluginSetupProcessor.sol) contract deploys all the contracts and gathers addresses and other input arguments required for the installation/uninstallation/upgrade instructions. This can include: + + - deployment of new contracts + - initialization of new storage variables + - deprecating/decomissioning outdated (helper) contracts + - governance settings or other attributes + - ... + + Because the addresses of all associated contracts are now known, a static permission list can be emitted, hashed, and stored on-chain. + +4. Once the Plugin installation has been prepared, we use it as the parameter of the `applyInstallation()` action. Once encoded, this action is what must be added to the `Action[]` array of the installation proposal. That way, when the proposal passes, the action becomes executable and the plugin can be installed in the DAO using the parameters defined in the prepare installation process. For a plugin to be installed, it needs to be approved by the governance mechanism (plugin) of the organization, passed as the encoded action of a proposal, and executed by a signer. + +:::info +The governance plugin can be a simple majority vote, an optimistic process or an admin governance plugin that does not involve a waiting period. It can be any governance mechanism existing within the DAO which has access to the DAO's `execute` permission. +::: + +This gives the DAO members the opportunity to check which permissions the `PluginSetup` contract request before granting/revoking them. + +Plugin setup proposals must be carefully examined as they can be a potential security risk if the `PluginSetup` contract comes from an untrusted source. To learn more visit the [Security](./01-security-risk-mitigation.md) section. + + + +#### What happens during the Preparation Application? + +After this initial preparation transaction, the addresses and permissions related to the plugin become apparent. The members of a governance plugin with permissions can decide if the installation proposal should be accepted or denied. + +Once the proposal has passed, the actions specified in the `Action[]` array can get executed and the `applyInstallation()` action is used to complete the installation of the plugin into the DAO. + +This is processed as follows: + +1. The DAO temporarily grants the `ROOT_PERMISSION_ID` permission to the `PluginSetupProcessor`. This is needed so that the processor can modify the DAO's permissions settings to set up the plugin. +2. This `Action` calls the `applyInstallation`, `applyUpdate`, or `applyUninstallation` method in the `PluginSetupProcessor`, containing the list of requested permissions as argument. The permissions hash is compared with the stored hash to make sure that no permission was changed. + In addition to the above, the update process also upgrades the logic contract to which the proxy points too. +3. If the hash is valid, the list is processed and `PluginSetupProcessor` conducts the requested sequence of `grant`, `grantWithCondition` and `revoke` calls on the owning DAO. + Finally, the `PluginSetupProcessor` asks the DAO to revoke the `ROOT_PERMISSION_ID` permission from itself. + +:::info +The two-step setup procedure in Aragon OSx is not limited to the setup of only one plugin — you can **setup multiple plugins at once** by first preparing them in a single proposal and then processing the entire setup sequence in one transaction. This is powerful and allows you to **transform your entire DAO in one proposal**, for example, to install a new governance plugin (e.g., a gasless ZK-vote) and finance plugin (e.g., to stream loans to your members), while uninstalling your old ERC20 token vote in one go. +::: + +In the next sections, you will learn about how plugins are curated on Aragon's repository. + +
+ +**a.** ![Schematic depiction of the plugin installation process.](plugin-installation.drawio.svg) +**b.** ![Schematic depiction of the plugin update process.](plugin-update.drawio.svg) +**c.** ![Schematic depiction of the plugin uninstallation process.](plugin-uninstallation.drawio.svg) + +

+ Simplified overview of the two-transaction plugin a. installation, b. update, and c. uninstallation process with the involved contracts as rounded rectangles, interactions between them as arrows, and relations as dashed lines. The first and second transaction are distinguished by numbering as well as solid and dotted lines, respectively. +

+ +
diff --git a/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/02-plugin-management/02-plugin-setup/plugin-installation.drawio.svg b/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/02-plugin-management/02-plugin-setup/plugin-installation.drawio.svg new file mode 100644 index 00000000..74fa7144 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/02-plugin-management/02-plugin-setup/plugin-installation.drawio.svg @@ -0,0 +1,45 @@ +
1c.createProposal()
+ 1c. createProposal() +
Plugin Repository
+ Plugin Repository +
1b.prepareInstallation()
+ 1b. prepareInstallation() +
DAO
+ DAO +
doSomething() ✨
+ doSomething() ✨ +
Plugin Logic
+ Plugin Logic +
1a.prepareInstallation(repo, version)
+ 1a. prepareInstallation(repo, version) +
2c.grant()
+ 2c. grant() +
Permission
Manager
+ Permission... +
Plugin
+ Plugin +
1.2
+ 1.2 +
1.1
+ 1.1 +
1.2
+ 1.2 +
2a.execute()
+ 2a. execute() +
Proposal:
grant permissions
+ Proposal:... +
2b.applyInstallation()
+ 2b. applyInstallation() +
Plugin Setup Processor
+ Plugin Setup Process... +
Plugin Setup
+ Plugin Setup +
🗳
+ 🗳 +
🧑‍🔧
+ 🧑‍🔧 +
Proposal
Creator
+ Proposal... +
+ Text is not SVG - cannot display +
\ No newline at end of file diff --git a/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/02-plugin-management/02-plugin-setup/plugin-uninstallation.drawio.svg b/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/02-plugin-management/02-plugin-setup/plugin-uninstallation.drawio.svg new file mode 100644 index 00000000..a6eace35 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/02-plugin-management/02-plugin-setup/plugin-uninstallation.drawio.svg @@ -0,0 +1,47 @@ +
doSomething()
+ doSomething() +
Plugin Repository
+ Plugin Repository +
DAO
+ DAO +
Plugin Logic
+ Plugin Logic +
1a.prepareUninstallation(repo, version)
+ 1a. prepareUninstallation(repo, version) +
2c.revoke()
+ 2c. revoke() +
Permission
Manager
+ Permission... +
Plugin
+ Plugin +
1.2
+ 1.2 +
1.1
+ 1.1 +
1.2
+ 1.2 +
2a.execute()
+ 2a. execute() +
1c.createProposal()
+ 1c. createProposal() +
Proposal:
revoke permissions
+ Proposal:... +
2b.applyUninstallation()
+ 2b. applyUninstallation() +
Plugin Setup Processor
+ Plugin Setup Process... +
✂️
+ ✂️ +
Plugin Setup
+ Plugin Setup +
🗳
+ 🗳 +
🧑‍🔧
+ 🧑‍🔧 +
Proposal
Creator
+ Proposal... +
1b.prepareUnnstallation()
+ 1b. prepareUnnstallation() +
+ Text is not SVG - cannot display +
\ No newline at end of file diff --git a/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/02-plugin-management/02-plugin-setup/plugin-update.drawio.svg b/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/02-plugin-management/02-plugin-setup/plugin-update.drawio.svg new file mode 100644 index 00000000..b18ed2a5 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/02-plugin-management/02-plugin-setup/plugin-update.drawio.svg @@ -0,0 +1,53 @@ +
doSomething()
+ doSomething() +
doSomethingNew() ✨
+ doSomethingNew() ✨ +
Plugin
+ Plugin +
Plugin Repository
+ Plugin Repository +
DAO
+ DAO +
2a.execute()
+ 2a. execute() +
2c.grant/revoke()
+ 2c. grant/revoke() +
Permission
Manager
+ Permission... +
2b.applyUpdate()
+ 2b. applyUpdate() +
1c.createProposal()
+ 1c. createProposal() +
Proposal:
modify permissions
+ Proposal:... +
1.2
+ 1.2 +
1.3
+ 1.3 +
Plugin Logic
+ Plugin Logic +
Plugin Setup
+ Plugin Setup +
1.1
+ 1.1 +
1.2
+ 1.2 +
1.3
+ 1.3 +
1a.prepareUpdate(plugin, newVersion)
+ 1a. prepareUpdate(plugin, newVersion) +
Plugin Setup Processor
+ Plugin Setup Process... +
+ ✨ +
🗳
+ 🗳 +
🧑‍🔧
+ 🧑‍🔧 +
Proposal
Creator
+ Proposal... +
1b.prepareUpdate()
+ 1b. prepareUpdate() +
+ Text is not SVG - cannot display +
\ No newline at end of file diff --git a/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/02-plugin-management/index.md b/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/02-plugin-management/index.md new file mode 100644 index 00000000..e26b10cc --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/02-plugin-management/index.md @@ -0,0 +1,53 @@ +--- +title: Plugins +--- + +## Plugins + +As mentioned earlier, plugins built by Aragon and third-party developers can be added and removed from your DAO to adapt it to your needs. + +The management of these plugins is handled for you by the Aragon OSx protocol so that the process of + +- Releasing new plugins as well as +- Installing, updating, and uninstalling them to your DAO + +becomes as streamlined as possible. + +In the following, we learn what a plugin consists of. + + + +### What Does a Plugin Consist Of? + +An Aragon OSx Plugin consists of: + +- The `PluginSetup` contract + + - referencing the `Plugin` implementation internally + - containing the setup instruction to install, update, and uninstall it to an existing DAO + +- A metadata URI pointing to a `JSON` file containing the + + - AragonApp frontend information + - Information needed for the setup ABI + +- A version tag consisting of a + + - Release number + - Build number + +A detailed explanation of the [build and release versioning](../../../02-how-to-guides/02-plugin-development/07-publication/01-versioning.md) is found in the How-to sections in our developer portal. + +
+ +![](./plugin-version.drawio.svg) + +

+ A schematic depiction of a plugin bundle consisting of a version tag, the plugin setup contract pointing to the plugin implementation contract, and a metadata URI. +

+ +
+ +The `PluginSetup` is written by you, the plugin developer. The processing of the setup is managed by the `PluginSetupProcessor`, the central component of the setup process in the Aragon OSx framework, which is explained in the section [The Plugin Setup Process](./02-plugin-setup/index.md). + +Each plugin with its different builds and releases is versioned inside its own plugin repositories in a `PluginRepo` contract, which is explained in the next section. diff --git a/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/02-plugin-management/plugin-version.drawio.svg b/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/02-plugin-management/plugin-version.drawio.svg new file mode 100644 index 00000000..d6d314aa --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/02-plugin-management/plugin-version.drawio.svg @@ -0,0 +1,19 @@ +
Version
+ Version +
Plugin
+ Plugin +
PluginSetup
+ PluginSetup +
1.1
+ 1.1 +
Metadata
+ Metadata +
Tag
+ Tag +
Build
+ Build +
Release
+ Release +
+ Text is not SVG - cannot display +
\ No newline at end of file diff --git a/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/03-ens-names.md b/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/03-ens-names.md new file mode 100644 index 00000000..36446e45 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/03-ens-names.md @@ -0,0 +1,21 @@ +--- +title: ENS Names +--- + +## Unique DAO and Plugin Repo Names + +To make DAOs and plugin repositories easily identifiable in the Aragon OSx ecosystem, we assign unique ENS names to them upon registration during the [DAO creation](./01-dao-creation/index.md) and [plugin publishing](./02-plugin-management/01-plugin-repo/01-plugin-repo-creation.md) processes. + +:::info +You can skip registering an ENS name for your DAO under the `dao.eth` by leaving the [`DAOSettings.subdomain` field](../../03-reference-guide/framework/dao/DAOFactory.md#public-struct-daosettings) empty when calling the [`createDao`](../../03-reference-guide/framework/dao/DAOFactory.md#external-function-createdao) function. +::: + +### Allowed Character Set + +We allow the following characters for the subdomain names: + +- Lowercase letters `a-z` +- Digits `0-9` +- The hyphen `-` + +This way, you can name and share the DAO or plugin repo you have created as `my-cool.dao.eth` or `my-handy.plugin.dao.eth` to make their addresses easily shareable and discoverable on ENS-supporting chains. diff --git a/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/aragon-os-infrastructure-core-overview.drawio.svg b/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/aragon-os-infrastructure-core-overview.drawio.svg new file mode 100644 index 00000000..562f5051 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/aragon-os-infrastructure-core-overview.drawio.svg @@ -0,0 +1,89 @@ +
Framework
+ Framework +
Plugin Management
+ Plugin Management +
DAO Creation
+ DAO Creation +
Core
+ Core +
Plugin
+ Plugin +
IPlugin
+ IPlugin +
DAO
+ DAO +
PermissionManager
+ PermissionManager +
CallbackHandler
+ CallbackHandler +
DaoAuthorizable
+ DaoAuthorizable +
PluginRepo
Registry
+ PluginRepo... +
versions
+ versions +
PluginRepo
+ PluginRepo +
processes
+ processes +
PluginSetup
Procesor
+ PluginSetup... +
registers
+ registers +
creates & manages
+ creates & manages +
PluginSetup
+ PluginSetup +
PluginRepoFactory
+ PluginRepoFactory +
registers
+ registers +
👷
+ 👷 +
Non-upgradeable
+ Non-upgradeable +
Upgradeable
+ Upgradeable +
DaoAuthorizable
Upgradeable
+ DaoAuthorizable... +
connects
+ connects +
ERC-1271
SignatureValidator
+ ERC-1271... +
select Plugins
+ select Plugins +
creates
+ creates +
creates
+ creates +
DAOFactory
+ DAOFactory +
DAORegistry
+ DAORegistry +
creates
+ creates +
PluginCloneable
+ PluginCloneable +
Plugin
+ Plugin +
PluginUUPS Upgradeable
+ PluginUUPS Upgradeab... +
Creation
+ Creation +
Curation
+ Curation +
Setup
+ Setup +
IMembeship
+ IMembeship +
IProposal
+ IProposal +
ERC-4824
DAO Interface
+ ERC-4824... +
provides
data
+ provides... +
Upgradeable
+ Upgradeable +
+ Text is not SVG - cannot display +
\ No newline at end of file diff --git a/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/index.md b/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/index.md new file mode 100644 index 00000000..adc424a2 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/01-how-it-works/02-framework/index.md @@ -0,0 +1,29 @@ +--- +title: Framework - How Everything Connects +--- + +## The Infrastructure Running the Aragon OSx Protocol + +The Aragon OSx protocol is composed of **framework-related contracts** creating and managing the **core contracts**. This includes the + +- [Creation of DAOs](01-dao-creation/index.md) and initial plugin configuration +- [Management of plugins](02-plugin-management/index.md), which includes the + + - The setup in existing DAOs + - The versioning of different implementations and respective setup contracts, UI, and related metadata + +- [Assignment of ENS Names](./03-ens-names.md) to `Plugin` and `DAO` contracts created through the framework + +An overview of the involved contracts and their interactions is shown below: + +
+ +![](aragon-os-infrastructure-core-overview.drawio.svg) + +

+ Overview of the framework and core contracts of the Aragon OSx protocol. +

+ +
+ +In the following sections, you will learn more about the framework-related contracts of the Aragon OSx protocol. diff --git a/versioned_docs/version-1.3.0/osx/01-how-it-works/03-framwork-dao.md b/versioned_docs/version-1.3.0/osx/01-how-it-works/03-framwork-dao.md new file mode 100644 index 00000000..bf7ee42f --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/01-how-it-works/03-framwork-dao.md @@ -0,0 +1,11 @@ +--- +title: Protocol Governance +--- + +## Governing the Aragon OSx Framework + +To govern the framework infrastructure, a **Framework DAO** was deployed. + +The Framework DAO controls the permissions of and between the framework-related contracts required to configure and maintain them as well as to replace or upgrade them. + +This Framework DAO constitutes the **governance layer** of the Aragon OSx DAO Framework. diff --git a/versioned_docs/version-1.3.0/osx/01-how-it-works/aragon-os-framework-overview.drawio.svg b/versioned_docs/version-1.3.0/osx/01-how-it-works/aragon-os-framework-overview.drawio.svg new file mode 100644 index 00000000..e101a296 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/01-how-it-works/aragon-os-framework-overview.drawio.svg @@ -0,0 +1,51 @@ +
External
+ External +
Code Layer
+ Code Layer +
- decide strategy
+ - decide strategy +
- set parameters
- manage permissions
+ - set parameters... +
-create DAOs
-manage plugins

+ - create DAOs... +
- providebasicand
customfunctionalities
+ - provide basic and... +
Responsibilities
+ Responsibilities +
- provide secure
primitives

+ - provide secure... +
Aragon OSx
+ Aragon OSx +
Governance Layer
+ Governance Layer +
governs
+ governs +
Aragon OSx
Framework DAO
+ Aragon OSx... +
governs
+ governs +
Aragon DAO
+ Aragon DAO +
manages / deploys
+ manages / deploys +
OpenZeppelin Contracts
+ OpenZeppelin... +
uses
+ uses +
Core
+ Core +
DAO
+ DAO +
Plugin
+ Plugin +
Framework
+ Framework +
DAO Creation
+ DAO Creation +
Plugin
Management
+ Plugin... +

ENS

+ ENS +
+ Text is not SVG - cannot display +
\ No newline at end of file diff --git a/versioned_docs/version-1.3.0/osx/01-how-it-works/index.md b/versioned_docs/version-1.3.0/osx/01-how-it-works/index.md new file mode 100644 index 00000000..edd79c1c --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/01-how-it-works/index.md @@ -0,0 +1,29 @@ +--- +title: How It Works +--- + +## The Aragon OSx DAO Framework + +The Aragon OSx protocol is a DAO framework structured as follows: + +
+ Aragon architecture diagram +

+ Overview of the Aragon OSx protocol with its structural components and their responsibilities: the governance layer constituted by the framework DAO, the code layer including the framework and core contracts, which depends on external libraries and services +

+
+ +### Code Layer + +The foundation of the Aragon OSx protocol is the **code layer** constituted by the core and framework related contracts. +The [core contracts](./01-core/index.md) provide the core primitives intended to be used by users and implemented by developers of the DAO framework. +The [framework contracts](./02-framework/index.md) provide the infrastructure to easily create and manage your DAOs and plugins easy. +Both are built on top of external dependencies, most notably the [OpenZeppelin](https://www.openzeppelin.com/contracts) and the [Ethereum Name Service (ENS)](https://docs.ens.domains/) contracts. + +The core and framework contracts are free to use, and no additional fees are charged. + +### Governance Layer + +To govern the framework infrastructure, an Aragon OSx [Framework DAO](./03-framwork-dao.md) is deployed constituting the **governance layer** of the Aragon OSx protocol. + +In the next sections, you will learn more about the individual components of the framework. diff --git a/versioned_docs/version-1.3.0/osx/02-how-to-guides/01-dao/01-best-practices.md b/versioned_docs/version-1.3.0/osx/02-how-to-guides/01-dao/01-best-practices.md new file mode 100644 index 00000000..987d064b --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/02-how-to-guides/01-dao/01-best-practices.md @@ -0,0 +1,22 @@ +--- +title: Best Practices +--- + +## Some Advice When Operating your DAO + +### DOs 👌 + +- Make sure that at least one address (typically a governance plugin) has `EXECUTE_PERMISSION_ID` permission so that something can be executed on behalf of the DAO. +- Check every proposal asking to install, update, or uninstall a plugin with utmost care and review. Installation means granting an external contract permissions to do things on behalf of your DAO, so you want to be extra careful about: + - the implementation contract + - the setup contract + - the helper contracts + - the permissions being granted/revoked + +### DON'Ts ✋ + +- Incapacitate your DAO by revoking all `EXECUTE_PERMISSION`. This means your DAO will be blocked and any assets you hold may be locked in forever. This can happen through: + - uninstalling your last governance plugin. + - applying an update to your last governance plugin. +- Don't give permissions to directly call functions from the DAO. Better and safer to use a plugin instead. +- If you're using the Token Voting plugin in your DAO, make sure you don't mint additional tokens without careful consideration. If you mint too many at once, this may lock your DAO, since you will not be able to reach the minimum participation threshold. This happens if there are not enough tokens already on the market to meet the minimum participation percentage and the DAO owns most of the governance tokens. diff --git a/versioned_docs/version-1.3.0/osx/02-how-to-guides/01-dao/02-action-execution.md b/versioned_docs/version-1.3.0/osx/02-how-to-guides/01-dao/02-action-execution.md new file mode 100644 index 00000000..4344ae90 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/02-how-to-guides/01-dao/02-action-execution.md @@ -0,0 +1,150 @@ +--- +title: Executing actions on behalf of the DAO +--- + +## Using the DAO Executor + +Executing actions on behalf of the DAO is done through the `execute` function from the `DAO.sol` contract. This function allows us to [pass an array of actions)](https://github.com/aragon/osx/blob/develop/packages/contracts/src/core/dao/DAO.sol) to be executed by the DAO contract itself. + +However, for the `execute` call to work, the address calling the function (the `msg.sender`) needs to have the [`EXECUTE_PERMISSION`](../../01-how-it-works/01-core/02-permissions/index.md#permissions-native-to-the-dao-contract). This is to prevent anyone from being able to execute actions on behalf of the DAO and keep your assets safe from malicious actors. + +## How to grant the Execute Permission + +Usually, the `EXECUTE_PERMISSION` is granted to a governance plugin of the DAO so that only the approved proposals can be executed. For example, we'd grant the `EXECUTE_PERMISSION` to the address of the Multisig Plugin. That way, when a proposal is approved by the required members of the multisig, the plugin is able to call the `execute` function on the DAO in order to get the actions executed. + +To grant the `EXECUTE_PERMISSION` to an address, you'll want to call on the `PermissionManager`'s [`grant` function](https://github.com/aragon/osx/blob/develop/packages/contracts/src/core/permission/PermissionManager.sol#L105) and pass it 4 parameters: + +- `where`: the address of the contract containing the function `who` wants access to +- `who`: the address (EOA or contract) receiving the permission +- `permissionId`: the permission identifier the caller needs to have in order to be able to execute the action +- `condition`: the address of the condition contract that will be asked (if any) before authorizing the call to happen + +:::caution +You probably don't want to grant `EXECUTE_PERMISSION` to any random address, since this gives the address access to execute any action on behalf of the DAO. We recommend you only grant `EXECUTE_PERMISSION` to governance plugins to ensure the safety of your assets. Granting `EXECUTE_PERMISSION` to an externally owned account is considered an anti-pattern. +::: + +## Examples + +### Calling a DAO Function + +Imagine you want to call an internal function inside the `DAO` contract, for example, to manually [grant or revoke a permission](../../01-how-it-works/01-core/02-permissions/index.md). The corresponding `Action` and `execute` function call look as follows: + +```solidity +function exampleGrantCall( + DAO dao, + bytes32 _callId, + address _where, + address _who, + bytes32 _permissionId +) { + // Create the action array + IDAO.Action[] memory actions = new IDAO.Action[](1); + actions[0] = IDAO.Action({ + to: address(dao), + value: 0, + data: abi.encodeWithSelector(PermissionManager.grant.selector, _where, _who, _permissionId) + }); + + // Execute the action array + (bytes[] memory execResults, ) = dao.execute({ + _callId: _callId, + _actions: actions, + _allowFailureMap: 0 + }); +} +``` + +Here we use the selector of the [`grant` function](../../03-reference-guide/core/permission/PermissionManager.md#external-function-grant). To revoke the permission, the selector of the [`revoke` function](../../03-reference-guide/core/permission/PermissionManager.md#external-function-revoke) must be used. + +If the caller possesses the [`ROOT_PERMISSION_ID` permission](../../01-how-it-works/01-core/02-permissions/index.md#permissions-native-to-the-dao-contract) on the DAO contract, the call becomes simpler and cheaper: + +:::caution +Granting the `ROOT_PERMISSION_ID` permission to other contracts other than the `DAO` contract is dangerous and considered as an anti-pattern. +::: + +```solidity +function exampleGrantFunction(DAO dao, address _where, address _who, bytes32 _permissionId) { + dao.grant(_where, _who, _permissionId); // For this to work, the `msg.sender` needs the `ROOT_PERMISSION_ID` +} +``` + +### Sending Native Tokens + +Send `0.1 ETH` from the DAO treasury to Alice. +The corresponding `Action` and `execute` function call would look as follows: + +```solidity +function exampleNativeTokenTransfer(IDAO dao, bytes32 _callId, address _receiver) { + // Create the action array + IDAO.Action[] memory actions = new IDAO.Action[](1); + + actions[0] = IDAO.Action({to: _receiver, value: 0.1 ether, data: ''}); + + // Execute the action array + dao.execute({_callId: _callId, _actions: actions, _allowFailureMap: 0}); +} +``` + +### Calling a Function from an External Contract + +Imagine that you want to call an external function, let's say in a `Calculator` contract that adds two numbers for you. The corresponding `Action` and `execute` function call look as follows: + +```solidity +contract ICalculator { + function add(uint256 _a, uint256 _b) external pure returns (uint256 sum); +} + +function exampleFunctionCall( + IDAO dao, + bytes32 _callId, + ICalculator _calculator, + uint256 _a, + uint256 _b +) { + // Create the action array + IDAO.Action[] memory actions = new IDAO.Action[](1); + actions[0] = IDAO.Action({ + to: address(_calculator), + value: 0, // 0 native tokens must be sent with this call + data: abi.encodeCall(_calculator.add, (_a, _b)) + }); + + // Execute the action array + (bytes[] memory execResults, ) = dao.execute({ + _callId: _callId, + _actions: actions, + _allowFailureMap: 0 + }); + + // Decode the action results + uint256 sum = abi.decode(execResults[0], (uint256)); // the result of `add(_a,_b)` +} +``` + +### Calling a Payable Function + +Wrap `0.1 ETH` from the DAO treasury into `wETH` by depositing it into the [Goerli WETH9 contract](https://goerli.etherscan.io/token/0xb4fbf271143f4fbf7b91a5ded31805e42b2208d6#writeContract). +The corresponding `Action` and `execute` function call look as follows: + +```solidity +interface IWETH9 { + function deposit() external payable; + + function withdraw(uint256 _amount) external; +} + +function examplePayableFunctionCall(IDAO dao, bytes32 _callId, IWETH9 _wethToken) { + // Create the action array + + IDAO.Action[] memory actions = new IDAO.Action[](1); + + actions[0] = IDAO.Action({ + to: address(_wethToken), + value: 0.1 ether, + data: abi.encodeCall(IWETH9.deposit, ()) + }); + + // Execute the action array + dao.execute({_callId: _callId, _actions: actions, _allowFailureMap: 0}); +} +``` diff --git a/versioned_docs/version-1.3.0/osx/02-how-to-guides/01-dao/03-protocol-upgrades.md b/versioned_docs/version-1.3.0/osx/02-how-to-guides/01-dao/03-protocol-upgrades.md new file mode 100644 index 00000000..ad874d1b --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/02-how-to-guides/01-dao/03-protocol-upgrades.md @@ -0,0 +1,13 @@ +--- +title: Upgrade your DAO to future Aragon OSx Versions +--- + +## Upgrading to Future Aragon OSx Protocol Versions + +At Aragon, we are constantly working on improving the Aragon OSx framework. + +To make it easy for your DAO to switch to future Aragon OSx protocol versions, we added the possibility to upgrade our protocol in the future. + +Whenever we provide a new Aragon OSx protocol version, it will be possible to upgrade your DAO and associated plugins through your DAO dashboard. + +[Add your email here](https://aragondevelopers.substack.com/) if you'd like to receive updates when this happens! diff --git a/versioned_docs/version-1.3.0/osx/02-how-to-guides/01-dao/04-managing-plugins/index.md b/versioned_docs/version-1.3.0/osx/02-how-to-guides/01-dao/04-managing-plugins/index.md new file mode 100644 index 00000000..57f31704 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/02-how-to-guides/01-dao/04-managing-plugins/index.md @@ -0,0 +1,50 @@ +--- +title: Manage your DAO's Plugins +--- + +## How to manage the Plugins within your DAO + + + +You can install, uninstall or update any plugin into your DAO. If you want to dive deeper into plugins, check out [how plugins work here](../../../01-how-it-works/01-core/03-plugins/index.md). + +Before diving deeper into this guide, make sure that you understand [permissions](../../../01-how-it-works/01-core/02-permissions/index.md) and know about the [DAO executor](../../../01-how-it-works/01-core/01-dao/index.md). + +#### How to create a DAO with Plugins + +When you create your DAO, you must **install at least one functioning governance plugin** (meaning one plugin having the `EXECUTION_PERMISSION`) so your have a mechanism of executing actions on behalf of your DAO. +This is crucial because otherwise nobody can operate the DAO and it would become incapacitated right after it was created. You would have spent gas for nothing. + +:::info +If you create your DAO through the [Aragon App](https://app.aragon.org) or the [Aragon SDK](https://devs.aragon.org/docs/sdk), this will be checked and you will be warned in case you have not selected a suitable Aragon plugin. +::: + +Although the easiest (and recommended) way to create your DAO is through the [Aragon App](https://app.aragon.org) or the [Aragon SDK](https://devs.aragon.org/docs/sdk), you can also do it directly from the protocol through calling on the [`createDAO` function](https://github.com/aragon/osx/blob/develop/packages/contracts/src/framework/dao/DAOFactory.sol#L63) from the `DAOFactory` contract and passing it the calldata `DAOSettings` for your DAO as well as the `PluginSettings` array referencing the plugins and the settings to be installed upon DAO creation. + + + +#### How to change a DAO's Governance Setup after a DAO has been created + +After a DAO is created with at least one plugin installed with `EXECUTE_PERMISSION` on the DAO, it's likely you may want to change change your governance setup later on by [installing, updating, or uninstalling plugins](../../../01-how-it-works/02-framework/02-plugin-management/02-plugin-setup/index.md). + +Here, it is very important that you **maintain at least one functioning governance plugin** (a contract with `EXECUTE_PERMISSION` on the DAO) so that your assets are not locked in the future. In that regard, you want to be careful to not accidentally: + +- uninstall every plugin within your DAO, or +- update or upgrade the plugin or otherwise change the internal plugin settings. + +If you do that, nobody would be able to create proposals and execute actions on the DAO anymore. Accordingly, DAOs must review proposals requesting to change the governance setup with utmost care before voting for them. In the next section, we explain how to review a proposal properly and what to pay attention too. + + + +### How to maintain Execution Permission on the DAO + +A very important thing to consider when operating your DAO is to make sure that you do not lock it - meaning, you allow it into a state where the DAO cannot execute actions anymore. + +The accidental loss of the permission to execute actions on your DAO ([the `EXECUTION_PERMISSION_ID` permission](../../../01-how-it-works/01-core/02-permissions/index.md#permissions-native-to-the-dao-contract)) incapacitates your DAO. If this happens, you are not able to withdraw funds or act through the DAO, unless you have the `ROOT_PERMISSION_ID` on the DAO. + +:::danger +Do not interact directly with the smart contracts unless you know exactly what you are doing, **especially if this involves granting or revoking permissions**. Instead, use the Aragon App or Aragon SDK for creating and managing your DAO and interacting with the smart contracts. +::: + +If you interact with the Aragon OSx protocol through the Aragon App frontend or the Aragon SDK and use only audited and verified plugins, this will not happen. +However, diligence and care is required in some situations. diff --git a/versioned_docs/version-1.3.0/osx/02-how-to-guides/01-dao/index.md b/versioned_docs/version-1.3.0/osx/02-how-to-guides/01-dao/index.md new file mode 100644 index 00000000..e50ec109 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/02-how-to-guides/01-dao/index.md @@ -0,0 +1,27 @@ +--- +title: How to Operate a DAO +--- + +DAOs are decentralized autonomous organizations. They are a group of people managing on-chain assets through a set of smart contracts. + +## What do you need to know in order to operate your DAO? + +DAOs manage assets through collective decision-making mechanisms. Although a lot can be said of the social, behavioral aspects of operating a DAO, in this guide we will focus on the technical aspects. + +In Aragon OSx, DAOs are a treasury and a permission management system - all other functionality is enabled through "capsules of opt-in functionality allowing the DAO to work in custom ways". These are called Plugins. + +:::note +Plugins are smart contracts which extend the functionality of what the DAO can do. They are able to execute actions on behalf of the DAO through permissions the DAO grants or revokes them. +::: + +Decision-making mechanisms are one example of Plugins. Treasury management, action bundles, or connections to other smart contracts are others. + + + + +In this section, we'll go through how to operate and maintain your DAO: + +- [A Summary of Best Practices](./01-best-practices.md) +- [How to execute actions on behalf of the DAO](./02-action-execution.md) +- [How to manage a DAO's plugins](./04-managing-plugins/index.md) +- [How to upgrade your DAO to a future Aragon OSx Releases](./03-protocol-upgrades.md) diff --git a/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/01-best-practices.md b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/01-best-practices.md new file mode 100644 index 00000000..7230dc4e --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/01-best-practices.md @@ -0,0 +1,30 @@ +--- +title: Before Starting +--- + +## Advice for Developing a Plugin + +### DOs 👌 + +- Document your contracts using [NatSpec](https://docs.soliditylang.org/en/v0.8.17/natspec-format.html). +- Test your contracts, e.g., using toolkits such as [hardhat (JS)](https://hardhat.org/hardhat-runner/docs/guides/test-contracts) or [Foundry (Rust)](https://book.getfoundry.sh/forge/tests). +- Use the `auth` modifier to control the access to functions in your plugin instead of `onlyOwner` or similar. +- Write plugins implementations that need minimal permissions on the DAO. +- Write `PluginSetup` contracts that remove all permissions on uninstallation that they requested during installation or updates. +- Plan the lifecycle of your plugin (need for upgrades). +- Follow our [versioning guidelines](../02-plugin-development/07-publication/01-versioning.md). + +### DON'Ts ✋ + +- Leave any contract uninitialized. +- Grant the `ROOT_PERMISSION_ID` permission to anything or anyone. +- Grant with `who: ANY_ADDR` unless you know what you are doing. +- Expect people to grant or revoke any permissions manually during the lifecycle of a plugin. The `PluginSetup` should take this complexity away from the user and after uninstallation, all permissions should be removed. +- Write upgradeable contracts that: + - Repurpose existing storage (in upgradeable plugins). + - Inherit from previous versions as this can mess up the inheritance chain. Instead, write self-contained contracts. + + + + +In the following sections, you will learn about the details about plugin development. diff --git a/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/02-plugin-types.md b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/02-plugin-types.md new file mode 100644 index 00000000..3979f990 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/02-plugin-types.md @@ -0,0 +1,73 @@ +--- +title: Choosing the Plugin Type +--- + +## How to Choose the Base Contract for Your Plugin + +Although it is not mandatory to choose one of our interfaces as the base contracts for your plugins, we do offer some options for you to inherit from and speed up development. + +The needs of your plugin determine the type of plugin you may want to choose. This is based on: + +- the need for a plugin's upgradeability +- whether you need it deployed by a specific deployment method +- whether you need it to be compatible with meta transactions + +In this regard, we provide 3 options for base contracts you can choose from: + +- `Plugin` for instantiation via `new` +- `PluginClones` for [minimal proxy pattern (ERC-1167)](https://eips.ethereum.org/EIPS/eip-1167) deployment +- `PluginUUPSUpgradeable` for [UUPS pattern (ERC-1822)](https://eips.ethereum.org/EIPS/eip-1822) deployment + +Let's take a look at what this means for you. + +### Upgradeability & Deployment + +Upgradeability and the deployment method of a plugin contract go hand in hand. The motivation behind upgrading smart contracts is nicely summarized by OpenZeppelin: + +> Smart contracts in Ethereum are immutable by default. Once you create them there is no way to alter them, effectively acting as an unbreakable contract among participants. +> +> However, for some scenarios, it is desirable to be able to modify them [...] +> +> - to fix a bug [...], +> - to add additional features, or simply to +> - change the rules enforced by it. +> +> Here’s what you’d need to do to fix a bug in a contract you cannot upgrade: +> +> 1. Deploy a new version of the contract +> 2. Manually migrate all state from the old one contract to the new one (which can be very expensive in terms of gas fees!) +> 3. Update all contracts that interacted with the old contract to use the address of the new one +> 4. Reach out to all your users and convince them to start using the new deployment (and handle both contracts being used simultaneously, as users are slow to migrate +> +> _source: [OpenZeppelin: What's in an upgrade](https://docs.openzeppelin.com/learn/upgrading-smart-contracts#whats-in-an-upgrade)_ + +Some key things to keep in mind: + +- With upgradeable smart contracts, you can modify their code while keep using or even extending the storage (see the guide [Writing Upgradeable Contracts](https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable) by OpenZepplin). +- To enable upgradeable smart contracts (as well as cheap contract clones), the proxy pattern is used. +- Depending on your upgradeability requirements and the deployment method you choose, you can also greatly reduce the gas costs to distribute your plugin. However, the upgradeability and deployment method can introduce caveats during [the plugin setup](../../01-how-it-works/02-framework/02-plugin-management/02-plugin-setup/index.md), especially when updating from an older version to a new one. + +The following table compares the different deployment methods with their benefits and drawbacks: + +| | `new` Instantiation | Minimal Proxy (Clones) | Transparent Proxy | UUPS Proxy | +| ------------- | --------------------------------------------- | ------------------------------------------------- | ------------------------------------------------ | --------------------------------------------- | +| upgradability | no | no | yes | yes | +| gas costs | high | very low | moderate | low | +| difficulty | low | low | high | high | + +Accordingly, we recommend to use [minimal proxies (ERC-1167)](https://eips.ethereum.org/EIPS/eip-1167) for non-upgradeable and [UUPS proxies (1822)](https://eips.ethereum.org/EIPS/eip-1822) for upgradeable plugin. +To help you with developing and deploying your plugin within the Aragon infrastructure, we provide the following implementation that you can inherit from: + +- `Plugin` for instantiation via `new` +- `PluginClones` for [minimal proxy pattern (ERC-1167)](https://eips.ethereum.org/EIPS/eip-1167) deployment +- `PluginUUPSUpgradeable` for [UUPS pattern (ERC-1822)](https://eips.ethereum.org/EIPS/eip-1822) deployment + +#### Caveats of Non-upgradeable Plugins + +Aragon plugins using the non-upgradeable smart contracts bases (`Plugin`, `PluginCloneable`) can be cheap to deploy (i.e., using clones) but **cannot be updated**. + +Updating, in distinction from upgrading, will call Aragon OSx' internal process for switching from an older plugin version to a newer one. + +:::caution +To switch from an older version of a non-upgradeable contract to a newer one, the underlying contract has to be replaced. In consequence, the state of the older version is not available in the new version anymore, unless it is migrated or has been made publicly accessible in the old version through getter functions. +::: diff --git a/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/03-non-upgradeable-plugin/01-initialization.md b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/03-non-upgradeable-plugin/01-initialization.md new file mode 100644 index 00000000..c32733b8 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/03-non-upgradeable-plugin/01-initialization.md @@ -0,0 +1,81 @@ +--- +title: Initialization +--- + +## How to Initialize Non-Upgradeable Plugins + +Every plugin should receive and store the address of the DAO it is associated with upon initialization. This is how the plugin will be able to interact with the DAO that has installed it. + +In addition, your plugin implementation might want to introduce other storage variables that should be initialized immediately after the contract was created. For example, in the `SimpleAdmin` plugin example (which sets one address as the full admin of the DAO), we'd want to store the `admin` address. + +```solidity +contract SimpleAdmin is Plugin { + address public admin; +} +``` + +The way we set up the plugin's `initialize()` function depends on the plugin type selected. To review plugin types in depth, check out our [guide here](../02-plugin-types.md). + +Additionally, the way we deploy our contracts is directly correlated with how they're initialized. For Non-Upgradeable Plugins, there's two ways in which we can deploy our plugin: + +- Deployment via Solidity's `new` keyword, OR +- Deployment via the Minimal Proxy Pattern + +### Option A: Deployment via Solidity's `new` Keyword + +To instantiate the contract via Solidity's `new` keyword, you should inherit from the `Plugin` Base Template Aragon created. You can find it [here](https://github.com/aragon/osx-commons/blob/develop/contracts/src/plugin/Plugin.sol). + +In this case, the compiler will force you to write a `constructor` function calling the `Plugin` parent `constructor` and provide it with a contract of type `IDAO`. Inside the constructor, you might want to initialize the storage variables that you have added yourself, such as the `admin` address in the example below. + +```solidity +// SPDX-License-Identifier: AGPL-3.0-or-later +pragma solidity 0.8.21; + +import {Plugin, IDAO} from '@aragon/osx/core/plugin/Plugin.sol'; + +contract SimpleAdmin is Plugin { + address public immutable admin; + + /// @notice Initializes the contract. + /// @param _dao The associated DAO. + /// @param _admin The address of the admin. + constructor(IDAO _dao, address _admin) Plugin(_dao) { + admin = _admin; + } +} +``` + +:::note +The `admin` variable is set as `immutable` so that it can never be changed. Immutable variables can only be initialized in the constructor. +::: + +This type of constructor implementation stores the `IDAO _dao` reference in the right place. If your plugin is deployed often, which we could expect, we can [save significant amounts of gas by deployment through using the minimal proxy pattern](https://blog.openzeppelin.com/workshop-recap-cheap-contract-deployment-through-clones/). + +### Option B: Deployment via the Minimal Proxy Pattern + +To deploy our plugin via the [minimal clones pattern (ERC-1167)](https://eips.ethereum.org/EIPS/eip-1167), you inherit from the `PluginCloneable` contract introducing the same features as `Plugin`. The only difference is that you now have to remember to write an `initialize` function. + +```solidity +// SPDX-License-Identifier: AGPL-3.0-or-later +pragma solidity 0.8.21; + +import {PluginCloneable, IDAO} from '@aragon/osx/core/plugin/PluginCloneable.sol'; + +contract SimpleAdmin is PluginCloneable { + address public admin; + + /// @notice Initializes the contract. + /// @param _dao The associated DAO. + /// @param _admin The address of the admin. + function initialize(IDAO _dao, address _admin) external initializer { + __PluginCloneable_init(_dao); + admin = _admin; + } +} +``` + +We must protect it from being called multiple times by using [OpenZepplin's `initializer` modifier made available through `Initalizable`](https://docs.openzeppelin.com/contracts/4.x/api/proxy#Initializable) and call the internal function `__PluginCloneable_init(IDAO _dao)` available through the `PluginCloneable` base contract to store the `IDAO _dao` reference in the right place. + +:::caution +If you forget calling `__PluginCloneable_init(_dao)` inside your `initialize` function, your plugin won't be associated with a DAO and cannot use the DAO's `PermissionManager`. +::: diff --git a/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/03-non-upgradeable-plugin/02-implementation.md b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/03-non-upgradeable-plugin/02-implementation.md new file mode 100644 index 00000000..d0b8af77 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/03-non-upgradeable-plugin/02-implementation.md @@ -0,0 +1,81 @@ +--- +title: Plugin Implementation Contract +--- + +## How to Build a Non-Upgradeable Plugin + +Once we've initialized our plugin (take a look at our guide on [how to initialize Non-Upgradeable Plugins here](./01-initialization.md)), we can start using the Non-Upgradeable Base Template to perform actions on the DAO. + +### 1. Set the Permission Identifier + +Firstly, we want to define a [permission identifier](../../../01-how-it-works/01-core/02-permissions/index.md#permission-identifiers) `bytes32` constant at the top of the contract and establish a `keccak256` hash of the permission name we want to choose. In this example, we're calling it the `ADMIN_EXECUTE_PERMISSION`. + +```solidity +contract SimpleAdmin is PluginCloneable { + /// @notice The ID of the permission required to call the `execute` function. + bytes32 public constant ADMIN_EXECUTE_PERMISSION_ID = keccak256('ADMIN_EXECUTE_PERMISSION'); + + address public admin; + + /// @notice Initializes the contract. + /// @param _dao The associated DAO. + /// @param _admin The address of the admin. + function initialize(IDAO _dao, address _admin) external initializer { + __PluginCloneable_init(_dao); + admin = _admin; + } + + /// @notice Executes actions in the associated DAO. + function execute(IDAO.Action[] calldata _actions) external auth(ADMIN_EXECUTE_PERMISSION_ID) { + revert('Not implemented.'); + } +} +``` + +:::note +You are free to choose the permission name however you like. For example, you could also have used `keccak256('SIMPLE_ADMIN_PLUGIN:PERMISSION_1')`. However, it is important that the permission names are descriptive and cannot be confused with each other. +::: + +Setting this permission is key because it ensures only signers who have been granted that permission are able to execute functions. + +### 2. Add the logic implementation + +Now that we have created the permission, we will use it to protect the implementation. We want to make sure only the authorized callers holding the `ADMIN_EXECUTE_PERMISSION`, can use the function. + +Because we have initialized the [`PluginClonable` base contract](https://github.com/aragon/osx-commons/blob/develop/contracts/src/plugin/PluginCloneable.sol), we can now use its features, i.e., the [`auth` modifier](https://github.com/aragon/osx-commons/blob/1cf46ff15dbda8481f9ee37558e7ea8b257d51f2/contracts/src/permission/auth/DaoAuthorizable.sol#L30-L35) provided through the `DaoAuthorizable` base class. The `auth('ADMIN_EXECUTE_PERMISSION')` returns an error if the address calling on the function has not been granted that permission, effectively protecting from malicious use cases. + +Later, we will also use the [`dao()` getter function from the base contract](https://github.com/aragon/osx-commons/blob/1cf46ff15dbda8481f9ee37558e7ea8b257d51f2/contracts/src/permission/auth/DaoAuthorizable.sol#L24-L28), which returns the associated DAO for that plugin. + +```solidity +contract SimpleAdmin is PluginCloneable { + /// @notice The ID of the permission required to call the `execute` function. + bytes32 public constant ADMIN_EXECUTE_PERMISSION_ID = keccak256('ADMIN_EXECUTE_PERMISSION'); + + address public admin; + + /// @notice Initializes the contract. + /// @param _dao The associated DAO. + /// @param _admin The address of the admin. + function initialize(IDAO _dao, address _admin) external initializer { + __PluginCloneable_init(_dao); + admin = _admin; + } + + /// @notice Executes actions in the associated DAO. + /// @param _actions The actions to be executed by the DAO. + function execute(IDAO.Action[] calldata _actions) external auth(ADMIN_EXECUTE_PERMISSION_ID) { + dao().execute({callId: 0x0, actions: _actions, allowFailureMap: 0}); + } +} +``` + +:::note +In this example, we are building a governance plugin. To increase its capabilities and provide some standardization into the protocol, we recommend completing the governance plugin by [implementing the `IProposal` and `IMembership` interfaces](../05-governance-plugins/index.md). +Optionally, you can also allow certain actions to fail by using [the failure map feature of the DAO executor](../../../01-how-it-works/01-core/01-dao/01-actions.md#allowing-for-failure). +::: + +For now, we used default values for the `callId` and `allowFailureMap` parameters required by the DAO's `execute` function. With this, the plugin implementation could be used and deployed already. Feel free to add any additional logic to your plugin's capabilities here. + +### 3. Plugin done, Setup contract next! + +Now that we have the logic for the plugin implemented, we'll need to define how this plugin should be installed/uninstalled from a DAO. In the next step, we'll write the `PluginSetup` contract - the one containing the installation, uninstallation, and upgrading instructions for the plugin. diff --git a/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/03-non-upgradeable-plugin/03-setup.md b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/03-non-upgradeable-plugin/03-setup.md new file mode 100644 index 00000000..7a301c64 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/03-non-upgradeable-plugin/03-setup.md @@ -0,0 +1,338 @@ +--- +title: Plugin Setup Contract +--- + +## What is the Plugin Setup contract? + +The Plugin Setup contract is the contract defining the instructions for installing, uninstalling, or upgrading plugins into DAOs. This contract prepares the permission granting or revoking that needs to happen in order for plugins to be able to perform actions on behalf of the DAO. + +You need it for the plugin to be installed intto the DAO. + +### 1. Finish the Plugin contract + +Before building your Plugin Setup contract, make sure you have the logic for your plugin implemented. In this case, we're building a simple admin plugin which grants one address permission to execute actions on behalf of the DAO. + +```solidity +contract SimpleAdmin is PluginCloneable { + /// @notice The ID of the permission required to call the `execute` function. + bytes32 public constant ADMIN_EXECUTE_PERMISSION_ID = keccak256('ADMIN_EXECUTE_PERMISSION'); + + address public admin; + + /// @notice Initializes the contract. + /// @param _dao The associated DAO. + /// @param _admin The address of the admin. + function initialize(IDAO _dao, address _admin) external initializer { + __PluginCloneable_init(_dao); + admin = _admin; + } + + /// @notice Executes actions in the associated DAO. + /// @param _actions The actions to be executed by the DAO. + function execute(IDAO.Action[] calldata _actions) external auth(ADMIN_EXECUTE_PERMISSION_ID) { + dao().execute({_callId: 0x0, _actions: _actions, _allowFailureMap: 0}); + } +} +``` + +### 2. How to initialize the Plugin Setup contract + +Each `PluginSetup` contract is deployed only once and we will publish a separate `PluginSetup` instance for each version. Accordingly, we instantiate the `implementation` contract via Solidity's `new` keyword as deployment with the minimal proxy pattern would be more expensive in this case. + +```solidity +// SPDX-License-Identifier: AGPL-3.0-or-later +pragma solidity 0.8.21; + +import {PluginSetup, IPluginSetup} from '@aragon/osx/framework/plugin/setup/PluginSetup.sol'; +import {SimpleAdmin} from './SimpleAdmin.sol'; + +contract SimpleAdminSetup is PluginSetup { + /// @notice The address of `SimpleAdmin` plugin contract to be cloned. + address private immutable simpleAdminImplementation; + + /// @notice The constructor setting the `SimpleAdmin` implementation contract to clone from. + constructor() { + simpleAdminImplementation = address(new SimpleAdmin()); + } + + /// @inheritdoc IPluginSetup + function implementation() external view returns (address) { + return simpleAdminImplementation; + } +} +``` + +### 3. Build the Skeleton + +In order for the Plugin to be easily installed into the DAO, we need to define the permissions the plugin will need. + +We will create a `prepareInstallation()` function, as well as a `prepareUninstallation()` function. These are the functions the `PluginSetupProcessor.sol` (the contract in charge of installing plugins into the DAO) will use to prepare the installation/uninstallation of the plugin into the DAO. + +For example, a skeleton for our `SimpleAdminSetup` contract inheriting from `PluginSetup` looks as follows: + +```solidity +import {PermissionLib} from '@aragon/osx/core/permission/PermissionLib.sol'; + +contract SimpleAdminSetup is PluginSetup { + /// @notice The address of `SimpleAdmin` plugin logic contract to be cloned. + address private immutable simpleAdminImplementation; + + /// @notice The constructor setting the `SimpleAdmin` implementation contract to clone from. + constructor() { + simpleAdminImplementation = address(new SimpleAdmin()); + } + + /// @inheritdoc IPluginSetup + function prepareInstallation( + address _dao, + bytes calldata _data + ) external returns (address plugin, PreparedSetupData memory preparedSetupData) { + revert('Not implemented yet.'); + } + + /// @inheritdoc IPluginSetup + function prepareUninstallation( + address _dao, + SetupPayload calldata _payload + ) external view returns (PermissionLib.MultiTargetPermission[] memory permissions) { + revert('Not implemented yet.'); + } + + /// @inheritdoc IPluginSetup + function implementation() external view returns (address) { + return simpleAdminImplementation; + } +} +``` + +As you can see, we have a constructor storing the implementation contract instantiated via the `new` method in the private immutable variable `implementation` to save gas and a `implementation` function to retrieve it. + +Next, we will add the implementation for the `prepareInstallation` and `prepareUninstallation` functions. + +### 4. Implementing the `prepareInstallation()` function + +The `prepareInstallation()` function should take in two parameters: + +1. the `DAO` it prepares the installation for, and +2. the `_data` parameter containing all the information needed for this function to work properly, in this case, the address we want to set as admin of our DAO. + +Hence, the first thing we should do when working on the `prepareInsallation()` function is decode the information from the `_data` parameter. We also want to check that the address is not accidentally set to `address(0)`, which would freeze the DAO forever. + +```solidity +import {Clones} from '@openzeppelin/contracts/proxy/Clones.sol'; + +contract SimpleAdminSetup is PluginSetup { + using Clones for address; + + /// @notice Thrown if the admin address is zero. + /// @param admin The admin address. + error AdminAddressInvalid(address admin); + + // ... +} +``` + +Then, we will use [OpenZepplin's `Clones` library](https://docs.openzeppelin.com/contracts/4.x/api/proxy#Clones) to clone our Plugin contract and initialize it with the `admin` address. The first line, `using Clones for address;`, allows us to call OpenZepplin `Clones` library to clone contracts deployed at an address. + +The second line introduces a custom error being thrown if the admin address specified is the zero address. + +```solidity +function prepareInstallation( + address _dao, + bytes calldata _data +) external returns (address plugin, PreparedSetupData memory preparedSetupData) { + // Decode `_data` to extract the params needed for cloning and initializing the `Admin` plugin. + address admin = abi.decode(_data, (address)); + + if (admin == address(0)) { + revert AdminAddressInvalid({admin: admin}); + } + + // Clone plugin contract. + plugin = implementation.clone(); + + // Initialize cloned plugin contract. + SimpleAdmin(plugin).initialize(IDAO(_dao), admin); + + // Prepare permissions + PermissionLib.MultiTargetPermission[] + memory permissions = new PermissionLib.MultiTargetPermission[](2); + + // Grant the `ADMIN_EXECUTE_PERMISSION` of the plugin to the admin. + permissions[0] = PermissionLib.MultiTargetPermission({ + operation: PermissionLib.Operation.Grant, + where: plugin, + who: admin, + condition: PermissionLib.NO_CONDITION, + permissionId: SimpleAdmin(plugin).ADMIN_EXECUTE_PERMISSION_ID() + }); + + // Grant the `EXECUTE_PERMISSION` on the DAO to the plugin. + permissions[1] = PermissionLib.MultiTargetPermission({ + operation: PermissionLib.Operation.Grant, + where: _dao, + who: plugin, + condition: PermissionLib.NO_CONDITION, + permissionId: DAO(payable(_dao)).EXECUTE_PERMISSION_ID() + }); + + preparedSetupData.permissions = permissions; +} +``` + +Finally, we construct and return an array with the permissions that we need for our plugin to work properly. + +- First, we request granting the `ADMIN_EXECUTE_PERMISSION_ID` to the `admin` address received. This is what gives the address access to use `plugin`'s functionality - in this case, call on the plugin's `execute` function so it can execute actions on behalf of the DAO. +- Second, we request that our newly deployed plugin can use the `EXECUTE_PERMISSION_ID` permission on the `_dao`. We don't add conditions to the permissions in this case, so we use the `NO_CONDITION` constant provided by `PermissionLib`. + +### 5. Implementing the `prepareUninstallation()` function + +For the uninstallation, we have to make sure to revoke the two permissions that have been granted during the installation process. +First, we revoke the `ADMIN_EXECUTE_PERMISSION_ID` from the `admin` address that we have stored in the implementation contract. +Second, we revoke the `EXECUTE_PERMISSION_ID` from the `plugin` address that we obtain from the `_payload` calldata. + +```solidity +function prepareUninstallation( + address _dao, + SetupPayload calldata _payload +) external view returns (PermissionLib.MultiTargetPermission[] memory permissions) { + // Collect addresses + address plugin = _payload.plugin; + address admin = SimpleAdmin(plugin).admin(); + + // Prepare permissions + permissions = new PermissionLib.MultiTargetPermission[](2); + + permissions[0] = PermissionLib.MultiTargetPermission({ + operation: PermissionLib.Operation.Revoke, + where: plugin, + who: admin, + condition: PermissionLib.NO_CONDITION, + permissionId: SimpleAdmin(plugin).ADMIN_EXECUTE_PERMISSION_ID() + }); + + permissions[1] = PermissionLib.MultiTargetPermission({ + operation: PermissionLib.Operation.Revoke, + where: _dao, + who: plugin, + condition: PermissionLib.NO_CONDITION, + permissionId: DAO(payable(_dao)).EXECUTE_PERMISSION_ID() + }); +} +``` + +#### 6. Putting Everything Together + +Now, it's time to wrap up everything together. You should have a contract that looks like this: + +```solidity +// SPDX-License-Identifier: AGPL-3.0-or-later +pragma solidity 0.8.21; + +import {Clones} from '@openzeppelin/contracts/proxy/Clones.sol'; + +import {PermissionLib} from '@aragon/osx/core/permission/PermissionLib.sol'; +import {PluginSetup, IPluginSetup} from '@aragon/osx/framework/plugin/setup/PluginSetup.sol'; +import {SimpleAdmin} from './SimpleAdmin.sol'; + +contract SimpleAdminSetup is PluginSetup { + using Clones for address; + + /// @notice The address of `SimpleAdmin` plugin logic contract to be cloned. + address private immutable simpleAdminImplementation; + + /// @notice Thrown if the admin address is zero. + /// @param admin The admin address. + error AdminAddressInvalid(address admin); + + /// @notice The constructor setting the `Admin` implementation contract to clone from. + constructor() { + simpleAdminImplementation = address(new SimpleAdmin()); + } + + /// @inheritdoc IPluginSetup + function prepareInstallation( + address _dao, + bytes calldata _data + ) external returns (address plugin, PreparedSetupData memory preparedSetupData) { + // Decode `_data` to extract the params needed for cloning and initializing the `Admin` plugin. + address admin = abi.decode(_data, (address)); + + if (admin == address(0)) { + revert AdminAddressInvalid({admin: admin}); + } + + // Clone plugin contract. + plugin = implementation.clone(); + + // Initialize cloned plugin contract. + SimpleAdmin(plugin).initialize(IDAO(_dao), admin); + + // Prepare permissions + PermissionLib.MultiTargetPermission[] + memory permissions = new PermissionLib.MultiTargetPermission[](2); + + // Grant the `ADMIN_EXECUTE_PERMISSION` of the plugin to the admin. + permissions[0] = PermissionLib.MultiTargetPermission({ + operation: PermissionLib.Operation.Grant, + where: plugin, + who: admin, + condition: PermissionLib.NO_CONDITION, + permissionId: SimpleAdmin(plugin).ADMIN_EXECUTE_PERMISSION_ID() + }); + + // Grant the `EXECUTE_PERMISSION` on the DAO to the plugin. + permissions[1] = PermissionLib.MultiTargetPermission({ + operation: PermissionLib.Operation.Grant, + where: _dao, + who: plugin, + condition: PermissionLib.NO_CONDITION, + permissionId: DAO(payable(_dao)).EXECUTE_PERMISSION_ID() + }); + + preparedSetupData.permissions = permissions; + } + + /// @inheritdoc IPluginSetup + function prepareUninstallation( + address _dao, + SetupPayload calldata _payload + ) external view returns (PermissionLib.MultiTargetPermission[] memory permissions) { + // Collect addresses + address plugin = _payload.plugin; + address admin = SimpleAdmin(plugin).admin(); + + // Prepare permissions + permissions = new PermissionLib.MultiTargetPermission[](2); + + permissions[0] = PermissionLib.MultiTargetPermission({ + operation: PermissionLib.Operation.Revoke, + where: plugin, + who: admin, + condition: PermissionLib.NO_CONDITION, + permissionId: SimpleAdmin(plugin).ADMIN_EXECUTE_PERMISSION_ID() + }); + + permissions[1] = PermissionLib.MultiTargetPermission({ + operation: PermissionLib.Operation.Revoke, + where: _dao, + who: plugin, + condition: PermissionLib.NO_CONDITION, + permissionId: DAO(payable(_dao)).EXECUTE_PERMISSION_ID() + }); + } + + /// @inheritdoc IPluginSetup + function implementation() external view returns (address) { + return simpleAdminImplementation; + } +} +``` + +Once done, our plugin is ready to be published on the Aragon plugin registry. With the address of the `SimpleAdminSetup` contract, we are ready for creating our `PluginRepo`, the plugin's repository where all plugin versions will live. Check out our how to guides on [publishing your plugin here](../07-publication/index.md). + +### In the future: Subsequent Builds + +For subsequent builds or releases of your plugin, you'll simply write a new implementation and associated Plugin Setup contract providing a new `prepareInstallation` and `prepareUninstallation` function. + +If a DAO wants to install the new build or release, it must uninstall its current plugin and freshly install the new plugin version, which can happen in the same action array in a governance proposal. However, the plugin storage and event history will be lost since this is a non-upgradeable plugin. If you want to prevent the latter, you can learn [how to write an upgradeable plugin here](../03-non-upgradeable-plugin/index.md). diff --git a/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/03-non-upgradeable-plugin/index.md b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/03-non-upgradeable-plugin/index.md new file mode 100644 index 00000000..bf7da198 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/03-non-upgradeable-plugin/index.md @@ -0,0 +1,351 @@ +--- +title: Non-Upgradeable Plugins +--- + +## Get Started with Non-Upgradeable Plugins + +A Non-Upgradeable Plugin is a Plugin built on smart contracts that cannot be upgraded. This may or may not be what you want. + +Some observations: + +- Non-Upgradeable contracts are simpler to create, deploy, and manage. +- Instantiation is done via the `new` keyword or deployed via the [minimal proxy pattern (ERC-1167)](https://eips.ethereum.org/EIPS/eip-1167) +- The storage is contained within each version. So if your plugin is dependent on state information from previous versions, you won't have access to it directly in upcoming versions, since every version is a blank new state. If this is a requirement for your project, we recommend you deploy an [Upgradeable Plugin](../04-upgradeable-plugin/index.md). + +Before moving on with the Guide, make sure you've read our documentation on [Choosing the Best Type for Your Plugin](../02-plugin-types.md) to make sure you're selecting the right type of contract for your Plugin. + +## Building a Non-Upgradeble Plugin + +We will build a plugin which returns "Hello world!" and the amount of times the function has been called. + +### 1. Setup + +1. Make sure you have Node.js in your computer. + +For Mac: + +```bash +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash +nvm install 18 +nvm use 18 +nvm alias default 18 +npm install npm --global +``` + +Or for Linux: + +```bash +sudo apt update +sudo apt install curl git +curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - +sudo apt-get install -y nodejs +``` + +[Here's a tutorial](https://hardhat.org/tutorial/setting-up-the-environment) on installing this if you haven't done so already. + +2. Next up, we want to create a Hardhat project in our terminal. This is the Solidity framework we'll use to get our project up and runing. + +```bash +npm init +npm install --save-dev hardhat +npx hardhat +``` + +[Here's a tutorial](https://hardhat.org/tutorial/creating-a-new-hardhat-project) on how to answer the prompts if you need. For reference, I used the Typescript option for my Hardhat project. + +3. Install `@aragon/osx` package + +We want to install the Aragon OSx contract package within our project so we can access and import them throughout our project. This should speed up development significantly, although not it's not mandatory in order to build Aragon plugins. + +```bash +npm i @aragon/osx +``` + +### 2. Building the plugin + +1. Create `GreeterPlugin` contract + +Plugins are composed of two key contracts: + +- The `Plugin` contract, containing the implementation logic for the Plugin, +- The `PluginSetup` contract, containing the instructions needed to install or uninstall a Plugin into a DAO. + +In this case, we will create the `GreeterPlugin.sol` contract containing the main logic for our plugin - aka returning "Hello world!" when calling on the `greet()` function. Keep in mind, that because we're importing from the `Plugin` base template in this case, we are able to tap into: + +- the `auth(PERMISSION_ID)` modifier, which checks whether the account calling on that function has the permission specified in the `auth` parameters. +- the `dao()` getter function, which returns the DAO instance to which the plugin permissions are bound. + +First, in your terminal, create the `GreeterPlugin.sol` contract: + +```bash +touch contracts/GreeterPlugin.sol +``` + +Then, inside of the file, add the functionality: + +```solidity +// SPDX-License-Identifier: AGPL-3.0-or-later +pragma solidity 0.8.21; + +import {Plugin, IDAO} from '@aragon/osx/core/plugin/Plugin.sol'; + +contract GreeterPlugin is Plugin { + // Permissions are what connects everything together. Addresses who have been granted the GREET_PERMISSION will be able to call on functions with the modifier `auth(GREET_PERMISSION_ID)`. These will be granted in the PluginSetup.sol contract up next. + bytes32 public constant GREET_PERMISSION_ID = keccak256('GREET_PERMISSION'); + + uint256 public amountOfTimes = 0; + + constructor(IDAO _dao) Plugin(_dao) {} + + function greet() external auth(GREET_PERMISSION_ID) returns (string memory greeter) { + greeter = string.concat( + 'Hello world! This function has been called ', + Strings.toString(amountOfTimes), + ' times.' + ); + amountOfTimes += 1; + } + + function _amountOftimes() external view returns (uint256) { + return amountOfTimes; + } +} +``` + +2. Create `GreeterPluginSetup` contract + +Now that we're done with our `GreeterPlugin` implementation, we can get started with the installation instructions. + +When we speak of installation, we're essentially referring to the the granting of the permissions needed so that the transactions can happen. In our `GreeterPlugin` contract, we defined a `GREET_PERMISSION`. Then, we used the `auth(GREET_PERMISSION_ID)` modifier on the `greet()`, defining that only those addresses with the `GREET_PERMISSION` will be able to call on the `greet()` function. + +In the `prepareInstallation()` function here then, we will grant the `GREET_PERMISSION` to the DAO so it can call the function. In the `prepareUninstallation()` function, we do the opposite and revoke the `GREET_PERMISSION`. + +```solidity +// SPDX-License-Identifier: AGPL-3.0-or-later +pragma solidity 0.8.21; + +import {PluginSetup} from '@aragon/osx/framework/plugin/setup/PluginSetup.sol'; +import {PermissionLib} from '@aragon/osx/core/permission/PermissionLib.sol'; +import './GreeterPlugin.sol'; + +contract GreeterPluginSetup is PluginSetup { + function prepareInstallation( + address _dao, + bytes memory + ) external returns (address plugin, PreparedSetupData memory preparedSetupData) { + plugin = address(new GreeterPlugin(IDAO(_dao))); + + PermissionLib.MultiTargetPermission[] + memory permissions = new PermissionLib.MultiTargetPermission[](1); + + permissions[0] = PermissionLib.MultiTargetPermission({ + operation: PermissionLib.Operation.Grant, + where: plugin, + who: _dao, + condition: PermissionLib.NO_CONDITION, + permissionId: keccak256('GREET_PERMISSION') + }); + + preparedSetupData.permissions = permissions; + } + + function prepareUninstallation( + address _dao, + SetupPayload calldata _payload + ) external pure returns (PermissionLib.MultiTargetPermission[] memory permissions) { + permissions = new PermissionLib.MultiTargetPermission[](1); + + permissions[0] = PermissionLib.MultiTargetPermission({ + operation: PermissionLib.Operation.Revoke, + where: _payload.plugin, + who: _dao, + condition: PermissionLib.NO_CONDITION, + permissionId: keccak256('GREET_PERMISSION') + }); + } + + function implementation() external view returns (address) {} +} +``` + +### 3. Deploy your Plugin + +#### a) Hardhat's local environment + +1. In the Terminal, we first want to create a deployment script file: + +```bash +touch scripts/deploy.ts +``` + +2. Now, let's add the deployment script in to the `deploy.ts` file + +```solidity +import { ethers } from "hardhat"; + +async function main() { + const [deployer] = await ethers.getSigners(); + + console.log("Deploying contracts with the account:", deployer.address); + console.log("Account balance:", (await deployer.getBalance()).toString()); + + const getGreeterSetup = await ethers.getContractFactory("GreeterPluginSetup"); + const GreeterSetup = await getGreeterSetup.deploy(); + + await GreeterSetup.deployed(); + + console.log("GreeterSetup address:", GreeterSetup.address); +} + +// We recommend this pattern to be able to use async/await everywhere +// and properly handle errors. +main().catch((error) => { + console.error(error); + process.exitCode = 1; +}); +``` + +3. Let's deploy! + +In your terminal, run: + +```bash +npx hardhat run scripts/deploy.ts +``` + +#### b) Goerli testnet network or others + +Now that we know the local deployment works, we will want to deploy our plugin to Goerli testnet so we can publish it in the Aragon OSx protocol to be accessed by DAOs. + +1. Firstly, let's set up the `hardhat.config.js` with Goerli environment attributes (or whichever network you'd like to deploy your plugin to). + +```tsx +import '@nomicfoundation/hardhat-toolbox'; + +// To find your Alchemy key, go to https://dashboard.alchemy.com/. Infura or any other provider would work here as well. +const goerliAlchemyKey = 'add-your-own-alchemy-key'; +// To find a private key, go to your wallet of choice and export a private key. Remember this must be kept secret at all times. +const privateKeyGoerli = 'add-your-account-private-key'; + +module.exports = { + defaultNetwork: 'hardhat', + networks: { + hardhat: {}, + goerli: { + url: `https://eth-goerli.g.alchemy.com/v2/${goerliAlchemyKey}`, + accounts: [privateKeyGoerli], + }, + }, + solidity: { + version: '0.8.17', + settings: { + optimizer: { + enabled: true, + runs: 200, + }, + }, + }, + paths: { + sources: './contracts', + tests: './test', + cache: './cache', + artifacts: './artifacts', + }, + mocha: { + timeout: 40000, + }, +}; +``` + +2. Once we have the Goerli environment set up, run this command in your terminal to deploy the plugin: + +```bash +npx hardhat run --network goerli scripts/deploy.ts +``` + +### 4. Publish the Plugin in Aragon OSx + +Now that the plugin is deployed on Goerli, we can publish it into the Aragon OSx Protocol so any DAO can install it! + +Publishing a plugin into Aragon OSx means creating a `PluginRepo` instance containing the plugin's first version. As developers can deploy more versions of the plugin moving forward, publishing a new version means adding a new `PluginSetup` contract into their plugin's `PluginRepo` contract. This is where all plugin versions will be stored and what Aragon's plugin installer will use to fetch the `latestVersion` and install it into DAO's. + +You can publish the plugin into Aragon's protocol through a few different ways: + +#### a) Etherscan + +Go to the [`PluginFactory`](https://goerli.etherscan.io/address/0x301868712b77744A3C0E5511609238399f0A2d4d#writeContract) contract on Etherscan and deploy the first version of your plugin. + +![Register your Plugin through Etherscan](https://res.cloudinary.com/dacofvu8m/image/upload/v1682466427/Screen_Shot_2023-04-25_at_19.46.58_nlo9p1.png) + +#### b) Publishing script + +You can also publish your Plugin through using a `publish` script. + +1. Create the `publish.ts` file within your `scripts` folder. + +```bash +touch scripts/publish.ts +``` + +2. Add this publishing script to the `publish.ts` file. + +This will get the `PluginRepoFactory` contract and call on its `createPluginRepoWithFirstVersion` to create the plugin's `PluginRepo` instance, where plugin versions will be stored. + +```ts +import { + PluginRepoFactory__factory, + PluginRepoRegistry__factory, + PluginRepo__factory, +} from '@aragon/osx-ethers'; +import {DeployFunction} from 'hardhat-deploy/types'; +import {HardhatRuntimeEnvironment} from 'hardhat/types'; + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const {deployments, network} = hre; + const [deployer] = await hre.ethers.getSigners(); + + const pluginRepoFactoryAddr = '0x301868712b77744A3C0E5511609238399f0A2d4d'; + + const pluginRepoFactory = PluginRepoFactory__factory.connect(pluginRepoFactoryAddr, deployer); + + const pluginName = 'greeter-plugin'; + const pluginSetupContractName = 'GreeterPluginSetup'; + + const pluginSetupContract = await deployments.get(pluginSetupContractName); + + const tx = await pluginRepoFactory.createPluginRepoWithFirstVersion( + pluginName, + pluginSetupContract.address, + deployer.address, + '0x00', // releaseMetadata: the hex representation of the CID containing your plugin's metadata - so the description, name, author, any UI, etc + '0x00' // buildMetadata: same as above but for each build, rather than release + ); + + console.log( + `You can find the transaction address which published the ${pluginName} Plugin here: ${tx}` + ); +}; + +export default func; +``` + +In order to run the script and finalize the publishing, run this in your terminal: + +```bash +npx hardhat run scripts/publish.ts +``` + +To publish new versions in the future, + +## Conclusion + +Hope this tutorial is useful to get you started developing for Aragon! If you need any additional support or questions, feel free to hop into our [Discord](https://discord.com/channels/672466989217873929/742442842474938478) and ask away. + +Excited to see what you build! 🔥 + +Up next, check out our guides on: + +1. [How to initialize Non-Upgradeable Plugins](./01-initialization.md) +2. [How to build the implementation of a Non-Upgradeable Plugin](./02-implementation.md) +3. [How to build and deploy a Plugin Setup contract for a Non-Upgradeable Plugin](./03-setup.md) +4. [How to publish my plugin into the Aragon OSx protocol](../07-publication/index.md) diff --git a/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/04-upgradeable-plugin/01-initialization.md b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/04-upgradeable-plugin/01-initialization.md new file mode 100644 index 00000000..70a23dd5 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/04-upgradeable-plugin/01-initialization.md @@ -0,0 +1,76 @@ +--- +title: Intialization +--- + +## How to Initialize Upgradeable Plugins + +To deploy your implementation contract via the [UUPS pattern (ERC-1822)](https://eips.ethereum.org/EIPS/eip-1822), you inherit from the `PluginUUPSUpgradeable` contract. + +We must protect it from being set up multiple times by using [OpenZepplin's `initializer` modifier made available through `Initalizable`](https://docs.openzeppelin.com/contracts/4.x/api/proxy#Initializable). In order to do this, we will call the internal function `__PluginUUPSUpgradeable_init(IDAO _dao)` function available through the `PluginUUPSUpgradeable` base contract to store the `IDAO _dao` reference in the right place. + +:::note +This has to be called - otherwise, anyone else could call the plugin's initialization with whatever params they wanted. +::: + +```solidity +// SPDX-License-Identifier: AGPL-3.0-or-later +pragma solidity 0.8.21; + +import {PluginUUPSUpgradeable, IDAO} '@aragon/osx/core/plugin/PluginUUPSUpgradeable.sol'; + +/// @title SimpleStorage build 1 +contract SimpleStorageBuild1 is PluginUUPSUpgradeable { + uint256 public number; // added in build 1 + + /// @notice Initializes the plugin when build 1 is installed. + function initializeBuild1(IDAO _dao, uint256 _number) external initializer { + __PluginUUPSUpgradeable_init(_dao); + number = _number; + } +} +``` + +:::note +Keep in mind that in order to discriminate between the different initialize functions of your different builds, we name the initialize function `initializeBuild1`. This becomes more demanding for subsequent builds of your plugin. +::: + +### Initializing Subsequent Builds + +Since you have chosen to build an upgradeable plugin, you can publish subsequent builds of plugin and **allow the users to update from an earlier build without losing the storage**. + +:::caution +Do not inherit from previous versions as this can mess up the inheritance chain. Instead, write self-contained contracts by simply copying the code or modifying the file in your git repo. +::: + +In this example, we wrote a `SimpleStorageBuild2` contract and added a new storage variable `address public account;`. Because users can freshly install the new version or update from build 1, we now have to write two initializer functions: `initializeBuild2` and `initializeFromBuild1` in our Plugin implementation contract. + +```solidity +/// @title SimpleStorage build 2 +contract SimpleStorageBuild2 is PluginUUPSUpgradeable { + uint256 public number; // added in build 1 + address public account; // added in build 2 + + /// @notice Initializes the plugin when build 2 is installed. + function initializeBuild2( + IDAO _dao, + uint256 _number, + address _account + ) external reinitializer(2) { + __PluginUUPSUpgradeable_init(_dao); + number = _number; + account = _account; + } + + /// @notice Initializes the plugin when the update from build 1 to build 2 is applied. + /// @dev The initialization of `SimpleStorageBuild1` has already happened. + function initializeFromBuild1(IDAO _dao, address _account) external reinitializer(2) { + account = _account; + } +} +``` + +In general, for each version for which you want to support updates from, you have to provide a separate `initializeFromBuildX` function taking care of initializing the storage and transferring the `helpers` and `permissions` of the previous version into the same state as if it had been freshly installed. + +Each `initializeBuildX` must be protected with a modifier that allows it to be only called once. + +In contrast to build 1, we now must use [OpenZeppelin's `modifier reinitializer(uint8 build)`](https://docs.openzeppelin.com/contracts/4.x/api/proxy#Initializable-reinitializer-uint8-) for build 2 instead of `modifier initializer` because it allows us to execute 255 subsequent initializations. More specifically, we used `reinitializer(2)` here for our build 2. Note that we could also have used `function initializeBuild1(IDAO _dao, uint256 _number) external reinitializer(1)` for build 1 because `initializer` and `reinitializer(1)` are equivalent statements. For build 3, we must use `reinitializer(3)`, for build 4 `reinitializer(4)` and so on. diff --git a/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/04-upgradeable-plugin/02-implementation.md b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/04-upgradeable-plugin/02-implementation.md new file mode 100644 index 00000000..fa53b80f --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/04-upgradeable-plugin/02-implementation.md @@ -0,0 +1,44 @@ +--- +title: Plugin Implementation Contract +--- + +## How to build an Upgradeable Plugin implementation contract + +In this guide, we'll build a `SimpleStorage` Upgradeable plugin which all it does is storing a number. + +The Plugin contract is the one containing all the logic we'd like to implement on the DAO. + +### 1. Set up the initialize function + +Make sure you have the initializer of your plugin well set up. Please review [our guide on how to do that here](./01-initialization.md) if you haven't already. + +Once you this is done, let's dive into several implementations and builds, as can be expected for Upgradeable plugins. + +### 2. Adding your plugin implementation logic + +In our first build, we want to add an authorized `storeNumber` function to the contract - allowing a caller holding the `STORE_PERMISSION_ID` permission to change the stored value similar to what we did for [the non-upgradeable `SimpleAdmin` Plugin](../03-non-upgradeable-plugin/02-implementation.md): + +```solidity +import {PluginUUPSUpgradeable, IDAO} '@aragon/osx/core/plugin/PluginUUPSUpgradeable.sol'; + +/// @title SimpleStorage build 1 +contract SimpleStorageBuild1 is PluginUUPSUpgradeable { + bytes32 public constant STORE_PERMISSION_ID = keccak256('STORE_PERMISSION'); + + uint256 public number; // added in build 1 + + /// @notice Initializes the plugin when build 1 is installed. + function initializeBuild1(IDAO _dao, uint256 _number) external initializer { + __PluginUUPSUpgradeable_init(_dao); + number = _number; + } + + function storeNumber(uint256 _number) external auth(STORE_PERMISSION_ID) { + number = _number; + } +} +``` + +### 3. Plugin done, PluginSetup contract next! + +Now that we have the logic for the plugin implemented, we'll need to define how this plugin should be installed/uninstalled from a DAO. In the next step, we'll write the `PluginSetup` contract - the one containing the installation, uninstallation, and upgrading instructions for the plugin. diff --git a/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/04-upgradeable-plugin/03-setup.md b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/04-upgradeable-plugin/03-setup.md new file mode 100644 index 00000000..4f3fc186 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/04-upgradeable-plugin/03-setup.md @@ -0,0 +1,204 @@ +--- +title: Plugin Setup Contract +--- + +## How to build the Plugin Setup Contract for Upgradeable Plugins + +The Plugin Setup contract is the contract defining the instructions for installing, uninstalling, or upgrading plugins into DAOs. This contract prepares the permission granting or revoking that needs to happen in order for plugins to be able to perform actions on behalf of the DAO. + +### 1. Finish the Plugin contract's first build + +Before building the Plugin Setup contract, make sure you have the logic for your plugin implemented. In this case, we're building a simple storage plugin which stores a number. + +```solidity +// SPDX-License-Identifier: AGPL-3.0-or-later +pragma solidity 0.8.21; + +import {IDAO, PluginUUPSUpgradeable} from '@aragon/osx/core/plugin/PluginUUPSUpgradeable.sol'; + +/// @title SimpleStorage build 1 +contract SimpleStorageBuild1 is PluginUUPSUpgradeable { + bytes32 public constant STORE_PERMISSION_ID = keccak256('STORE_PERMISSION'); + + uint256 public number; // added in build 1 + + /// @notice Initializes the plugin when build 1 is installed. + function initializeBuild1(IDAO _dao, uint256 _number) external initializer { + __PluginUUPSUpgradeable_init(_dao); + number = _number; + } + + function storeNumber(uint256 _number) external auth(STORE_PERMISSION_ID) { + number = _number; + } +} +``` + +### 2. Add the `prepareInstallation()` and `prepareUninstallation()` functions + +Each `PluginSetup` contract is deployed only once and each plugin version will have its own `PluginSetup` contract deployed. Accordingly, we instantiate the `implementation` contract via Solidity's `new` keyword as deployment with the minimal proxy pattern would be more expensive in this case. + +In order for the Plugin to be easily installed into the DAO, we need to define the instructions for the plugin to work effectively. We have to tell the DAO's Permission Manager which permissions it needs to grant or revoke. + +Hence, we will create a `prepareInstallation()` function, as well as a `prepareUninstallation()` function. These are the functions the `PluginSetupProcessor.sol` (the contract in charge of installing plugins into the DAO) will use. + +The `prepareInstallation()` function takes in two parameters: + +1. the `DAO` it should prepare the installation for, and +2. the `_data` parameter containing all the information needed for this function to work properly, encoded as a `bytes memory`. In this case, we get the number we want to store. + +Hence, the first thing we should do when working on the `prepareInsallation()` function is decode the information from the `_data` parameter. +Similarly, the `prepareUninstallation()` function takes in a `payload`. + +```solidity +// SPDX-License-Identifier: AGPL-3.0-or-later + +pragma solidity 0.8.21; + +import {PermissionLib} from '@aragon/osx/core/permission/PermissionLib.sol'; +import {PluginSetup, IPluginSetup} from '@aragon/osx/framework/plugin/setup/PluginSetup.sol'; +import {SimpleStorageBuild1} from './SimpleStorageBuild1.sol'; + +/// @title SimpleStorageSetup build 1 +contract SimpleStorageBuild1Setup is PluginSetup { + address private immutable simpleStorageImplementation; + + constructor() { + simpleStorageImplementation = address(new SimpleStorageBuild1()); + } + + /// @inheritdoc IPluginSetup + function prepareInstallation( + address _dao, + bytes memory _data + ) external returns (address plugin, PreparedSetupData memory preparedSetupData) { + uint256 number = abi.decode(_data, (uint256)); + + plugin = createERC1967Proxy( + simpleStorageImplementation, + abi.encodeCall(SimpleStorageBuild1.initializeBuild1, (IDAO(_dao), number)) + ); + + PermissionLib.MultiTargetPermission[] + memory permissions = new PermissionLib.MultiTargetPermission[](1); + + permissions[0] = PermissionLib.MultiTargetPermission({ + operation: PermissionLib.Operation.Grant, + where: plugin, + who: _dao, + condition: PermissionLib.NO_CONDITION, + permissionId: SimpleStorageBuild1(this.implementation()).STORE_PERMISSION_ID() + }); + + preparedSetupData.permissions = permissions; + } + + /// @inheritdoc IPluginSetup + function prepareUninstallation( + address _dao, + SetupPayload calldata _payload + ) external view returns (PermissionLib.MultiTargetPermission[] memory permissions) { + permissions = new PermissionLib.MultiTargetPermission[](1); + + permissions[0] = PermissionLib.MultiTargetPermission({ + operation: PermissionLib.Operation.Revoke, + where: _payload.plugin, + who: _dao, + condition: PermissionLib.NO_CONDITION, + permissionId: SimpleStorageBuild1(this.implementation()).STORE_PERMISSION_ID() + }); + } + + /// @inheritdoc IPluginSetup + function implementation() external view returns (address) { + return simpleStorageImplementation; + } +} +``` + +As you can see, we have a constructor storing the implementation contract instantiated via the `new` method in the private immutable variable `implementation` to save gas and an `implementation` function to return it. + +:::note +Specifically important for this type of plugin is the `prepareUpdate()` function. Since we don't know the parameters we will require when updating the plugin to the next version, we can't add the `prepareUpdate()` function just yet. However, keep in mind that we will need to deploy new Plugin Setup contracts in subsequent builds to add in the `prepareUpdate()` function with each build requirements. We see this in depth in the ["How to update an Upgradeable Plugin" section](./05-updating-versions.md). +::: + +### 3. Deployment + +Once you're done with your Plugin Setup contract, we'll need to deploy it so we can publish it into the Aragon OSx protocol. You can deploy your contract with a basic deployment script. + +Firstly, we'll make sure our preferred network is well setup within our `hardhat.config.js` file, which should look something like: + +```js +import '@nomicfoundation/hardhat-toolbox'; + +// To find your Alchemy key, go to https://dashboard.alchemy.com/. Infure or any other provider would work here as well. +const goerliAlchemyKey = 'add-your-own-alchemy-key'; +// To find a private key, go to your wallet of choice and export a private key. Remember this must be kept secret at all times. +const privateKeyGoerli = 'add-your-account-private-key'; + +module.exports = { + defaultNetwork: 'hardhat', + networks: { + hardhat: {}, + goerli: { + url: `https://eth-goerli.g.alchemy.com/v2/${goerliAlchemyKey}`, + accounts: [privateKeyGoerli], + }, + }, + solidity: { + version: '0.8.17', + settings: { + optimizer: { + enabled: true, + runs: 200, + }, + }, + }, + paths: { + sources: './contracts', + tests: './test', + cache: './cache', + artifacts: './artifacts', + }, + mocha: { + timeout: 40000, + }, +}; +``` + +Then, create a `scripts/deploy.js` file and add a simple deploy script. We'll only be deploying the PluginSetup contract, since this should deploy the Plugin contract within its constructor. + +```js +import {ethers} from 'hardhat'; + +async function main() { + const [deployer] = await ethers.getSigners(); + + console.log('Deploying contracts with the account:', deployer.address); + console.log('Account balance:', (await deployer.getBalance()).toString()); + + const getSimpleStorageSetup = await ethers.getContractFactory('SimpleStorageSetup'); + const SimpleStorageSetup = await SimpleStorageSetup.deploy(); + + await SimpleStorageSetup.deployed(); + + console.log('SimpleStorageSetup address:', SimpleStorageSetup.address); +} + +// We recommend this pattern to be able to use async/await everywhere +// and properly handle errors. +main().catch(error => { + console.error(error); + process.exitCode = 1; +}); +``` + +Finally, run this in your terminal to execute the command: + +```bash +npx hardhat run scripts/deploy.ts +``` + +### 4. Publishing the Plugin to the Aragon OSx Protocol + +Once done, our plugin is ready to be published on the Aragon plugin registry. With the address of the `SimpleAdminSetup` contract deployed, we're almost ready for creating our `PluginRepo`, the plugin's repository where all plugin versions will live. Check out our how to guides on [publishing your plugin here](../07-publication/index.md). diff --git a/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/04-upgradeable-plugin/04-subsequent-builds.md b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/04-upgradeable-plugin/04-subsequent-builds.md new file mode 100644 index 00000000..bd2d9bcd --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/04-upgradeable-plugin/04-subsequent-builds.md @@ -0,0 +1,150 @@ +--- +title: Subsequent Builds +--- + +## How to create a subsequent build to an Upgradeable Plugin + +A build is a new implementation of your Upgradeable Plugin. Upgradeable contracts offer advantages because you can cheaply change or fix the logic of your contract without losing the storage of your contract. + +The Aragon OSx protocol has an on-chain versioning system built-in, which distinguishes between releases and builds. + +- **Releases** contain breaking changes, which are incompatible with preexisting installations. Updates to a different release are not possible. Instead, you must install the new plugin release and uninstall the old one. +- **Builds** are minor/patch versions within a release, and they are meant for compatible upgrades only (adding a feature or fixing a bug without changing anything else). + +In this how to guide, we'll go through how we can create these builds for our plugins. Specifically, we'll showcase two specific types of builds - one that modifies the storage of the plugins, another one which modifies its bytecode. Both are possible and can be implemented within the same build implementation as well. + +### 1. Make sure your previous build is deployed and published + +Make sure you have at least one build already deployed and published into the Aragon protocol. Make sure to check out our [publishing guide](../07-publication/index.md) to ensure this step is done. + +### 2. Create a new build implementation + +In this second build implementation we want to update the functionality of our plugin - in this case, we want to update the storage of our plugin with new values. Specifically, we will add a second storage variable `address public account;`. Additional to the `initializeFromBuild2` function, we also want to add a second setter function `storeAccount` that uses the same permission as `storeNumber`. + +As you can see, we're still inheritting from the `PluginUUPSUpgradeable` contract and simply overriding some implementation from the previous build. The idea is that when someone upgrades the plugin and calls on these functions, they'll use this new upgraded implementation, rather than the older one. + +```solidity +import {PluginUUPSUpgradeable, IDAO} '@aragon/osx/core/plugin/PluginUUPSUpgradeable.sol'; + +/// @title SimpleStorage build 2 +contract SimpleStorageBuild2 is PluginUUPSUpgradeable { + bytes32 public constant STORE_PERMISSION_ID = keccak256('STORE_PERMISSION'); + + uint256 public number; // added in build 1 + address public account; // added in build 2 + + /// @notice Initializes the plugin when build 2 is installed. + function initializeBuild2( + IDAO _dao, + uint256 _number, + address _account + ) external reinitializer(2) { + __PluginUUPSUpgradeable_init(_dao); + number = _number; + account = _account; + } + + /// @notice Initializes the plugin when the update from build 1 to build 2 is applied. + /// @dev The initialization of `SimpleStorageBuild1` has already happened. + function initializeFromBuild1(address _account) external reinitializer(2) { + account = _account; + } + + function storeNumber(uint256 _number) external auth(STORE_PERMISSION_ID) { + number = _number; + } + + function storeAccount(address _account) external auth(STORE_PERMISSION_ID) { + account = _account; + } +} +``` + +Builds that you publish don't necessarily need to introduce new storage varaibles of your contracts and don't necessarily need to change the storage. To read more about Upgradeability, check out [OpenZeppelin's UUPSUpgradeability implementation here](https://docs.openzeppelin.com/contracts/4.x/api/proxy#UUPSUpgradeable). + +:::note +Note that because these contracts are Upgradeable, keeping storage gaps `uint256 [50] __gap;` in dependencies is a must in order to avoid storage corruption. To learn more about storage gaps, review OpenZeppelin's documentation [here](https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable#storage-gaps). +::: + +### 3. Alternatively, a build implementation modifying bytecode + +Updates for your contracts don't necessarily need to affect the storage, they can also modify the plugin's bytecode. Modifying the contract's bytecode, means making changes to: + +- functions +- constants +- immutables +- events +- errors + +For this third build, then, we want to change the bytecode of our implementation as an example, so we 've introduced two separate permissions for the `storeNumber` and `storeAccount` functions and named them `STORE_NUMBER_PERMISSION_ID` and `STORE_ACCOUNT_PERMISSION_ID` permission, respectively. Additionally, we decided to add the `NumberStored` and `AccountStored` events as well as an error preventing users from setting the same value twice. All these changes only affect the contract bytecode and not the storage. + +Here, it is important to remember how Solidity stores `constant`s (and `immutable`s). In contrast to normal variables, they are directly written into the bytecode on contract creation so that we don't need to worry that the second `bytes32` constant that we added shifts down the storage so that the value in `uint256 public number` gets lost. +It is also important to note that, the `initializeFromBuild2` could be left empty. Here, we just emit the events with the currently stored values. + +```solidity +import {PluginUUPSUpgradeable, IDAO} '@aragon/osx/core/plugin/PluginUUPSUpgradeable.sol'; + +/// @title SimpleStorage build 3 +contract SimpleStorageBuild3 is PluginUUPSUpgradeable { + bytes32 public constant STORE_NUMBER_PERMISSION_ID = keccak256('STORE_NUMBER_PERMISSION'); // changed in build 3 + bytes32 public constant STORE_ACCOUNT_PERMISSION_ID = keccak256('STORE_ACCOUNT_PERMISSION'); // added in build 3 + + uint256 public number; // added in build 1 + address public account; // added in build 2 + + // added in build 3 + event NumberStored(uint256 number); + event AccountStored(address number); + error AlreadyStored(); + + /// @notice Initializes the plugin when build 3 is installed. + function initializeBuild3( + IDAO _dao, + uint256 _number, + address _account + ) external reinitializer(3) { + __PluginUUPSUpgradeable_init(_dao); + number = _number; + account = _account; + + emit NumberStored({number: _number}); + emit AccountStored({account: _account}); + } + + /// @notice Initializes the plugin when the update from build 2 to build 3 is applied. + /// @dev The initialization of `SimpleStorageBuild2` has already happened. + function initializeFromBuild2() external reinitializer(3) { + emit NumberStored({number: number}); + emit AccountStored({account: account}); + } + + /// @notice Initializes the plugin when the update from build 1 to build 3 is applied. + /// @dev The initialization of `SimpleStorageBuild1` has already happened. + function initializeFromBuild1(address _account) external reinitializer(3) { + account = _account; + + emit NumberStored({number: number}); + emit AccountStored({account: _account}); + } + + function storeNumber(uint256 _number) external auth(STORE_NUMBER_PERMISSION_ID) { + if (_number == number) revert AlreadyStored(); + + number = _number; + + emit NumberStored({number: _number}); + } + + function storeAccount(address _account) external auth(STORE_ACCOUNT_PERMISSION_ID) { + if (_account == account) revert AlreadyStored(); + + account = _account; + + emit AccountStored({account: _account}); + } +} +``` + +:::note +Despite no storage-related changes happening in build 3, we must apply the `reinitializer(3)` modifier to all `initialize` functions so that none of them can be called twice or in the wrong order. +::: diff --git a/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/04-upgradeable-plugin/05-updating-versions.md b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/04-upgradeable-plugin/05-updating-versions.md new file mode 100644 index 00000000..e10e3b44 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/04-upgradeable-plugin/05-updating-versions.md @@ -0,0 +1,360 @@ +--- +title: Upgrade a DAO Plugin +--- + +## How to upgrade an Upgradeable Plugin + +Updating an Upgradeable plugin means we want to direct the implementation of our functionality to a new build, rather than the existing one. + +In this tutorial, we will go through how to update the version of an Upgradeable plugin and each component needed. + +### 1. Create the new build implementation contract + +Firstly, you want to create the new build implementation contract the plugin should use. You can read more about how to do this in the ["How to create a subsequent build implementation to an Upgradeable Plugin" guide](./04-subsequent-builds.md). + +```solidity +// SPDX-License-Identifier: AGPL-3.0-or-later +pragma solidity 0.8.21; + +import {IDAO, PluginUUPSUpgradeable} from '@aragon/osx/core/plugin/PluginUUPSUpgradeable.sol'; + +/// @title SimpleStorage build 2 +contract SimpleStorageBuild2 is PluginUUPSUpgradeable { + bytes32 public constant STORE_PERMISSION_ID = keccak256('STORE_PERMISSION'); + + uint256 public number; // added in build 1 + address public account; // added in build 2 + + /// @notice Initializes the plugin when build 2 is installed. + function initializeBuild2( + IDAO _dao, + uint256 _number, + address _account + ) external reinitializer(2) { + __PluginUUPSUpgradeable_init(_dao); + number = _number; + account = _account; + } + + /// @notice Initializes the plugin when the update from build 1 to build 2 is applied. + /// @dev The initialization of `SimpleStorageBuild1` has already happened. + function initializeFromBuild1(address _account) external reinitializer(2) { + account = _account; + } + + function storeNumber(uint256 _number) external auth(STORE_PERMISSION_ID) { + number = _number; + } + + function storeAccount(address _account) external auth(STORE_PERMISSION_ID) { + account = _account; + } +} +``` + +### 2. Write a new Plugin Setup contract + +In order to do update a plugin, we need a `prepareUpdate()` function in our Plugin Setup contract which points the functionality to a new build, as we described in the ["How to create a subsequent build implementation to an Upgradeable Plugin" guide](./04-subsequent-builds.md). The `prepareUpdate()` function must transition the plugin from the old build state into the new one so that it ends up having the same permissions (and helpers) as if it had been freshly installed. + +In contrast to the original build 1, build 2 requires two input arguments: `uint256 _number` and `address _account` that we decode from the bytes-encoded input `_data`. + +```solidity +// SPDX-License-Identifier: AGPL-3.0-or-later + +pragma solidity 0.8.21; + +import {PermissionLib} from '@aragon/osx/core/permission/PermissionLib.sol'; +import {PluginSetup, IPluginSetup} from '@aragon/osx/framework/plugin/setup/PluginSetup.sol'; +import {SimpleStorageBuild2} from './SimpleStorageBuild2.sol'; + +/// @title SimpleStorageSetup build 2 +contract SimpleStorageBuild2Setup is PluginSetup { + address private immutable simpleStorageImplementation; + + constructor() { + simpleStorageImplementation = address(new SimpleStorageBuild2()); + } + + /// @inheritdoc IPluginSetup + function prepareInstallation( + address _dao, + bytes memory _data + ) external returns (address plugin, PreparedSetupData memory preparedSetupData) { + (uint256 _number, address _account) = abi.decode(_data, (uint256, address)); + + plugin = createERC1967Proxy( + simpleStorageImplementation, + abi.encodeWithSelector(SimpleStorageBuild2.initializeBuild2.selector, _dao, _number, _account) + ); + + PermissionLib.MultiTargetPermission[] + memory permissions = new PermissionLib.MultiTargetPermission[](1); + + permissions[0] = PermissionLib.MultiTargetPermission({ + operation: PermissionLib.Operation.Grant, + where: plugin, + who: _dao, + condition: PermissionLib.NO_CONDITION, + permissionId: SimpleStorageBuild2(this.implementation()).STORE_PERMISSION_ID() + }); + + preparedSetupData.permissions = permissions; + } + + /// @inheritdoc IPluginSetup + function prepareUpdate( + address _dao, + uint16 _currentBuild, + SetupPayload calldata _payload + ) + external + pure + override + returns (bytes memory initData, PreparedSetupData memory preparedSetupData) + { + (_dao, preparedSetupData); + + if (_currentBuild == 0) { + address _account = abi.decode(_payload.data, (address)); + initData = abi.encodeWithSelector( + SimpleStorageBuild2.initializeFromBuild1.selector, + _account + ); + } + } + + /// @inheritdoc IPluginSetup + function prepareUninstallation( + address _dao, + SetupPayload calldata _payload + ) external view returns (PermissionLib.MultiTargetPermission[] memory permissions) { + permissions = new PermissionLib.MultiTargetPermission[](1); + + permissions[0] = PermissionLib.MultiTargetPermission({ + operation: PermissionLib.Operation.Revoke, + where: _payload.plugin, + who: _dao, + condition: PermissionLib.NO_CONDITION, + permissionId: SimpleStorageBuild2(this.implementation()).STORE_PERMISSION_ID() + }); + } + + /// @inheritdoc IPluginSetup + function implementation() external view returns (address) { + return simpleStorageImplementation; + } +} +``` + +The key thing to review in this new Plugin Setup contract is its `prepareUpdate()` function. The function only contains a condition checking from which build number the update is transitioning to build `2`. Here, it is the build number `1` as this is the only update path we support. Inside, we decode the `address _account` input argument provided with `bytes _date` and pass it to the `initializeFromBuild1` function taking care of intializing the storage that was added in this build. + +### 3. Future builds + +For each build we add, we will need to add a `prepareUpdate()` function with any parameters needed to update to that implementation. + +In this third build, for example, we are modifying the bytecode of the plugin. + +
+Third plugin build example, modifying the plugin's bytecode + +```solidity +// SPDX-License-Identifier: AGPL-3.0-or-later +pragma solidity 0.8.21; + +import {IDAO, PluginUUPSUpgradeable} from '@aragon/osx/core/plugin/PluginUUPSUpgradeable.sol'; + +/// @title SimpleStorage build 3 +contract SimpleStorageBuild3 is PluginUUPSUpgradeable { + bytes32 public constant STORE_NUMBER_PERMISSION_ID = keccak256('STORE_NUMBER_PERMISSION'); // changed in build 3 + bytes32 public constant STORE_ACCOUNT_PERMISSION_ID = keccak256('STORE_ACCOUNT_PERMISSION'); // added in build 3 + + uint256 public number; // added in build 1 + address public account; // added in build 2 + + // added in build 3 + event NumberStored(uint256 number); + event AccountStored(address account); + error AlreadyStored(); + + /// @notice Initializes the plugin when build 3 is installed. + function initializeBuild3( + IDAO _dao, + uint256 _number, + address _account + ) external reinitializer(3) { + __PluginUUPSUpgradeable_init(_dao); + number = _number; + account = _account; + + emit NumberStored({number: _number}); + emit AccountStored({account: _account}); + } + + /// @notice Initializes the plugin when the update from build 2 to build 3 is applied. + /// @dev The initialization of `SimpleStorageBuild2` has already happened. + function initializeFromBuild2() external reinitializer(3) { + emit NumberStored({number: number}); + emit AccountStored({account: account}); + } + + /// @notice Initializes the plugin when the update from build 1 to build 3 is applied. + /// @dev The initialization of `SimpleStorageBuild1` has already happened. + function initializeFromBuild1(address _account) external reinitializer(3) { + account = _account; + + emit NumberStored({number: number}); + emit AccountStored({account: _account}); + } + + function storeNumber(uint256 _number) external auth(STORE_NUMBER_PERMISSION_ID) { + if (_number == number) revert AlreadyStored(); + + number = _number; + + emit NumberStored({number: _number}); + } + + function storeAccount(address _account) external auth(STORE_ACCOUNT_PERMISSION_ID) { + if (_account == account) revert AlreadyStored(); + + account = _account; + + emit AccountStored({account: _account}); + } +} +``` + +
+ +With each new build implementation, we will need to udate the Plugin Setup contract to be able to update to that new version. We do this through updating the `prepareUpdate()` function to support any new features that need to be set up. + +
+Third plugin setup example, modifying prepareUpdate function + +```solidity +// SPDX-License-Identifier: AGPL-3.0-or-later + +pragma solidity 0.8.21; + +import {PermissionLib} from '@aragon/osx/core/permission/PermissionLib.sol'; +import {PluginSetup, IPluginSetup} from '@aragon/osx/framework/plugin/setup/PluginSetup.sol'; +import {SimpleStorageBuild2} from '../build2/SimpleStorageBuild2.sol'; +import {SimpleStorageBuild3} from './SimpleStorageBuild3.sol'; + +/// @title SimpleStorageSetup build 3 +contract SimpleStorageBuild3Setup is PluginSetup { + address private immutable simpleStorageImplementation; + + constructor() { + simpleStorageImplementation = address(new SimpleStorageBuild3()); + } + + /// @inheritdoc IPluginSetup + function prepareInstallation( + address _dao, + bytes memory _data + ) external returns (address plugin, PreparedSetupData memory preparedSetupData) { + (uint256 _number, address _account) = abi.decode(_data, (uint256, address)); + + plugin = createERC1967Proxy( + simpleStorageImplementation, + abi.encodeWithSelector(SimpleStorageBuild3.initializeBuild3.selector, _dao, _number, _account) + ); + + PermissionLib.MultiTargetPermission[] + memory permissions = new PermissionLib.MultiTargetPermission[](2); + + permissions[0] = PermissionLib.MultiTargetPermission({ + operation: PermissionLib.Operation.Grant, + where: plugin, + who: _dao, + condition: PermissionLib.NO_CONDITION, + permissionId: SimpleStorageBuild3(this.implementation()).STORE_NUMBER_PERMISSION_ID() + }); + + permissions[1] = permissions[0]; + permissions[1].permissionId = SimpleStorageBuild3(this.implementation()) + .STORE_ACCOUNT_PERMISSION_ID(); + + preparedSetupData.permissions = permissions; + } + + /// @inheritdoc IPluginSetup + function prepareUpdate( + address _dao, + uint16 _currentBuild, + SetupPayload calldata _payload + ) + external + view + override + returns (bytes memory initData, PreparedSetupData memory preparedSetupData) + { + if (_currentBuild == 0) { + address _account = abi.decode(_payload.data, (address)); + initData = abi.encodeWithSelector( + SimpleStorageBuild3.initializeFromBuild1.selector, + _account + ); + } else if (_currentBuild == 1) { + initData = abi.encodeWithSelector(SimpleStorageBuild3.initializeFromBuild2.selector); + } + + PermissionLib.MultiTargetPermission[] + memory permissions = new PermissionLib.MultiTargetPermission[](3); + permissions[0] = PermissionLib.MultiTargetPermission({ + operation: PermissionLib.Operation.Revoke, + where: _dao, + who: _payload.plugin, + condition: PermissionLib.NO_CONDITION, + permissionId: keccak256('STORE_PERMISSION') + }); + + permissions[1] = permissions[0]; + permissions[1].operation = PermissionLib.Operation.Grant; + permissions[1].permissionId = SimpleStorageBuild3(this.implementation()) + .STORE_NUMBER_PERMISSION_ID(); + + permissions[2] = permissions[1]; + permissions[2].permissionId = SimpleStorageBuild3(this.implementation()) + .STORE_ACCOUNT_PERMISSION_ID(); + + preparedSetupData.permissions = permissions; + } + + /// @inheritdoc IPluginSetup + function prepareUninstallation( + address _dao, + SetupPayload calldata _payload + ) external view returns (PermissionLib.MultiTargetPermission[] memory permissions) { + permissions = new PermissionLib.MultiTargetPermission[](2); + + permissions[0] = PermissionLib.MultiTargetPermission({ + operation: PermissionLib.Operation.Revoke, + where: _payload.plugin, + who: _dao, + condition: PermissionLib.NO_CONDITION, + permissionId: SimpleStorageBuild3(this.implementation()).STORE_NUMBER_PERMISSION_ID() + }); + + permissions[1] = permissions[1]; + permissions[1].permissionId = SimpleStorageBuild3(this.implementation()) + .STORE_ACCOUNT_PERMISSION_ID(); + } + + /// @inheritdoc IPluginSetup + function implementation() external view returns (address) { + return simpleStorageImplementation; + } +} +``` + +
+ +In this case, the `prepareUpdate()` function only contains a condition checking from which build number the update is transitioning to build 2. Here, we can update from build 0 or build 1 and different operations must happen for each case to transition to `SimpleAdminBuild3`. + +In the first case, `initializeFromBuild1` is called taking care of intializing `address _account` that was added in build 1 and emitting the events added in build 2. + +In the second case, `initializeFromBuild2` is called taking care of intializing the build. Here, only the two events will be emitted. + +Lastly, the `prepareUpdate()` function takes care of modifying the permissions by revoking the `STORE_PERMISSION_ID` and granting the more specific `STORE_NUMBER_PERMISSION_ID` and `STORE_ACCOUNT)PERMISSION_ID` permissions, that are also granted if build 2 is freshly installed. This must happen for both update paths so this code is outside the `if` statements. diff --git a/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/04-upgradeable-plugin/index.md b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/04-upgradeable-plugin/index.md new file mode 100644 index 00000000..37ca2ad3 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/04-upgradeable-plugin/index.md @@ -0,0 +1,33 @@ +--- +title: Upgradeable Plugins +--- + +## How to develop an Upgradeable Plugin + +Upgradeable contracts offer advantages because you can cheaply change or fix the logic of your contract without losing the storage of your contract. If you want to review plugin types in depth, check out our [guide on plugin types here](../02-plugin-types.md). + +The drawbacks however, are that: + +- there are plenty of ways to make a mistake, and +- the changeable logic poses a new attack surface. + +Although we've abstracted away most of the complications of the upgrade process through our `PluginUUPSUpgradeable` base class, please know that writing an upgradeable contract is an advanced topic. + +### Prerequisites + +- You have read about the different [plugin types](../02-plugin-types.md) and decided to develop an upgradeable plugin being deployed via the [UUPS pattern (ERC-1822)](https://eips.ethereum.org/EIPS/eip-1822). +- You know how to write a [non-upgradeable plugin](../03-non-upgradeable-plugin/index.md). +- You know about the difficulties and pitfalls of ["Writing Upgradeable Contracts"](https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable) that come with + - modifiying the storage layout + - initialization + - inheritance + - leaving storage gaps + +Up next, check out our guides on: + +1. [How to initialize an Upgradeable Plugins](./01-initialization.md) +2. [How to build the implementation of an Upgradeable Plugin](./02-implementation.md) +3. [How to build and deploy a Plugin Setup contract for an Upgradeable Plugin](./03-setup.md) +4. [How to create a subsequent build implementation to an Upgradeable Plugin](./04-subsequent-builds.md) +5. [How to upgrade an Upgradeable Plugin](./05-updating-versions.md) +6. [How to publish my plugin into the Aragon OSx protocol](../07-publication/index.md) diff --git a/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/05-governance-plugins/01-proposals.md b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/05-governance-plugins/01-proposals.md new file mode 100644 index 00000000..e515dc09 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/05-governance-plugins/01-proposals.md @@ -0,0 +1,43 @@ +--- +title: Proposals +--- + +## The `IProposal` Interface + +:::note +This page is a stub and work in progress +::: + +Create and execute proposals containing actions and a description. + +### Interface `IProposal` + +```solidity +interface IProposal { + /// @notice Emitted when a proposal is created. + /// @param proposalId The ID of the proposal. + /// @param creator The creator of the proposal. + /// @param startDate The start date of the proposal in seconds. + /// @param endDate The end date of the proposal in seconds. + /// @param metadata The metadata of the proposal. + /// @param actions The actions that will be executed if the proposal passes. + /// @param allowFailureMap A bitmap allowing the proposal to succeed, even if individual actions might revert. If the bit at index `i` is 1, the proposal succeeds even if the `i`th action reverts. A failure map value of 0 requires every action to not revert. + event ProposalCreated( + uint256 indexed proposalId, + address indexed creator, + uint64 startDate, + uint64 endDate, + bytes metadata, + IDAO.Action[] actions, + uint256 allowFailureMap + ); + + /// @notice Emitted when a proposal is executed. + /// @param proposalId The ID of the proposal. + event ProposalExecuted(uint256 indexed proposalId); + + /// @notice Returns the proposal count determining the next proposal ID. + /// @return The proposal count. + function proposalCount() external view returns (uint256); +} +``` diff --git a/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/05-governance-plugins/02-membership.md b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/05-governance-plugins/02-membership.md new file mode 100644 index 00000000..24d829e3 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/05-governance-plugins/02-membership.md @@ -0,0 +1,44 @@ +--- +title: Membership +--- + +## The `IMembership` Interface + +:::note +This page is a stub and work in progress +::: + +Introduce members to the DAO upon installation through [the `IMembership` interface](./02-membership.md). + +### Interface IMembership + +```solidity title= +/// @notice An interface to be implemented by DAO plugins that define membership. +interface IMembership { + /// @notice Emitted when members are added to the DAO plugin. + /// @param members The list of new members being added. + event MembersAdded(address[] members); + + /// @notice Emitted when members are removed from the DAO plugin. + /// @param members The list of existing members being removed. + event MembersRemoved(address[] members); + + /// @notice Emitted to announce the membership being defined by a contract. + /// @param definingContract The contract defining the membership. + event MembershipContractAnnounced(address indexed definingContract); + + /// @notice Checks if an account is a member of the DAO. + /// @param _account The address of the account to be checked. + /// @return Whether the account is a member or not. + /// @dev This function must be implemented in the plugin contract that introduces the members to the DAO. + function isMember(address _account) external view returns (bool); +} +``` + +### Introducing Members directly + +```solidity +event MembersAdded(address[] members) + +event MembersRemoved(address[] members) +``` diff --git a/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/05-governance-plugins/index.md b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/05-governance-plugins/index.md new file mode 100644 index 00000000..b43f7807 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/05-governance-plugins/index.md @@ -0,0 +1,41 @@ +--- +title: Governance Plugins +--- + +## How to Build a Governance Plugin + +One of the most common use cases for plugins are governance plugins. Governance plugins are plugins DAOs install to help them make decisions. + +### What are Governance Plugins + +Governance plugins are characterized by the **ability to execute actions in the DAO** they have been installed to. Accordingly, the `EXECUTE_PERMISSION_ID` is granted on installation on the installing DAO to the governance plugin contract. + +```solidity +grant({ + where: installingDao, + who: governancePlugin, + permissionId: EXECUTE_PERMISSION_ID +}); +``` + +Beyond this fundamental ability, governance plugins usually implement two interfaces: + +- [The `IProposal` interface](./01-proposals.md) introducing the **notion of proposals** and how they are created and executed. +- [The `IMembership` interface](./02-membership.md) introducing the **notion of membership** to the DAO. + +### Examples of Governance Plugins + +Some examples of governance plugins are: + +- [A token-voting plugin](https://github.com/aragon/osx/tree/develop/packages/contracts/src/plugins/governance/majority-voting/token): Results are based on what the majority votes and the vote's weight is determined by how many tokens an account holds. Ex: Alice has 10 tokens, Bob 2, and Alice votes yes, the yes wins. +- [Multisig plugin](https://github.com/aragon/osx/tree/develop/packages/contracts/src/plugins/governance/multisig): A determined set of addresses is able to approve. Once `x` amount of addresses approve (as determined by the plugin settings), then the proposal automatically succeeds. +- [Admin plugin](https://github.com/aragon/osx/tree/develop/packages/contracts/src/plugins/governance/admin): One address can create and immediately execute proposals on the DAO (full control). +- [Addresslist plugin](https://github.com/aragon/osx/tree/develop/packages/contracts/src/plugins/governance/majority-voting/addresslist): Majority-based voting, where list of addresses are able to vote in decision-making for the organization. Unlike a multisig, everybody here is expected to vote yes/no/abstain within a certain time frame. + +:::note +More tutorials on how to build governance plugins coming soon. +::: + + + + diff --git a/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/06-meta-tx-plugins.md b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/06-meta-tx-plugins.md new file mode 100644 index 00000000..a195e393 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/06-meta-tx-plugins.md @@ -0,0 +1,46 @@ +--- +title: Meta Transactions +--- + +## Support for Meta Transactions + +Our plugins are compatible with the [ERC-2771 (Meta Transaction)](https://eips.ethereum.org/EIPS/eip-2771) standard, which allows users to send gasless transactions, also known as meta transactions. +This is possible because we use `_msgSender` and `_msgData` context from OpenZeppelin's `Context` and `ContextUpgradeable` in our `Plugin`, `PluginCloneable`, and `PluginUUPSUpgradeable` classes. + +To support meta transactions, your implementation contract must inherit and override the `Context` implementation with the `_msgSender` and `_msgData` functions provided in OpenGSN's `BaseRelayRecipient`, and use the DAO's trusted forwarder. + +Below we show for the example of the `TokenVoting` plugin how you can make an existing plugin contract meta-transaction compatible. + +```solidity +import {ContextUpgradeable} from '@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol'; +import {BaseRelayRecipient} from '@opengsn/contracts/src/BaseRelayRecipient.sol'; + +contract MyPlugin is PluginUUPSUpgradeable, BaseRelayRecipient { + function initialize(IDAO _dao) external initializer { + __PluginUUPSUpgradeable_init(_dao); + _setTrustedForwarder(dao.getTrustedForwarder()); + } + + // ... the implementation + + function _msgSender() + internal + view + virtual + override(ContextUpgradeable, BaseRelayRecipient) + returns (address) + { + return BaseRelayRecipient._msgSender(); + } + + function _msgData() + internal + view + virtual + override(ContextUpgradeable, BaseRelayRecipient) + returns (bytes calldata) + { + return BaseRelayRecipient._msgData(); + } +} +``` diff --git a/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/07-publication/01-versioning.md b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/07-publication/01-versioning.md new file mode 100644 index 00000000..89348f29 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/07-publication/01-versioning.md @@ -0,0 +1,59 @@ +--- +title: New Plugin Version +--- + +## How to add a new version of your plugin + +The Aragon OSx protocol has an on-chain versioning system built-in, which distinguishes between releases and builds. + +- **Releases** contain breaking changes, which are incompatible with preexisting installations. Updates to a different release are not possible. Instead, you must install the new plugin release and uninstall the old one. +- **Builds** are minor/patch versions within a release, and they are meant for compatible upgrades only (adding a feature or fixing a bug without changing anything else). + +Builds are particularly important for `UUPSUpgradeable` plugins, whereas a non-upgradeable plugin will work off of only releases. + +Given a version tag `RELEASE.BUILD`, we can infer that: + +1. We are doing a `RELEASE` version when we apply breaking changes affecting the interaction with other contracts on the blockchain to: + + - The `Plugin` implementation contract such as the + + - change or removal of storage variables + - removal of external functions + - change of external function headers + +2. We are doing a `BUILD` version when we apply backward compatible changes not affecting the interaction with other contracts on the blockchain to: + + - The `Plugin` implementation contract such as the + + - addition of + + - storage variables + - external functions + + - change of + + - external function bodies + + - addition, change, or removal of + + - internal functions + - constants + - immutables + - events + - errors + + - The `PluginSetup` contract such as + + - addition, change, or removal of + + - input parameters + - helper contracts + - requested permissions + + - The release and build `metadata` URIs such as the + + - change of + + - the plugin setup ABI + - the plugin UI components + - the plugin description diff --git a/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/07-publication/02-metadata.md b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/07-publication/02-metadata.md new file mode 100644 index 00000000..bfe6d57c --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/07-publication/02-metadata.md @@ -0,0 +1,122 @@ +--- +title: Plugin Metadata +--- + +## Plugin Metadata Specification + +The plugin metadata is necessary to allow the App frontend to interact with any plugins: + +- Now: generic setup (installation, update, uninstallation) + - Allows the frontend to render the necessary fields for the input being required to setup the plugin (e.g., the list of initial members of the Multisig plugin) +- Future: render a UI in a generic way (buttons, text fields, flows) within the specs of the Open Design System (ODS) (e.g. manage the list of Multisig members or the approval settings) + +Currently, two kinds of metadata exist: + +1. Release metadata +2. Build metadata + +### Release Metadata + +The release metadata is a `.json` file stored on IPFS with its IPFS CID published for each release in the [PluginRepo](../../../01-how-it-works/02-framework/02-plugin-management/01-plugin-repo/index.md) (see also the section about [versioning](../07-publication/01-versioning.md#)). + +The intention is to provide an appealing overview of each releases functionality. +It can be updated with each call to [`createVersion()`](../../../03-reference-guide/framework/plugin/repo/IPluginRepo.md#external-function-createversion) in `IPluginRepo` by the repo maintainer. +It can be replaced at any time with [`updateReleaseMetadata()`](../../../03-reference-guide/framework/plugin/repo/IPluginRepo.md#external-function-updatereleasemetadata) in `IPluginRepo` by the repo maintainer. + +The `release-metadata.json` file consists of the following entries: + +| Key | Type | Description | +| ----------- | ----------- | ---------------------------------------------------------------------------- | +| name | `string` | Name of the plugin (e.g. `"Multisig"`) | +| description | `string` | Description of the plugin release and its functionality. | +| images | UNSPECIFIED | Optional. Contains a series of images advertising the plugins functionality. | + +#### Example + +```json +{ + "name": "Multisig", + "description": "", + "images": {} +} +``` + +### Build Metadata + +The build metadata is a `.json` file stored on IPFS with its IPFS CID published for each build **only once** in the [PluginRepo](../../../01-how-it-works/02-framework/02-plugin-management/01-plugin-repo/index.md) (see also the section about [versioning](../07-publication/01-versioning.md#)). + +The intention is to inform about the changes that were introduced in this build compared to the previous one and give instructions to the App frontend and other users on how to interact with the plugin setup and implementation contract. +It can be published **only once** with the call to [`createVersion()`](../../../03-reference-guide/framework/plugin/repo/IPluginRepo.md#external-function-createversion) in `IPluginRepo` by the repo maintainer. + +| Key | Type | Description | +| ----------- | ----------- | --------------------------------------------------------------------------------------------------------- | +| ui | UNSPECIFIED | A special formatted object containing instructions for the App frontend on how to render the plugin's UI. | +| change | `string` | Description of the code and UI changes compared to the previous build of the same release. | +| pluginSetup | `object` | Optional. Contains a series of images advertising the plugins functionality. | + +Each build metadata contains the following fields: + +- one `"prepareInstallation"` object +- one `"prepareUninstallation"` object +- 0 to N `"prepareUpdate"` objects enumerated from 1 to N+1 + +Each `"prepare..."` object contains: + +| Key | Type | Description | +| ----------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| description | `string` | The description of what this particular setup step is doing and what it requires the input for. | +| inputs | `object[]` | A description of the inputs required for this setup step following the [Solidity JSON ABI](https://docs.ethers.org/v5/api/utils/abi/formats/#abi-formats--solidity) format enriched with an additional `"description"` field for each element. | + +By following the Solidity JSON ABI format for the inputs, we followed an establishd standard, have support for complex types (tuples, arrays, nested versions of the prior) and allow for future extensibility (such as the human readable description texts that we have added). + +#### Example + +```json +{ + "ui": {}, + "change": "- The ability to create a proposal now depends on the membership status of the current instead of the snapshot block.\n- Added a check ensuring that the initial member list cannot overflow.", + "pluginSetup": { + "prepareInstallation": { + "description": "The information required for the installation.", + "inputs": [ + { + "internalType": "address[]", + "name": "members", + "type": "address[]", + "description": "The addresses of the initial members to be added." + }, + { + "components": [ + { + "internalType": "bool", + "name": "onlyListed", + "type": "bool", + "description": "Whether only listed addresses can create a proposal or not." + }, + { + "internalType": "uint16", + "name": "minApprovals", + "type": "uint16", + "description": "The minimal number of approvals required for a proposal to pass." + } + ], + "internalType": "struct Multisig.MultisigSettings", + "name": "multisigSettings", + "type": "tuple", + "description": "The inital multisig settings." + } + ], + "prepareUpdate": { + "1": { + "description": "No input is required for the update.", + "inputs": [] + } + }, + "prepareUninstallation": { + "description": "No input is required for the uninstallation.", + "inputs": [] + } + } + } +} +``` diff --git a/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/07-publication/index.md b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/07-publication/index.md new file mode 100644 index 00000000..d57afca5 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/07-publication/index.md @@ -0,0 +1,132 @@ +--- +title: Publication of your Plugin into Aragon OSx +--- + +## How to publish a plugin into Aragon's plugin registry + +Once you've deployed your Plugin Setup contract, you will be able to publish your plugin into Aragon's plugin registry so any Aragon DAO can install it. + +### 1. Make sure your plugin is deployed in the right network + +Make sure your Plugin Setup contract is deployed in your network of choice (you can find all of the networks we support [here](https://github.com/aragon/osx-commons/tree/develop/configs/src/deployments/json)). You will need the address of your Plugin Setup contract to be able to publish the plugin into the protocol. + +### 2. Publishing your plugin + +Every plugin in Aragon can have future versions, so when publishing a plugin to the Aragon protocol, we're really creating a [`PluginRepo`](https://github.com/aragon/osx/blob/develop/packages/contracts/src/framework/plugin/repo/PluginRepo.sol) instance for each plugin, which will contain all of the plugin's versions. + +To publish a plugin, we will use Aragon's `PluginRepoFactory` contract - in charge of creating `PluginRepo` instances containing your plugin's versions. To do this, we will call its `createPluginRepoWithFirstVersion` function, which will [create the first version of a plugin](https://github.com/aragon/core/blob/develop/packages/contracts/src/framework/plugin/repo/PluginRepoFactory.sol#L48) and add that new `PluginRepo` address into the `PluginRepoRegistry` containing all available plugins within the protocol. + +You can find all of the addresses of `PluginRepoFactory` contracts by network [here](https://github.com/aragon/osx-commons/tree/develop/configs/src/deployments/json). + +To create more versions of your plugin in the future, you'll call on the [`createVersion` function](https://github.com/aragon/osx/blob/develop/packages/contracts/src/framework/plugin/repo/PluginRepo.sol#L128) from the `PluginRepo` instance of your plugin. When you publish your plugin, you'll be able to find the address of your plugin's `PluginRepo` instance within the transaction data. + +Having that said, there's a few ways to publish your plugin into Aragon's protocol: + +#### Option A: Etherscan + +Go directly to Etherscan and search for the address of the `PluginRepoFactory` as found in [this list](https://github.com/aragon/osx-commons/tree/develop/configs/src/deployments/json). + +Then, go to the "Write Contract" tab and add the attributes requested to call on the `createPluginRepoWithFirstVersion` function. Make sure you "Connect your Wallet" before hitting "Write" and signing the transaction. + +![Etherscan](https://res.cloudinary.com/dacofvu8m/image/upload/v1682466427/Screen_Shot_2023-04-25_at_19.46.58_nlo9p1.png) + +For some context: + +- `subdomain`: The subdomain name of your plugin. Whatever you write here should be hyphenated (i.e. `my-plugin`) and should be unique. +- `pluginSetupAddress`: The address of your deployed Plugin Setup contract (i.e. `0x3018f7712b77744A31277511609238399f0A26h8`). +- `maintainer`: The address owner of that plugin (i.e. `0x87789071456774411227751100h89g899fg6679`). +- `releaseMetadata`: The URI of the data regarding the release of this plugin (i.e. `0x87789071456774411227751100h89g899fg6679`). If you don't have any as of now, simply pass `0x00`. You get this address by uploading your metadata object to IPFS. +- `buildMetadata`: The URI of the data regarding this specific build implementation (i.e. `0x87789071456774411227751100h89g899fg6679`). If you don't have any as of now, simply pass `0x00`. You get this address by [uploading your metadata object to IPFS](https://docs.infura.io/infura/tutorials/ethereum/create-an-nft-using-truffle/upload-nft-metadata-to-ipfs). + +#### Option B: Programmatically publish with a script + +You may want to have a publishing script directly off of your Hardhat project. In that case, you may want to check out our [publishing script and additional helpers here](https://github.com/aragon/simple-storage-example-plugin/blob/main/deploy/02_repo/10_publish_r1b1_in_new_repo.ts). + +```js +import buildMetadata1 from '../../contracts/release1/build1/build-metadata.json'; +import releaseMetadata1 from '../../contracts/release1/release-metadata.json'; +import {networkNameMapping, osxContracts, addDeployedContract} from '../../utils/helpers'; +import {toHex} from '../../utils/ipfs-upload'; +import {uploadToIPFS} from '../../utils/ipfs-upload'; +import {findEventTopicLog} from '@aragon/osx-commons-sdk'; +import { + PluginRepoFactory__factory, + PluginRepoRegistry__factory, + PluginRepo__factory, +} from '@aragon/osx-ethers'; +import {DeployFunction} from 'hardhat-deploy/types'; +import {HardhatRuntimeEnvironment} from 'hardhat/types'; + +const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { + const {deployments, network} = hre; + const [deployer] = await hre.ethers.getSigners(); + + // Get the plugin factory address + let pluginRepoFactoryAddr: string; + if (isLocal(network)) { + const hardhatForkNetwork = process.env.HARDHAT_FORK_NETWORK + ? process.env.HARDHAT_FORK_NETWORK + : 'mainnet'; + + pluginRepoFactoryAddr = osxContracts[hardhatForkNetwork].PluginRepoFactory; + console.log( + `Using the ${hardhatForkNetwork} PluginRepoFactory address (${pluginRepoFactoryAddr}) for deployment testing on network ${network.name}` + ); + } else { + pluginRepoFactoryAddr = osxContracts[networkNameMapping[network.name]].PluginRepoFactory; + + console.log( + `Using the ${ + networkNameMapping[network.name] + } PluginRepoFactory address (${pluginRepoFactoryAddr}) for deployment...` + ); + } + + const pluginRepoFactory = PluginRepoFactory__factory.connect(pluginRepoFactoryAddr, deployer); + + // Upload the metadata + const releaseMetadataURI = `ipfs://${await uploadToIPFS( + JSON.stringify(releaseMetadata1), + false + )}`; + const buildMetadataURI = `ipfs://${await uploadToIPFS(JSON.stringify(buildMetadata1), false)}`; + + console.log(`Uploaded metadata of release 1: ${releaseMetadataURI}`); + console.log(`Uploaded metadata of build 1: ${buildMetadataURI}`); + + const pluginName = 'simple-storage'; + const pluginSetupContractName = 'SimpleStorageR1B1Setup'; + + const setupR1B1 = await deployments.get(pluginSetupContractName); + + // Create Repo for Release 1 and Build 1 + const tx = await pluginRepoFactory.createPluginRepoWithFirstVersion( + pluginName, + setupR1B1.address, + deployer.address, + toHex(releaseMetadataURI), + toHex(buildMetadataURI) + ); + const eventLog = await findEventTopicLog( + tx, + PluginRepoRegistry__factory.createInterface(), + 'PluginRepoRegistered' + ); + + const pluginRepo = PluginRepo__factory.connect(eventLog.args.pluginRepo, deployer); + + console.log(`"${pluginName}" PluginRepo deployed at: ${pluginRepo.address} with `); + + addDeployedContract(network.name, 'PluginRepo', pluginRepo.address); + addDeployedContract(network.name, pluginSetupContractName, setupR1B1.address); +}; + +export default func; +func.tags = ['SimpleStoragePluginRepo', 'PublishSimpleStorageR1B2']; +``` + +### 3. Publishing subsequent builds + +When publishing subsquent builds, you want to use the `createVersion` function in the `PluginRepo` contract ([check out the function's source code here](https://github.com/aragon/osx/blob/develop/packages/contracts/src/framework/plugin/repo/PluginRepo.sol#L128)). + +Similar as above, you can publish the new version on Etherscan directly or through a publishing script. diff --git a/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/index.md b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/index.md new file mode 100644 index 00000000..869b37a7 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/02-how-to-guides/02-plugin-development/index.md @@ -0,0 +1,211 @@ +--- +title: How to build a DAO Plugin +--- + +## Plugin Development Quickstart Guide + +Plugins are how we extend the functionality for DAOs. In Aragon OSx, everything a DAO can do is based on Plugin functionality enabled through permissions. + +In this Quickstart guide, we will build a Greeter Plugin which returns "Hello World!". + +## Hello, World! + +### 1. Setup + +First, let's [create a Hardhat project](https://hardhat.org/tutorial/creating-a-new-hardhat-project). + +```bash +mkdir aragon-plugin-tutorial +cd aragon-plugin-tutorial +yarn init +yarn add --dev hardhat +npx hardhat +``` + +You'll want to select an empty Hardhat project to get started. + +``` +$ npx hardhat +888 888 888 888 888 +888 888 888 888 888 +888 888 888 888 888 +8888888888 8888b. 888d888 .d88888 88888b. 8888b. 888888 +888 888 "88b 888P" d88" 888 888 "88b "88b 888 +888 888 .d888888 888 888 888 888 888 .d888888 888 +888 888 888 888 888 Y88b 888 888 888 888 888 Y88b. +888 888 "Y888888 888 "Y88888 888 888 "Y888888 "Y888 + +👷 Welcome to Hardhat v2.9.9 👷‍ + +? What do you want to do? … + Create a JavaScript project + Create a TypeScript project +❯ Create an empty hardhat.config.js + Quit +``` + +Then, you'll want to import the Aragon OSx contracts inside your Solidity project. + +```bash +yarn add @aragon/osx +``` + +or + +```bash +npm install @aragon/osx +``` + +Now that we have OSx within our project, we can start developing our plugin implementation. + +### 2. GreeterPlugin + +We'll create a Greeter Plugin which returns a "Hello World!" string when calling on `greet()`. + +In order to do this, we'll create a `GreeterPlugin.sol` file. This is where all of our plugin logic will live. + +```bash +mkdir contracts && cd contracts +touch GreeterPlugin.sol +``` + +Inside the `GreeterPlugin.sol`, we want to: + +- Pass the DAO the plugin will be using within the constructor. This will enable us to install a Plugin into a DAO. +- Add the greeter function. + +```solidity +// SPDX-License-Identifier: AGPL-3.0-or-later +pragma solidity 0.8.21; + +import {Plugin, IDAO} from '@aragon/osx/core/plugin/Plugin.sol'; + +contract GreeterPlugin is Plugin { + constructor(IDAO _dao) Plugin(_dao) {} + + function greet() external pure returns (string memory) { + return 'Hello world!'; + } +} +``` + +### 3. GreeterSetup + +Once we're done with the plugin logic, we want to write a Setup contract. + +The Setup contract contains the instructions to be called whenever this plugin is installed, uninstalled or upgraded for a DAO. It is the one in charge of setting the permissions that enable the plugin execute actions on the DAO. + +Let's create our GreeterSetup contract inside your `contracts` folder: + +```bash +touch GreeterSetup.sol +``` + +Inside the file, we'll add the `prepareInstallation` and `prepareUninstallation` functions. These are the functions that will get called to install/uninstall the plugin into a DAO. + +```solidity +// SPDX-License-Identifier: AGPL-3.0-or-later +pragma solidity 0.8.21; + +import {PermissionLib} from '@aragon/osx/core/permission/PermissionLib.sol'; +import {PluginSetup} from '@aragon/osx/framework/plugin/setup/PluginSetup.sol'; +import './GreeterPlugin.sol'; + +contract GreeterSetup is PluginSetup { + function prepareInstallation( + address _dao, + bytes memory + ) external returns (address plugin, PreparedSetupData memory /*preparedSetupData*/) { + plugin = address(new GreeterPlugin(IDAO(_dao))); + } + + function prepareUninstallation( + address _dao, + SetupPayload calldata _payload + ) external pure returns (PermissionLib.MultiTargetPermission[] memory /*permissions*/) { + (_dao, _payload); + } + + function implementation() external view returns (address) {} +} +``` + +### 4. Deploy the Plugin + +To publish the plugin into the Aragon protocol, we first need to deploy the `PluginSetup.sol` contract to our network of choice. We can deploy it using [Hardhat's deploy script](https://hardhat.org/tutorial/deploying-to-a-live-network). + +In order to deploy directly from Hardhat, we'll use [Hardhat's Toolbox](https://hardhat.org/hardhat-runner/plugins/nomicfoundation-hardhat-toolbox). + +```bash +yarn add @nomicfoundation/hardhat-toolbox +``` + +Then, we can create a folder called `scripts` and inside of it, we'll add our deploy script. + +```bash +mkdir scripts && touch scripts/deploy.cjs +``` + +Inside that file, we will add our deploy script. + +```js +const hre = require('hardhat'); + +async function main() { + const [deployer] = await hre.ethers.getSigners(); + + console.log('Deploying contracts with the account:', deployer.address); + console.log('Account balance:', (await deployer.getBalance()).toString()); + + const getGreeterSetup = await hre.ethers.getContractFactory('GreeterSetup'); + const GreeterSetup = await getGreeterSetup.deploy(); + + console.log('GreeterSetup address:', GreeterSetup.address); +} + +main() + .then(() => process.exit(0)) + .catch(error => { + console.error(error); + process.exit(1); + }); +``` + +On the terminal, we should then see something like this: + +```bash +Deploying contracts with the account: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 +Account balance: 10000000000000000000000 +GreeterSetup address: 0x5FbDB2315678afecb367f032d93F642f64180aa3 +``` + +### 5. Publish the Plugin to the Aragon protocol + +Lastly, we can call the [`createPluginRepoWithFirstVersion` function from Aragon's `PluginRepoFactory`](../../03-reference-guide/framework/plugin/repo/PluginRepoFactory.md) passing it the address of your deployed `GreeterSetup` contract and the first version of your Plugin will be published into the protocol! + +We can do this directly by calling the function on Etherscan ([make sure to get the right scan and contract address based on your network](https://github.com/aragon/osx-commons/tree/develop/configs/src/deployments/json)) or through locally calling on the method from your project using Ethers. + +![Etherscan](https://res.cloudinary.com/dacofvu8m/image/upload/v1682466427/Screen_Shot_2023-04-25_at_19.46.58_nlo9p1.png) + +If you want to review how to publish your plugin in more depth, review our [How to Publish a Plugin in Aragon OSx guide here](./07-publication//index.md) + +### Next Steps + +Congratulations 🎉! You have developed a plugin that every Aragon DAO will be able to use. + +Currently, it is not doing much. Let's change this by adding additional functionality. You check out our [existing plugins](https://github.com/aragon/osx/tree/develop/packages/contracts/src/plugins) as inspiration. + +You could also make it: + +- [a non-upgradeable governance plugin](./03-non-upgradeable-plugin/index.md) +- [an upgradeable plugin (advanced)](./04-upgradeable-plugin/index.md) + +But first, let's have a look at: + +- [best practices and patterns](./01-best-practices.md) +- [different plugin deployment types](./02-plugin-types.md) + +And if you want to add additional versions to it, check out our guides on: + +- [How to publish a plugin](./07-publication/index.md) +- [How to manage plugin versioning](./07-publication/01-versioning.md) diff --git a/versioned_docs/version-1.3.0/osx/02-how-to-guides/index.md b/versioned_docs/version-1.3.0/osx/02-how-to-guides/index.md new file mode 100644 index 00000000..2bf68843 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/02-how-to-guides/index.md @@ -0,0 +1,49 @@ +--- +title: How-to Guides +--- + +## Welcome to our How To Guides on Using the Aragon OSx Protocol! + +With a few lines of code, the Aragon OSx protocol allows you create, manage, and change your on-chain organizations, through extending functionality for DAOs through the installation and uninstallation of plugins. + +The organizations that survive the longest are the ones that easily adapt to changing circumstances. DAOs too need a way to adapt and evolve, even if they’re governed on an immutable blockchain. + +This is where Plugins come in! + +### DAO Plugins + +DAO Plugins are smart contracts extending the functionality for DAOs + +Some examples of DAO Plugins are: + +- 💰 Treasury management tools (i.e. staking, yield distributions, etc), +- 👩🏾‍⚖️ Governance mechanisms for collective decision-making (i.e. NFT voting, multi-sig voting, etc) +- 🔌 Integrations with other ecosystem projects (i.e. Snapshot off-chain voting with Aragon on-chain execution, AI-enabled decision-makers, etc) +- …. basically anything you’d like your DAO to do! + +In the Aragon OSx protocol, everything a DAO does is decided and implemented through plugins. + +Technically speaking, Aragon DAOs are: + +- 💳 A treasury: holding all of the DAO’s assets, and +- 🤝 A permission management system: protecting the assets, through checking that only addresses with x permissions can execute actions on behalf of the DAO. + +All other functionality is enabled through plugins. This allows DAOs to be extremely flexible and modular as they mature, through installing and uninstalling these plugins as needs arise. + +![Aragon DAO](https://res.cloudinary.com/dacofvu8m/image/upload/v1683224604/Screen_Shot_2023-05-04_at_14.21.52_uuogzr.png) + +On the technical level, plugins are composed of two key contracts: + +- ⚡️ The Plugin implementation contract: containing all of the logic and functionality for your DAO, and +- 👩🏻‍🏫 The Plugin Setup contract: containing the installation, uninstallation and upgrade instructions for your plugin. + +![Aragon OSx Plugins](https://res.cloudinary.com/dacofvu8m/image/upload/v1683225098/Screen_Shot_2023-05-04_at_14.31.25_r0qqut.png) + +Through plugins, we provide a secure, flexible way for on-chain organizations to iterate as they grow. + +We enable everyone to experiment with governance at the speed of software! + +Check out our How-To-Guides on: + +- [How to Develop your own Plugin](./02-plugin-development/index.md) +- [How to Operate your DAO](./01-dao/index.md) diff --git a/versioned_docs/version-1.3.0/osx/03-reference-guide/core/dao/DAO.md b/versioned_docs/version-1.3.0/osx/03-reference-guide/core/dao/DAO.md new file mode 100644 index 00000000..f3c398e6 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/03-reference-guide/core/dao/DAO.md @@ -0,0 +1,442 @@ +## Description + +This contract is the entry point to the Aragon DAO framework and provides our users a simple and easy to use public interface. + +Public API of the Aragon DAO framework. + +## Implementation + +### public variable EXECUTE_PERMISSION_ID + +The ID of the permission required to call the `execute` function. + +```solidity +bytes32 EXECUTE_PERMISSION_ID +``` + +### public variable UPGRADE_DAO_PERMISSION_ID + +The ID of the permission required to call the `_authorizeUpgrade` function. + +```solidity +bytes32 UPGRADE_DAO_PERMISSION_ID +``` + +### public variable SET_METADATA_PERMISSION_ID + +The ID of the permission required to call the `setMetadata` function. + +```solidity +bytes32 SET_METADATA_PERMISSION_ID +``` + +### public variable SET_TRUSTED_FORWARDER_PERMISSION_ID + +The ID of the permission required to call the `setTrustedForwarder` function. + +```solidity +bytes32 SET_TRUSTED_FORWARDER_PERMISSION_ID +``` + +### public variable REGISTER_STANDARD_CALLBACK_PERMISSION_ID + +The ID of the permission required to call the `registerStandardCallback` function. + +```solidity +bytes32 REGISTER_STANDARD_CALLBACK_PERMISSION_ID +``` + +### public variable VALIDATE_SIGNATURE_PERMISSION_ID + +The ID of the permission required to validate [ERC-1271](https://eips.ethereum.org/EIPS/eip-1271) signatures. + +```solidity +bytes32 VALIDATE_SIGNATURE_PERMISSION_ID +``` + +### internal variable MAX_ACTIONS + +The internal constant storing the maximal action array length. + +```solidity +uint256 MAX_ACTIONS +``` + +### error ReentrantCall + +Thrown if a call is reentrant. + +```solidity +error ReentrantCall() +``` + +### error TooManyActions + +Thrown if the action array length is larger than `MAX_ACTIONS`. + +```solidity +error TooManyActions() +``` + +### error ActionFailed + +Thrown if action execution has failed. + +```solidity +error ActionFailed(uint256 index) +``` + +| Input | Type | Description | +| :------ | --------- | -------------------------------------------------------- | +| `index` | `uint256` | The index of the action in the action array that failed. | + +### error InsufficientGas + +Thrown if an action has insufficent gas left. + +```solidity +error InsufficientGas() +``` + +### error ZeroAmount + +Thrown if the deposit amount is zero. + +```solidity +error ZeroAmount() +``` + +### error NativeTokenDepositAmountMismatch + +Thrown if there is a mismatch between the expected and actually deposited amount of native tokens. + +```solidity +error NativeTokenDepositAmountMismatch(uint256 expected, uint256 actual) +``` + +| Input | Type | Description | +| :--------- | --------- | ----------------------------------------- | +| `expected` | `uint256` | The expected native token amount. | +| `actual` | `uint256` | The actual native token amount deposited. | + +### error ProtocolVersionUpgradeNotSupported + +Thrown if an upgrade is not supported from a specific protocol version . + +```solidity +error ProtocolVersionUpgradeNotSupported(uint8[3] protocolVersion) +``` + +### error FunctionRemoved + +Thrown when a function is removed but left to not corrupt the interface ID. + +```solidity +error FunctionRemoved() +``` + +### event NewURI + +Emitted when a new DAO URI is set. + +```solidity +event NewURI(string daoURI) +``` + +| Input | Type | Description | +| :------- | -------- | ------------ | +| `daoURI` | `string` | The new URI. | + +### internal modifier nonReentrant + +A modifier to protect a function from calling itself, directly or indirectly (reentrancy). + +```solidity +modifier nonReentrant() +``` + +_Currently, this modifier is only applied to the `execute()` function. If this is used multiple times, private `_beforeNonReentrant()` and `_afterNonReentrant()` functions should be created to prevent code duplication._ + +### public function constructor + +Disables the initializers on the implementation contract to prevent it from being left uninitialized. + +```solidity +constructor() public +``` + +### external function initialize + +Initializes the DAO by + +- setting the reentrancy status variable to `_NOT_ENTERED` +- registering the [ERC-165](https://eips.ethereum.org/EIPS/eip-165) interface ID +- setting the trusted forwarder for meta transactions +- giving the `ROOT_PERMISSION_ID` permission to the initial owner (that should be revoked and transferred to the DAO after setup). + +```solidity +function initialize(bytes _metadata, address _initialOwner, address _trustedForwarder, string daoURI_) external +``` + +| Input | Type | Description | +| :------------------ | --------- | ------------------------------------------------------------------------------------ | +| `_metadata` | `bytes` | IPFS hash that points to all the metadata (logo, description, tags, etc.) of a DAO. | +| `_initialOwner` | `address` | The initial owner of the DAO having the `ROOT_PERMISSION_ID` permission. | +| `_trustedForwarder` | `address` | The trusted forwarder responsible for verifying meta transactions. | +| `daoURI_` | `string` | The DAO URI required to support [ERC-4824](https://eips.ethereum.org/EIPS/eip-4824). | + +_This method is required to support [ERC-1822](https://eips.ethereum.org/EIPS/eip-1822)._ + +### external function initializeFrom + +Initializes the DAO after an upgrade from a previous protocol version. + +```solidity +function initializeFrom(uint8[3] _previousProtocolVersion, bytes _initData) external +``` + +| Input | Type | Description | +| :------------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `_previousProtocolVersion` | `uint8[3]` | The semantic protocol version number of the previous DAO implementation contract this upgrade is transitioning from. | +| `_initData` | `bytes` | The initialization data to be passed to via `upgradeToAndCall` (see [ERC-1967](https://docs.openzeppelin.com/contracts/4.x/api/proxy#ERC1967Upgrade)). | + +### internal function isPermissionRestrictedForAnyAddr + +Decides if the granting permissionId is restricted when `_who == ANY_ADDR` or `_where == ANY_ADDR`. + +```solidity +function isPermissionRestrictedForAnyAddr(bytes32 _permissionId) internal pure returns (bool) +``` + +| Input | Type | Description | +| :-------------- | --------- | -------------------------------------------- | +| `_permissionId` | `bytes32` | The permission identifier. | +| **Output** | | +| `0` | `bool` | Whether or not the permission is restricted. | + +_By default, every permission is unrestricted and it is the derived contract's responsibility to override it. Note, that the `ROOT_PERMISSION_ID` is included and not required to be set it again._ + +### internal function \_authorizeUpgrade + +Internal method authorizing the upgrade of the contract via the [upgradeability mechanism for UUPS proxies](https://docs.openzeppelin.com/contracts/4.x/api/proxy#UUPSUpgradeable) (see [ERC-1822](https://eips.ethereum.org/EIPS/eip-1822)). + +```solidity +function _authorizeUpgrade(address) internal virtual +``` + +_The caller must have the `UPGRADE_DAO_PERMISSION_ID` permission._ + +### external function setTrustedForwarder + +Setter for the trusted forwarder verifying the meta transaction. + +```solidity +function setTrustedForwarder(address _newTrustedForwarder) external +``` + +| Input | Type | Description | +| :--------------------- | --------- | ----------- | +| `_newTrustedForwarder` | `address` | | + +### external function getTrustedForwarder + +Getter for the trusted forwarder verifying the meta transaction. + +```solidity +function getTrustedForwarder() external view virtual returns (address) +``` + +| Output | Type | Description | +| ------ | --------- | ------------------------------ | +| `0` | `address` | The trusted forwarder address. | + +### external function hasPermission + +Checks if an address has permission on a contract via a permission identifier and considers if `ANY_ADDRESS` was used in the granting process. + +```solidity +function hasPermission(address _where, address _who, bytes32 _permissionId, bytes _data) external view returns (bool) +``` + +| Input | Type | Description | +| :-------------- | --------- | ----------------------------------------------------------------- | +| `_where` | `address` | The address of the contract. | +| `_who` | `address` | The address of a EOA or contract to give the permissions. | +| `_permissionId` | `bytes32` | The permission identifier. | +| `_data` | `bytes` | The optional data passed to the `PermissionCondition` registered. | +| **Output** | | +| `0` | `bool` | Returns true if the address has permission, false if not. | + +### external function setMetadata + +Updates the DAO metadata (e.g., an IPFS hash). + +```solidity +function setMetadata(bytes _metadata) external +``` + +| Input | Type | Description | +| :---------- | ------- | ----------------------------------------- | +| `_metadata` | `bytes` | The IPFS hash of the new metadata object. | + +### external function execute + +Executes a list of actions. If a zero allow-failure map is provided, a failing action reverts the entire execution. If a non-zero allow-failure map is provided, allowed actions can fail without the entire call being reverted. + +```solidity +function execute(bytes32 _callId, struct IDAO.Action[] _actions, uint256 _allowFailureMap) external returns (bytes[] execResults, uint256 failureMap) +``` + +| Input | Type | Description | +| :----------------- | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `_callId` | `bytes32` | The ID of the call. The definition of the value of `callId` is up to the calling contract and can be used, e.g., as a nonce. | +| `_actions` | `struct IDAO.Action[]` | The array of actions. | +| `_allowFailureMap` | `uint256` | A bitmap allowing execution to succeed, even if individual actions might revert. If the bit at index `i` is 1, the execution succeeds even if the `i`th action reverts. A failure map value of 0 requires every action to not revert. | +| **Output** | | +| `execResults` | `bytes[]` | The array of results obtained from the executed actions in `bytes`. | +| `failureMap` | `uint256` | The resulting failure map containing the actions have actually failed. | + +### external function deposit + +Deposits (native) tokens to the DAO contract with a reference string. + +```solidity +function deposit(address _token, uint256 _amount, string _reference) external payable +``` + +| Input | Type | Description | +| :----------- | --------- | ------------------------------------------------------------------- | +| `_token` | `address` | The address of the token or address(0) in case of the native token. | +| `_amount` | `uint256` | The amount of tokens to deposit. | +| `_reference` | `string` | The reference describing the deposit reason. | + +### external function setSignatureValidator + +Removed function being left here to not corrupt the IDAO interface ID. Any call will revert. + +```solidity +function setSignatureValidator(address) external pure +``` + +_Introduced in v1.0.0. Removed in v1.4.0._ + +### external function isValidSignature + +Checks whether a signature is valid for a provided hash according to [ERC-1271](https://eips.ethereum.org/EIPS/eip-1271). + +```solidity +function isValidSignature(bytes32 _hash, bytes _signature) external view returns (bytes4) +``` + +| Input | Type | Description | +| :----------- | --------- | ------------------------------------------------------------------------------------------------ | +| `_hash` | `bytes32` | The hash of the data to be signed. | +| `_signature` | `bytes` | The signature byte array associated with `_hash`. | +| **Output** | | +| `0` | `bytes4` | Returns the `bytes4` magic value `0x1626ba7e` if the signature is valid and `0xffffffff` if not. | + +_Relays the validation logic determining who is allowed to sign on behalf of the DAO to its permission manager. +Caller specific bypassing can be set direct granting (i.e., `grant({_where: dao, _who: specificErc1271Caller, _permissionId: VALIDATE_SIGNATURE_PERMISSION_ID})`). +Caller specific signature validation logic can be set by granting with a `PermissionCondition` (i.e., `grantWithCondition({_where: dao, _who: specificErc1271Caller, _permissionId: VALIDATE_SIGNATURE_PERMISSION_ID, _condition: yourConditionImplementation})`) +Generic signature validation logic can be set for all calling contracts by granting with a `PermissionCondition` to `PermissionManager.ANY_ADDR()` (i.e., `grantWithCondition({_where: dao, _who: PermissionManager.ANY_ADDR(), _permissionId: VALIDATE_SIGNATURE_PERMISSION_ID, _condition: yourConditionImplementation})`)._ + +### external function receive + +Emits the `NativeTokenDeposited` event to track native token deposits that weren't made via the deposit method. + +```solidity +receive() external payable +``` + +_This call is bound by the gas limitations for `send`/`transfer` calls introduced by [ERC-2929](https://eips.ethereum.org/EIPS/eip-2929). +Gas cost increases in future hard forks might break this function. As an alternative, [ERC-2930](https://eips.ethereum.org/EIPS/eip-2930)-type transactions using access lists can be employed._ + +### external function fallback + +Fallback to handle future versions of the [ERC-165](https://eips.ethereum.org/EIPS/eip-165) standard. + +```solidity +fallback(bytes _input) external returns (bytes) +``` + +| Input | Type | Description | +| :--------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `_input` | `bytes` | An alias being equivalent to `msg.data`. This feature of the fallback function was introduced with the [solidity compiler version 0.7.6](https://github.com/ethereum/solidity/releases/tag/v0.7.6) | +| **Output** | | +| `0` | `bytes` | The magic number registered for the function selector triggering the fallback. | + +### internal function \_setMetadata + +Emits the MetadataSet event if new metadata is set. + +```solidity +function _setMetadata(bytes _metadata) internal +``` + +| Input | Type | Description | +| :---------- | ------- | --------------------------------- | +| `_metadata` | `bytes` | Hash of the IPFS metadata object. | + +### internal function \_setTrustedForwarder + +Sets the trusted forwarder on the DAO and emits the associated event. + +```solidity +function _setTrustedForwarder(address _trustedForwarder) internal +``` + +| Input | Type | Description | +| :------------------ | --------- | ------------------------------ | +| `_trustedForwarder` | `address` | The trusted forwarder address. | + +### external function registerStandardCallback + +Registers an ERC standard having a callback by registering its [ERC-165](https://eips.ethereum.org/EIPS/eip-165) interface ID and callback function signature. + +```solidity +function registerStandardCallback(bytes4 _interfaceId, bytes4 _callbackSelector, bytes4 _magicNumber) external +``` + +| Input | Type | Description | +| :------------------ | -------- | ------------------------------------------------------------- | +| `_interfaceId` | `bytes4` | The ID of the interface. | +| `_callbackSelector` | `bytes4` | The selector of the callback function. | +| `_magicNumber` | `bytes4` | The magic number to be registered for the function signature. | + +### external function daoURI + +A distinct Uniform Resource Identifier (URI) pointing to a JSON object following the "EIP-4824 DAO JSON-LD Schema". This JSON file splits into four URIs: membersURI, proposalsURI, activityLogURI, and governanceURI. The membersURI should point to a JSON file that conforms to the "EIP-4824 Members JSON-LD Schema". The proposalsURI should point to a JSON file that conforms to the "EIP-4824 Proposals JSON-LD Schema". The activityLogURI should point to a JSON file that conforms to the "EIP-4824 Activity Log JSON-LD Schema". The governanceURI should point to a flatfile, normatively a .md file. Each of the JSON files named above can be statically hosted or dynamically-generated. + +```solidity +function daoURI() external view returns (string) +``` + +| Output | Type | Description | +| ------ | -------- | ----------- | +| `0` | `string` | | + +### external function setDaoURI + +Updates the set DAO URI to a new value. + +```solidity +function setDaoURI(string newDaoURI) external +``` + +| Input | Type | Description | +| :---------- | -------- | -------------------------- | +| `newDaoURI` | `string` | The new DAO URI to be set. | + +### internal function \_setDaoURI + +Sets the new [ERC-4824](https://eips.ethereum.org/EIPS/eip-4824) DAO URI and emits the associated event. + +```solidity +function _setDaoURI(string daoURI_) internal +``` + +| Input | Type | Description | +| :-------- | -------- | ---------------- | +| `daoURI_` | `string` | The new DAO URI. | + + diff --git a/versioned_docs/version-1.3.0/osx/03-reference-guide/core/dao/IEIP4824.md b/versioned_docs/version-1.3.0/osx/03-reference-guide/core/dao/IEIP4824.md new file mode 100644 index 00000000..1c6cf7e2 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/03-reference-guide/core/dao/IEIP4824.md @@ -0,0 +1,19 @@ +## Description + +See https://eips.ethereum.org/EIPS/eip-4824 + +## Implementation + +### external function daoURI + +A distinct Uniform Resource Identifier (URI) pointing to a JSON object following the "EIP-4824 DAO JSON-LD Schema". This JSON file splits into four URIs: membersURI, proposalsURI, activityLogURI, and governanceURI. The membersURI should point to a JSON file that conforms to the "EIP-4824 Members JSON-LD Schema". The proposalsURI should point to a JSON file that conforms to the "EIP-4824 Proposals JSON-LD Schema". The activityLogURI should point to a JSON file that conforms to the "EIP-4824 Activity Log JSON-LD Schema". The governanceURI should point to a flatfile, normatively a .md file. Each of the JSON files named above can be statically hosted or dynamically-generated. + +```solidity +function daoURI() external view returns (string _daoURI) +``` + +| Output | Type | Description | +| --------- | -------- | ------------ | +| `_daoURI` | `string` | The DAO URI. | + + diff --git a/versioned_docs/version-1.3.0/osx/03-reference-guide/core/permission/PermissionManager.md b/versioned_docs/version-1.3.0/osx/03-reference-guide/core/permission/PermissionManager.md new file mode 100644 index 00000000..9caec23b --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/03-reference-guide/core/permission/PermissionManager.md @@ -0,0 +1,404 @@ +## Description + +The abstract permission manager used in a DAO, its associated plugins, and other framework-related components. + +## Implementation + +### public variable ROOT_PERMISSION_ID + +The ID of the permission required to call the `grant`, `grantWithCondition`, `revoke`, and `bulk` function. + +```solidity +bytes32 ROOT_PERMISSION_ID +``` + +### internal variable ANY_ADDR + +A special address encoding permissions that are valid for any address `who` or `where`. + +```solidity +address ANY_ADDR +``` + +### internal variable UNSET_FLAG + +A special address encoding if a permissions is not set and therefore not allowed. + +```solidity +address UNSET_FLAG +``` + +### internal variable ALLOW_FLAG + +A special address encoding if a permission is allowed. + +```solidity +address ALLOW_FLAG +``` + +### internal variable permissionsHashed + +A mapping storing permissions as hashes (i.e., `permissionHash(where, who, permissionId)`) and their status encoded by an address (unset, allowed, or redirecting to a `PermissionCondition`). + +```solidity +mapping(bytes32 => address) permissionsHashed +``` + +### error Unauthorized + +Thrown if a call is unauthorized. + +```solidity +error Unauthorized(address where, address who, bytes32 permissionId) +``` + +| Input | Type | Description | +| :------------- | --------- | ----------------------------------------------------- | +| `where` | `address` | The context in which the authorization reverted. | +| `who` | `address` | The address (EOA or contract) missing the permission. | +| `permissionId` | `bytes32` | The permission identifier. | + +### error PermissionAlreadyGrantedForDifferentCondition + +Thrown if a permission has been already granted with a different condition. + +```solidity +error PermissionAlreadyGrantedForDifferentCondition(address where, address who, bytes32 permissionId, address currentCondition, address newCondition) +``` + +| Input | Type | Description | +| :----------------- | --------- | ------------------------------------------------------------------------------- | +| `where` | `address` | The address of the target contract to grant `_who` permission to. | +| `who` | `address` | The address (EOA or contract) to which the permission has already been granted. | +| `permissionId` | `bytes32` | The permission identifier. | +| `currentCondition` | `address` | The current condition set for permissionId. | +| `newCondition` | `address` | The new condition it tries to set for permissionId. | + +_This makes sure that condition on the same permission can not be overwriten by a different condition._ + +### error ConditionNotAContract + +Thrown if a condition address is not a contract. + +```solidity +error ConditionNotAContract(contract IPermissionCondition condition) +``` + +| Input | Type | Description | +| :---------- | ------------------------------- | ----------------------------------- | +| `condition` | `contract IPermissionCondition` | The address that is not a contract. | + +### error ConditionInterfacNotSupported + +Thrown if a condition contract does not support the `IPermissionCondition` interface. + +```solidity +error ConditionInterfacNotSupported(contract IPermissionCondition condition) +``` + +| Input | Type | Description | +| :---------- | ------------------------------- | ----------------------------------- | +| `condition` | `contract IPermissionCondition` | The address that is not a contract. | + +### error PermissionsForAnyAddressDisallowed + +Thrown for `ROOT_PERMISSION_ID` or `EXECUTE_PERMISSION_ID` permission grants where `who` or `where` is `ANY_ADDR`. + +```solidity +error PermissionsForAnyAddressDisallowed() +``` + +### error AnyAddressDisallowedForWhoAndWhere + +Thrown for permission grants where `who` and `where` are both `ANY_ADDR`. + +```solidity +error AnyAddressDisallowedForWhoAndWhere() +``` + +### error GrantWithConditionNotSupported + +Thrown if `Operation.GrantWithCondition` is requested as an operation but the method does not support it. + +```solidity +error GrantWithConditionNotSupported() +``` + +### event Granted + +Emitted when a permission `permission` is granted in the context `here` to the address `_who` for the contract `_where`. + +```solidity +event Granted(bytes32 permissionId, address here, address where, address who, address condition) +``` + +| Input | Type | Description | +| :------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| `permissionId` | `bytes32` | The permission identifier. | +| `here` | `address` | The address of the context in which the permission is granted. | +| `where` | `address` | The address of the target contract for which `_who` receives permission. | +| `who` | `address` | The address (EOA or contract) receiving the permission. | +| `condition` | `address` | The address `ALLOW_FLAG` for regular permissions or, alternatively, the `IPermissionCondition` contract implementation to be used. | + +### event Revoked + +Emitted when a permission `permission` is revoked in the context `here` from the address `_who` for the contract `_where`. + +```solidity +event Revoked(bytes32 permissionId, address here, address where, address who) +``` + +| Input | Type | Description | +| :------------- | --------- | --------------------------------------------------------------------- | +| `permissionId` | `bytes32` | The permission identifier. | +| `here` | `address` | The address of the context in which the permission is revoked. | +| `where` | `address` | The address of the target contract for which `_who` loses permission. | +| `who` | `address` | The address (EOA or contract) losing the permission. | + +### internal modifier auth + +A modifier to make functions on inheriting contracts authorized. Permissions to call the function are checked through this permission manager. + +```solidity +modifier auth(bytes32 _permissionId) +``` + +| Input | Type | Description | +| :-------------- | --------- | ---------------------------------------------------------------------------------- | +| `_permissionId` | `bytes32` | The permission identifier required to call the method this modifier is applied to. | + +### internal function \_\_PermissionManager_init + +Initialization method to set the initial owner of the permission manager. + +```solidity +function __PermissionManager_init(address _initialOwner) internal +``` + +| Input | Type | Description | +| :-------------- | --------- | -------------------------------------------- | +| `_initialOwner` | `address` | The initial owner of the permission manager. | + +_The initial owner is granted the `ROOT_PERMISSION_ID` permission._ + +### external function grant + +Grants permission to an address to call methods in a contract guarded by an auth modifier with the specified permission identifier. + +```solidity +function grant(address _where, address _who, bytes32 _permissionId) external virtual +``` + +| Input | Type | Description | +| :-------------- | --------- | ------------------------------------------------------------------------ | +| `_where` | `address` | The address of the target contract for which `_who` receives permission. | +| `_who` | `address` | The address (EOA or contract) receiving the permission. | +| `_permissionId` | `bytes32` | The permission identifier. | + +_Requires the `ROOT_PERMISSION_ID` permission. +Note, that granting permissions with `_who` or `_where` equal to `ANY_ADDR` does not replace other permissions with specific `_who` and `_where` addresses that exist in parallel._ + +### external function grantWithCondition + +Grants permission to an address to call methods in a target contract guarded by an auth modifier with the specified permission identifier if the referenced condition permits it. + +```solidity +function grantWithCondition(address _where, address _who, bytes32 _permissionId, contract IPermissionCondition _condition) external virtual +``` + +| Input | Type | Description | +| :-------------- | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | +| `_where` | `address` | The address of the target contract for which `_who` receives permission. | +| `_who` | `address` | The address (EOA or contract) receiving the permission. | +| `_permissionId` | `bytes32` | The permission identifier. | +| `_condition` | `contract IPermissionCondition` | The `PermissionCondition` that will be asked for authorization on calls connected to the specified permission identifier. | + +_Requires the `ROOT_PERMISSION_ID` permission +Note, that granting permissions with `_who` or `_where` equal to `ANY_ADDR` does not replace other permissions with specific `_who` and `_where` addresses that exist in parallel._ + +### external function revoke + +Revokes permission from an address to call methods in a target contract guarded by an auth modifier with the specified permission identifier. + +```solidity +function revoke(address _where, address _who, bytes32 _permissionId) external virtual +``` + +| Input | Type | Description | +| :-------------- | --------- | --------------------------------------------------------------------- | +| `_where` | `address` | The address of the target contract for which `_who` loses permission. | +| `_who` | `address` | The address (EOA or contract) losing the permission. | +| `_permissionId` | `bytes32` | The permission identifier. | + +_Requires the `ROOT_PERMISSION_ID` permission. +Note, that revoking permissions with `_who` or `_where` equal to `ANY_ADDR` does not revoke other permissions with specific `_who` and `_where` addresses that exist in parallel._ + +### external function applySingleTargetPermissions + +Applies an array of permission operations on a single target contracts `_where`. + +```solidity +function applySingleTargetPermissions(address _where, struct PermissionLib.SingleTargetPermission[] items) external virtual +``` + +| Input | Type | Description | +| :------- | ----------------------------------------------- | ------------------------------------------------------------ | +| `_where` | `address` | The address of the single target contract. | +| `items` | `struct PermissionLib.SingleTargetPermission[]` | The array of single-targeted permission operations to apply. | + +### external function applyMultiTargetPermissions + +Applies an array of permission operations on multiple target contracts `items[i].where`. + +```solidity +function applyMultiTargetPermissions(struct PermissionLib.MultiTargetPermission[] _items) external virtual +``` + +| Input | Type | Description | +| :------- | ---------------------------------------------- | ----------------------------------------------------------- | +| `_items` | `struct PermissionLib.MultiTargetPermission[]` | The array of multi-targeted permission operations to apply. | + +### public function isGranted + +Checks if the caller address has permission on the target contract via a permission identifier and relays the answer to a condition contract if this was declared during the granting process. + +```solidity +function isGranted(address _where, address _who, bytes32 _permissionId, bytes _data) public view virtual returns (bool) +``` + +| Input | Type | Description | +| :-------------- | --------- | ---------------------------------------------------------------------------------------------------------- | +| `_where` | `address` | The address of the target contract for which `_who` receives permission. | +| `_who` | `address` | The address (EOA or contract) for which the permission is checked. | +| `_permissionId` | `bytes32` | The permission identifier. | +| `_data` | `bytes` | Optional data to be passed to the set `PermissionCondition`. | +| **Output** | | +| `0` | `bool` | Returns true if `_who` has the permissions on the target contract via the specified permission identifier. | + +### internal function \_checkCondition + +Relays the question if caller address has permission on target contract via a permission identifier to a condition contract. +Checks a condition contract by doing an external call via try/catch. + +```solidity +function _checkCondition(address _condition, address _where, address _who, bytes32 _permissionId, bytes _data) internal view virtual returns (bool) +``` + +| Input | Type | Description | +| :-------------- | --------- | --------------------------------------------------------------------------------------------------------------------------- | +| `_condition` | `address` | The condition contract that is called. | +| `_where` | `address` | The address of the target contract for which `_who` receives permission. | +| `_who` | `address` | The address (EOA or contract) owning the permission. | +| `_permissionId` | `bytes32` | The permission identifier. | +| `_data` | `bytes` | Optional data to be passed to a referenced `PermissionCondition`. | +| **Output** | | +| `0` | `bool` | Returns `true` if a caller (`_who`) has the permissions on the contract (`_where`) via the specified permission identifier. | + +_If the external call fails, we return `false`._ + +### internal function \_initializePermissionManager + +Grants the `ROOT_PERMISSION_ID` permission to the initial owner during initialization of the permission manager. + +```solidity +function _initializePermissionManager(address _initialOwner) internal +``` + +| Input | Type | Description | +| :-------------- | --------- | -------------------------------------------- | +| `_initialOwner` | `address` | The initial owner of the permission manager. | + +### internal function \_grant + +This method is used in the external `grant` method of the permission manager. + +```solidity +function _grant(address _where, address _who, bytes32 _permissionId) internal virtual +``` + +| Input | Type | Description | +| :-------------- | --------- | ------------------------------------------------------------------------ | +| `_where` | `address` | The address of the target contract for which `_who` receives permission. | +| `_who` | `address` | The address (EOA or contract) owning the permission. | +| `_permissionId` | `bytes32` | The permission identifier. | + +_Note, that granting permissions with `_who` or `_where` equal to `ANY_ADDR` does not replace other permissions with specific `_who` and `_where` addresses that exist in parallel._ + +### internal function \_grantWithCondition + +This method is used in the external `grantWithCondition` method of the permission manager. + +```solidity +function _grantWithCondition(address _where, address _who, bytes32 _permissionId, contract IPermissionCondition _condition) internal virtual +``` + +| Input | Type | Description | +| :-------------- | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | +| `_where` | `address` | The address of the target contract for which `_who` receives permission. | +| `_who` | `address` | The address (EOA or contract) owning the permission. | +| `_permissionId` | `bytes32` | The permission identifier. | +| `_condition` | `contract IPermissionCondition` | An address either resolving to a `PermissionCondition` contract address or being the `ALLOW_FLAG` address (`address(2)`). | + +_Note, that granting permissions with `_who` or `_where` equal to `ANY_ADDR` does not replace other permissions with specific `_who` and `_where` addresses that exist in parallel._ + +### internal function \_revoke + +This method is used in the public `revoke` method of the permission manager. + +```solidity +function _revoke(address _where, address _who, bytes32 _permissionId) internal virtual +``` + +| Input | Type | Description | +| :-------------- | --------- | ------------------------------------------------------------------------ | +| `_where` | `address` | The address of the target contract for which `_who` receives permission. | +| `_who` | `address` | The address (EOA or contract) owning the permission. | +| `_permissionId` | `bytes32` | The permission identifier. | + +_Note, that revoking permissions with `_who` or `_where` equal to `ANY_ADDR` does not revoke other permissions with specific `_who` and `_where` addresses that might have been granted in parallel._ + +### internal function \_auth + +A private function to be used to check permissions on the permission manager contract (`address(this)`) itself. + +```solidity +function _auth(bytes32 _permissionId) internal view virtual +``` + +| Input | Type | Description | +| :-------------- | --------- | ---------------------------------------------------------------------------------- | +| `_permissionId` | `bytes32` | The permission identifier required to call the method this modifier is applied to. | + +### internal function permissionHash + +Generates the hash for the `permissionsHashed` mapping obtained from the word "PERMISSION", the contract address, the address owning the permission, and the permission identifier. + +```solidity +function permissionHash(address _where, address _who, bytes32 _permissionId) internal pure virtual returns (bytes32) +``` + +| Input | Type | Description | +| :-------------- | --------- | ------------------------------------------------------------------------ | +| `_where` | `address` | The address of the target contract for which `_who` receives permission. | +| `_who` | `address` | The address (EOA or contract) owning the permission. | +| `_permissionId` | `bytes32` | The permission identifier. | +| **Output** | | +| `0` | `bytes32` | The permission hash. | + +### internal function isPermissionRestrictedForAnyAddr + +Decides if the granting permissionId is restricted when `_who == ANY_ADDR` or `_where == ANY_ADDR`. + +```solidity +function isPermissionRestrictedForAnyAddr(bytes32 _permissionId) internal view virtual returns (bool) +``` + +| Input | Type | Description | +| :-------------- | --------- | -------------------------------------------- | +| `_permissionId` | `bytes32` | The permission identifier. | +| **Output** | | +| `0` | `bool` | Whether or not the permission is restricted. | + +_By default, every permission is unrestricted and it is the derived contract's responsibility to override it. Note, that the `ROOT_PERMISSION_ID` is included and not required to be set it again._ + + diff --git a/versioned_docs/version-1.3.0/osx/03-reference-guide/core/utils/CallbackHandler.md b/versioned_docs/version-1.3.0/osx/03-reference-guide/core/utils/CallbackHandler.md new file mode 100644 index 00000000..a127ac67 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/03-reference-guide/core/utils/CallbackHandler.md @@ -0,0 +1,82 @@ +## Description + +This contract handles callbacks by registering a magic number together with the callback function's selector. It provides the `_handleCallback` function that inheriting contracts have to call inside their `fallback()` function (`_handleCallback(msg.callbackSelector, msg.data)`). This allows to adaptively register ERC standards (e.g., [ERC-721](https://eips.ethereum.org/EIPS/eip-721), [ERC-1115](https://eips.ethereum.org/EIPS/eip-1155), or future versions of [ERC-165](https://eips.ethereum.org/EIPS/eip-165)) and returning the required magic numbers for the associated callback functions for the inheriting contract so that it doesn't need to be upgraded. + +This callback handling functionality is intented to be used by executor contracts (i.e., `DAO.sol`). + +## Implementation + +### internal variable callbackMagicNumbers + +A mapping between callback function selectors and magic return numbers. + +```solidity +mapping(bytes4 => bytes4) callbackMagicNumbers +``` + +### internal variable UNREGISTERED_CALLBACK + +The magic number refering to unregistered callbacks. + +```solidity +bytes4 UNREGISTERED_CALLBACK +``` + +### error UnkownCallback + +Thrown if the callback function is not registered. + +```solidity +error UnkownCallback(bytes4 callbackSelector, bytes4 magicNumber) +``` + +| Input | Type | Description | +| :----------------- | -------- | --------------------------------------------------------------------- | +| `callbackSelector` | `bytes4` | The selector of the callback function. | +| `magicNumber` | `bytes4` | The magic number to be registered for the callback function selector. | + +### event CallbackReceived + +Emitted when `_handleCallback` is called. + +```solidity +event CallbackReceived(address sender, bytes4 sig, bytes data) +``` + +| Input | Type | Description | +| :------- | --------- | ------------------------ | +| `sender` | `address` | Who called the callback. | +| `sig` | `bytes4` | The function signature. | +| `data` | `bytes` | The calldata. | + +### internal function \_handleCallback + +Handles callbacks to adaptively support ERC standards. + +```solidity +function _handleCallback(bytes4 _callbackSelector, bytes _data) internal virtual returns (bytes4) +``` + +| Input | Type | Description | +| :------------------ | -------- | ------------------------------------------------------------------------------ | +| `_callbackSelector` | `bytes4` | The function selector of the callback function. | +| `_data` | `bytes` | The calldata. | +| **Output** | | +| `0` | `bytes4` | The magic number registered for the function selector triggering the fallback. | + +_This function is supposed to be called via `_handleCallback(msg.sig, msg.data)` in the `fallback()` function of the inheriting contract._ + +### internal function \_registerCallback + +Registers a magic number for a callback function selector. + +```solidity +function _registerCallback(bytes4 _callbackSelector, bytes4 _magicNumber) internal virtual +``` + +| Input | Type | Description | +| :------------------ | -------- | --------------------------------------------------------------------- | +| `_callbackSelector` | `bytes4` | The selector of the callback function. | +| `_magicNumber` | `bytes4` | The magic number to be registered for the callback function selector. | + + diff --git a/versioned_docs/version-1.3.0/osx/03-reference-guide/framework/dao/DAOFactory.md b/versioned_docs/version-1.3.0/osx/03-reference-guide/framework/dao/DAOFactory.md new file mode 100644 index 00000000..00694cb8 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/03-reference-guide/framework/dao/DAOFactory.md @@ -0,0 +1,123 @@ +## Description + +This contract is used to create a DAO. + +## Implementation + +### public variable daoBase + +The DAO base contract, to be used for creating new `DAO`s via `createERC1967Proxy` function. + +```solidity +address daoBase +``` + +### public variable daoRegistry + +The DAO registry listing the `DAO` contracts created via this contract. + +```solidity +contract DAORegistry daoRegistry +``` + +### public variable pluginSetupProcessor + +The plugin setup processor for installing plugins on the newly created `DAO`s. + +```solidity +contract PluginSetupProcessor pluginSetupProcessor +``` + +### public struct DAOSettings + +```solidity +struct DAOSettings { + address trustedForwarder; + string daoURI; + string subdomain; + bytes metadata; +} +``` + +### public struct PluginSettings + +```solidity +struct PluginSettings { + struct PluginSetupRef pluginSetupRef; + bytes data; +} +``` + +### error NoPluginProvided + +Thrown if `PluginSettings` array is empty, and no plugin is provided. + +```solidity +error NoPluginProvided() +``` + +### public function constructor + +The constructor setting the registry and plugin setup processor and creating the base contracts for the factory. + +```solidity +constructor(contract DAORegistry _registry, contract PluginSetupProcessor _pluginSetupProcessor) public +``` + +| Input | Type | Description | +| :---------------------- | ------------------------------- | ------------------------------------------------- | +| `_registry` | `contract DAORegistry` | The DAO registry to register the DAO by its name. | +| `_pluginSetupProcessor` | `contract PluginSetupProcessor` | The address of PluginSetupProcessor. | + +### public function supportsInterface + +Checks if this or the parent contract supports an interface by its ID. + +```solidity +function supportsInterface(bytes4 _interfaceId) public view virtual returns (bool) +``` + +| Input | Type | Description | +| :------------- | -------- | --------------------------------------------- | +| `_interfaceId` | `bytes4` | The ID of the interface. | +| **Output** | | +| `0` | `bool` | Returns `true` if the interface is supported. | + +### external function createDao + +Creates a new DAO, registers it on the DAO registry, and installs a list of plugins via the plugin setup processor. + +```solidity +function createDao(struct DAOFactory.DAOSettings _daoSettings, struct DAOFactory.PluginSettings[] _pluginSettings) external returns (contract DAO createdDao) +``` + +| Input | Type | Description | +| :---------------- | ------------------------------------ | ------------------------------------------------------------------------------------------------------------- | +| `_daoSettings` | `struct DAOFactory.DAOSettings` | The DAO settings to be set during the DAO initialization. | +| `_pluginSettings` | `struct DAOFactory.PluginSettings[]` | The array containing references to plugins and their settings to be installed after the DAO has been created. | + +### internal function \_createDAO + +Deploys a new DAO `ERC1967` proxy, and initialize it with this contract as the intial owner. + +```solidity +function _createDAO(struct DAOFactory.DAOSettings _daoSettings) internal returns (contract DAO dao) +``` + +| Input | Type | Description | +| :------------- | ------------------------------- | -------------------------------------------------------------------- | +| `_daoSettings` | `struct DAOFactory.DAOSettings` | The trusted forwarder, name and metadata hash of the DAO it creates. | + +### internal function \_setDAOPermissions + +Sets the required permissions for the new DAO. + +```solidity +function _setDAOPermissions(contract DAO _dao) internal +``` + +| Input | Type | Description | +| :----- | -------------- | ------------------------------ | +| `_dao` | `contract DAO` | The DAO instance just created. | + + diff --git a/versioned_docs/version-1.3.0/osx/03-reference-guide/framework/dao/DAORegistry.md b/versioned_docs/version-1.3.0/osx/03-reference-guide/framework/dao/DAORegistry.md new file mode 100644 index 00000000..501895ac --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/03-reference-guide/framework/dao/DAORegistry.md @@ -0,0 +1,82 @@ +## Description + +This contract provides the possibility to register a DAO. + +## Implementation + +### public variable REGISTER_DAO_PERMISSION_ID + +The ID of the permission required to call the `register` function. + +```solidity +bytes32 REGISTER_DAO_PERMISSION_ID +``` + +### public variable subdomainRegistrar + +The ENS subdomain registrar registering the DAO subdomains. + +```solidity +contract ENSSubdomainRegistrar subdomainRegistrar +``` + +### error InvalidDaoSubdomain + +Thrown if the DAO subdomain doesn't match the regex `[0-9a-z\-]` + +```solidity +error InvalidDaoSubdomain(string subdomain) +``` + +### event DAORegistered + +Emitted when a new DAO is registered. + +```solidity +event DAORegistered(address dao, address creator, string subdomain) +``` + +| Input | Type | Description | +| :---------- | --------- | -------------------------------- | +| `dao` | `address` | The address of the DAO contract. | +| `creator` | `address` | The address of the creator. | +| `subdomain` | `string` | The DAO subdomain. | + +### public function constructor + +```solidity +constructor() public +``` + +_Used to disallow initializing the implementation contract by an attacker for extra safety._ + +### external function initialize + +Initializes the contract. + +```solidity +function initialize(contract IDAO _managingDao, contract ENSSubdomainRegistrar _subdomainRegistrar) external +``` + +| Input | Type | Description | +| :-------------------- | -------------------------------- | --------------------------------------------------------------------- | +| `_managingDao` | `contract IDAO` | the managing DAO address. | +| `_subdomainRegistrar` | `contract ENSSubdomainRegistrar` | The `ENSSubdomainRegistrar` where `ENS` subdomain will be registered. | + +### external function register + +Registers a DAO by its address. If a non-empty subdomain name is provided that is not taken already, the DAO becomes the owner of the ENS name. + +```solidity +function register(contract IDAO dao, address creator, string subdomain) external +``` + +| Input | Type | Description | +| :---------- | --------------- | -------------------------------- | +| `dao` | `contract IDAO` | The address of the DAO contract. | +| `creator` | `address` | The address of the creator. | +| `subdomain` | `string` | The DAO subdomain. | + +_A subdomain is unique within the Aragon DAO framework and can get stored here._ + + diff --git a/versioned_docs/version-1.3.0/osx/03-reference-guide/framework/plugin/repo/IPluginRepo.md b/versioned_docs/version-1.3.0/osx/03-reference-guide/framework/plugin/repo/IPluginRepo.md new file mode 100644 index 00000000..1b1c2ef3 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/03-reference-guide/framework/plugin/repo/IPluginRepo.md @@ -0,0 +1,35 @@ +## Description + +The interface required for a plugin repository. + +## Implementation + +### external function updateReleaseMetadata + +Updates the metadata for release with content `@fromHex(_releaseMetadata)`. + +```solidity +function updateReleaseMetadata(uint8 _release, bytes _releaseMetadata) external +``` + +| Input | Type | Description | +| :----------------- | ------- | ------------------------- | +| `_release` | `uint8` | The release number. | +| `_releaseMetadata` | `bytes` | The release metadata URI. | + +### external function createVersion + +Creates a new plugin version as the latest build for an existing release number or the first build for a new release number for the provided `PluginSetup` contract address and metadata. + +```solidity +function createVersion(uint8 _release, address _pluginSetupAddress, bytes _buildMetadata, bytes _releaseMetadata) external +``` + +| Input | Type | Description | +| :-------------------- | --------- | ----------------------------------------- | +| `_release` | `uint8` | The release number. | +| `_pluginSetupAddress` | `address` | The address of the plugin setup contract. | +| `_buildMetadata` | `bytes` | The build metadata URI. | +| `_releaseMetadata` | `bytes` | The release metadata URI. | + + diff --git a/versioned_docs/version-1.3.0/osx/03-reference-guide/framework/plugin/repo/PluginRepo.md b/versioned_docs/version-1.3.0/osx/03-reference-guide/framework/plugin/repo/PluginRepo.md new file mode 100644 index 00000000..4eb16575 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/03-reference-guide/framework/plugin/repo/PluginRepo.md @@ -0,0 +1,332 @@ +## Description + +The plugin repository contract required for managing and publishing different plugin versions within the Aragon DAO framework. + +## Implementation + +### public struct Tag + +```solidity +struct Tag { + uint8 release; + uint16 build; +} +``` + +### public struct Version + +```solidity +struct Version { + struct PluginRepo.Tag tag; + address pluginSetup; + bytes buildMetadata; +} +``` + +### public variable MAINTAINER_PERMISSION_ID + +The ID of the permission required to call the `createVersion` function. + +```solidity +bytes32 MAINTAINER_PERMISSION_ID +``` + +### public variable UPGRADE_REPO_PERMISSION_ID + +The ID of the permission required to call the `createVersion` function. + +```solidity +bytes32 UPGRADE_REPO_PERMISSION_ID +``` + +### internal variable buildsPerRelease + +The mapping between release and build numbers. + +```solidity +mapping(uint8 => uint16) buildsPerRelease +``` + +### internal variable versions + +The mapping between the version hash and the corresponding version information. + +```solidity +mapping(bytes32 => struct PluginRepo.Version) versions +``` + +### internal variable latestTagHashForPluginSetup + +The mapping between the plugin setup address and its corresponding version hash. + +```solidity +mapping(address => bytes32) latestTagHashForPluginSetup +``` + +### public variable latestRelease + +The ID of the latest release. + +```solidity +uint8 latestRelease +``` + +_The maximum release number is 255._ + +### error VersionHashDoesNotExist + +Thrown if a version does not exist. + +```solidity +error VersionHashDoesNotExist(bytes32 versionHash) +``` + +| Input | Type | Description | +| :------------ | --------- | ------------- | +| `versionHash` | `bytes32` | The tag hash. | + +### error InvalidPluginSetupInterface + +Thrown if a plugin setup contract does not inherit from `PluginSetup`. + +```solidity +error InvalidPluginSetupInterface() +``` + +### error ReleaseZeroNotAllowed + +Thrown if a release number is zero. + +```solidity +error ReleaseZeroNotAllowed() +``` + +### error InvalidReleaseIncrement + +Thrown if a release number is incremented by more than one. + +```solidity +error InvalidReleaseIncrement(uint8 latestRelease, uint8 newRelease) +``` + +| Input | Type | Description | +| :-------------- | ------- | -------------------------- | +| `latestRelease` | `uint8` | The latest release number. | +| `newRelease` | `uint8` | The new release number. | + +### error PluginSetupAlreadyInPreviousRelease + +Thrown if the same plugin setup contract exists already in a previous releases. + +```solidity +error PluginSetupAlreadyInPreviousRelease(uint8 release, uint16 build, address pluginSetup) +``` + +| Input | Type | Description | +| :------------ | --------- | -------------------------------------------------------- | +| `release` | `uint8` | The release number of the already existing plugin setup. | +| `build` | `uint16` | The build number of the already existing plugin setup. | +| `pluginSetup` | `address` | The plugin setup contract address. | + +### error EmptyReleaseMetadata + +Thrown if the metadata URI is empty. + +```solidity +error EmptyReleaseMetadata() +``` + +### error ReleaseDoesNotExist + +Thrown if release does not exist. + +```solidity +error ReleaseDoesNotExist() +``` + +### event VersionCreated + +Thrown if the same plugin setup exists in previous releases. + +```solidity +event VersionCreated(uint8 release, uint16 build, address pluginSetup, bytes buildMetadata) +``` + +| Input | Type | Description | +| :-------------- | --------- | ----------------------------------------- | +| `release` | `uint8` | The release number. | +| `build` | `uint16` | The build number. | +| `pluginSetup` | `address` | The address of the plugin setup contract. | +| `buildMetadata` | `bytes` | The build metadata URI. | + +### event ReleaseMetadataUpdated + +Thrown when a release's metadata was updated. + +```solidity +event ReleaseMetadataUpdated(uint8 release, bytes releaseMetadata) +``` + +| Input | Type | Description | +| :---------------- | ------- | ------------------------- | +| `release` | `uint8` | The release number. | +| `releaseMetadata` | `bytes` | The release metadata URI. | + +### public function constructor + +```solidity +constructor() public +``` + +_Used to disallow initializing the implementation contract by an attacker for extra safety._ + +### external function initialize + +Initializes the contract by + +- initializing the permission manager +- granting the `MAINTAINER_PERMISSION_ID` permission to the initial owner. + +```solidity +function initialize(address initialOwner) external +``` + +_This method is required to support [ERC-1822](https://eips.ethereum.org/EIPS/eip-1822)._ + +### external function createVersion + +Creates a new plugin version as the latest build for an existing release number or the first build for a new release number for the provided `PluginSetup` contract address and metadata. + +```solidity +function createVersion(uint8 _release, address _pluginSetup, bytes _buildMetadata, bytes _releaseMetadata) external +``` + +| Input | Type | Description | +| :----------------- | --------- | ------------------------- | +| `_release` | `uint8` | The release number. | +| `_pluginSetup` | `address` | | +| `_buildMetadata` | `bytes` | The build metadata URI. | +| `_releaseMetadata` | `bytes` | The release metadata URI. | + +### external function updateReleaseMetadata + +Updates the metadata for release with content `@fromHex(_releaseMetadata)`. + +```solidity +function updateReleaseMetadata(uint8 _release, bytes _releaseMetadata) external +``` + +| Input | Type | Description | +| :----------------- | ------- | ------------------------- | +| `_release` | `uint8` | The release number. | +| `_releaseMetadata` | `bytes` | The release metadata URI. | + +### public function getLatestVersion + +Returns the latest version for a given release number. + +```solidity +function getLatestVersion(uint8 _release) public view returns (struct PluginRepo.Version) +``` + +| Input | Type | Description | +| :--------- | --------------------------- | ----------------------------------- | +| `_release` | `uint8` | The release number. | +| **Output** | | +| `0` | `struct PluginRepo.Version` | The latest version of this release. | + +### public function getLatestVersion + +Returns the latest version for a given plugin setup. + +```solidity +function getLatestVersion(address _pluginSetup) public view returns (struct PluginRepo.Version) +``` + +| Input | Type | Description | +| :------------- | --------------------------- | ---------------------------------------------------- | +| `_pluginSetup` | `address` | The plugin setup address | +| **Output** | | +| `0` | `struct PluginRepo.Version` | The latest version associated with the plugin Setup. | + +### public function getVersion + +Returns the version associated with a tag. + +```solidity +function getVersion(struct PluginRepo.Tag _tag) public view returns (struct PluginRepo.Version) +``` + +| Input | Type | Description | +| :--------- | --------------------------- | ------------------------------------ | +| `_tag` | `struct PluginRepo.Tag` | The version tag. | +| **Output** | | +| `0` | `struct PluginRepo.Version` | The version associated with the tag. | + +### public function getVersion + +Returns the version for a tag hash. + +```solidity +function getVersion(bytes32 _tagHash) public view returns (struct PluginRepo.Version) +``` + +| Input | Type | Description | +| :--------- | --------------------------- | --------------------------------------- | +| `_tagHash` | `bytes32` | The tag hash. | +| **Output** | | +| `0` | `struct PluginRepo.Version` | The version associated with a tag hash. | + +### public function buildCount + +Gets the total number of builds for a given release number. + +```solidity +function buildCount(uint8 _release) public view returns (uint256) +``` + +| Input | Type | Description | +| :--------- | --------- | ------------------------------------- | +| `_release` | `uint8` | The release number. | +| **Output** | | +| `0` | `uint256` | The number of builds of this release. | + +### internal function tagHash + +The hash of the version tag obtained from the packed, bytes-encoded release and build number. + +```solidity +function tagHash(struct PluginRepo.Tag _tag) internal pure returns (bytes32) +``` + +| Input | Type | Description | +| :--------- | ----------------------- | --------------------- | +| `_tag` | `struct PluginRepo.Tag` | The version tag. | +| **Output** | | +| `0` | `bytes32` | The version tag hash. | + +### internal function \_authorizeUpgrade + +Internal method authorizing the upgrade of the contract via the [upgradeability mechanism for UUPS proxies](https://docs.openzeppelin.com/contracts/4.x/api/proxy#UUPSUpgradeable) (see [ERC-1822](https://eips.ethereum.org/EIPS/eip-1822)). + +```solidity +function _authorizeUpgrade(address) internal virtual +``` + +_The caller must have the `UPGRADE_REPO_PERMISSION_ID` permission._ + +### public function supportsInterface + +Checks if this or the parent contract supports an interface by its ID. + +```solidity +function supportsInterface(bytes4 _interfaceId) public view virtual returns (bool) +``` + +| Input | Type | Description | +| :------------- | -------- | --------------------------------------------- | +| `_interfaceId` | `bytes4` | The ID of the interface. | +| **Output** | | +| `0` | `bool` | Returns `true` if the interface is supported. | + + diff --git a/versioned_docs/version-1.3.0/osx/03-reference-guide/framework/plugin/repo/PluginRepoFactory.md b/versioned_docs/version-1.3.0/osx/03-reference-guide/framework/plugin/repo/PluginRepoFactory.md new file mode 100644 index 00000000..684cca2b --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/03-reference-guide/framework/plugin/repo/PluginRepoFactory.md @@ -0,0 +1,110 @@ +## Description + +This contract creates `PluginRepo` proxies and registers them on a `PluginRepoRegistry` contract. + +## Implementation + +### public variable pluginRepoRegistry + +The Aragon plugin registry contract. + +```solidity +contract PluginRepoRegistry pluginRepoRegistry +``` + +### public variable pluginRepoBase + +The address of the `PluginRepo` base contract to proxy to.. + +```solidity +address pluginRepoBase +``` + +### public function constructor + +Initializes the addresses of the Aragon plugin registry and `PluginRepo` base contract to proxy to. + +```solidity +constructor(contract PluginRepoRegistry _pluginRepoRegistry) public +``` + +| Input | Type | Description | +| :-------------------- | ----------------------------- | ----------------------------------- | +| `_pluginRepoRegistry` | `contract PluginRepoRegistry` | The aragon plugin registry address. | + +### public function supportsInterface + +Checks if this or the parent contract supports an interface by its ID. + +```solidity +function supportsInterface(bytes4 _interfaceId) public view virtual returns (bool) +``` + +| Input | Type | Description | +| :------------- | -------- | --------------------------------------------- | +| `_interfaceId` | `bytes4` | The ID of the interface. | +| **Output** | | +| `0` | `bool` | Returns `true` if the interface is supported. | + +### external function createPluginRepo + +Creates a plugin repository proxy pointing to the `pluginRepoBase` implementation and registers it in the Aragon plugin registry. + +```solidity +function createPluginRepo(string _subdomain, address _initialOwner) external returns (contract PluginRepo) +``` + +| Input | Type | Description | +| :-------------- | --------- | -------------------------------- | +| `_subdomain` | `string` | The plugin repository subdomain. | +| `_initialOwner` | `address` | The plugin maintainer address. | + +### external function createPluginRepoWithFirstVersion + +Creates and registers a `PluginRepo` with an ENS subdomain and publishes an initial version `1.1`. + +```solidity +function createPluginRepoWithFirstVersion(string _subdomain, address _pluginSetup, address _maintainer, bytes _releaseMetadata, bytes _buildMetadata) external returns (contract PluginRepo pluginRepo) +``` + +| Input | Type | Description | +| :----------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------- | +| `_subdomain` | `string` | The plugin repository subdomain. | +| `_pluginSetup` | `address` | The plugin factory contract associated with the plugin version. | +| `_maintainer` | `address` | The maintainer of the plugin repo. This address has permission to update metadata, upgrade the repo logic, and manage the repo permissions. | +| `_releaseMetadata` | `bytes` | The release metadata URI. | +| `_buildMetadata` | `bytes` | The build metadata URI. | + +_After the creation of the `PluginRepo` and release of the first version by the factory, ownership is transferred to the `_maintainer` address._ + +### internal function \_setPluginRepoPermissions + +Set the final permissions for the published plugin repository maintainer. All permissions are revoked from the plugin factory and granted to the specified plugin maintainer. + +```solidity +function _setPluginRepoPermissions(contract PluginRepo pluginRepo, address maintainer) internal +``` + +| Input | Type | Description | +| :----------- | --------------------- | -------------------------------------------- | +| `pluginRepo` | `contract PluginRepo` | The plugin repository instance just created. | +| `maintainer` | `address` | The plugin maintainer address. | + +_The plugin maintainer is granted the `MAINTAINER_PERMISSION_ID`, `UPGRADE_REPO_PERMISSION_ID`, and `ROOT_PERMISSION_ID`._ + +### internal function \_createPluginRepo + +Internal method creating a `PluginRepo` via the [ERC-1967](https://eips.ethereum.org/EIPS/eip-1967) proxy pattern from the provided base contract and registering it in the Aragon plugin registry. + +```solidity +function _createPluginRepo(string _subdomain, address _initialOwner) internal returns (contract PluginRepo pluginRepo) +``` + +| Input | Type | Description | +| :-------------- | --------- | -------------------------------- | +| `_subdomain` | `string` | The plugin repository subdomain. | +| `_initialOwner` | `address` | The initial owner address. | + +_Passing an empty `_subdomain` will cause the transaction to revert._ + + diff --git a/versioned_docs/version-1.3.0/osx/03-reference-guide/framework/plugin/repo/PluginRepoRegistry.md b/versioned_docs/version-1.3.0/osx/03-reference-guide/framework/plugin/repo/PluginRepoRegistry.md new file mode 100644 index 00000000..92031841 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/03-reference-guide/framework/plugin/repo/PluginRepoRegistry.md @@ -0,0 +1,86 @@ +## Description + +This contract maintains an address-based registry of plugin repositories in the Aragon App DAO framework. + +## Implementation + +### public variable REGISTER_PLUGIN_REPO_PERMISSION_ID + +The ID of the permission required to call the `register` function. + +```solidity +bytes32 REGISTER_PLUGIN_REPO_PERMISSION_ID +``` + +### public variable subdomainRegistrar + +The ENS subdomain registrar registering the PluginRepo subdomains. + +```solidity +contract ENSSubdomainRegistrar subdomainRegistrar +``` + +### event PluginRepoRegistered + +Emitted if a new plugin repository is registered. + +```solidity +event PluginRepoRegistered(string subdomain, address pluginRepo) +``` + +| Input | Type | Description | +| :----------- | --------- | --------------------------------------- | +| `subdomain` | `string` | The subdomain of the plugin repository. | +| `pluginRepo` | `address` | The address of the plugin repository. | + +### error InvalidPluginSubdomain + +Thrown if the plugin subdomain doesn't match the regex `[0-9a-z\-]` + +```solidity +error InvalidPluginSubdomain(string subdomain) +``` + +### error EmptyPluginRepoSubdomain + +Thrown if the plugin repository subdomain is empty. + +```solidity +error EmptyPluginRepoSubdomain() +``` + +### public function constructor + +```solidity +constructor() public +``` + +_Used to disallow initializing the implementation contract by an attacker for extra safety._ + +### external function initialize + +Initializes the contract by setting calling the `InterfaceBasedRegistry` base class initialize method. + +```solidity +function initialize(contract IDAO _dao, contract ENSSubdomainRegistrar _subdomainRegistrar) external +``` + +| Input | Type | Description | +| :-------------------- | -------------------------------- | --------------------------------------------------------------------- | +| `_dao` | `contract IDAO` | The address of the managing DAO. | +| `_subdomainRegistrar` | `contract ENSSubdomainRegistrar` | The `ENSSubdomainRegistrar` where `ENS` subdomain will be registered. | + +### external function registerPluginRepo + +Registers a plugin repository with a subdomain and address. + +```solidity +function registerPluginRepo(string subdomain, address pluginRepo) external +``` + +| Input | Type | Description | +| :----------- | --------- | --------------------------------------- | +| `subdomain` | `string` | The subdomain of the PluginRepo. | +| `pluginRepo` | `address` | The address of the PluginRepo contract. | + + diff --git a/versioned_docs/version-1.3.0/osx/03-reference-guide/framework/plugin/repo/placeholder/PlaceholderSetup.md b/versioned_docs/version-1.3.0/osx/03-reference-guide/framework/plugin/repo/placeholder/PlaceholderSetup.md new file mode 100644 index 00000000..63c098a4 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/03-reference-guide/framework/plugin/repo/placeholder/PlaceholderSetup.md @@ -0,0 +1,60 @@ +## Description + +A placeholder setup contract for outdated plugin builds. When moving plugin repos to new chains or layers, where only the latest release and build should be available, this placeholder can be used to populate previous builds. + +## Implementation + +### error PlaceholderSetupCannotBeUsed + +Thrown if the dummy is used. + +```solidity +error PlaceholderSetupCannotBeUsed() +``` + +### external function prepareInstallation + +Prepares the installation of a plugin. + +```solidity +function prepareInstallation(address, bytes) external pure returns (address, struct IPluginSetup.PreparedSetupData) +``` + +| Input | Type | Description | +| :--------- | --------------------------------------- | ----------- | +| `` | `address` | | +| `` | `bytes` | | +| **Output** | | +| `0` | `address` | | +| `1` | `struct IPluginSetup.PreparedSetupData` | | + +### external function prepareUninstallation + +Prepares the uninstallation of a plugin. + +```solidity +function prepareUninstallation(address, struct IPluginSetup.SetupPayload) external pure returns (struct PermissionLib.MultiTargetPermission[]) +``` + +| Input | Type | Description | +| :--------- | ---------------------------------------------- | ----------- | +| `` | `address` | | +| `` | `struct IPluginSetup.SetupPayload` | | +| **Output** | | +| `0` | `struct PermissionLib.MultiTargetPermission[]` | | + +### external function implementation + +Returns the plugin implementation address. + +```solidity +function implementation() external pure returns (address) +``` + +| Output | Type | Description | +| ------ | --------- | -------------------------------------------------- | +| `0` | `address` | The address of the plugin implementation contract. | + +_The implementation can be instantiated via the `new` keyword, cloned via the minimal clones pattern (see [ERC-1167](https://eips.ethereum.org/EIPS/eip-1167)), or proxied via the UUPS pattern (see [ERC-1822](https://eips.ethereum.org/EIPS/eip-1822))._ + + diff --git a/versioned_docs/version-1.3.0/osx/03-reference-guide/framework/plugin/setup/PluginSetupProcessor.md b/versioned_docs/version-1.3.0/osx/03-reference-guide/framework/plugin/setup/PluginSetupProcessor.md new file mode 100644 index 00000000..0ceda55b --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/03-reference-guide/framework/plugin/setup/PluginSetupProcessor.md @@ -0,0 +1,475 @@ +## Description + +This contract processes the preparation and application of plugin setups (installation, update, uninstallation) on behalf of a requesting DAO. + +This contract is temporarily granted the `ROOT_PERMISSION_ID` permission on the applying DAO and therefore is highly security critical. + +## Implementation + +### public variable APPLY_INSTALLATION_PERMISSION_ID + +The ID of the permission required to call the `applyInstallation` function. + +```solidity +bytes32 APPLY_INSTALLATION_PERMISSION_ID +``` + +### public variable APPLY_UPDATE_PERMISSION_ID + +The ID of the permission required to call the `applyUpdate` function. + +```solidity +bytes32 APPLY_UPDATE_PERMISSION_ID +``` + +### public variable APPLY_UNINSTALLATION_PERMISSION_ID + +The ID of the permission required to call the `applyUninstallation` function. + +```solidity +bytes32 APPLY_UNINSTALLATION_PERMISSION_ID +``` + +### public struct PluginState + +```solidity +struct PluginState { + uint256 blockNumber; + bytes32 currentAppliedSetupId; + mapping(bytes32 => uint256) preparedSetupIdToBlockNumber; +} +``` + +### public variable states + +A mapping between the plugin installation ID (obtained from the DAO and plugin address) and the plugin state information. + +```solidity +mapping(bytes32 => struct PluginSetupProcessor.PluginState) states +``` + +_This variable is public on purpose to allow future versions to access and migrate the storage._ + +### public struct PrepareInstallationParams + +```solidity +struct PrepareInstallationParams { + struct PluginSetupRef pluginSetupRef; + bytes data; +} +``` + +### public struct ApplyInstallationParams + +```solidity +struct ApplyInstallationParams { + struct PluginSetupRef pluginSetupRef; + address plugin; + struct PermissionLib.MultiTargetPermission[] permissions; + bytes32 helpersHash; +} +``` + +### public struct PrepareUpdateParams + +```solidity +struct PrepareUpdateParams { + struct PluginRepo.Tag currentVersionTag; + struct PluginRepo.Tag newVersionTag; + contract PluginRepo pluginSetupRepo; + struct IPluginSetup.SetupPayload setupPayload; +} +``` + +### public struct ApplyUpdateParams + +```solidity +struct ApplyUpdateParams { + address plugin; + struct PluginSetupRef pluginSetupRef; + bytes initData; + struct PermissionLib.MultiTargetPermission[] permissions; + bytes32 helpersHash; +} +``` + +### public struct PrepareUninstallationParams + +```solidity +struct PrepareUninstallationParams { + struct PluginSetupRef pluginSetupRef; + struct IPluginSetup.SetupPayload setupPayload; +} +``` + +### public struct ApplyUninstallationParams + +```solidity +struct ApplyUninstallationParams { + address plugin; + struct PluginSetupRef pluginSetupRef; + struct PermissionLib.MultiTargetPermission[] permissions; +} +``` + +### public variable repoRegistry + +The plugin repo registry listing the `PluginRepo` contracts versioning the `PluginSetup` contracts. + +```solidity +contract PluginRepoRegistry repoRegistry +``` + +### error SetupApplicationUnauthorized + +Thrown if a setup is unauthorized and cannot be applied because of a missing permission of the associated DAO. + +```solidity +error SetupApplicationUnauthorized(address dao, address caller, bytes32 permissionId) +``` + +| Input | Type | Description | +| :------------- | --------- | ---------------------------------------------------------------------------------------------- | +| `dao` | `address` | The address of the DAO to which the plugin belongs. | +| `caller` | `address` | The address (EOA or contract) that requested the application of a setup on the associated DAO. | +| `permissionId` | `bytes32` | The permission identifier. | + +_This is thrown if the `APPLY_INSTALLATION_PERMISSION_ID`, `APPLY_UPDATE_PERMISSION_ID`, or APPLY_UNINSTALLATION_PERMISSION_ID is missing._ + +### error PluginNonupgradeable + +Thrown if a plugin is not upgradeable. + +```solidity +error PluginNonupgradeable(address plugin) +``` + +| Input | Type | Description | +| :------- | --------- | ----------------------------------- | +| `plugin` | `address` | The address of the plugin contract. | + +### error PluginProxyUpgradeFailed + +Thrown if the upgrade of an `UUPSUpgradeable` proxy contract (see [ERC-1822](https://eips.ethereum.org/EIPS/eip-1822)) failed. + +```solidity +error PluginProxyUpgradeFailed(address proxy, address implementation, bytes initData) +``` + +| Input | Type | Description | +| :--------------- | --------- | ----------------------------------------------------------------------------------------------- | +| `proxy` | `address` | The address of the proxy. | +| `implementation` | `address` | The address of the implementation contract. | +| `initData` | `bytes` | The initialization data to be passed to the upgradeable plugin contract via `upgradeToAndCall`. | + +### error IPluginNotSupported + +Thrown if a contract does not support the `IPlugin` interface. + +```solidity +error IPluginNotSupported(address plugin) +``` + +| Input | Type | Description | +| :------- | --------- | ---------------------------- | +| `plugin` | `address` | The address of the contract. | + +### error PluginRepoNonexistent + +Thrown if a plugin repository does not exist on the plugin repo registry. + +```solidity +error PluginRepoNonexistent() +``` + +### error SetupAlreadyPrepared + +Thrown if a plugin setup was already prepared indicated by the prepared setup ID. + +```solidity +error SetupAlreadyPrepared(bytes32 preparedSetupId) +``` + +| Input | Type | Description | +| :---------------- | --------- | ---------------------- | +| `preparedSetupId` | `bytes32` | The prepared setup ID. | + +### error SetupNotApplicable + +Thrown if a prepared setup ID is not eligible to be applied. This can happen if another setup has been already applied or if the setup wasn't prepared in the first place. + +```solidity +error SetupNotApplicable(bytes32 preparedSetupId) +``` + +| Input | Type | Description | +| :---------------- | --------- | ---------------------- | +| `preparedSetupId` | `bytes32` | The prepared setup ID. | + +### error InvalidUpdateVersion + +Thrown if the update version is invalid. + +```solidity +error InvalidUpdateVersion(struct PluginRepo.Tag currentVersionTag, struct PluginRepo.Tag newVersionTag) +``` + +| Input | Type | Description | +| :------------------ | ----------------------- | ---------------------------------------------- | +| `currentVersionTag` | `struct PluginRepo.Tag` | The tag of the current version to update from. | +| `newVersionTag` | `struct PluginRepo.Tag` | The tag of the new version to update to. | + +### error PluginAlreadyInstalled + +Thrown if plugin is already installed and one tries to prepare or apply install on it. + +```solidity +error PluginAlreadyInstalled() +``` + +### error InvalidAppliedSetupId + +Thrown if the applied setup ID resulting from the supplied setup payload does not match with the current applied setup ID. + +```solidity +error InvalidAppliedSetupId(bytes32 currentAppliedSetupId, bytes32 appliedSetupId) +``` + +| Input | Type | Description | +| :---------------------- | --------- | ------------------------------------------------------------------------------------ | +| `currentAppliedSetupId` | `bytes32` | The current applied setup ID with which the data in the supplied payload must match. | +| `appliedSetupId` | `bytes32` | The applied setup ID obtained from the data in the supplied setup payload. | + +### event InstallationPrepared + +Emitted with a prepared plugin installation to store data relevant for the application step. + +```solidity +event InstallationPrepared(address sender, address dao, bytes32 preparedSetupId, contract PluginRepo pluginSetupRepo, struct PluginRepo.Tag versionTag, bytes data, address plugin, struct IPluginSetup.PreparedSetupData preparedSetupData) +``` + +| Input | Type | Description | +| :------------------ | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | +| `sender` | `address` | The sender that prepared the plugin installation. | +| `dao` | `address` | The address of the DAO to which the plugin belongs. | +| `preparedSetupId` | `bytes32` | The prepared setup ID obtained from the supplied data. | +| `pluginSetupRepo` | `contract PluginRepo` | The repository storing the `PluginSetup` contracts of all versions of a plugin. | +| `versionTag` | `struct PluginRepo.Tag` | The version tag of the plugin setup of the prepared installation. | +| `data` | `bytes` | The bytes-encoded data containing the input parameters for the preparation as specified in the corresponding ABI on the version's metadata. | +| `plugin` | `address` | The address of the plugin contract. | +| `preparedSetupData` | `struct IPluginSetup.PreparedSetupData` | The deployed plugin's relevant data which consists of helpers and permissions. | + +### event InstallationApplied + +Emitted after a plugin installation was applied. + +```solidity +event InstallationApplied(address dao, address plugin, bytes32 preparedSetupId, bytes32 appliedSetupId) +``` + +| Input | Type | Description | +| :---------------- | --------- | --------------------------------------------------- | +| `dao` | `address` | The address of the DAO to which the plugin belongs. | +| `plugin` | `address` | The address of the plugin contract. | +| `preparedSetupId` | `bytes32` | The prepared setup ID. | +| `appliedSetupId` | `bytes32` | The applied setup ID. | + +### event UpdatePrepared + +Emitted with a prepared plugin update to store data relevant for the application step. + +```solidity +event UpdatePrepared(address sender, address dao, bytes32 preparedSetupId, contract PluginRepo pluginSetupRepo, struct PluginRepo.Tag versionTag, struct IPluginSetup.SetupPayload setupPayload, struct IPluginSetup.PreparedSetupData preparedSetupData, bytes initData) +``` + +| Input | Type | Description | +| :------------------ | --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `sender` | `address` | The sender that prepared the plugin update. | +| `dao` | `address` | The address of the DAO to which the plugin belongs. | +| `preparedSetupId` | `bytes32` | The prepared setup ID. | +| `pluginSetupRepo` | `contract PluginRepo` | The repository storing the `PluginSetup` contracts of all versions of a plugin. | +| `versionTag` | `struct PluginRepo.Tag` | The version tag of the plugin setup of the prepared update. | +| `setupPayload` | `struct IPluginSetup.SetupPayload` | The payload containing the plugin and helper contract addresses deployed in a preparation step as well as optional data to be consumed by the plugin setup. | +| `preparedSetupData` | `struct IPluginSetup.PreparedSetupData` | The deployed plugin's relevant data which consists of helpers and permissions. | +| `initData` | `bytes` | The initialization data to be passed to the upgradeable plugin contract. | + +### event UpdateApplied + +Emitted after a plugin update was applied. + +```solidity +event UpdateApplied(address dao, address plugin, bytes32 preparedSetupId, bytes32 appliedSetupId) +``` + +| Input | Type | Description | +| :---------------- | --------- | --------------------------------------------------- | +| `dao` | `address` | The address of the DAO to which the plugin belongs. | +| `plugin` | `address` | The address of the plugin contract. | +| `preparedSetupId` | `bytes32` | The prepared setup ID. | +| `appliedSetupId` | `bytes32` | The applied setup ID. | + +### event UninstallationPrepared + +Emitted with a prepared plugin uninstallation to store data relevant for the application step. + +```solidity +event UninstallationPrepared(address sender, address dao, bytes32 preparedSetupId, contract PluginRepo pluginSetupRepo, struct PluginRepo.Tag versionTag, struct IPluginSetup.SetupPayload setupPayload, struct PermissionLib.MultiTargetPermission[] permissions) +``` + +| Input | Type | Description | +| :---------------- | ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `sender` | `address` | The sender that prepared the plugin uninstallation. | +| `dao` | `address` | The address of the DAO to which the plugin belongs. | +| `preparedSetupId` | `bytes32` | The prepared setup ID. | +| `pluginSetupRepo` | `contract PluginRepo` | The repository storing the `PluginSetup` contracts of all versions of a plugin. | +| `versionTag` | `struct PluginRepo.Tag` | The version tag of the plugin to used for install preparation. | +| `setupPayload` | `struct IPluginSetup.SetupPayload` | The payload containing the plugin and helper contract addresses deployed in a preparation step as well as optional data to be consumed by the plugin setup. | +| `permissions` | `struct PermissionLib.MultiTargetPermission[]` | The list of multi-targeted permission operations to be applied to the installing DAO. | + +### event UninstallationApplied + +Emitted after a plugin installation was applied. + +```solidity +event UninstallationApplied(address dao, address plugin, bytes32 preparedSetupId) +``` + +| Input | Type | Description | +| :---------------- | --------- | --------------------------------------------------- | +| `dao` | `address` | The address of the DAO to which the plugin belongs. | +| `plugin` | `address` | The address of the plugin contract. | +| `preparedSetupId` | `bytes32` | The prepared setup ID. | + +### internal modifier canApply + +A modifier to check if a caller has the permission to apply a prepared setup. + +```solidity +modifier canApply(address _dao, bytes32 _permissionId) +``` + +| Input | Type | Description | +| :-------------- | --------- | -------------------------- | +| `_dao` | `address` | The address of the DAO. | +| `_permissionId` | `bytes32` | The permission identifier. | + +### public function constructor + +Constructs the plugin setup processor by setting the associated plugin repo registry. + +```solidity +constructor(contract PluginRepoRegistry _repoRegistry) public +``` + +| Input | Type | Description | +| :-------------- | ----------------------------- | ---------------------------------- | +| `_repoRegistry` | `contract PluginRepoRegistry` | The plugin repo registry contract. | + +### external function prepareInstallation + +Prepares the installation of a plugin. + +```solidity +function prepareInstallation(address _dao, struct PluginSetupProcessor.PrepareInstallationParams _params) external returns (address plugin, struct IPluginSetup.PreparedSetupData preparedSetupData) +``` + +| Input | Type | Description | +| :------------------ | ------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `_dao` | `address` | The address of the installing DAO. | +| `_params` | `struct PluginSetupProcessor.PrepareInstallationParams` | The struct containing the parameters for the `prepareInstallation` function. | +| **Output** | | +| `plugin` | `address` | The prepared plugin contract address. | +| `preparedSetupData` | `struct IPluginSetup.PreparedSetupData` | The data struct containing the array of helper contracts and permissions that the setup has prepared. | + +### external function applyInstallation + +Applies the permissions of a prepared installation to a DAO. + +```solidity +function applyInstallation(address _dao, struct PluginSetupProcessor.ApplyInstallationParams _params) external +``` + +| Input | Type | Description | +| :-------- | ----------------------------------------------------- | -------------------------------------------------------------------------- | +| `_dao` | `address` | The address of the installing DAO. | +| `_params` | `struct PluginSetupProcessor.ApplyInstallationParams` | The struct containing the parameters for the `applyInstallation` function. | + +### external function prepareUpdate + +Prepares the update of an UUPS upgradeable plugin. + +```solidity +function prepareUpdate(address _dao, struct PluginSetupProcessor.PrepareUpdateParams _params) external returns (bytes initData, struct IPluginSetup.PreparedSetupData preparedSetupData) +``` + +| Input | Type | Description | +| :------------------ | ------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `_dao` | `address` | The address of the DAO For which preparation of update happens. | +| `_params` | `struct PluginSetupProcessor.PrepareUpdateParams` | The struct containing the parameters for the `prepareUpdate` function. | +| **Output** | | +| `initData` | `bytes` | The initialization data to be passed to upgradeable contracts when the update is applied | +| `preparedSetupData` | `struct IPluginSetup.PreparedSetupData` | The data struct containing the array of helper contracts and permissions that the setup has prepared. | + +_The list of `_params.setupPayload.currentHelpers` has to be specified in the same order as they were returned from previous setups preparation steps (the latest `prepareInstallation` or `prepareUpdate` step that has happend) on which the update is prepared for._ + +### external function applyUpdate + +Applies the permissions of a prepared update of an UUPS upgradeable proxy contract to a DAO. + +```solidity +function applyUpdate(address _dao, struct PluginSetupProcessor.ApplyUpdateParams _params) external +``` + +| Input | Type | Description | +| :-------- | ----------------------------------------------- | -------------------------------------------------------------------- | +| `_dao` | `address` | The address of the updating DAO. | +| `_params` | `struct PluginSetupProcessor.ApplyUpdateParams` | The struct containing the parameters for the `applyUpdate` function. | + +### external function prepareUninstallation + +Prepares the uninstallation of a plugin. + +```solidity +function prepareUninstallation(address _dao, struct PluginSetupProcessor.PrepareUninstallationParams _params) external returns (struct PermissionLib.MultiTargetPermission[] permissions) +``` + +| Input | Type | Description | +| :------------ | --------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `_dao` | `address` | The address of the uninstalling DAO. | +| `_params` | `struct PluginSetupProcessor.PrepareUninstallationParams` | The struct containing the parameters for the `prepareUninstallation` function. | +| **Output** | | +| `permissions` | `struct PermissionLib.MultiTargetPermission[]` | The list of multi-targeted permission operations to be applied to the uninstalling DAO. | + +_The list of `_params.setupPayload.currentHelpers` has to be specified in the same order as they were returned from previous setups preparation steps (the latest `prepareInstallation` or `prepareUpdate` step that has happend) on which the uninstallation was prepared for._ + +### external function applyUninstallation + +Applies the permissions of a prepared uninstallation to a DAO. + +```solidity +function applyUninstallation(address _dao, struct PluginSetupProcessor.ApplyUninstallationParams _params) external +``` + +| Input | Type | Description | +| :-------- | ------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `_dao` | `address` | The address of the DAO. | +| `_params` | `struct PluginSetupProcessor.ApplyUninstallationParams` | The struct containing the parameters for the `applyUninstallation` function. | + +_The list of `_params.setupPayload.currentHelpers` has to be specified in the same order as they were returned from previous setups preparation steps (the latest `prepareInstallation` or `prepareUpdate` step that has happend) on which the uninstallation was prepared for._ + +### public function validatePreparedSetupId + +Validates that a setup ID can be applied for `applyInstallation`, `applyUpdate`, or `applyUninstallation`. + +```solidity +function validatePreparedSetupId(bytes32 pluginInstallationId, bytes32 preparedSetupId) public view +``` + +| Input | Type | Description | +| :--------------------- | --------- | --------------------------------------------------------------------------------------------- | +| `pluginInstallationId` | `bytes32` | The plugin installation ID obtained from the hash of `abi.encode(daoAddress, pluginAddress)`. | +| `preparedSetupId` | `bytes32` | The prepared setup ID to be validated. | + +_If the block number stored in `states[pluginInstallationId].blockNumber` exceeds the one stored in `pluginState.preparedSetupIdToBlockNumber[preparedSetupId]`, the prepared setup with `preparedSetupId` is outdated and not applicable anymore._ + + diff --git a/versioned_docs/version-1.3.0/osx/03-reference-guide/framework/plugin/setup/PluginSetupProcessorHelpers.md b/versioned_docs/version-1.3.0/osx/03-reference-guide/framework/plugin/setup/PluginSetupProcessorHelpers.md new file mode 100644 index 00000000..b656e13e --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/03-reference-guide/framework/plugin/setup/PluginSetupProcessorHelpers.md @@ -0,0 +1,91 @@ +### public struct PluginSetupRef + +```solidity +struct PluginSetupRef { + struct PluginRepo.Tag versionTag; + contract PluginRepo pluginSetupRepo; +} +``` + +### enum PreparationType + +```solidity +enum PreparationType { + None, + Installation, + Update, + Uninstallation +} +``` + +### internal function \_getPluginInstallationId + +Returns an ID for plugin installation by hashing the DAO and plugin address. + +```solidity +function _getPluginInstallationId(address _dao, address _plugin) internal pure returns (bytes32) +``` + +| Input | Type | Description | +| :-------- | --------- | -------------------------------------------- | +| `_dao` | `address` | The address of the DAO conducting the setup. | +| `_plugin` | `address` | The plugin address. | + +### internal function \_getPreparedSetupId + +Returns an ID for prepared setup obtained from hashing characterizing elements. + +```solidity +function _getPreparedSetupId(struct PluginSetupRef _pluginSetupRef, bytes32 _permissionsHash, bytes32 _helpersHash, bytes _data, enum PreparationType _preparationType) internal pure returns (bytes32) +``` + +| Input | Type | Description | +| :----------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `_pluginSetupRef` | `struct PluginSetupRef` | The reference of the plugin setup containing plugin setup repo and version tag. | +| `_permissionsHash` | `bytes32` | The hash of the permission operations requested by the setup. | +| `_helpersHash` | `bytes32` | The hash of the helper contract addresses. | +| `_data` | `bytes` | The bytes-encoded initialize data for the upgrade that is returned by `prepareUpdate`. | +| `_preparationType` | `enum PreparationType` | The type of preparation the plugin is currently undergoing. Without this, it is possible to call `applyUpdate` even after `applyInstallation` is called. | +| **Output** | | +| `0` | `bytes32` | The prepared setup id. | + +### internal function \_getAppliedSetupId + +Returns an identifier for applied installations. + +```solidity +function _getAppliedSetupId(struct PluginSetupRef _pluginSetupRef, bytes32 _helpersHash) internal pure returns (bytes32) +``` + +| Input | Type | Description | +| :---------------- | ----------------------- | ------------------------------------------------------------------------------- | +| `_pluginSetupRef` | `struct PluginSetupRef` | The reference of the plugin setup containing plugin setup repo and version tag. | +| `_helpersHash` | `bytes32` | The hash of the helper contract addresses. | +| **Output** | | +| `0` | `bytes32` | The applied setup id. | + +### internal function hashHelpers + +Returns a hash of an array of helper addresses (contracts or EOAs). + +```solidity +function hashHelpers(address[] _helpers) internal pure returns (bytes32) +``` + +| Input | Type | Description | +| :--------- | ----------- | --------------------------------------------------------------- | +| `_helpers` | `address[]` | The array of helper addresses (contracts or EOAs) to be hashed. | + +### internal function hashPermissions + +Returns a hash of an array of multi-targeted permission operations. + +```solidity +function hashPermissions(struct PermissionLib.MultiTargetPermission[] _permissions) internal pure returns (bytes32) +``` + +| Input | Type | Description | +| :------------- | ---------------------------------------------- | ----------------------------------------------------- | +| `_permissions` | `struct PermissionLib.MultiTargetPermission[]` | The array of of multi-targeted permission operations. | +| **Output** | | +| `0` | `bytes32` | The hash of the array of permission operations. | diff --git a/versioned_docs/version-1.3.0/osx/03-reference-guide/framework/utils/InterfaceBasedRegistry.md b/versioned_docs/version-1.3.0/osx/03-reference-guide/framework/utils/InterfaceBasedRegistry.md new file mode 100644 index 00000000..2ef6819a --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/03-reference-guide/framework/utils/InterfaceBasedRegistry.md @@ -0,0 +1,106 @@ +## Description + +An [ERC-165](https://eips.ethereum.org/EIPS/eip-165)-based registry for contracts. + +## Implementation + +### public variable UPGRADE_REGISTRY_PERMISSION_ID + +The ID of the permission required to call the `_authorizeUpgrade` function. + +```solidity +bytes32 UPGRADE_REGISTRY_PERMISSION_ID +``` + +### public variable targetInterfaceId + +The [ERC-165](https://eips.ethereum.org/EIPS/eip-165) interface ID that the target contracts being registered must support. + +```solidity +bytes4 targetInterfaceId +``` + +### public variable entries + +The mapping containing the registry entries returning true for registered contract addresses. + +```solidity +mapping(address => bool) entries +``` + +### error ContractAlreadyRegistered + +Thrown if the contract is already registered. + +```solidity +error ContractAlreadyRegistered(address registrant) +``` + +| Input | Type | Description | +| :----------- | --------- | --------------------------------------------- | +| `registrant` | `address` | The address of the contract to be registered. | + +### error ContractInterfaceInvalid + +Thrown if the contract does not support the required interface. + +```solidity +error ContractInterfaceInvalid(address registrant) +``` + +| Input | Type | Description | +| :----------- | --------- | --------------------------------------------- | +| `registrant` | `address` | The address of the contract to be registered. | + +### error ContractERC165SupportInvalid + +Thrown if the contract does not support ERC165. + +```solidity +error ContractERC165SupportInvalid(address registrant) +``` + +| Input | Type | Description | +| :----------- | --------- | ---------------------------- | +| `registrant` | `address` | The address of the contract. | + +### internal function \_\_InterfaceBasedRegistry_init + +Initializes the component. + +```solidity +function __InterfaceBasedRegistry_init(contract IDAO _managingDao, bytes4 _targetInterfaceId) internal virtual +``` + +| Input | Type | Description | +| :------------------- | --------------- | ----------------------------------------------------------------------------------------------------- | +| `_managingDao` | `contract IDAO` | The interface of the DAO managing the components permissions. | +| `_targetInterfaceId` | `bytes4` | The [ERC-165](https://eips.ethereum.org/EIPS/eip-165) interface id of the contracts to be registered. | + +_This is required for the UUPS upgradability pattern._ + +### internal function \_authorizeUpgrade + +Internal method authorizing the upgrade of the contract via the [upgradeability mechanism for UUPS proxies](https://docs.openzeppelin.com/contracts/4.x/api/proxy#UUPSUpgradeable) (see [ERC-1822](https://eips.ethereum.org/EIPS/eip-1822)). + +```solidity +function _authorizeUpgrade(address) internal virtual +``` + +_The caller must have the `UPGRADE_REGISTRY_PERMISSION_ID` permission._ + +### internal function \_register + +Register an [ERC-165](https://eips.ethereum.org/EIPS/eip-165) contract address. + +```solidity +function _register(address _registrant) internal +``` + +| Input | Type | Description | +| :------------ | --------- | ----------------------------------------------------------------------------- | +| `_registrant` | `address` | The address of an [ERC-165](https://eips.ethereum.org/EIPS/eip-165) contract. | + +_The managing DAO needs to grant REGISTER_PERMISSION_ID to registrar._ + + diff --git a/versioned_docs/version-1.3.0/osx/03-reference-guide/framework/utils/RegistryUtils.md b/versioned_docs/version-1.3.0/osx/03-reference-guide/framework/utils/RegistryUtils.md new file mode 100644 index 00000000..d0461434 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/03-reference-guide/framework/utils/RegistryUtils.md @@ -0,0 +1,20 @@ +### internal function isSubdomainValid + +Validates that a subdomain name is composed only from characters in the allowed character set: + +- the lowercase letters `a-z` +- the digits `0-9` +- the hyphen `-` + +```solidity +function isSubdomainValid(string subDomain) internal pure returns (bool) +``` + +| Input | Type | Description | +| :---------- | -------- | ----------------------------------------------------------------------- | +| `subDomain` | `string` | The name of the DAO. | +| **Output** | | +| `0` | `bool` | `true` if the name is valid or `false` if at least one char is invalid. | + +_This function allows empty (zero-length) subdomains. If this should not be allowed, make sure to add a respective check when using this function in your code. +Aborts on the first invalid char found._ diff --git a/versioned_docs/version-1.3.0/osx/03-reference-guide/framework/utils/ens/ENSMigration.md b/versioned_docs/version-1.3.0/osx/03-reference-guide/framework/utils/ens/ENSMigration.md new file mode 100644 index 00000000..d862e4b0 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/03-reference-guide/framework/utils/ens/ENSMigration.md @@ -0,0 +1,5 @@ +## Description + +## Implementation + + diff --git a/versioned_docs/version-1.3.0/osx/03-reference-guide/framework/utils/ens/ENSSubdomainRegistrar.md b/versioned_docs/version-1.3.0/osx/03-reference-guide/framework/utils/ens/ENSSubdomainRegistrar.md new file mode 100644 index 00000000..302e4f89 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/03-reference-guide/framework/utils/ens/ENSSubdomainRegistrar.md @@ -0,0 +1,137 @@ +## Description + +This contract registers ENS subdomains under a parent domain specified in the initialization process and maintains ownership of the subdomain since only the resolver address is set. This contract must either be the domain node owner or an approved operator of the node owner. The default resolver being used is the one specified in the parent domain. + +## Implementation + +### public variable UPGRADE_REGISTRAR_PERMISSION_ID + +The ID of the permission required to call the `_authorizeUpgrade` function. + +```solidity +bytes32 UPGRADE_REGISTRAR_PERMISSION_ID +``` + +### public variable REGISTER_ENS_SUBDOMAIN_PERMISSION_ID + +The ID of the permission required to call the `registerSubnode` and `setDefaultResolver` function. + +```solidity +bytes32 REGISTER_ENS_SUBDOMAIN_PERMISSION_ID +``` + +### public variable ens + +The ENS registry contract + +```solidity +contract ENS ens +``` + +### public variable node + +The namehash of the domain on which subdomains are registered. + +```solidity +bytes32 node +``` + +### public variable resolver + +The address of the ENS resolver resolving the names to an address. + +```solidity +address resolver +``` + +### error AlreadyRegistered + +Thrown if the subnode is already registered. + +```solidity +error AlreadyRegistered(bytes32 subnode, address nodeOwner) +``` + +| Input | Type | Description | +| :---------- | --------- | ----------------------- | +| `subnode` | `bytes32` | The subnode namehash. | +| `nodeOwner` | `address` | The node owner address. | + +### error InvalidResolver + +Thrown if node's resolver is invalid. + +```solidity +error InvalidResolver(bytes32 node, address resolver) +``` + +| Input | Type | Description | +| :--------- | --------- | -------------------------- | +| `node` | `bytes32` | The node namehash. | +| `resolver` | `address` | The node resolver address. | + +### public function constructor + +```solidity +constructor() public +``` + +_Used to disallow initializing the implementation contract by an attacker for extra safety._ + +### external function initialize + +Initializes the component by + +- checking that the contract is the domain node owner or an approved operator +- initializing the underlying component +- registering the [ERC-165](https://eips.ethereum.org/EIPS/eip-165) interface ID +- setting the ENS contract, the domain node hash, and resolver. + +```solidity +function initialize(contract IDAO _managingDao, contract ENS _ens, bytes32 _node) external +``` + +| Input | Type | Description | +| :------------- | --------------- | --------------------------------------------------------------------------- | +| `_managingDao` | `contract IDAO` | The interface of the DAO managing the components permissions. | +| `_ens` | `contract ENS` | The interface of the ENS registry to be used. | +| `_node` | `bytes32` | The ENS parent domain node under which the subdomains are to be registered. | + +### internal function \_authorizeUpgrade + +Internal method authorizing the upgrade of the contract via the [upgradeability mechanism for UUPS proxies](https://docs.openzeppelin.com/contracts/4.x/api/proxy#UUPSUpgradeable) (see [ERC-1822](https://eips.ethereum.org/EIPS/eip-1822)). + +```solidity +function _authorizeUpgrade(address) internal virtual +``` + +_The caller must have the `UPGRADE_REGISTRAR_PERMISSION_ID` permission._ + +### external function registerSubnode + +Registers a new subdomain with this registrar as the owner and set the target address in the resolver. + +```solidity +function registerSubnode(bytes32 _label, address _targetAddress) external +``` + +| Input | Type | Description | +| :--------------- | --------- | -------------------------------------------- | +| `_label` | `bytes32` | The labelhash of the subdomain name. | +| `_targetAddress` | `address` | The address to which the subdomain resolves. | + +_It reverts with no message if this contract isn't the owner nor an approved operator for the given node._ + +### external function setDefaultResolver + +Sets the default resolver contract address that the subdomains being registered will use. + +```solidity +function setDefaultResolver(address _resolver) external +``` + +| Input | Type | Description | +| :---------- | --------- | --------------------------------- | +| `_resolver` | `address` | The resolver contract to be used. | + + diff --git a/versioned_docs/version-1.3.0/osx/03-reference-guide/index.md b/versioned_docs/version-1.3.0/osx/03-reference-guide/index.md new file mode 100644 index 00000000..499bb549 --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/03-reference-guide/index.md @@ -0,0 +1,7 @@ +--- +title: Reference Guide +--- + +## Reference Guide + +This reference is automatically generated from the [Solidity NatSpec comments](https://docs.soliditylang.org/en/develop/natspec-format.html) of the contracts in the [aragon/osx GitHub](https://github.com/aragon/osx) repository. diff --git a/versioned_docs/version-1.3.0/osx/index.md b/versioned_docs/version-1.3.0/osx/index.md new file mode 100644 index 00000000..e3e43afb --- /dev/null +++ b/versioned_docs/version-1.3.0/osx/index.md @@ -0,0 +1,61 @@ +--- +title: Aragon OSx +sidebar_label: Introduction to Aragon OSx +sidebar_position: 0 +--- + +## The Contracts Behind the Protocol + +The Aragon OSx protocol is the foundation layer of the new Aragon stack. It allows users to create, manage, and customize DAOs in a way that is lean, adaptable, and secure. + +The Aragon OSx protocol architecture is composed of two key sections: + +- **Core contracts**: the primitives the end user will interact with. It is composed of 3 parts: + - **DAO contract:** the main contract of our protocol. It holds a DAO's assets and possible actions. + - **Permissions**: govern interactions between the plugins, DAOs, and any other address - allowing them (or not) to execute actions on behalf of and within the DAO. + - **Plugins**: base templates of plugins. +- **Framework contracts**: in charge of creating and registering each deployed DAO or plugin. It contains: + - **DAO and Plugin Repository Factories**: creates DAOs or plugins. + - **DAO and Plugin Registries**: registers into our protocol those DAOs or plugins. + - **Plugin Setup Processor:** installs and uninstalls plugins into DAOs. + +Through permissions and plugins, DAO builders are able to build and customize their DAO to suit their needs. + +## Getting Started + +Users interact with the Aragon OSx protocol through the [Aragon App](https://app.aragon.org), the [Aragon SDK](https://devs.aragon.org/docs/sdk), or directly calling on the [protocol contracts](https://github.com/aragon/osx) - as well as through any third-party projects built using our stack. + +To **add the contracts to your project**, open a terminal in the root folder of your Solidity project and run: + +```shell +yarn add @aragon/osx +``` + +Then, to use the contracts within your project, **import the contracts** through something like: + + + +```solidity title="MyCoolPlugin.sol" +// SPDX-License-Identifier: AGPL-3.0-or-later +pragma solidity 0.8.21; + +import {Plugin, IDAO} from '@aragon/osx/core/plugin/Plugin.sol'; + +contract MyCoolPlugin is Plugin { + // ... +} +``` + +## Customize your DAO + +DAO Plugins are the best way to customize your DAO. These are modular extendable pieces of software which you can install or uninstall from your DAO as it evolves and grows. + +To learn more about plugins, check out our guide [here](./02-how-to-guides/02-plugin-development/index.md). + +### Walkthrough + +This documentation is divided into conceptual and practical sections as well as the reference guide. + +- Conceptual [How It Works articles](01-how-it-works/index.md) explain the architecture behind our protocol. +- Practical [How-to Guides](02-how-to-guides/index.md) explain how to use and leverage our protocol. +- The [Reference Guide](03-reference-guide/index.md) generated from the NatSpec comments of the latest `@aragon/osx` release documents each individual Solididty contract, function, and variable. diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/01-create-dao.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/01-create-dao.md new file mode 100644 index 00000000..26f344f6 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/01-create-dao.md @@ -0,0 +1,111 @@ +--- +title: Create a DAO +--- + +## Create a DAO + +The `createDao` function allows you to create a DAO using the parameters you set for it. + +```ts +import { + Client, + CreateDaoParams, + DaoCreationSteps, + DaoMetadata, + TokenVotingClient, + TokenVotingPluginInstall, + VotingMode, +} from "@aragon/sdk-client"; +import { GasFeeEstimation } from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Instantiate the general purpose client from the Aragon OSx SDK context. +const client: Client = new Client(context); + +const metadata: DaoMetadata = { + name: "My DAO", + description: "This is a description", + avatar: "image-url", + links: [{ + name: "Web site", + url: "https://...", + }], +}; + +// Through pinning the metadata in IPFS, we can get the IPFS URI. You can read more about it here: https://docs.ipfs.tech/how-to/pin-files/ +const metadataUri = await client.methods.pinMetadata(metadata); + + +// You need at least one plugin in order to create a DAO. In this example, we'll use the TokenVoting plugin, but feel free to install whichever one best suites your needs. You can find resources on how to do this in the plugin sections. +// These would be the plugin params if you need to mint a new token for the DAO to enable TokenVoting. +const tokenVotingPluginInstallParams: TokenVotingPluginInstall = { + votingSettings: { + minDuration: 60 * 60 * 24 * 2, // seconds + minParticipation: 0.25, // 25% + supportThreshold: 0.5, // 50% + minProposerVotingPower: BigInt("5000"), // default 0 + votingMode: VotingMode.EARLY_EXECUTION, // default is STANDARD. other options: EARLY_EXECUTION, VOTE_REPLACEMENT + }, + newToken: { + name: "Token", // the name of your token + symbol: "TOK", // the symbol for your token. shouldn't be more than 5 letters + decimals: 18, // the number of decimals your token uses + minter: "0x...", // optional. if you don't define any, we'll use the standard OZ ERC20 contract. Otherwise, you can define your own token minter contract address. + balances: [ + { // Defines the initial balances of the new token + address: "0x2371238740123847102983471022", // address of the account to receive the newly minted tokens + balance: BigInt(10), // amount of tokens that address should receive + }, + ], + }, +}; + +// Creates a TokenVoting plugin client with the parameteres defined above (with an existing token). +const tokenVotingInstallItem = TokenVotingClient.encoding + .getPluginInstallItem(tokenVotingPluginInstallParams, "goerli"); + +const createDaoParams: CreateDaoParams = { + metadataUri, + ensSubdomain: "my-org", // my-org.dao.eth + plugins: [tokenVotingInstallItem], // plugin array cannot be empty or the transaction will fail. you need at least one governance mechanism to create your DAO. +}; + +// Estimate how much gas the transaction will cost. +const estimatedGas: GasFeeEstimation = await client.estimation.createDao( + createDaoParams, +); +console.log({ avg: estimatedGas.average, maximum: estimatedGas.max }); + +// Create the DAO. +const steps = client.methods.createDao(createDaoParams); + +for await (const step of steps) { + try { + switch (step.key) { + case DaoCreationSteps.CREATING: + console.log({ txHash: step.txHash }); + break; + case DaoCreationSteps.DONE: + console.log({ + daoAddress: step.address, + pluginAddresses: step.pluginAddresses, + }); + break; + } + } catch (err) { + console.error(err); + } +} +``` + + +Returns: +```tsx +{ + txHash: "0xb1c14a49...3e8620b0f5832d61c" +} +{ + daoAddress: "0xb1c14a49...3e8620b0f5832d61c", + pluginAddresses: ["0xb1c14a49...3e8620b0f5832d61c", "0xb1c14a49...3e8620b0f5832d61c"] +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/02-deposit-eth.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/02-deposit-eth.md new file mode 100644 index 00000000..3b77a01c --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/02-deposit-eth.md @@ -0,0 +1,56 @@ +--- +title: Deposit ETH +--- + +## Deposit ETH to a DAO + +Handles the flow of depositing the native EVM token (when in mainnet, it's ETH) to an Aragon OSx DAO. + +```ts +import { Client, DaoDepositSteps, DepositParams } from "@aragon/sdk-client"; +import { GasFeeEstimation, TokenType } from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Instantiate the general purpose client from the Aragon OSx SDK context. +const client: Client = new Client(context); + +const depositParams: DepositParams = { + daoAddressOrEns: "my-dao.dao.eth", + amount: BigInt(10), // amount in wei + type: TokenType.NATIVE, // "native" for ETH, otherwise "erc20" for ERC20 tokens +}; + +// Estimate how much gas the transaction will cost. +const estimatedGas: GasFeeEstimation = await client.estimation.deposit( + depositParams, +); +console.log({ avg: estimatedGas.average, max: estimatedGas.max }); + +// Deposit ETH to the DAO. +const steps = client.methods.deposit(depositParams); +for await (const step of steps) { + try { + switch (step.key) { + case DaoDepositSteps.DEPOSITING: + console.log({ txHash: step.txHash }); + break; + case DaoDepositSteps.DONE: + console.log({ amount: step.amount }); + break; + } + } catch (err) { + console.error(err); + } +} +``` + + +Returns: +```tsx +{ + txHash: "0xb1c14a49...3e8620b0f5832d61c" +} +{ + amount: 10n, +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/03-deposit-erc20.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/03-deposit-erc20.md new file mode 100644 index 00000000..04c5ec41 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/03-deposit-erc20.md @@ -0,0 +1,85 @@ +--- +title: Deposit ERC-20 +--- + +### Deposit ERC-20 Tokens to a DAO + +Deposits ERC-20 tokens to a DAO. + +- Similar to the ETH deposit flow +- The `tokenAddress` field is required. This is the contract address of the ERC-20 token. +- Will attempt to increase the ERC20 allowance if not sufficient. +- More intermediate steps are yielded. + +```ts +import { + Client, + DaoDepositSteps, + DepositParams, + SetAllowanceSteps, +} from "@aragon/sdk-client"; +import { GasFeeEstimation, TokenType } from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Instantiate the general purpose client from the Aragon OSx SDK context. +const client: Client = new Client(context); + +const depositParams: DepositParams = { + daoAddressOrEns: "0x1234567890123456789012345678901234567890", // my-dao.dao.eth + amount: BigInt(10), // amount in wei + tokenAddress: "0x1234567890123456789012345678901234567890", // token contract adddress + type: TokenType.ERC20, // "erc20" for ERC20 token, otherwise "native" for ETH +}; + +// Estimate how much gas the transaction will cost. +const estimatedGas: GasFeeEstimation = await client.estimation.deposit( + depositParams, +); +console.log({ avg: estimatedGas.average, max: estimatedGas.max }); + +// Deposit the ERC20 tokens. +const steps = client.methods.deposit(depositParams); +for await (const step of steps) { + try { + switch (step.key) { + case DaoDepositSteps.CHECKED_ALLOWANCE: + console.log({ checkedAllowance: step.allowance }); + break; + case SetAllowanceSteps.SETTING_ALLOWANCE: + console.log({ updateAllowanceTxHash: step.txHash }); + break; + case SetAllowanceSteps.ALLOWANCE_SET: + console.log({ updatedAllowance: step.allowance }); + break; + case DaoDepositSteps.DEPOSITING: + console.log({ depositingTxHash: step.txHash }); + break; + case DaoDepositSteps.DONE: + console.log({ amount: step.amount }); + break; + } + } catch (err) { + console.error(err); + } +} +``` + + +Returns: +```tsx +{ + checkedAllowance: 0n +} +{ + updateAllowanceTxHash: "0xb1c14a49...3e8620b0f5832d61c" +} +{ + updatedAllowance: 10n +} +{ + depositingTxHash: "0xb1c14a49...3e8620b0f5832d61c" +} +{ + amount: 10n +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/04-deposit-erc721.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/04-deposit-erc721.md new file mode 100644 index 00000000..616c4203 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/04-deposit-erc721.md @@ -0,0 +1,73 @@ +--- +title: Deposit ERC-721 +--- + +### Deposit ERC-721 Tokens to a DAO + +Deposits ERC-721 tokens to a DAO. + +- Similar to the ERC20 deposit flow +- The `tokenAddress` field is required. This is the contract address of the ERC-721 token. +- TokenId is required. This is the token ID of the ERC-721 token. +- Calls the safeTransferFrom function of the ERC-721 token contract. + +```ts +import { + Client, + DaoDepositSteps, + DepositParams, + SetAllowanceSteps, + } from "@aragon/sdk-client"; + import { GasFeeEstimation, TokenType } from "@aragon/sdk-client-common"; + import { context } from "../index"; + + // Instantiate the general purpose client from the Aragon OSx SDK context. + const client: Client = new Client(context); + + const depositParams: DepositParams = { + daoAddressOrEns: "0x1234567890123456789012345678901234567890", // my-dao.dao.eth + tokenAddress: "0x1234567890123456789012345678901234567890", // token contract adddress + type: TokenType.ERC721, // "erc721" for ERC721 token + tokenId: BigInt(1), // token ID of the ERC-721 token + }; + + // Estimate how much gas the transaction will cost. + const estimatedGas: GasFeeEstimation = await client.estimation.deposit( + depositParams, + ); + console.log({ avg: estimatedGas.average, max: estimatedGas.max }); + + // Deposit the ERC721 tokens. + const steps = client.methods.deposit(depositParams); + for await (const step of steps) { + try { + switch (step.key) { + case DaoDepositSteps.DEPOSITING: + console.log({ depositingTxHash: step.txHash }); + break; + case DaoDepositSteps.DONE: + console.log({ tokenId: step.tokenId }); + break; + } + } catch (err) { + console.error(err); + } + } +``` + + +Returns: + ```tsx + { + depositingTxHash: "0xb1c14a49...3e8620b0f5832d61c" + } + { + tokenId: 1n + } + ``` + +```ts + +``` + + diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/05-deposit-erc1155.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/05-deposit-erc1155.md new file mode 100644 index 00000000..575e28ca --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/05-deposit-erc1155.md @@ -0,0 +1,78 @@ +--- +title: Deposit ERC-1155 +--- + +### Deposit ERC-1155 Tokens to a DAO + +Deposits ERC-1155 tokens to a DAO. + +- Similar to the ERC20 deposit flow +- The `tokenAddress` field is required. This is the contract address of the ERC-1155 token. +- TokenIds is required. This is the token ID of the ERC-1155 token. +- Amounts is required. This is the amount of the ERC-1155 token to deposit. +- Supports depositing multiple ERC-1155 tokens in a single transaction. +- Calls the safeTransferFrom or safeBatchTransferFrom function of the ERC-1155 token contract. +- If only one token ID is provided, the safeTransferFrom function is called. +- If multiple token IDs are provided, the safeBatchTransferFrom function is called. + +```ts +import { + Client, + DaoDepositSteps, + DepositParams, + } from "@aragon/sdk-client"; + import { GasFeeEstimation, TokenType } from "@aragon/sdk-client-common"; + import { context } from "../index"; + + // Instantiate the general purpose client from the Aragon OSx SDK context. + const client: Client = new Client(context); + + const depositParams: DepositParams = { + daoAddressOrEns: "0x1234567890123456789012345678901234567890", // my-dao.dao.eth + tokenAddress: "0x1234567890123456789012345678901234567890", // token contract adddress + type: TokenType.ERC1155, // "erc1155" for ERC1155 token + tokenIds: [BigInt(1)], // token ID of the ERC-1155 token + amounts: [BigInt(1)], // amount of the ERC-1155 token to deposit + }; + + // Estimate how much gas the transaction will cost. + const estimatedGas: GasFeeEstimation = await client.estimation.deposit( + depositParams, + ); + console.log({ avg: estimatedGas.average, max: estimatedGas.max }); + + // Deposit the ERC1155 tokens. + const steps = client.methods.deposit(depositParams); + for await (const step of steps) { + try { + switch (step.key) { + case DaoDepositSteps.DEPOSITING: + console.log({ depositingTxHash: step.txHash }); + break; + case DaoDepositSteps.DONE: + console.log({ tokenId: step.tokenIds, amount: step.amounts }); + break; + } + } catch (err) { + console.error(err); + } + } +``` + + +Returns: + ```tsx + { + depositingTxHash: "0xb1c14a49...3e8620b0f5832d61c" + } + { + tokenIds: [1n], + amounts: [1n] + } + ``` + +```ts + +``` + + diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/06-get-dao.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/06-get-dao.md new file mode 100644 index 00000000..f17b759e --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/06-get-dao.md @@ -0,0 +1,54 @@ +--- +title: Get DAO Details +--- + +## Get the DAO details + +Gets a DAO's details using its address or ENS domain. + +```ts +import { Client, DaoDetails } from "@aragon/sdk-client"; +import { context } from "../index"; + +// Instantiate the general purpose client from the Aragon OSx SDK context. +const client: Client = new Client(context); + +// Address or ENS of the DAO whose metadata you want to retrieve. +const daoAddressOrEns: string = "0x1234567890123456789012345678901234567890"; // test.dao.eth + +// Get a DAO's details. +const dao: DaoDetails | null = await client.methods.getDao(daoAddressOrEns); +console.log(dao); +``` + + +Returns: + +```json +{ + address: "0x1234567890123456789012345678901234567890", + ensDomain: "test.dao.eth", + metadata: { + name: "test", + description: "this is a description", + avatar?: "https://wbsite.com/image.jpeg", + links: [ + { + name: "Website", + url: "https://website..." + }, + { + name: "Discord", + url: "https://discord.com/..." + } + ] + }, + creationDate: , + plugins: [ + { + id: token-voting.plugin.dao.eth, + instanceAddress: "0x12345..." + } + ] +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/07-get-daos.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/07-get-daos.md new file mode 100644 index 00000000..19afbdca --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/07-get-daos.md @@ -0,0 +1,82 @@ +--- +title: Get DAOs +--- + +## Get Existing DAOs from the DAO Registry + +Gets a list of DAOs from the Aragon OSx DAO registry. + +```ts +import { + Client, + DaoListItem, + DaoQueryParams, + DaoSortBy, +} from "@aragon/sdk-client"; +import { SortDirection } from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Instantiate the general purpose client from the Aragon OSx SDK context. +const client: Client = new Client(context); + +const queryParams: DaoQueryParams = { + skip: 0, // optional + limit: 10, // optional, + direction: SortDirection.ASC, // optional + sortBy: DaoSortBy.CREATED_AT, //optional, alternatively "SUBDOMAIN" (and "POPULARITY" coming soon) +}; + +// Get a list of DAOs from the Aragon DAO registry. +const daos: DaoListItem[] = await client.methods.getDaos(queryParams); +console.log(daos); +``` + + +Returns: + +```json +[ + { + address: "0x12345...", + ensDomain: "test.dao.eth", + metadata: { + name: "Test", + description: "This is a description" + }; + plugins: [ + { + id: "token-voting.plugin.dao.eth", + instanceAddress: "0x12345..." + } + ] + }, + { + address: "0x12345...", + ensDomain: "test-1.dao.eth", + metadata: { + name: "Test 1", + description: "This is a description 1" + }; + plugins: [ + { + id: "address-list-voting.plugin.dao.eth", + instanceAddress: "0x12345..." + } + ] + }, + { + address: "0x12345...", + ensDomain: "test-2.dao.eth", + metadata: { + name: "Test 2", + description: "This is a description 2" + }; + plugins: [ + { + id: "token-voting.plugin.dao.eth", + instanceAddress: "0x12345..." + } + ] + } +] + ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/08-get-balances.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/08-get-balances.md new file mode 100644 index 00000000..43e7630d --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/08-get-balances.md @@ -0,0 +1,47 @@ +--- +title: Get DAO Balance +--- + +## Get the Balance of a DAO + +Gets a DAO's financial assets based on the DAO address or its ENS domain. + +```ts +import { AssetBalance, Client } from "@aragon/sdk-client"; +import { context } from "../index"; + +// Instantiate the general purpose client from the Aragon OSx SDK context. +const client: Client = new Client(context); + +// Address of the DAO whose asset balances you want to retrieve. +const daoAddressOrEns: string = "0x12345..."; + +// Get a DAO's asset balances. +const daoBalances: AssetBalance[] | null = await client.methods.getDaoBalances({ + daoAddressOrEns, +}); +console.log(daoBalances); +``` + + +Returns: + +```json +[ + { + type: "native", + balance: 100000n, + updateDate: + }, + { + type: "erc20", + address: "0x1234567890123456789012345678901234567890" + name: "The Token", + symbol: "TOK", + decimals: 18, + balance: 200000n + updateDate: + }, + ... +] +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/09-get-transfers.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/09-get-transfers.md new file mode 100644 index 00000000..ab0f9d39 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/09-get-transfers.md @@ -0,0 +1,85 @@ +--- +title: Get DAO Transfers +--- + +## Get Transfers from DAO's Activity + +Gets the list of asset transfers to and from DAOs. +If passed a `daoAddressOrEns`, will only retrieve transfers for that DAO. Otherwise, it returns for all DAOs. + +By default, retrieves ETH, DAI, USDC and USDT, on Mainnet). + +```ts +import { + Client, + Transfer, + TransferQueryParams, + TransferSortBy, + TransferType, +} from "@aragon/sdk-client"; +import { SortDirection } from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Instantiate the general purpose client from the Aragon OSx SDK context. +const client: Client = new Client(context); + +const params: TransferQueryParams = { + daoAddressOrEns: "0x1234567890123456789012345678901234567890", // optional + sortBy: TransferSortBy.CREATED_AT, // optional + limit: 10, // optional + skip: 0, // optional + direction: SortDirection.ASC, // optional, options: DESC or ASC + type: TransferType.DEPOSIT, // optional, options: DEPOSIT or WITHDRAW +}; + +// Get a list of DAO transfers based on params set. +const daoTransfers: Transfer[] | null = await client.methods.getDaoTransfers( + params, +); +console.log(daoTransfers); +``` + + +Returns: + +```json +[ + { + type: "withdraw", + tokenType: "erc20", + token: { + address: "0xc7ad46e0b8a400bb3c915120d284aafba8fc4735", + name: "Dai Stablecoin", + symbol: "DAI", + decimals: 18, + }, + amount: 1000000000000000n, + creationDate: + transactionId: "0xdb0f9422b5c3199021481c98a655741ca16119ff8a59571854a94a6f31dad7ba", + to: "0xc8541aae19c5069482239735ad64fac3dcc52ca2", + proposalId: "0x1234567890123456789012345678901234567890_0x0" + }, + { + type: "deposit", + tokenType: "native", + amount: 1000000000000000n, + creationDate: + transactionId: "0xc18b310b2f8cf427d95fa905dc842df2cf999075f18579afbcbdce19f8db0a30", + from: "0xc8541aae19c5069482239735ad64fac3dcc52ca2", + }, + { + type: "deposit", + tokenType: "erc20", + token: { + address: "0xc7ad46e0b8a400bb3c915120d284aafba8fc4735", + name: "Dai Stablecoin", + symbol: "DAI", + decimals: 18, + }, + amount: 1000000000000000n, + creationDate: + transactionId: "0xdd8fff77c1f3e819d4224f8d02a00583c7e5d55475b8a9d70867aee0d6d16f07", + from: "0xc8541aae19c5069482239735ad64fac3dcc52ca2", + } +] +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/10-set-allowance.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/10-set-allowance.md new file mode 100644 index 00000000..b7423d73 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/10-set-allowance.md @@ -0,0 +1,60 @@ +--- +title: Update ERC-20 Allowance +--- + +## Updates an ERC-20 Tokens' Allowance + +In order for an address to deposit an ERC20 token into the DAO, the allowance approval for that token needs to be set to the amount the person wants to deposit. +This function ensures the allowance approval is set to that amount. +Refer to OpenZeppelin docs here on ERC20's token allowance methods: https://docs.openzeppelin.com/contracts/2.x/api/token/erc20#IERC20-allowance-address-address-). + +This function updates the allowance approval to the amount specified. + +```ts +import { + Client, + SetAllowanceParams, + SetAllowanceSteps, +} from "@aragon/sdk-client"; +import { context } from "../index"; + +// Instantiate the general purpose client from the Aragon OSx SDK context. +const client: Client = new Client(context); + +const setAllowanceParams: SetAllowanceParams = { + spender: "0x1234567890123456789012345678901234567890", + amount: BigInt(10), // amount + tokenAddress: "0x1234567890123456789012345678901234567890", // token contract adddress +}; + +const steps = client.methods.setAllowance(setAllowanceParams); + +for await (const step of steps) { + try { + switch (step.key) { + case SetAllowanceSteps.SETTING_ALLOWANCE: + console.log({ updateAllowanceTxHash: step.txHash }); + break; + case SetAllowanceSteps.ALLOWANCE_SET: + console.log({ updatedAllowance: step.allowance }); + break; + } + } catch (err) { + console.error(err); + } +} +``` + + +Returns: +```tsx +{ + checkedAllowance: 0n +} +{ + updateAllowanceTxHash: "0xb1c14a49...3e8620b0f5832d61c" +} +{ + updatedAllowance: 10n +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/11-pin-metadata.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/11-pin-metadata.md new file mode 100644 index 00000000..4c6b9cc1 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/11-pin-metadata.md @@ -0,0 +1,38 @@ +--- +title: Pin Metadata to IPFS +--- + +## Pins Metadata for a DAO within IPFS + +Adds a pin data set into the specified IPFS nodes. +Return an IPFS CID preceded by "ipfs://". + +```ts +import { Client, DaoMetadata } from "@aragon/sdk-client"; +import { context } from "../index"; + +// Instantiate the general purpose client from the Aragon OSx SDK context. +const client: Client = new Client(context); + +// The Metadata object containing the details of the DAO. +const metadata: DaoMetadata = { + name: "My DAO", + description: "This is a description", + avatar: "", + links: [{ + name: "Web site", + url: "https://...", + }], +}; + +// Pin the metadata in IPFS. +const metadataUri = await client.methods.pinMetadata(metadata); +console.log(metadataUri); +``` + + +Returns: + +```json + "ipfs://Qm..." +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/12-prepare-installation.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/12-prepare-installation.md new file mode 100644 index 00000000..5e00853a --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/12-prepare-installation.md @@ -0,0 +1,81 @@ +--- +title: Prepare Installation +--- +### Prepare installation of a plugin + +The `prepareInstallation` method performs the prior steps so that a DAO proposal can eventually apply the installation of a Plugin to the given DAO. +A governance proposal will need to be created with an action calling `applyInstallation`. + +For more details see https://devs.aragon.org/docs/sdk/examples/encoders-decoders/apply-installation#encoding + +```ts +import { Client } from "@aragon/sdk-client"; +import { + PrepareInstallationParams, + PrepareInstallationStep, +} from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Instantiate the general purpose client from the Aragon OSx SDK context. +const client: Client = new Client(context); + +// Obtained from the plugin metadata +// See an example: https://github.com/aragon/simple-storage-example-plugin/blob/main/contracts/release1/build3/build-metadata-R1B3.json#L7-L20 +const installationAbi = [/* ... */]; + +const prepareInstallationParams: PrepareInstallationParams = { + daoAddressOrEns: "0x1234567890123456789012345678901234567890", // my-dao.dao.eth + pluginRepo: "0x2345678901234567890123456789012345678901", + installationParams: [ + // Example parameters needed by the plugin's prepareInstall function + 1234, + "0x1234567890123456789012345678901234567890", + ], + installationAbi, +}; + +// Prepare the installation +const steps = client.methods.prepareInstallation(prepareInstallationParams); +for await (const step of steps) { + try { + switch (step.key) { + case PrepareInstallationStep.PREPARING: + console.log({ txHash: step.txHash }); + break; + case PrepareInstallationStep.DONE: + console.log({ step }); + break; + } + } catch (err) { + console.error(err); + } +} +``` + + +Returns: +```tsx +{ + txhash: "0xb1c14a49...3e8620b0f5832d61c" +} +{ + step: { + helpers: ["0x12345...", "0x12345..."] + pluginRepo: "0x12345...", + pluginAdddres: "0x12345...", + versionTag: { + build: 1, + release: 1 + }, + permissions: [ + { + condition: "0x12345...", + who: "0x12345...", + where: "0x12345...", + operation: 1, // GRANT + permissionId: "0x1234567890..." + } + ] + } +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/13-get-protocol-version.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/13-get-protocol-version.md new file mode 100644 index 00000000..f65f0b4f --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/13-get-protocol-version.md @@ -0,0 +1,35 @@ +--- +title: Get Protocol Version +--- + +### Get the protocol version of a DAO + +The `getProtocolVersion` method returns the protocol version of a DAO in the form of an array of three numbers. + +```ts +import { + Client, + } from "@aragon/sdk-client"; + import { context } from "../index"; + + // Instantiate the general purpose client from the Aragon OSx SDK context. + const client: Client = new Client(context); + + const protocolVersion = await client.methods + .getProtocolVersion( + "0x1234567890123456789012345678901234567890", + ); + console.log(protocolVersion); +``` + + +Returns: + ```tsx + [1, 0, 0] + ``` + +```ts + +``` + + diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/14-prepare-uninstallation.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/14-prepare-uninstallation.md new file mode 100644 index 00000000..bfcb5cfb --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/14-prepare-uninstallation.md @@ -0,0 +1,90 @@ +--- +title: Prepare Uninstallation +--- + +### Prepare the uninstallation of a plugin + +The `prepareUninstallation` method performs the prior steps so that a DAO proposal can eventually apply the removal of a Plugin. +The proposal will need an Action calling the `applyUninstallation` function. + +For more details see https://devs.aragon.org/docs/sdk/examples/encoders-decoders/apply-uninstallation#encoding + +```ts +import { Client, PrepareUninstallationSteps } from "@aragon/sdk-client"; +import { + PrepareUninstallationParams, + GasFeeEstimation, +} from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Instantiate the general purpose client from the Aragon OSx SDK context. +const client: Client = new Client(context); + +const prepareUninstallationParams: PrepareUninstallationParams = { + daoAddressOrEns: "0x1234567890123456789012345678901234567890", // my-dao.dao.eth + pluginAddress: "0x2345678901234567890123456789012345678901", + uninstallationParams: [ + // Example parameters needed by the plugin's prepareUninstall function + 1234, + "0x1234567890123456789012345678901234567890", + ], + uninstallationAbi: ["uint256", "adress"], +}; + +// Estimate how much gas the transaction will cost. +const estimatedGas: GasFeeEstimation = + await client.estimation.prepareUninstallation(prepareUninstallationParams); +console.log({ avg: estimatedGas.average, max: estimatedGas.max }); + +// Deposit the ERC20 tokens. +const steps = client.methods.prepareUninstallation(prepareUninstallationParams); +for await (const step of steps) { + try { + switch (step.key) { + case PrepareUninstallationSteps.PREPARING: + console.log({ txHash: step.txHash }); + break; + case PrepareUninstallationSteps.DONE: + console.log({ + permissions: step.permissions, + pluginAddress: step.pluginAddress, + pluginRepo: step.pluginRepo, + versionTag: step.versionTag, + }); + break; + } + } catch (err) { + console.error(err); + } +} +``` + + +Returns: +```tsx +{ + txhash: "0xb1c14a49...3e8620b0f5832d61c" +} +{ + permissions: [ + { + operation: 1, // revoke + where: "0x12345...", + who: "0x23456...", + permissionId: "0x1234567890..." + }, + { + operation: 1, //REVOKE + where: "0x3456...", + who: "0x4567...", + permissionId: "0x1234567890..." + } + ], + pluginAddress: "0x1234567890...", + pluginRepo: "0x1234567890..." + versionTag: { + build: 1, + release: 1 + } +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/15-prepare-update.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/15-prepare-update.md new file mode 100644 index 00000000..c4ec668e --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/15-prepare-update.md @@ -0,0 +1,101 @@ +--- +title: Prepare Update +--- + +### Prepare the Update of a plugin + +The `prepareUpdate` method performs the prior steps so that a DAO proposal can eventually apply the the update of a Plugin. +The proposal will need an Action calling the `applyUpdate` function. + +```ts +import { + Client, + PrepareUpdateParams, + PrepareUpdateStep, +} from "@aragon/sdk-client"; +import { context } from "../index"; + +// Instantiate the general purpose client from the Aragon OSx SDK context. +const client: Client = new Client(context); + +const updateAbi = [/* ... */]; + +const prepareUpdateParams: PrepareUpdateParams = { + daoAddressOrEns: "0x1234567890123456789012345678901234567890", // my-dao.dao.eth + pluginAddress: "0x2345678901234567890123456789012345678901", + pluginRepo: "0x2345678901234567890123456789012345678901", + newVersion: { + build: 2, + release: 1, + }, + updateParams: [ + // Example parameters needed by the plugin's prepareUpdate function + 1234, + "0x1234567890123456789012345678901234567890", + ], + updateAbi, +}; + +// Estimate how much gas the transaction will cost. +const estimatedGas = await client.estimation + .prepareUpdate( + prepareUpdateParams, + ); +console.log({ avg: estimatedGas.average, max: estimatedGas.max }); + +// Deposit the ERC20 tokens. +const steps = client.methods.prepareUpdate(prepareUpdateParams); +for await (const step of steps) { + try { + switch (step.key) { + case PrepareUpdateStep.PREPARING: + console.log({ txHash: step.txHash }); + break; + case PrepareUpdateStep.DONE: + console.log({ + permissions: step.permissions, + pluginAddress: step.pluginAddress, + pluginRepo: step.pluginRepo, + versionTag: step.versionTag, + initData: step.initData, + helpers: step.helpers, + }); + break; + } + } catch (err) { + console.error(err); + } +} +``` + + +Returns: + ```tsx + { + txhash: "0xb1c14a49...3e8620b0f5832d61c" + } + { + permissions: [ + { + operation: 1, // revoke + where: "0x12345...", + who: "0x23456...", + permissionId: "0x1234567890..." + }, + { + operation: 1, //REVOKE + where: "0x3456...", + who: "0x4567...", + permissionId: "0x1234567890..." + } + ], + pluginAddress: "0x1234567890...", + pluginRepo: "0x1234567890...", + initData: Uint8Array(0) [], + versionTag: { + build: 1, + release: 1 + }, + helpers: ["0x12345...", "0x12345..."] + } + ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/16-is-plugin-update-valid.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/16-is-plugin-update-valid.md new file mode 100644 index 00000000..ae411d2e --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/16-is-plugin-update-valid.md @@ -0,0 +1,38 @@ +--- +title: Check plugin update proposal +--- + +### Check if a plugin update proposal is valid + +Goes though the actions of an `IProposal` compatible proposal and checks that the actions are valid for updating a plugin + +```ts +import { Client } from "@aragon/sdk-client"; +import { context } from "../index"; + +// Instantiate the general purpose client from the Aragon OSx SDK context. +const client: Client = new Client(context); + +// The Id of the proposal. This is the address of the governance plugin and the proposal number in hexadecimal +// you can find it at the last part of the URL to the proposal for example +// https://app.aragon.org/#/daos/polygon/0x6c30c1a36ac486456932b2f106053c42443514b2/governance/proposals/0x0cff359a7455de5bb50aa0567517536d3dfe002d_0x10 +const proposalId = "0x0cff359a7455de5bb50aa0567517536d3dfe002d_0x10" + + +// check if a plugin update proposal is valid +const isValid = client.methods.isPluginUpdateProposalValid(proposalId); + +console.log(isValid); +``` + + +Returns: + ```tsx + { + isValid: false, + causes: [ + "invalidRevokePermission", + "invalidGrantPermission", + ] + } + ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/17-is-plugin-update-proposal.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/17-is-plugin-update-proposal.md new file mode 100644 index 00000000..27436846 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/17-is-plugin-update-proposal.md @@ -0,0 +1,31 @@ +--- +title: Check proposal is a plugin update proposal +--- + +### Check if a proposal contains the actions required to update a plugin + +Goes though a list of actions and checks that contains the necessary actions for updating a plugin + +```ts +import { Client } from "@aragon/sdk-client"; +import { context } from "../index"; + +// Instantiate the general purpose client from the Aragon OSx SDK context. +const client: Client = new Client(context); + +// The Id of the proposal. This is the address of the governance plugin and the proposal number in hexadecimal +// you can find it at the last part of the URL to the proposal for example +// https://app.aragon.org/#/daos/polygon/0x6c30c1a36ac486456932b2f106053c42443514b2/governance/proposals/0x0cff359a7455de5bb50aa0567517536d3dfe002d_0x10 +const proposalId = "0x0cff359a7455de5bb50aa0567517536d3dfe002d_0x10"; + +// check if a plugin update proposal is valid +const isValid = client.methods.isPluginUpdateProposal(proposalId); + +console.log(isValid); +``` + + +Returns: + ```tsx + false + ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/18-is-dao-update-valid.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/18-is-dao-update-valid.md new file mode 100644 index 00000000..db67ce9c --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/18-is-dao-update-valid.md @@ -0,0 +1,36 @@ +--- +title: Check dao update proposal +--- + +### Check if a dap update proposal is valid + +Goes though the actions of an `IProposal` compatible proposal and checks that the actions are valid for updating a dao + +```ts +import { Client } from "@aragon/sdk-client"; +import { context } from "../index"; + +// Instantiate the general purpose client from the Aragon OSx SDK context. +const client: Client = new Client(context); + +// The Id of the proposal. This is the address of the governance plugin and the proposal number in hexadecimal +// you can find it at the last part of the URL to the proposal for example +// https://app.aragon.org/#/daos/polygon/0x6c30c1a36ac486456932b2f106053c42443514b2/governance/proposals/0x0cff359a7455de5bb50aa0567517536d3dfe002d_0x10 +const proposalId = "0x0cff359a7455de5bb50aa0567517536d3dfe002d_0x11"; + +// check if a dap update proposal is valid +const isValid = client.methods.isDaoUpdateProposalValid(proposalId); + +console.log(isValid); +``` + + +Returns: + ```tsx + { + isValid: false, + causes: [ + "invalidImplementation", + ] + } + ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/19-is-dao-update-proposal.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/19-is-dao-update-proposal.md new file mode 100644 index 00000000..9d578a2b --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/19-is-dao-update-proposal.md @@ -0,0 +1,31 @@ +--- +title: Check proposal is a dao update proposal +--- + +### Check if a proposal contains the actions required to update a dao + +Goes though a list of actions and checks that contains the necessary actions for updating a dao + +```ts +import { Client } from "@aragon/sdk-client"; +import { context } from "../index"; + +// Instantiate the general purpose client from the Aragon OSx SDK context. +const client: Client = new Client(context); + +// The Id of the proposal. This is the address of the governance plugin and the proposal number in hexadecimal +// you can find it at the last part of the URL to the proposal for example +// https://app.aragon.org/#/daos/polygon/0x6c30c1a36ac486456932b2f106053c42443514b2/governance/proposals/0x0cff359a7455de5bb50aa0567517536d3dfe002d_0x10 +const proposalId = "0x0cff359a7455de5bb50aa0567517536d3dfe002d_0x11"; + +// check if a plugin update proposal is valid +const isValid = client.methods.isDaoUpdateProposal(proposalId); + +console.log(isValid); +``` + + +Returns: + ```tsx + false + ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/20-get-plugin-preparations.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/20-get-plugin-preparations.md new file mode 100644 index 00000000..746f62f2 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/20-get-plugin-preparations.md @@ -0,0 +1,74 @@ +--- +title: Get Plugin Preparations +--- + +## Get Plugin Preparations + +Returns plugin preparations filtered by: + +- pluginAddress +- daoAddressOrEns +- pluginRepoAddress +- type(Installation or Update) + +```ts +import { + Client, + PluginPreparationListItem, + PluginPreparationQueryParams, + PluginPreparationSortBy, +} from "@aragon/sdk-client"; +import { SortDirection } from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Instantiate the general purpose client from the Aragon OSx SDK context. +const client: Client = new Client(context); + +const params: PluginPreparationQueryParams = { + limit: 10, + skip: 0, + direction: SortDirection.ASC, + sortBy: PluginPreparationSortBy.ID, + pluginAddress: "0x1234567890123456789012345678901234567890", + daoAddressOrEns: "0x1234567890123456789012345678901234567890", + pluginRepoAddress: "0x1234567890123456789012345678901234567890", +}; + +// Get a list of DAOs from the Aragon DAO registry. +const pluginPreparations: PluginPreparationListItem[] = await client.methods + .getPluginPreparations(params); +console.log(pluginPreparations); +``` + + +Returns: + +```json +[ + { + id: string, + type: "Installation", + creator: "0x1234567890123456789012345678901234567890", + dao: "0x1234567890123456789012345678901234567890", + pluginRepo: { + id: "0x1234567890123456789012345678901234567890", + subdomain: "multisig" + }, + versionTag: { + build: 1, + release: 1 + }, + pluginAddress: "0x1234567890123456789012345678901234567890", + permissions: [ + { + who: "0x1234567890123456789012345678901234567890", + where: "0x1234567890123456789012345678901234567890", + permissionId: "0x12345678", + condition: "0x1234567890123456789012345678901234567890" + } + ] + helpers: ["0x1234567890123456789012345678901234567890"],; + data: new Uint8Array() + } +] + ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/01-client/index.md b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/index.md new file mode 100644 index 00000000..9bbe7be1 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/01-client/index.md @@ -0,0 +1,24 @@ +--- +title: Client Setup +--- + +## Setting Up the SDK Client + +Next thing you'll want to do is set up the general purpose client so you can call on the SDK functions. This client is used to interact with any DAO on the network you're connected to. + +The `Client` class that can be imported via `@aragon/sdk-client` allows you to perform operations that apply to all DAOs, regardless of the plugins they use. + +We also have clients for each plugin, which allow us to use the plugin-specific functions. + +Clients can be stored in a singleton and inherited from there. Can also be stored in a [context hook](https://www.freecodecamp.org/news/react-context-for-beginners/) for easier use throughout your Javascript framework. + +```ts +import { Client } from "@aragon/sdk-client"; +import { context } from "../index"; + +// Instantiate the general purpose client from the Aragon OSx SDK context. +const client: Client = new Client(context); +console.log(client); +``` + + diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/01-installation.md b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/01-installation.md new file mode 100644 index 00000000..05fac9f4 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/01-installation.md @@ -0,0 +1,100 @@ +--- +title: Create Multisig DAO +--- + +## Create a DAO with a Multisig Installed + +The Mutisig plugin is a governance plugin which enables x out of y signers to approve a proposal in order for it to pass. +It establishes a minimum approval threshold and a list of addresses which are allowed to vote. + +In order to create a DAO with a Multisig plugin, you will need to first instantiate the Multisig plugin client, then use it when creating your DAO. + +```ts +import { + Client, + CreateDaoParams, + DaoCreationSteps, + MultisigClient, + MultisigPluginInstallParams, +} from "@aragon/sdk-client"; +import { GasFeeEstimation } from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Instantiate a client from the Aragon OSx SDK context. +const client: Client = new Client(context); + +// Addresses which will be allowed to vote in the Multisig plugin. +const members: string[] = [ + "0x1234567890123456789012345678901234567890", + "0x2345678901234567890123456789012345678901", + "0x3456789012345678901234567890123456789012", + "0x4567890123456789012345678901234567890123", +]; + +const multisigPluginIntallParams: MultisigPluginInstallParams = { + votingSettings: { + minApprovals: 1, + onlyListed: true, + }, + members, +}; + +// Encodes the parameters of the Multisig plugin. These will get used in the installation plugin for the DAO. +const multisigPluginInstallItem = MultisigClient.encoding + .getPluginInstallItem(multisigPluginIntallParams, "goerli"); + +// Pin metadata to IPFS, returns IPFS CID string. +const metadataUri: string = await client.methods.pinMetadata({ + name: "My DAO", + description: "This is a description", + avatar: "", // image url + links: [{ + name: "Web site", + url: "https://...", + }], +}); + +const createParams: CreateDaoParams = { + metadataUri, + ensSubdomain: "my-org", // my-org.dao.eth + plugins: [multisigPluginInstallItem], +}; + +// Estimate gas for the transaction. +const estimatedGas: GasFeeEstimation = await client.estimation.createDao( + createParams, +); +console.log({ avg: estimatedGas.average, max: estimatedGas.max }); + +// Creates a DAO with a Multisig plugin installed. +const steps = client.methods.createDao(createParams); +for await (const step of steps) { + try { + switch (step.key) { + case DaoCreationSteps.CREATING: + console.log({ txHash: step.txHash }); + break; + case DaoCreationSteps.DONE: + console.log({ + daoAddress: step.address, + pluginAddresses: step.pluginAddresses, + }); + break; + } + } catch (err) { + console.error(err); + } +} +``` + + +Returns: +```tsx +{ + txHash: "0xb1c14a49...3e8620b0f5832d61c" +} +{ + daoAddress: "0xb1c14a49...3e8620b0f5832d61c", + pluginAddresses: ["0xb1c14a49...3e8620b0f5832d61c", "0xb1c14a49...3e8620b0f5832d61c"] +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/02-create-proposal.md b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/02-create-proposal.md new file mode 100644 index 00000000..5e1a4f02 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/02-create-proposal.md @@ -0,0 +1,83 @@ +--- +title: Create a Proposal +--- + +## Create a Multisig Proposal + +Creates a proposal whose governance mechanism is the Multisig plugin and its defined configuration. + +```ts +import { + CreateMultisigProposalParams, + MultisigClient, + ProposalCreationSteps, +} from "@aragon/sdk-client"; +import { ProposalMetadata } from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Insantiate a Multisig plugin client. +const multisigClient: MultisigClient = new MultisigClient(context); + +const proposalMetadata: ProposalMetadata = { + title: "Test Proposal", + summary: "This is a short description", + description: "This is a long description", + resources: [ + { + name: "Discord", + url: "https://discord.com/...", + }, + { + name: "Website", + url: "https://website...", + }, + ], + media: { + logo: "https://...", + header: "https://...", + }, +}; + +// Pins the metadata to IPFS and gets back an IPFS URI. +const metadataUri: string = await multisigClient.methods.pinMetadata( + proposalMetadata, +); + +const proposalParams: CreateMultisigProposalParams = { + pluginAddress: "0x1234567890123456789012345678901234567890", + metadataUri, + // Boolean array indicating the actions that can and cannot fail + // when the proposal is executed. + failSafeActions: [], + actions: [], // optional - if left as an empty array, no action will be set for the proposal. the action needs to be encoded and will be executed once a proposal passes. +}; + +// Generates a proposal with the withdraw action as passed in the proposalParams. +const steps = multisigClient.methods.createProposal(proposalParams); + +for await (const step of steps) { + try { + switch (step.key) { + case ProposalCreationSteps.CREATING: + console.log({ txHash: step.txHash }); + break; + case ProposalCreationSteps.DONE: + console.log({ proposalId: step.proposalId }); + break; + } + } catch (err) { + console.error(err); + } +} +``` + + +Returns: +```tsx +{ + txHash: "0xb1c14a49...3e8620b0f5832d61c" +} +{ + proposalId: "0xb1c14a49...3e862_0x0", +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/03-create-proposal-with-actions.md b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/03-create-proposal-with-actions.md new file mode 100644 index 00000000..e4a1fe52 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/03-create-proposal-with-actions.md @@ -0,0 +1,97 @@ +--- +title: Create a Proposal with Actions +--- + +## Create a Multisig Proposal + +Creates a proposal with actions whose governance mechanism is the Multisig plugin and its defined configuration. +The actions are what will get executed once the proposal passes. + +```ts +import { + Client, + CreateMultisigProposalParams, + MultisigClient, + ProposalCreationSteps, + WithdrawParams, +} from "@aragon/sdk-client"; +import { ProposalMetadata, TokenType } from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Instantiate an Aragon OSx SDK client. +const client: Client = new Client(context); + +// Insantiate a Multisig plugin client. +const multisigClient: MultisigClient = new MultisigClient(context); + +const proposalMetadata: ProposalMetadata = { + title: "Test Proposal", + summary: "This is a short description", + description: "This is a long description", + resources: [ + { + name: "Discord", + url: "https://discord.com/...", + }, + { + name: "Website", + url: "https://website...", + }, + ], + media: { + logo: "https://...", + header: "https://...", + }, +}; + +// Pins the metadata to IPFS and gets back an IPFS URI. +const metadataUri: string = await multisigClient.methods.pinMetadata( + proposalMetadata, +); + +// An action the proposal could take. This is only an example of an action. You can find all encoded actions within our encoders section. +const withdrawParams: WithdrawParams = { + amount: BigInt(10), // amount in wei + tokenAddress: "0x1234567890123456789012345678901234567890", // ERC20 token's contract address to withdraw + type: TokenType.ERC20, + recipientAddressOrEns: "0x1234567890123456789012345678901234567890", // address or ENS name to send the assets to +}; + +// Encodes the action of withdrawing assets from a given DAO's vault and transfers them over to the recipient address. +const withdrawAction = await client.encoding.withdrawAction(withdrawParams); + +const proposalParams: CreateMultisigProposalParams = { + pluginAddress: "0x1234567890123456789012345678901234567890", + metadataUri, + actions: [withdrawAction], // optional - if left as an empty array, no action will be set for the proposal. the action needs to be encoded and will be executed once a proposal passes. +}; + +// Generates a proposal with the withdraw action as passed in the proposalParams. +const steps = multisigClient.methods.createProposal(proposalParams); + +for await (const step of steps) { + try { + switch (step.key) { + case ProposalCreationSteps.CREATING: + console.log({ txHash: step.txHash }); + break; + case ProposalCreationSteps.DONE: + console.log({ proposalId: step.proposalId }); + break; + } + } catch (err) { + console.error(err); + } +} +``` + + +Returns: +```tsx +{ + txHash: "0xb1c14a49...3e8620b0f5832d61c" +} +{ + proposalId: "0xb1c14a49...3e862_0x0", +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/04-can-approve.md b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/04-can-approve.md new file mode 100644 index 00000000..05c4081c --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/04-can-approve.md @@ -0,0 +1,31 @@ +--- +title: Check Approval Rights +--- + +## Check if a User Can Approve in a Multisig Proposal + +Checks whether a user is able to participate in a proposal created using the Multisig plugin. + +```ts +import { CanApproveParams, MultisigClient } from "@aragon/sdk-client"; +import { context } from "../index"; + +// Instantiate a Multisig client. +const client: MultisigClient = new MultisigClient(context); + +const canApproveParams: CanApproveParams = { + approverAddressOrEns: "0x1234567890123456789012345678901234567890", + proposalId: "0x1234567890123456789012345678901234567890_0x0", +}; + +// Checks whether the addressOrEns provided is able to approve a given proposal created with the pluginAddress. +const canApprove = await client.methods.canApprove(canApproveParams); +console.log(canApprove); +``` + + +Returns: + +``` + true +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/05-approve-proposal.md b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/05-approve-proposal.md new file mode 100644 index 00000000..80884b84 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/05-approve-proposal.md @@ -0,0 +1,51 @@ +--- +title: Approve Proposal +--- + +## Approve a Multisig Proposal + +A member of a Multisig plugin is an address that is able to give their approval for a transaction to go through. +This function enables Multisig members to approve a proposal. + +```ts +import { + ApproveMultisigProposalParams, + ApproveProposalStep, + MultisigClient, +} from "@aragon/sdk-client"; +import { context } from "../index"; + +// Insantiate a plugin context from the Aragon OSx SDK context. + +// Instantiate a Multisig client +const multisigClient = new MultisigClient(context); + +const approveParams: ApproveMultisigProposalParams = { + proposalId: "0x1234567890123456789012345678901234567890_0x0", + tryExecution: true, +}; + +const steps = multisigClient.methods.approveProposal(approveParams); + +for await (const step of steps) { + try { + switch (step.key) { + case ApproveProposalStep.APPROVING: + console.log({ txHash: step.txHash }); + break; + case ApproveProposalStep.DONE: + break; + } + } catch (err) { + console.error(err); + } +} +``` + + +Returns: +```tsx +{ + txHash: "0xb1c14a49...3e8620b0f5832d61c" +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/06-can-execute.md b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/06-can-execute.md new file mode 100644 index 00000000..f3f281f4 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/06-can-execute.md @@ -0,0 +1,28 @@ +--- +title: Check Execution +--- + +## Check if a User Can Execute an Proposal + +Checks whether the signer of the transaction is able to execute actions approved and created by proposals from the Multisig plugin. + +```ts +import { MultisigClient } from "@aragon/sdk-client"; +import { context } from "../index"; + +// Instantiate a Multisig client. +const multisigClient: MultisigClient = new MultisigClient(context); + +const proposalId: string = "0x1234567890123456789012345678901234567890_0x0"; + +// Checks whether the signer of the transaction can execute a given proposal. +const canExecute = await multisigClient.methods.canExecute(proposalId); +console.log(canExecute); +``` + + +Returns: + +``` +true +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/07-execute-proposal.md b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/07-execute-proposal.md new file mode 100644 index 00000000..c46163d0 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/07-execute-proposal.md @@ -0,0 +1,44 @@ +--- +title: Execute Proposal +--- + +## Execute a Multisig Proposal + +Executes the actions set within a proposal made using the Multisig plugin. + +```ts +import { ExecuteProposalStep, MultisigClient } from "@aragon/sdk-client"; +import { context } from "../index"; + +// Insantiate a plugin context from the Aragon OSx SDK context. + +// Insantiate a Multisig client. +const multisigClient = new MultisigClient(context); + +const proposalId: string = "0x1234567890123456789012345678901234567890_0x0"; + +// Executes the actions of a Multisig proposal. +const steps = multisigClient.methods.executeProposal(proposalId); + +for await (const step of steps) { + try { + switch (step.key) { + case ExecuteProposalStep.EXECUTING: + console.log({ txHash: step.txHash }); + break; + case ExecuteProposalStep.DONE: + break; + } + } catch (err) { + console.error(err); + } +} +``` + + +Returns: +```tsx +{ + txHash: "0xb1c14a49...3e8620b0f5832d61c" +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/08-get-proposal.md b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/08-get-proposal.md new file mode 100644 index 00000000..7fa2501a --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/08-get-proposal.md @@ -0,0 +1,67 @@ +--- +title: Get Proposal +--- + +## Get a Multisig Proposal by Its ID + +Get the proposal details of a given proposal made using the Multisig plugin. + +```ts +import { MultisigClient, MultisigProposal } from "@aragon/sdk-client"; +import { context } from "../index"; + +// Instantiate a Multisig client +const multisigClient: MultisigClient = new MultisigClient(context); + +const proposalId: string = "0x1234567890123456789012345678901234567890_0x0"; + +const multisigProposal: MultisigProposal | null = await multisigClient.methods + .getProposal(proposalId); +console.log(multisigProposal); +``` + + +Returns: + +``` +{ + id: "0x1234567890123456789012345678901234567890_0x0", + dao: { + address: "0x1234567890123456789012345678901234567890", + name: "Cool DAO" + }, + creatorAddress: "0x1234567890123456789012345678901234567890", + metadata: { + title: "Test Proposal", + summary: "Test Proposal Summary", + description: "This is a long description", + resources: [ + { + url: "https://dicord.com/...", + name: "Discord" + }, + { + url: "https://docs.com/...", + name: "Document" + } + ], + media: { + header: "https://.../image.jpeg", + logo: "https://.../image.jpeg" + } + }, + creationDate: , + actions: [ + { + to: "0x12345..." + value: 10n + data: [12,13,154...] + } + ], + status: "Executed", + approvals: [ + "0x123456789123456789123456789123456789", + "0x234567891234567891234567891234567890" + ] +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/09-get-proposals.md b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/09-get-proposals.md new file mode 100644 index 00000000..0e928cd0 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/09-get-proposals.md @@ -0,0 +1,68 @@ +--- +title: Get Proposals +--- + +## Get All Multisig Proposals That Have Been Created + +Gets the proposals made using the Multisig plugin for a given DAO. + +```ts +import { + MultisigClient, + MultisigProposalListItem, + ProposalQueryParams, + ProposalSortBy, +} from "@aragon/sdk-client"; +import { ProposalStatus, SortDirection } from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Instantiate a Multisig client +const multisigClient: MultisigClient = new MultisigClient(context); + +const queryParams: ProposalQueryParams = { + skip: 0, // optional + limit: 10, // optional + direction: SortDirection.ASC, // optional. otherwise, DESC + sortBy: ProposalSortBy.CREATED_AT, //optional. otherwise, NAME, VOTES (POPULARITY coming soon) + status: ProposalStatus.ACTIVE, // optional. otherwise, PENDING, SUCCEEDED, EXECUTED, DEFEATED + daoAddressOrEns: "0x1234348529348570294650287698237520938574284357", // or my-dao.dao.eth +}; + +const multisigProposals: MultisigProposalListItem[] = await multisigClient + .methods.getProposals(queryParams); +console.log(multisigProposals); +``` + + +Returns: + +``` +[ + { + id: "0x12345...", + dao: { + address: "0x1234567890123456789012345678901234567890", + name: "Cool DAO" + }; + creatorAddress: "0x1234567890123456789012345678901234567890", + metadata: { + title: "Test Proposal", + summary: "Test Proposal Summary" + }; + status: "Executed" + }, + { + id: "0x12345...", + dao: { + address: "0x1234567890123456789012345678901234567890", + name: "Cool DAO" + }; + creatorAddress: "0x1234567890123456789012345678901234567890", + metadata: { + title: "Test Proposal 2", + summary: "Test Proposal Summary 2" + }; + status: "Pending" + } +] +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/10-get-voting-settings.md b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/10-get-voting-settings.md new file mode 100644 index 00000000..f2b34651 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/10-get-voting-settings.md @@ -0,0 +1,30 @@ +--- +title: Get Settings +--- + +## Get the Multisig Plugin Settings + +Get the settings of a Multisig plugin from a specific DAO. + +```ts +import { MultisigClient, MultisigVotingSettings } from "@aragon/sdk-client"; +import { context } from "../index"; + +// Insantiate a Multisig client. +const multisigClient: MultisigClient = new MultisigClient(context); + +const daoAddressorEns: string = "0x12345348523485623984752394854320"; + +const multisigVotingSettings: MultisigVotingSettings = await multisigClient + .methods.getVotingSettings(daoAddressorEns); +console.log(multisigVotingSettings); +``` + + +Returns: +```json +{ + minApprovals: 4, + onlyListed: true +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/11-get-members.md b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/11-get-members.md new file mode 100644 index 00000000..828010dc --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/11-get-members.md @@ -0,0 +1,33 @@ +--- +title: Get Members +--- + +## Get DAO Members Introduced by the Multisig Plugin + +Gets the list of addresses able to participate in a Multisig proposal for a given DAO that has the Multisig plugin installed. + +```ts +import { MultisigClient } from "@aragon/sdk-client"; +import { context } from "../index"; + +// Instantiate a Multisig plugin client. +const multisigClient: MultisigClient = new MultisigClient(context); + +const daoPluginAddress: string = "0x1234548357023847502348"; // The address of the plugin that DAO has installed. You can find this through calling `getDao(daoAddress)` and getting the DAO details . + +const multisigMembers: string[] = await multisigClient.methods.getMembers( + { pluginAddress: daoPluginAddress }, +); +console.log(multisigMembers); +``` + + +Returns: + +``` +[ + "0x1234567890...", + "0x2345678901...", + "0x3456789012..." +] +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/12-pin-metadata.md b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/12-pin-metadata.md new file mode 100644 index 00000000..8b9edd98 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/12-pin-metadata.md @@ -0,0 +1,46 @@ +--- +title: Pin Metadata +--- + +## Add and Pin Metadata for the Multisig plugin + +Adds an pin data into one of the specified IPFS nodes and return a IPFS CID preceded by "ipfs://" + +```ts +import { MultisigClient } from "@aragon/sdk-client"; +import { ProposalMetadata } from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Instantiate a Multisig plugin client. +const multisigClient: MultisigClient = new MultisigClient(context); + +const metadata: ProposalMetadata = { + title: "Test Proposal", + summary: "This is a short description", + description: "This is a long description", + resources: [ + { + name: "Discord", + url: "https://discord.com/...", + }, + { + name: "Website", + url: "https://website...", + }, + ], + media: { + logo: "https://...", + header: "https://...", + }, +}; + +const metadataUri: string = await multisigClient.methods.pinMetadata(metadata); +console.log(metadataUri); +``` + + +Returns: + +```json +"ipfs://Qm..." +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/13-prepare-installation.md b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/13-prepare-installation.md new file mode 100644 index 00000000..d792b0ea --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/13-prepare-installation.md @@ -0,0 +1,71 @@ +--- +title: Prepare Installation +--- + +## Prepare the Installation of a Multisig Plugin + +```ts +import { + MultisigClient, + MultisigPluginPrepareInstallationParams, +} from "@aragon/sdk-client"; +import { PrepareInstallationStep } from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Create an Multisig client. +const multisigClient: MultisigClient = new MultisigClient( + context, +); + +const installationParams: MultisigPluginPrepareInstallationParams = { + settings: { + votingSettings: { + minApprovals: 5, + onlyListed: true, + }, + members: [ + "0x1234567890123456789012345678901234567890", + ], + }, + daoAddressOrEns: "0x1234567890123456789012345678901234567890", +}; +const steps = multisigClient.methods.prepareInstallation(installationParams); +for await (const step of steps) { + switch (step.key) { + case PrepareInstallationStep.PREPARING: + console.log({ txHash: step.txHash }); + break; + case PrepareInstallationStep.DONE: + console.log({ step }); + break; + } +} +``` + + +Returns: +```tsx +{ + txHash: "0xb1c14a49...3e8620b0f5832d61c" +} +{ + step: { + helpers: ["0x12345...", "0x12345..."] + pluginRepo: "0x12345...", + pluginAdddres: "0x12345...", + versionTag: { + build: 1, + release: 1 + }, + permissions: [ + { + condition: "0x12345...", + who: "0x12345...", + where: "0x12345...", + operation: 1, // GRANT + permissionId: "0x1234567890..." + } + ] + } +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/14-prepare-update.md b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/14-prepare-update.md new file mode 100644 index 00000000..383cd7fc --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/14-prepare-update.md @@ -0,0 +1,100 @@ +--- +title: Prepare Update +--- + +### Prepare the Update of the Multisig plugin + +The `prepareUpdate` method performs the prior steps so that a DAO proposal can eventually apply the the update the multisig plugin. +The proposal will need an Action calling the `applyUpdate` function. + +```ts +import { + MultisigClient, + MultisigPluginPrepareUpdateParams, + PrepareUpdateStep, +} from "@aragon/sdk-client"; +import { context } from "../index"; + +// Instantiate the general purpose client from the Aragon OSx SDK context. +const client: MultisigClient = new MultisigClient(context); + +const updateAbi = [/* ... */]; + +const prepareUpdateParams: MultisigPluginPrepareUpdateParams = { + daoAddressOrEns: "0x1234567890123456789012345678901234567890", // my-dao.dao.eth + pluginAddress: "0x2345678901234567890123456789012345678901", + newVersion: { + build: 2, + release: 1, + }, + updateParams: [ + // Example parameters needed by the plugin's prepareUpdate function + 1234, + "0x1234567890123456789012345678901234567890", + ], + updateAbi, +}; + +// Estimate how much gas the transaction will cost. +const estimatedGas = await client.estimation + .prepareUpdate( + prepareUpdateParams, + ); +console.log({ avg: estimatedGas.average, max: estimatedGas.max }); + +// Deposit the ERC20 tokens. +const steps = client.methods.prepareUpdate(prepareUpdateParams); +for await (const step of steps) { + try { + switch (step.key) { + case PrepareUpdateStep.PREPARING: + console.log({ txHash: step.txHash }); + break; + case PrepareUpdateStep.DONE: + console.log({ + permissions: step.permissions, + pluginAddress: step.pluginAddress, + pluginRepo: step.pluginRepo, + versionTag: step.versionTag, + initData: step.initData, + helpers: step.helpers, + }); + break; + } + } catch (err) { + console.error(err); + } +} +``` + + +Returns: + ```tsx + { + txhash: "0xb1c14a49...3e8620b0f5832d61c" + } + { + permissions: [ + { + operation: 1, // revoke + where: "0x12345...", + who: "0x23456...", + permissionId: "0x1234567890..." + }, + { + operation: 1, //REVOKE + where: "0x3456...", + who: "0x4567...", + permissionId: "0x1234567890..." + } + ], + pluginAddress: "0x1234567890...", + pluginRepo: "0x1234567890...", + initData: Uint8Array(0) [], + versionTag: { + build: 1, + release: 1 + }, + helpers: ["0x12345...", "0x12345..."] + } + ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/15-is-member.md b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/15-is-member.md new file mode 100644 index 00000000..726954b6 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/15-is-member.md @@ -0,0 +1,29 @@ +--- +title: Is Member +--- + +### Check if an address is a member of Multisig DAO in a specific block and plugin + +The is member function receives the plugin address and the address to check as parameters and returns a boolean value. + +```ts +import { MultisigClient } from "@aragon/sdk-client"; +import { context } from "../index"; + +// Instantiate the multisig client from the Aragon OSx SDK context. +const client: MultisigClient = new MultisigClient(context); + +const isMember = await client.methods.isMember({ + pluginAddress: "0x2345678901234567890123456789012345678901", + address: "0x1234567890123456789012345678901234567890", + blockNumber: 12345678, +}); + +console.log(isMember); +``` + + +Returns: + ```tsx + true + ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/index.md b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/index.md new file mode 100644 index 00000000..5bfb6a48 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/02-multisig-client/index.md @@ -0,0 +1,21 @@ +--- +title: Multisig Client +--- + +## Create a Multisig Client + +Creating a Multisig plugin Client allows you to access the Multisig plugin from your DAO. +In order to interact with the Multisig plugin, you need to create a `MultisigClient`. This is created using the `ContextPlugin`. + +```ts +import { MultisigClient } from "@aragon/sdk-client"; +import { context } from "../index"; + +// Create a plugin context from the Aragon OSx SDK context. + +// Creates a Multisig plugin client. +const multisigClient: MultisigClient = new MultisigClient(context); +console.log(multisigClient); +``` + + diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/01-installation.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/01-installation.md new file mode 100644 index 00000000..1196d318 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/01-installation.md @@ -0,0 +1,139 @@ +--- +title: Create Token Voting DAO +--- + +## Create a DAO with a Token Voting Plugin Installed + +Creates a DAO with the TokenVoting plugin installed off the bat. + +```ts +import { + Client, + CreateDaoParams, + DaoCreationSteps, + DaoMetadata, + TokenVotingClient, + TokenVotingPluginInstall, + VotingMode, +} from "@aragon/sdk-client"; +import { GasFeeEstimation } from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Insantiate the general purpose client from the Aragon OSx SDK context. +const client: Client = new Client(context); + +// You can do different types of installations, depending on your needs. +// For ex, these would be the plugin params if you want to use an already-existing ERC20 token. +const tokenVotingPluginInstallParams1: TokenVotingPluginInstall = { + votingSettings: { + minDuration: 60 * 60 * 24 * 2, // seconds (minimum amount is 3600) + minParticipation: 0.25, // 25% + supportThreshold: 0.5, // 50% + minProposerVotingPower: BigInt("5000"), // default 0 + votingMode: VotingMode.STANDARD, // default standard, other options: EARLY_EXECUTION, VOTE_REPLACEMENT + }, + useToken: { + tokenAddress: "0x23847102387419273491234", // contract address of the token to use as the voting token + wrappedToken: { + name: "Wrapped Token", // the name of your token + symbol: "WTK", // the symbol for your token. shouldn't be more than 5 letters + }, + }, +}; + +// These would be the plugin params if you need to mint a new token for the DAO to enable TokenVoting. +const tokenVotingPluginInstallParams2: TokenVotingPluginInstall = { + votingSettings: { + minDuration: 60 * 60 * 24 * 2, // seconds (minimum amount is 3600) + minParticipation: 0.25, // 25% + supportThreshold: 0.5, // 50% + minProposerVotingPower: BigInt("5000"), // default 0 + votingMode: VotingMode.EARLY_EXECUTION, // default is STANDARD. other options: EARLY_EXECUTION, VOTE_REPLACEMENT + }, + newToken: { + name: "Token", // the name of your token + symbol: "TOK", // the symbol for your token. shouldn't be more than 5 letters + decimals: 18, // the number of decimals your token uses + minter: "0x...", // optional. if you don't define any, we'll use the standard OZ ERC20 contract. Otherwise, you can define your own token minter contract address. + balances: [ + { // Defines the initial balances of the new token + address: "0x2371238740123847102983471022", // address of the account to receive the newly minted tokens + balance: BigInt(10), // amount of tokens that address should receive + }, + { + address: "0x0237123874012384710298347102", + balance: BigInt(10), + }, + { + address: "0x2237123874012384710298347102", + balance: BigInt(10), + }, + ], + }, +}; + +// Creates a TokenVoting plugin client with the parameteres defined above (with an existing token). +const tokenVotingPluginInstallItem1 = TokenVotingClient.encoding + .getPluginInstallItem(tokenVotingPluginInstallParams1, "goerli"); +// Creates a TokenVoting plugin client with the parameteres defined above (with newly minted tokens). +const tokenVotingPluginInstallItem2 = TokenVotingClient.encoding + .getPluginInstallItem(tokenVotingPluginInstallParams2, "goerli"); + +const daoMetadata: DaoMetadata = { + name: "My DAO", + description: "This is a description", + avatar: "", + links: [{ + name: "Web site", + url: "https://...", + }], +}; + +// Pins the DAO's metadata in IPFS to get back the URI. +const metadataUri: string = await client.methods.pinMetadata(daoMetadata); + +const createParams: CreateDaoParams = { + metadataUri, + ensSubdomain: "my-org", // my-org.dao.eth + plugins: [tokenVotingPluginInstallItem1, tokenVotingPluginInstallItem2], // optional, this will determine the plugins installed in your DAO upon creation. 1 is mandatory, more than that is optional based on the DAO's needs. +}; + +// Estimate how much gas the transaction will cost. +const estimatedGas: GasFeeEstimation = await client.estimation.createDao( + createParams, +); +console.log({ avg: estimatedGas.average, max: estimatedGas.max }); + +// Create the DAO with the two token voting plugins installed. This means that the DAO will be able to use either of the two tokens to vote depending on which TokenVoting plugin created the proposal. +const steps = client.methods.createDao(createParams); + +for await (const step of steps) { + try { + switch (step.key) { + case DaoCreationSteps.CREATING: + console.log({ txHash: step.txHash }); + break; + case DaoCreationSteps.DONE: + console.log({ + daoAddress: step.address, + pluginAddresses: step.pluginAddresses, + }); + break; + } + } catch (err) { + console.error(err); + } +} +``` + + +Returns: +```tsx +{ + txHash: "0xb1c14a49...3e8620b0f5832d61c" +} +{ + daoAddress: "0xb1c14a49...3e8620b0f5832d61c", + pluginAddresses: ["0xb1c14a49...3e8620b0f5832d61c", "0xb1c14a49...3e8620b0f5832d61c"] +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/02-create-proposal.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/02-create-proposal.md new file mode 100644 index 00000000..2a30ecc2 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/02-create-proposal.md @@ -0,0 +1,90 @@ +--- +title: Create Proposal +--- + +## Create a Token Voting Proposal + +In order to use the Token Voting governance mechanism within your DAO, you'll want to ensure your DAO has the TokenVoting plugin installed. +Then, you can create proposals using the `createProposal` method in your `TokenVotingClient`. + +```ts +import { + CreateMajorityVotingProposalParams, + ProposalCreationSteps, + TokenVotingClient, + VoteValues, +} from "@aragon/sdk-client"; +import { ProposalMetadata } from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Create a TokenVoting client. +const tokenVotingClient: TokenVotingClient = new TokenVotingClient( + context, +); + +const metadata: ProposalMetadata = { + title: "Test Proposal", + summary: "This is a short description", + description: "This is a long description", + resources: [ + { + name: "Discord", + url: "https://discord.com/...", + }, + { + name: "Website", + url: "https://website...", + }, + ], + media: { + logo: "https://...", + header: "https://...", + }, +}; + +// Pin the metadata in IPFS to get back the URI. +const metadataUri: string = await tokenVotingClient.methods.pinMetadata( + metadata, +); + +const pluginAddress: string = "0x1234567890123456789012345678901234567890"; // the address of the plugin contract containing all plugin logic. + +const proposalParams: CreateMajorityVotingProposalParams = { + pluginAddress, + metadataUri, + actions: [], + startDate: new Date(), + endDate: new Date(), + executeOnPass: false, + creatorVote: VoteValues.YES, // default NO, other options: ABSTAIN, YES. This saves gas for the voting transaction. +}; + +// Create a proposal where members participate through token voting. +const steps = tokenVotingClient.methods.createProposal(proposalParams); + +for await (const step of steps) { + try { + switch (step.key) { + case ProposalCreationSteps.CREATING: + console.log({ txHash: step.txHash }); + break; + case ProposalCreationSteps.DONE: + console.log({ proposalId: step.proposalId }); + break; + } + } catch (err) { + console.error(err); + } +} +``` + + +Returns: +```tsx +{ + txHash: "0xb1c14a49...3e8620b0f5832d61c" +} +{ + proposalId: "0xb1c14a49...3e862_0x0", +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/03-create-proposal-with-actions.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/03-create-proposal-with-actions.md new file mode 100644 index 00000000..9a8444ef --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/03-create-proposal-with-actions.md @@ -0,0 +1,98 @@ +--- +title: Create Proposal with Action +--- + +## Create a Token Voting Proposal with Actions + +Create a proposal with an action using the TokenVoting plugin as its governance mechanism. +An action is the encoded transaction which will get executed when a proposal passes. + +```ts +import { + CreateMajorityVotingProposalParams, + ProposalCreationSteps, + TokenVotingClient, + VoteValues, + VotingMode, + VotingSettings, +} from "@aragon/sdk-client"; +import { DaoAction } from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Create a TokenVoting client. +const tokenVotingClient: TokenVotingClient = new TokenVotingClient( + context, +); + +// The contract address of the token voting plugin you have installed in your DAO +const pluginAddress: string = "0x1234567890123456789012345678901234567890"; + +// Update +// [Optional] In case you wanted to pass an action to the proposal, you can configure it here and pass it immediately. An action is the encoded transaction which will get executed when a proposal passes. +// In this example, we are creating an action to change the settings of a governance plugin to demonstrate how to set it up. +const configActionParams: VotingSettings = { + minDuration: 60 * 60 * 24 * 2, // seconds + minParticipation: 0.25, // 25% + supportThreshold: 0.5, // 50% + minProposerVotingPower: BigInt("5000"), // default 0 + votingMode: VotingMode.EARLY_EXECUTION, // default STANDARD, other options: EARLY_EXECUTION, VOTE_REPLACEMENT +}; +// We need to encode the action so it can executed once the proposal passes. +const updatePluginSettingsAction: DaoAction = tokenVotingClient.encoding + .updatePluginSettingsAction(pluginAddress, configActionParams); + +const metadataUri: string = await tokenVotingClient.methods.pinMetadata({ + title: "Test proposal", + summary: "This is a test proposal", + description: "This is the description of a long test proposal", + resources: [ + { + url: "https://thforumurl.com", + name: "Forum", + }, + ], + media: { + header: "https://fileserver.com/header.png", + logo: "https://fileserver.com/logo.png", + }, +}); + +const proposalParams: CreateMajorityVotingProposalParams = { + pluginAddress: "0x1234567890123456789012345678901234567890", // the address of the TokenVoting plugin contract containing all plugin logic. + metadataUri, + actions: [updatePluginSettingsAction], // optional, if none, leave an empty array `[]` + startDate: new Date(), + endDate: new Date(), + executeOnPass: false, + creatorVote: VoteValues.YES, // default NO, other options: ABSTAIN, YES +}; + +// Creates a proposal using the token voting governance mechanism, which executes with the parameters set in the configAction object. +const steps = tokenVotingClient.methods.createProposal(proposalParams); + +for await (const step of steps) { + try { + switch (step.key) { + case ProposalCreationSteps.CREATING: + console.log(step.txHash); + break; + case ProposalCreationSteps.DONE: + console.log(step.proposalId); + break; + } + } catch (err) { + console.error(err); + } +} +``` + + +Returns: +```tsx +{ + txHash: "0xb1c14a49...3e8620b0f5832d61c" +} +{ + proposalId: "0xb1c14a49...3e862_0x0", +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/04-can-vote.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/04-can-vote.md new file mode 100644 index 00000000..3fae84c9 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/04-can-vote.md @@ -0,0 +1,38 @@ +--- +title: Check Voting Rights +--- + +## Check if an Address Can Vote in a Token Voting proposal + +This function returns a boolean indicating whether an address can vote in a specific TokenVoting proposal. + +```ts +import { + CanVoteParams, + TokenVotingClient, + VoteValues, +} from "@aragon/sdk-client"; +import { context } from "../index"; + +// Create an TokenVoting client. +const tokenVotingClient: TokenVotingClient = new TokenVotingClient( + context, +); + +const canVoteParams: CanVoteParams = { + proposalId: "0x1234567890123456789012345678901234567890_0x0", + voterAddressOrEns: "0x1234567890123456789012345678901234567890", // your-plugin.plugin.dao.eth + vote: VoteValues.YES, // alternatively, could be NO or ABSTAIN. +}; + +// Returns true or false depending on whether the address can vote in the specific proposal. +const canVote: boolean = await tokenVotingClient.methods.canVote(canVoteParams); +console.log(canVote); +``` + + +Returns: + +``` +true +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/05-vote-on-proposal.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/05-vote-on-proposal.md new file mode 100644 index 00000000..dbb20c11 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/05-vote-on-proposal.md @@ -0,0 +1,53 @@ +--- +title: Vote +--- + +## Vote on a Token Voting Proposal + +Adds a vote to a proposal using the TokenVoting governance mechanism. +The amount of votes submitted depends on the amount of tokens the signer address has. + +```ts +import { + TokenVotingClient, + VoteProposalParams, + VoteProposalStep, + VoteValues, +} from "@aragon/sdk-client"; +import { context } from "../index"; + +// Create a TokenVoting client. +const tokenVotingClient: TokenVotingClient = new TokenVotingClient( + context, +); + +const voteParams: VoteProposalParams = { + proposalId: "0x1234567890123456789012345678901234567890_0x0", + vote: VoteValues.YES, // alternatively NO, or ABSTAIN +}; + +// Creates a vote on a given proposal created by the token voting governance mechanism. +const steps = tokenVotingClient.methods.voteProposal(voteParams); + +for await (const step of steps) { + try { + switch (step.key) { + case VoteProposalStep.VOTING: + console.log({ txHash: step.txHash }); + break; + case VoteProposalStep.DONE: + break; + } + } catch (err) { + console.error(err); + } +} +``` + + +Returns: +```tsx +{ + txHash: "0xb1c14a49...3e8620b0f5832d61c" +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/06-can-execute.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/06-can-execute.md new file mode 100644 index 00000000..27f5b64c --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/06-can-execute.md @@ -0,0 +1,30 @@ +--- +title: Check Execution +--- + +## Check if a User Can Execute an Proposal + +Checks whether the signer of the transaction is able to execute actions approved and created by proposals from the TokenVoting plugin. + +```ts +import { TokenVotingClient } from "@aragon/sdk-client"; +import { context } from "../index"; + +// Instantiate a TokenVoting client. +const tokenVotingClient: TokenVotingClient = new TokenVotingClient( + context, +); + +const proposalId: string = "0x1234567890123456789012345678901234567890_0x0"; + +// Checks whether the signer of the transaction can execute a given proposal. +const canExecute = await tokenVotingClient.methods.canExecute(proposalId); +console.log(canExecute); +``` + + +Returns: + +``` +true +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/07-execute-proposal.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/07-execute-proposal.md new file mode 100644 index 00000000..83360fbd --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/07-execute-proposal.md @@ -0,0 +1,44 @@ +--- +title: Execute Proposal +--- + +## Execute a TokenVoting Proposal + +Executes the actions set within a proposal made using the TokenVoting plugin. + +```ts +import { ExecuteProposalStep, TokenVotingClient } from "@aragon/sdk-client"; +import { context } from "../index"; + +// Insantiate a plugin context from the Aragon OSx SDK context. + +// Insantiate a TokenVoting client. +const tokenVotingClient = new TokenVotingClient(context); + +const proposalId: string = "0x1234567890123456789012345678901234567890_0x0"; + +// Executes the actions of a TokenVoting proposal. +const steps = tokenVotingClient.methods.executeProposal(proposalId); + +for await (const step of steps) { + try { + switch (step.key) { + case ExecuteProposalStep.EXECUTING: + console.log({ txHash: step.txHash }); + break; + case ExecuteProposalStep.DONE: + break; + } + } catch (err) { + console.error(err); + } +} +``` + + +Returns: +```tsx +{ + txHash: "0xb1c14a49...3e8620b0f5832d61c" +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/08-get-proposal.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/08-get-proposal.md new file mode 100644 index 00000000..8189e16b --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/08-get-proposal.md @@ -0,0 +1,105 @@ +--- +title: Get Proposal +--- + +## Get a Token Voting Proposal by Its ID + +Gets a specific proposal using the TokenVoting plugin as its governance mechanism. + +```ts +import { TokenVotingClient, TokenVotingProposal } from "@aragon/sdk-client"; +import { context } from "../index"; + +// Instantiate a plugin context from an Aragon OSx SDK context. + +// Create a TokenVoting client. +const tokenVotingClient: TokenVotingClient = new TokenVotingClient( + context, +); + +// The address of the proposal you want to retrieve. +const proposalId: string = "0x1234567890123456789012345678901234567890_0x0"; + +// Get a specific proposal created using the TokenVoting plugin. +const tokenVotingProposal: TokenVotingProposal | null = await tokenVotingClient + .methods + .getProposal(proposalId); +console.log(tokenVotingProposal); +``` + + +Returns: + +``` +{ + id: "0x1234567890123456789012345678901234567890_0x0", + dao: { + address: "0x1234567890123456789012345678901234567890", + name: "Cool DAO" + }, + creatorAddress: "0x1234567890123456789012345678901234567890", + metadata: { + title: "Test Proposal", + summary: "test proposal summary", + description: "this is a long description", + resources: [ + { + url: "https://dicord.com/...", + name: "Discord" + }, + { + url: "https://docs.com/...", + "name: "Document" + } + ], + media: { + header: "https://.../image.jpeg", + logo: "https://.../image.jpeg" + } + }, + startDate: , + endDate: , + creationDate: , + creationBlockNumber: 812345, + executionDate: , + executionBlockNumber: 812345, + actions: [ + { + to: "0x12345..." + value: 10n + data: [12,13,154...] + } + ], + result { + yes: 700000n, + no: 300000n, + abstain: 0n + } + settings:{ + minParticipation: 0.5, + supportThreshold: 0.25, + minDuration: 7200 + }, + token: { + address: "0x1234567890123456789012345678901234567890, + name: "The Token", + symbol: "TOK", + decimals: 18 + }, + usedVotingWeight: 1000000n, + votes: [ + { + address: "0x123456789123456789123456789123456789", + vote: 2, // VoteValues.YES + voteWeight: 700000n + }, + { + address: "0x234567891234567891234567891234567890", + vote: 3, // VoteValues.NO + voteWeight: 300000n + } + ] + status: "Executed" +} + +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/09-get-proposals.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/09-get-proposals.md new file mode 100644 index 00000000..0e185384 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/09-get-proposals.md @@ -0,0 +1,97 @@ +--- +title: Get Proposals +--- + +## Get All Token Voting Proposals That Have Been Created + +Gets all proposals from a DAO that are created using the TokenVoting plugin as its governance mechanism. + +```ts +import { + ProposalQueryParams, + ProposalSortBy, + TokenVotingClient, + TokenVotingProposalListItem, +} from "@aragon/sdk-client"; +import { ProposalStatus, SortDirection } from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Create a plugin context from the Aragon SDK. + +// Create a TokenVoting client. +const tokenVotingClient: TokenVotingClient = new TokenVotingClient( + context, +); + +const queryParams: ProposalQueryParams = { + skip: 0, // optional + limit: 10, // optional + direction: SortDirection.ASC, // optional, otherwise DESC ("descending") + sortBy: ProposalSortBy.CREATED_AT, // optional, otherwise NAME, VOTES (POPULARITY coming soon) + status: ProposalStatus.ACTIVE, // optional, otherwise PENDING, SUCCEEDED, EXECUTED, DEFEATED +}; + +const tokenVotingProposals: TokenVotingProposalListItem[] = + await tokenVotingClient.methods.getProposals(queryParams); +console.log(tokenVotingProposals); +``` + + +Returns: + +``` +[ + { + id: "0x12345...", + dao: { + address: "0x1234567890123456789012345678901234567890", + name: "Cool DAO" + }, + creatorAddress: "0x1234567890123456789012345678901234567890", + metadata: { + title: "Test Proposal", + summary: "Test Proposal Summary" + }, + startDate: , + endDate: , + status: "Executed", + token: { + address: "0x1234567890123456789012345678901234567890, + name: "The Token", + symbol: "TOK", + decimals: 18 + }, + results { + yes: 100000n, + no: 77777n, + abstain: 0n + } + }, + { + id: "0x12345...", + dao: { + address: "0x1234567890123456789012345678901234567890", + name: "Cool DAO" + }, + creatorAddress: "0x1234567890123456789012345678901234567890", + metadata: { + title: "Test Proposal 2", + summary: "Test Proposal Summary 2" + }, + startDate: , + endDate: , + status: "Pending", + token: { + address: "0x1234567890123456789012345678901234567890, + name: "The Token", + symbol: "TOK", + decimals: 18 + }, + results { + yes: 100000n, + no: 77777n, + abstain: 0n + } + } +] +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/10-get-voting-settings.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/10-get-voting-settings.md new file mode 100644 index 00000000..166e066b --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/10-get-voting-settings.md @@ -0,0 +1,36 @@ +--- +title: Get Settings +--- + +## Get the Token Voting Plugin Settings + +Gets the settings defined for a specific TokenVoting plugin governance mechanism installed in a DAO. + +```ts +import { TokenVotingClient, VotingSettings } from "@aragon/sdk-client"; +import { context } from "../index"; + +// Create an Addresslist Client +const tokenVotingClient: TokenVotingClient = new TokenVotingClient( + context, +); + +const pluginAddress: string = "0x1234567890123456789012345678901234567890"; + +const tokenVotingSettings: VotingSettings | null = await tokenVotingClient + .methods.getVotingSettings(pluginAddress); +console.log(tokenVotingSettings); +``` + + +Returns: + +``` +{ + minDuration: 10000, // 10 seconds + minParticipation: 0.25, // 25% + supportThreshold: 0.5, // 50% + minProposerVotingPower: BigInt("5000"), + votingMode: "Standard" +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/11-get-members.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/11-get-members.md new file mode 100644 index 00000000..3b163949 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/11-get-members.md @@ -0,0 +1,58 @@ +--- +title: Get Members +--- + +## Get DAO Members Introduced by the Token Voting Plugin + +Returns an array with the addresses of all the members of a specific DAO which has the TokenVoting plugin installed. + +```ts +import { TokenVotingClient, TokenVotingMember } from "@aragon/sdk-client"; +import { context } from "../index"; + +// Create a TokenVoting client +const tokenVotingClient: TokenVotingClient = new TokenVotingClient( + context, +); + +const pluginAddress: string = "0x12345384572394756239846529574932532985"; // The address of the plugin that DAO has installed. You can find this by calling `getDao(daoAddress)` and getting the DAO details . + +const members: TokenVotingMember[] = await tokenVotingClient.methods.getMembers( + { pluginAddress }, +); +console.log(members); +``` + + +Returns: + +```json +[ + { + "address": "0x1234567890123456789012345678901234567890", + "balance": 100n, + "delegatee": "0x2345678901234567890123456789012345678901", + "votingPower": 0n, + "delegators": [] + }, + { + "address": "0x2345678901234567890123456789012345678901", + "balance": 0n, + "delegatee": null, + "votingPower": 100n, + "delegators": [ + { + "address": "0x1234567890123456789012345678901234567890", + "balance": 100n + } + ] + }, + { + "address": "0x3456789012345678901234567890123456789012", + "balance": 200n, + "delegatee": null, + "votingPower": 200n, + "delegators": [] + } +] +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/12-get-token.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/12-get-token.md new file mode 100644 index 00000000..786dcf52 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/12-get-token.md @@ -0,0 +1,65 @@ +--- +title: Get Token Details +--- + +## Get Token Details + +Returns the token details used in the TokenVoting plugin for a given DAO. +These are the details of the token used to vote in that specific DAO. + +```ts +import { TokenVotingClient } from "@aragon/sdk-client"; +import { context } from "../index"; + +// Create a TokenVoting client. +const tokenVotingClient: TokenVotingClient = new TokenVotingClient( + context, +); + +// The address of the TokenVoting plugin whose token you want to retrieve details about. +const pluginAddress: string = "0x1234567890123456789012345678901234567890"; + +// Get the token details used in the TokenVoting plugin for a given DAO. +// ERC721 Token coming soon! +const tokenDetails = await tokenVotingClient.methods.getToken(pluginAddress); +console.log(tokenDetails); +``` + + +Returns: + +``` +{ + type: 'erc20', + address: "0x1234567890987654323112345678900987654321", + name: "Token", + symbol: "TOK", + decimals: 18 +} +``` +Or: +``` +{ + address: '0x1234567890987654323112345678900987654321', + name: 'Wrapped Token', + symbol: 'wTOK', + decimals: 18, + underlyingToken: { + address: '0x012345678900098765432311234567890098765432', + name: 'Token', + symbol: 'TOK', + decimals: 18, + type: 'erc20' + }, + type: 'erc20' +} +``` +Or: +``` +{ + type: 'erc721', + address: "0x1234567890987654323112345678900987654321", + name: "Token", + symbol: "TOK" +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/13-pin-metadata.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/13-pin-metadata.md new file mode 100644 index 00000000..1a46ef2e --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/13-pin-metadata.md @@ -0,0 +1,51 @@ +--- +title: Pin Metadata +--- + +## Add and Pin Metadata + +Adds and pins data with into one of the specified IPFS nodes and return an IPFS CID preceded by "ipfs://". + +```ts +import { TokenVotingClient } from "@aragon/sdk-client"; +import { ProposalMetadata } from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Create an TokenVoting client. +const tokenVotingClient: TokenVotingClient = new TokenVotingClient( + context, +); + +const metadata: ProposalMetadata = { + title: "Test Proposal", + summary: "This is a short description", + description: "This is a long description", + resources: [ + { + name: "Discord", + url: "https://discord.com/...", + }, + { + name: "Website", + url: "https://website...", + }, + ], + media: { + logo: "https://...", + header: "https://...", + }, +}; + +// Pin the metadata in IPFS to get back the URI. +const metadataUri: string = await tokenVotingClient.methods.pinMetadata( + metadata, +); +console.log(metadataUri); +``` + + +Returns: + +```json +"ipfs://Qm..." +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/14-prepare-installation.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/14-prepare-installation.md new file mode 100644 index 00000000..55dfb022 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/14-prepare-installation.md @@ -0,0 +1,83 @@ +--- +title: Prepare Installation +--- + +## Prepare the Installation of a Token Voting Plugin + +```ts +import { + TokenVotingClient, + TokenVotingPluginPrepareInstallationParams, + VotingMode, +} from "@aragon/sdk-client"; +import { PrepareInstallationStep } from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Create an TokenVoting client. +const tokenVotingClient: TokenVotingClient = new TokenVotingClient( + context, +); + +const installationParams: TokenVotingPluginPrepareInstallationParams = { + settings: { + votingSettings: { + supportThreshold: 0.5, + minParticipation: 0.5, + minDuration: 7200, + minProposerVotingPower: BigInt(1), + votingMode: VotingMode.STANDARD, + }, + newToken: { + name: "test", + decimals: 18, + symbol: "TST", + balances: [ + { + address: "0x1234567890123456789012345678901234567890", + balance: BigInt(10), + }, + ], + }, + }, + daoAddressOrEns: "0x1234567890123456789012345678901234567890", +}; +const steps = tokenVotingClient.methods.prepareInstallation(installationParams); +for await (const step of steps) { + switch (step.key) { + case PrepareInstallationStep.PREPARING: + console.log(step.txHash); + break; + case PrepareInstallationStep.DONE: + console.log({ step }); + break; + } +} +``` + + +Returns: +```tsx +{ + txHash: "0xb1c14a49...3e8620b0f5832d61c" +} +{ + step: { + helpers: ["0x12345...", "0x12345..."] + pluginRepo: "0x12345...", + pluginAdddres: "0x12345...", + versionTag: { + build: 1, + release: 1 + }, + permissions: [ + { + condition: "0x12345...", + who: "0x12345...", + where: "0x12345...", + operation: 1, // GRANT + permissionId: "0x1234567890..." + } + ] + } +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/15-wrap-tokens.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/15-wrap-tokens.md new file mode 100644 index 00000000..cc807230 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/15-wrap-tokens.md @@ -0,0 +1,76 @@ +--- +title: Wrap Tokens +--- + +## Wrap ERC-20 tokens + +```ts +import { + Client, + SetAllowanceSteps, + TokenVotingClient, + WrapTokensStep, +} from "@aragon/sdk-client"; +import { context } from "../index"; + +// Create a TokenVoting client. +const tokenVotingClient: TokenVotingClient = new TokenVotingClient( + context, +); +// Create a TokenVoting client. +const client: Client = new Client( + context, +); + +const amount = BigInt(10); +const wrappedTokenAddress = "0x1234567890123456789012345678901234567890"; +const tokenAddress = "0x2345678901234567890123456789012345678901"; + +// must give the wrapped token contract allowance to wrap the tokens +const setAllowanceSteps = client.methods.setAllowance({ + amount, + spender: wrappedTokenAddress, + tokenAddress, +}); +for await (const step of setAllowanceSteps) { + try { + switch (step.key) { + case SetAllowanceSteps.SETTING_ALLOWANCE: + console.log(step.txHash); + break; + case SetAllowanceSteps.ALLOWANCE_SET: + console.log(step.allowance); + break; + } + } catch (err) { + console.error(err); + } +} + +const wrapTokenSteps = tokenVotingClient.methods.wrapTokens( + { + wrappedTokenAddress, + amount, + }, +); + +for await (const step of wrapTokenSteps) { + try { + switch (step.key) { + case WrapTokensStep.WRAPPING: + console.log(step.txHash); + break; + case WrapTokensStep.DONE: + break; + } + } catch (err) { + console.error(err); + } +} +``` + + +Returns: + ```tsx + "0xb1c14a49...3e8620b0f5832d61c" + ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/16-unwrap-tokens.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/16-unwrap-tokens.md new file mode 100644 index 00000000..ff282e73 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/16-unwrap-tokens.md @@ -0,0 +1,45 @@ +--- +title: Unwrap Tokens +--- + +## Unwrap ERC-20 tokens + +```ts +import { TokenVotingClient, UnwrapTokensStep } from "@aragon/sdk-client"; +import { context } from "../index"; + +// Create a TokenVoting client. +const tokenVotingClient: TokenVotingClient = new TokenVotingClient( + context, +); + +const amount = BigInt(10); +const wrappedTokenAddress = "0x1234567890123456789012345678901234567890"; + +const wrapTokenSteps = tokenVotingClient.methods.unwrapTokens( + { + wrappedTokenAddress, + amount, + }, +); + +for await (const step of wrapTokenSteps) { + try { + switch (step.key) { + case UnwrapTokensStep.UNWRAPPING: + console.log(step.txHash); + break; + case UnwrapTokensStep.DONE: + break; + } + } catch (err) { + console.error(err); + } +} +``` + + +Returns: + ```tsx + "0xb1c14a49...3e8620b0f5832d61c" + ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/17-delegate-tokens.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/17-delegate-tokens.md new file mode 100644 index 00000000..bb5e7a35 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/17-delegate-tokens.md @@ -0,0 +1,50 @@ +--- +title: Delegate Tokens +--- + +## Delegates yout token voting power to another address + +Delegates your token voting power to another address. To recover yout voting power back just delegate to your own address. + +```ts +import { + DelegateTokensParams, + DelegateTokensStep, + TokenVotingClient, +} from "@aragon/sdk-client"; +import { context } from "../index"; + +// Instantiate the general purpose client from the Aragon OSx SDK context. + +// Create a TokenVoting client. +const tokenVotingClient: TokenVotingClient = new TokenVotingClient( + context, +); + +const delegateTokensParams: DelegateTokensParams = { + delegatee: "0x1234567890123456789012345678901234567890", + tokenAddress: "0x1234567890123456789012345678901234567890", // token contract adddress +}; + +const steps = tokenVotingClient.methods.delegateTokens(delegateTokensParams); + +for await (const step of steps) { + try { + switch (step.key) { + case DelegateTokensStep.DELEGATING: + console.log(step.txHash); + break; + case DelegateTokensStep.DONE: + break; + } + } catch (err) { + console.error(err); + } +} +``` + + +Returns: + ```ts + "0xb1c14a49...3e8620b0f5832d61c" + ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/18-undelegate-tokens.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/18-undelegate-tokens.md new file mode 100644 index 00000000..58b0bfba --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/18-undelegate-tokens.md @@ -0,0 +1,43 @@ +--- +title: Undelegate Tokens +--- + +## Undelegates yout token voting power from the delegatee address + +This is the same as delegating to your own address. + +```ts +import { TokenVotingClient, UndelegateTokensStep } from "@aragon/sdk-client"; +import { context } from "../index"; + +// Instantiate the general purpose client from the Aragon OSx SDK context. + +// Create a TokenVoting client. +const tokenVotingClient: TokenVotingClient = new TokenVotingClient( + context, +); + +const tokenAddress = "0x1234567890123456789012345678901234567890"; + +const steps = tokenVotingClient.methods.undelegateTokens(tokenAddress); + +for await (const step of steps) { + try { + switch (step.key) { + case UndelegateTokensStep.UNDELEGATING: + console.log(step.txHash); + break; + case UndelegateTokensStep.DONE: + break; + } + } catch (err) { + console.error(err); + } +} +``` + + +Returns: + ```ts + "0xb1c14a49...3e8620b0f5832d61c" + ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/19-get-delegate.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/19-get-delegate.md new file mode 100644 index 00000000..f80223da --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/19-get-delegate.md @@ -0,0 +1,31 @@ +--- +title: Get Delegatee +--- + +## Get the address of the signer delegatee of a specific token + +Get the address of the signer delegatee.If the signer has not delegated their voting power, it will return null. + +```ts +import { TokenVotingClient } from "@aragon/sdk-client"; +import { context } from "../index"; + +// Instantiate the general purpose client from the Aragon OSx SDK context. + +// Create a TokenVoting client. +const tokenVotingClient: TokenVotingClient = new TokenVotingClient( + context, +); + +const tokenAddress = "0x1234567890123456789012345678901234567890"; // token contract adddress + +const delegatee = tokenVotingClient.methods.getDelegatee(tokenAddress); + +console.log(delegatee); +``` + + +Returns: + ```ts + "0x1234567890123456789012345678901234567890" // null if the signer has not delegated their voting power + ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/20-is-governance-token-compatible.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/20-is-governance-token-compatible.md new file mode 100644 index 00000000..b7043e06 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/20-is-governance-token-compatible.md @@ -0,0 +1,34 @@ +--- +title: Is TokenVoting compatible token +--- + +## Check if a token is compatible with the TokenVoting Plugin as an underlying token + +Check if a token is compatible with the TokenVoting Plugin as an underlying token. This means that the token is ERC20 and ERC165 compliant and has the required methods for the TokenVoting Plugin to work. + +```ts +import { TokenVotingClient } from "@aragon/sdk-client"; +import { context } from "../index"; + +// Instantiate the general purpose client from the Aragon OSx SDK context. + +// Create a TokenVoting client. +const tokenVotingClient: TokenVotingClient = new TokenVotingClient( + context, +); + +const tokenAddress = "0x1234567890123456789012345678901234567890"; // token contract adddress + +const compatibility = tokenVotingClient.methods.isTokenVotingCompatibleToken(tokenAddress); + +console.log(compatibility); +``` + + +Returns: + ```ts + // "compatible" if is erc20 and erc165 + // "needsWrap" if is erc20 and not erc165 or compatible with voting + // "incompatible" if is not erc20 + compatible + ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/21-prepare-update.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/21-prepare-update.md new file mode 100644 index 00000000..e607fc04 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/21-prepare-update.md @@ -0,0 +1,100 @@ +--- +title: Prepare Update +--- + +### Prepare the Update of the TokenVoting plugin + +The `prepareUpdate` method performs the prior steps so that a DAO proposal can eventually apply the the update the TokenVoting plugin. +The proposal will need an Action calling the `applyUpdate` function. + +```ts +import { + PrepareUpdateStep, + TokenVotingClient, + TokenVotingPluginPrepareUpdateParams, +} from "@aragon/sdk-client"; +import { context } from "../index"; + +// Instantiate the general purpose client from the Aragon OSx SDK context. +const client: TokenVotingClient = new TokenVotingClient(context); + +const updateAbi = [/* ... */]; + +const prepareUpdateParams: TokenVotingPluginPrepareUpdateParams = { + daoAddressOrEns: "0x1234567890123456789012345678901234567890", // my-dao.dao.eth + pluginAddress: "0x2345678901234567890123456789012345678901", + newVersion: { + build: 2, + release: 1, + }, + updateParams: [ + // Example parameters needed by the plugin's prepareUpdate function + 1234, + "0x1234567890123456789012345678901234567890", + ], + updateAbi, +}; + +// Estimate how much gas the transaction will cost. +const estimatedGas = await client.estimation + .prepareUpdate( + prepareUpdateParams, + ); +console.log({ avg: estimatedGas.average, max: estimatedGas.max }); + +// Deposit the ERC20 tokens. +const steps = client.methods.prepareUpdate(prepareUpdateParams); +for await (const step of steps) { + try { + switch (step.key) { + case PrepareUpdateStep.PREPARING: + console.log({ txHash: step.txHash }); + break; + case PrepareUpdateStep.DONE: + console.log({ + permissions: step.permissions, + pluginAddress: step.pluginAddress, + pluginRepo: step.pluginRepo, + versionTag: step.versionTag, + initData: step.initData, + helpers: step.helpers, + }); + break; + } + } catch (err) { + console.error(err); + } +} +``` + + +Returns: + ```tsx + { + txhash: "0xb1c14a49...3e8620b0f5832d61c" + } + { + permissions: [ + { + operation: 1, // revoke + where: "0x12345...", + who: "0x23456...", + permissionId: "0x1234567890..." + }, + { + operation: 1, //REVOKE + where: "0x3456...", + who: "0x4567...", + permissionId: "0x1234567890..." + } + ], + pluginAddress: "0x1234567890...", + pluginRepo: "0x1234567890...", + initData: Uint8Array(0) [], + versionTag: { + build: 1, + release: 1 + }, + helpers: ["0x12345...", "0x12345..."] + } + ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/22-is-member.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/22-is-member.md new file mode 100644 index 00000000..c2983c20 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/22-is-member.md @@ -0,0 +1,29 @@ +--- +title: Is Member +--- + +### Check if an address is a member of TokenVoting DAO in a specific block and plugin + +The is member function receives the plugin address and the address to check as parameters and returns a boolean value. + +```ts +import { TokenVotingClient } from "@aragon/sdk-client"; +import { context } from "../index"; + +// Instantiate the token voting client from the Aragon OSx SDK context. +const client: TokenVotingClient = new TokenVotingClient(context); + +const isMember = await client.methods.isMember({ + pluginAddress: "0x2345678901234567890123456789012345678901", + address: "0x1234567890123456789012345678901234567890", + blockNumber: 12345678, +}); + +console.log(isMember); +``` + + +Returns: + ```tsx + true + ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/index.md b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/index.md new file mode 100644 index 00000000..b06525a8 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/03-tokenVoting-client/index.md @@ -0,0 +1,24 @@ +--- +title: Token Voting Client +--- + +## Create a Token Voting Client + +The `TokenVoting` plugin allows token holders to create and vote on proposals. +The token contract created by the TokenVoting setup contract follow OpenZeppelin's ERC20Votes standard: https://docs.openzeppelin.com/contracts/4.x/api/token/erc20#ERC20Votes + +In order to interact with the `TokenVoting` plugin, you need to create a `TokenVotingClient`. +This is created using the `ContextPlugin` which grants us access to plugins within the SDK. + +```ts +import { TokenVotingClient } from "@aragon/sdk-client"; +import { context } from "../index"; + +// Instantiate the ContextPlugin from the Aragon OSx SDK context. + +// Create a TokenVoting client. +const tokenVotingClient = new TokenVotingClient(context); +console.log(tokenVotingClient); +``` + + diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/01-installation.md b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/01-installation.md new file mode 100644 index 00000000..f79178e9 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/01-installation.md @@ -0,0 +1,106 @@ +--- +title: Create Addresslist Voting DAO +--- + +## Create a DAO with a Addresslist Voting Plugin Installed + +The Addresslist governance plugin enables DAOs to preset an address list of approved addresses that can vote on proposals. This plugin is useful for DAOs that want to have a fixed list of addresses that can vote on proposals, without them necessarily having to own any specific tokens. + +In order to create a DAO with a AddresslistVoting plugin, you need to first, encode the instructions for installing the plugin, based also on the pararmeters you define. +Then, use those encoded instructions when creating your DAO. + +```ts +import { + AddresslistVotingClient, + AddresslistVotingPluginInstall, + Client, + CreateDaoParams, + DaoCreationSteps, + DaoMetadata, + VotingMode, +} from "@aragon/sdk-client"; +import { GasFeeEstimation } from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Instantiate a client from the Aragon OSx SDK context. +const client: Client = new Client(context); + +// Define the plugins to install and their params. +const addresslistVotingPluginInstallParams: AddresslistVotingPluginInstall = { + votingSettings: { + minDuration: 60 * 60 * 24 * 2, // seconds + minParticipation: 0.25, // 25% + supportThreshold: 0.5, // 50% + minProposerVotingPower: BigInt("5000"), // default 0 + votingMode: VotingMode.VOTE_REPLACEMENT, // default is STANDARD. other options: EARLY_EXECUTION, VOTE_REPLACEMENT + }, + addresses: [ + "0x1234567890123456789012345678901234567890", + "0x2345678901234567890123456789012345678901", + "0x3456789012345678901234567890123456789012", + "0x4567890123456789012345678901234567890123", + ], +}; + +// Encodes the plugin instructions for installing into the DAO with its defined parameters. +const addresslistVotingPluginInstallItem = AddresslistVotingClient + .encoding.getPluginInstallItem(addresslistVotingPluginInstallParams, "goerli"); + +const daoMetadata: DaoMetadata = { + name: "My DAO", + description: "This is a description", + avatar: "", + links: [{ + name: "Web site", + url: "https://...", + }], +}; + +// Pin metadata to IPFS, returns IPFS CID string. +const metadataUri: string = await client.methods.pinMetadata(daoMetadata); + +const createParams: CreateDaoParams = { + metadataUri, + ensSubdomain: "my-org", // my-org.dao.eth + plugins: [addresslistVotingPluginInstallItem], +}; + +// Estimate gas for the transaction. +const estimatedGas: GasFeeEstimation = await client.estimation.createDao( + createParams, +); +console.log({ avg: estimatedGas.average, max: estimatedGas.max }); + +// Creates a DAO with a Multisig plugin installed. +const steps = client.methods.createDao(createParams); + +for await (const step of steps) { + try { + switch (step.key) { + case DaoCreationSteps.CREATING: + console.log({ txHash: step.txHash }); + break; + case DaoCreationSteps.DONE: + console.log({ + daoAddress: step.address, + pluginAddresses: step.pluginAddresses, + }); + break; + } + } catch (err) { + console.error(err); + } +} +``` + + +Returns: +```tsx +{ + txHash: "0xb1c14a49...3e8620b0f5832d61c" +} +{ + daoAddress: "0xb1c14a49...3e8620b0f5832d61c", + pluginAddresses: ["0xb1c14a49...3e8620b0f5832d61c", "0xb1c14a49...3e8620b0f5832d61c"] +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/02-create-proposal.md b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/02-create-proposal.md new file mode 100644 index 00000000..df35da8e --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/02-create-proposal.md @@ -0,0 +1,89 @@ +--- +title: Create Proposal +--- + +## Create an Addresslist Voting Proposal + +Creates a proposal for a DAO with the Addresslist Voting plugin installed. +Within this proposal, only addresses in the approved list of the Addresslist Voting plugin can vote. + +```ts +import { + AddresslistVotingClient, + CreateMajorityVotingProposalParams, + ProposalCreationSteps, + VoteValues, +} from "@aragon/sdk-client"; +import { ProposalMetadata } from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Create a plugin context from the Aragon OSx SDK context. + +// Create an AddresslistVoting client. +const addresslistVotingClient = new AddresslistVotingClient(context); + +const metadata: ProposalMetadata = { + title: "Test Proposal", + summary: "This is a short description", + description: "This is a long description", + resources: [ + { + name: "Discord", + url: "https://discord.com/...", + }, + { + name: "Website", + url: "https://website...", + }, + ], + media: { + logo: "https://...", + header: "https://...", + }, +}; + +const metadataUri: string = await addresslistVotingClient.methods.pinMetadata( + metadata, +); + +const pluginAddress = "0x1234567890123456789012345678901234567890"; // the address of the AddresslistVoting plugin installed into the DAO. + +const proposalParams: CreateMajorityVotingProposalParams = { + pluginAddress, + metadataUri, + actions: [], + failSafeActions: [], + startDate: new Date(), + endDate: new Date(), + executeOnPass: false, + creatorVote: VoteValues.YES, // otherwise NO or ABSTAIN +}; + +const steps = addresslistVotingClient.methods.createProposal(proposalParams); + +for await (const step of steps) { + try { + switch (step.key) { + case ProposalCreationSteps.CREATING: + console.log({ txHash: step.txHash }); + break; + case ProposalCreationSteps.DONE: + console.log({ proposalId: step.proposalId }); + break; + } + } catch (err) { + console.error(err); + } +} +``` + + +Returns: +```tsx +{ + txHash: "0xb1c14a49...3e8620b0f5832d61c" +} +{ + proposalId: "0xb1c14a49...3e862_0x0", +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/03-create-proposal-with-actions.md b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/03-create-proposal-with-actions.md new file mode 100644 index 00000000..d0ed651a --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/03-create-proposal-with-actions.md @@ -0,0 +1,107 @@ +--- +title: Create Proposal with Actions +--- + +## Create a Token Voting Proposal with Actions + +Creates a proposal with an action(s) to get executed upon the proposal passes. Within this proposal, only addresses in the approved list of the AddresslistVoting plugin can vote. + +```ts +import { + AddresslistVotingClient, + CreateMajorityVotingProposalParams, + MajorityVotingSettings, + ProposalCreationSteps, + VoteValues, + VotingMode, +} from "@aragon/sdk-client"; +import { ProposalMetadata } from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Create a plugin context from the Aragon OSx SDK context. + +// Create an AddresslistVoting client from the Aragon OSx SDK context. +const addresslistVotingClient: AddresslistVotingClient = + new AddresslistVotingClient(context); + +// [Optional] You can add encoded actions to the proposal. These actions are the encoded transactions which will be executed when a transaction passes. +// In this example, we are updating the plugin settings as an action that you may want upon a proposal approval. +const updatePluginSettingsParams: MajorityVotingSettings = { + minDuration: 60 * 60 * 24 * 2, // seconds + minParticipation: 0.25, // 25% + supportThreshold: 0.5, // 50% + minProposerVotingPower: BigInt("5000"), // default 0 + votingMode: VotingMode.EARLY_EXECUTION, // alternatively, STANDARD or VOTE_REPLACEMENT +}; + +const pluginAddress = "0x1234567890123456789012345678901234567890"; // the address of the plugin contract itself + +// Sets up the action instructions based on the above parameters. +const updatePluginSettingsAction = addresslistVotingClient.encoding + .updatePluginSettingsAction( + pluginAddress, + updatePluginSettingsParams, + ); + +const daoMetadata: ProposalMetadata = { + title: "Test Proposal", + summary: "This is a short description", + description: "This is a long descrioption", + resources: [ + { + name: "Discord", + url: "https://discord.com/...", + }, + { + name: "Website", + url: "https://website...", + }, + ], + media: { + logo: "https://...", + header: "https://...", + }, +}; + +const metadataUri: string = await addresslistVotingClient.methods.pinMetadata( + daoMetadata, +); + +const proposalParams: CreateMajorityVotingProposalParams = { + pluginAddress: "0x1234567890123456789012345678901234567890", // the address of the AddresslistVoting plugin contract installed in the DAO + metadataUri, + actions: [updatePluginSettingsAction], // the action you want to have executed upon a proposal approval + startDate: new Date(), + endDate: new Date(), + executeOnPass: false, + creatorVote: VoteValues.YES, // otherwise NO or ABSTAIN +}; + +const steps = addresslistVotingClient.methods.createProposal(proposalParams); + +for await (const step of steps) { + try { + switch (step.key) { + case ProposalCreationSteps.CREATING: + console.log({ txHash: step.txHash }); + break; + case ProposalCreationSteps.DONE: + console.log({ proposalId: step.proposalId }); + break; + } + } catch (err) { + console.error(err); + } +} +``` + + +Returns: +```tsx +{ + txHash: "0xb1c14a49...3e8620b0f5832d61c" +} +{ + proposalId: "0xb1c14a49...3e862_0x0", +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/04-can-vote.md b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/04-can-vote.md new file mode 100644 index 00000000..33301b2a --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/04-can-vote.md @@ -0,0 +1,37 @@ +--- +title: Check Voting Rights +--- + +## Check if an Address Can Vote in a Addresslist Voting proposal + +Checks whether an address is able to participate in a DAO proposal created using the Addresslist Voting plugin. + +```ts +import { + AddresslistVotingClient, + CanVoteParams, + VoteValues, +} from "@aragon/sdk-client"; +import { context } from "../index"; + +// Instantiate a plugin context from the Aragon OSx SDK context + +// Create an AddresslistVoting client +const addresslistVotingClient = new AddresslistVotingClient(context); + +const canVoteParams: CanVoteParams = { + voterAddressOrEns: "0x1234567890123456789012345678901234567890", // the address who's potential to vote you want to check + proposalId: "0x1234567890123456789012345678901234567890_0x0", + vote: VoteValues.YES, // this doesn't execute the vote itself, simply checks whether that address can execute that vote. VoteValues can be NO, YES, or ABSTAIN +}; + +const canVote = await addresslistVotingClient.methods.canVote(canVoteParams); +console.log(canVote); +``` + + +Returns: + +```json +true +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/05-vote-proposal.md b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/05-vote-proposal.md new file mode 100644 index 00000000..88030a55 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/05-vote-proposal.md @@ -0,0 +1,53 @@ +--- +title: Vote +--- + +## Vote on a Addresslist Voting Proposal + +Enables voting on a proposal using the Addresslist Voting plugin installed within a DAO. + +```ts +import { + AddresslistVotingClient, + VoteProposalParams, + VoteProposalStep, + VoteValues, +} from "@aragon/sdk-client"; +import { context } from "../index"; + +// Create a plugin context from the Aragon OSx SDK context. + +// Create an Addresslist client to use the Addresslist plugin. +const addresslistVotingClient: AddresslistVotingClient = + new AddresslistVotingClient(context); + +const voteParams: VoteProposalParams = { + proposalId: "0x1234567890123456789012345678901234567890_0x0", + vote: VoteValues.YES, // alternatively NO, or ABSTAIN +}; + +// Vote on an Addresslist proposal. +const steps = addresslistVotingClient.methods.voteProposal(voteParams); + +for await (const step of steps) { + try { + switch (step.key) { + case VoteProposalStep.VOTING: + console.log({ txHash: step.txHash }); + break; + case VoteProposalStep.DONE: + break; + } + } catch (err) { + console.error({ err }); + } +} +``` + + +Returns: +```tsx +{ + txHash: "0xb1c14a49...3e8620b0f5832d61c" +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/06-can-execute.md b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/06-can-execute.md new file mode 100644 index 00000000..27f5b64c --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/06-can-execute.md @@ -0,0 +1,30 @@ +--- +title: Check Execution +--- + +## Check if a User Can Execute an Proposal + +Checks whether the signer of the transaction is able to execute actions approved and created by proposals from the TokenVoting plugin. + +```ts +import { TokenVotingClient } from "@aragon/sdk-client"; +import { context } from "../index"; + +// Instantiate a TokenVoting client. +const tokenVotingClient: TokenVotingClient = new TokenVotingClient( + context, +); + +const proposalId: string = "0x1234567890123456789012345678901234567890_0x0"; + +// Checks whether the signer of the transaction can execute a given proposal. +const canExecute = await tokenVotingClient.methods.canExecute(proposalId); +console.log(canExecute); +``` + + +Returns: + +``` +true +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/07-execute-proposal.md b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/07-execute-proposal.md new file mode 100644 index 00000000..740ff73f --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/07-execute-proposal.md @@ -0,0 +1,44 @@ +--- +title: Execution Proposal +--- + +## Execute a TokenVoting Proposal + +Executes the actions set within a proposal made using the TokenVoting plugin. + +```ts +import { ExecuteProposalStep, TokenVotingClient } from "@aragon/sdk-client"; +import { context } from "../index"; + +// Insantiate a plugin context from the Aragon OSx SDK context. + +// Insantiate a TokenVoting client. +const tokenVotingClient = new TokenVotingClient(context); + +const proposalId: string = "0x1234567890123456789012345678901234567890_0x0"; + +// Executes the actions of a TokenVoting proposal. +const steps = tokenVotingClient.methods.executeProposal(proposalId); + +for await (const step of steps) { + try { + switch (step.key) { + case ExecuteProposalStep.EXECUTING: + console.log({ txHash: step.txHash }); + break; + case ExecuteProposalStep.DONE: + break; + } + } catch (err) { + console.error(err); + } +} +``` + + +Returns: +```tsx +{ + txHash: "0xb1c14a49...3e8620b0f5832d61c" +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/08-get-proposal.md b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/08-get-proposal.md new file mode 100644 index 00000000..f955907e --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/08-get-proposal.md @@ -0,0 +1,94 @@ +--- +title: Get Proposal +--- + +## Get a Addresslist Voting Proposal by Its ID + +Gets a proposal created using the Addresslist Voting plugin. + +```ts +import { + AddresslistVotingClient, + AddresslistVotingProposal, +} from "@aragon/sdk-client"; +import { context } from "../index"; + +// Instantiates a plugin context from the Aragon OSx SDK context. + +// Instantiates an AddresslistVoting client. +const addresslistVotingClient: AddresslistVotingClient = + new AddresslistVotingClient(context); + +const proposalId: string = "0x1234567890123456789012345678901234567890_0x0"; + +const addresslistVotingProposal: AddresslistVotingProposal | null = + await addresslistVotingClient.methods.getProposal(proposalId); +console.log(addresslistVotingProposal); +``` + + +Returns: + +``` +{ + id: "0x1234567890123456789012345678901234567890_0x0", + dao: { + address: "0x1234567890123456789012345678901234567890", + name: "Cool DAO" + }, + creatorAddress: "0x1234567890123456789012345678901234567890", + metadata: { + title: "Test Proposal", + summary: "test proposal summary", + description: "this is a long description", + resources: [ + { + url: "https://dicord.com/...", + name: "Discord" + }, + { + url: "https://docs.com/...", + name: "Document" + } + ], + media: { + header: "https://.../image.jpeg", + logo: "https://.../image.jpeg" + } + }, + startDate: , + endDate: , + creationDate: , + creationBlockNumber: 812345, + executionDate: , + executionBlockNumber: 812345, + actions: [ + { + to: "0x12345..." + value: 10n + data: [12,13,154...] + } + ], + status: "Executed", + result { + yes: 1, + no: 1, + abstain: 0 + } + settings: { + minParticipation: 0.5, + supportThreshold: 0.25, + minDuration: 7200 + }, + votes: [ + { + address: "0x123456789123456789123456789123456789", + vote: 2 // VoteValues.YES + }, + { + address: "0x234567891234567891234567891234567890", + vote: 3 // VoteValues.NO + } + ] +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/09-get-proposals.md b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/09-get-proposals.md new file mode 100644 index 00000000..47d2c039 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/09-get-proposals.md @@ -0,0 +1,82 @@ +--- +title: Get Proposals +--- + +## Get All Addresslist Voting Proposals That Have Been Created + +Gets the list of proposals created using the Addresslist Voting plugin. + +```ts +import { + AddresslistVotingClient, + AddresslistVotingProposalListItem, + ProposalQueryParams, + ProposalSortBy, +} from "@aragon/sdk-client"; +import { ProposalStatus, SortDirection } from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Instantiate an AddresslistVoting client. +const addresslistVotingClient: AddresslistVotingClient = + new AddresslistVotingClient(context); + +const queryParams: ProposalQueryParams = { + skip: 0, // optional + limit: 10, // optional, + direction: SortDirection.ASC, // optional + sortBy: ProposalSortBy.CREATED_AT, //optional, alternatively NAME, VOTES (POPULARITY coming soon) + status: ProposalStatus.ACTIVE, // optional, alternatively PENDING, SUCCEEDED, EXECUTED, DEFEATED +}; + +const addresslistVotingProposals: AddresslistVotingProposalListItem[] = + await addresslistVotingClient.methods.getProposals(queryParams); +console.log(addresslistVotingProposals); +``` + + +Returns: + +```json +[ + { + id: "0x12345...", + dao: { + address: "0x1234567890123456789012345678901234567890", + name: "Cool DAO" + }, + creatorAddress: "0x1234567890123456789012345678901234567890", + metadata: { + title: "Test Proposal", + summary: "test proposal summary" + }, + startDate: , + endDate: , + status: "Executed", + results { + yes: 100000n, + no: 77777n, + abstain: 0n + } + }, + { + id: "0x12345...", + dao: { + address: "0x1234567890123456789012345678901234567890", + name: "Cool DAO" + }, + creatorAddress: "0x1234567890123456789012345678901234567890", + metadata: { + title: "Test Proposal 2", + summary: "test proposal summary 2" + }, + startDate: , + endDate: , + status: "Pending", + results { + yes: 100000n, + no: 77777n, + abstain: 0n + } + } +] +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/10-get-voting-settings.md b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/10-get-voting-settings.md new file mode 100644 index 00000000..fec53278 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/10-get-voting-settings.md @@ -0,0 +1,35 @@ +--- +title: Get Settings +--- + +## Get the Addresslist Voting Plugin Settings + +Get the settings established for a given AddresslistVoting plugin. + +```ts +import { AddresslistVotingClient, VotingSettings } from "@aragon/sdk-client"; +import { context } from "../index"; + +// Instantiate an AddresslistVoting client. +const addresslistVotingClient: AddresslistVotingClient = + new AddresslistVotingClient(context); + +const pluginAddress: string = "0x1234567890123456789012345678901234567890"; // the address of the AddresslistVoting plugin contract installed in the DAO. + +const addresslistVotingSettings: VotingSettings | null = + await addresslistVotingClient.methods.getVotingSettings(pluginAddress); +console.log(addresslistVotingSettings); +``` + + +Returns: + +```json +{ + minDuration: 60 * 60 * 24 * 2, // seconds + minParticipation: 0.25, // 25% + supportThreshold: 0.5, // 50% + minProposerVotingPower: BigInt("5000"), // default 0 + votingMode: "Standard" // default STANDARD, otherwise EARLY_EXECUTION or VOTE_REPLACEMENT +} + ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/11-get-members.md b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/11-get-members.md new file mode 100644 index 00000000..d58b9766 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/11-get-members.md @@ -0,0 +1,38 @@ +--- +title: Get Members +--- + +## Get DAO Members Introduced by the Addresslist Voting Plugin + +Gets an array of all addresses able to vote in a specific AddresslistVoting DAO proposal. + +```ts +import { AddresslistVotingClient } from "@aragon/sdk-client"; +import { context } from "../index"; + +// Instantiates a plugin context from the Aragon OSx SDK context. + +// Instantiates an AddressList client. +const addresslistVotingClient: AddresslistVotingClient = + new AddresslistVotingClient(context); + +const daoPluginAddress = "0x12345382947301297439127433492834"; // The address of the plugin that DAO has installed. You can find this by calling `getDao(daoAddress)` and getting the DAO details . + +const members: string[] = await addresslistVotingClient.methods.getMembers( + { pluginAddress: daoPluginAddress }, +); +console.log({ members }); +``` + + +Returns: + +```json +[ + "0x1234567890123456789012345678901234567890", + "0x2345678901234567890123456789012345678901", + "0x3456789012345678901234567890123456789012", + "0x4567890123456789012345678901234567890123", + "0x5678901234567890123456789012345678901234" +] +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/12-pin-metadata.md b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/12-pin-metadata.md new file mode 100644 index 00000000..3d2fd25f --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/12-pin-metadata.md @@ -0,0 +1,46 @@ +--- +title: Pin Metadata +--- + +## Add and Pin Metadata + +Adds and pin data into one of the specified IPFS nodes and return a IPFS CID preceded by "ipfs://". + +```ts +import { AddresslistVotingClient } from "@aragon/sdk-client"; +import { ProposalMetadata } from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Instantiate an AddresslistVoting plugin client. +const addresslistVotingClient: AddresslistVotingClient = + new AddresslistVotingClient(context); + +const proposalMetadata: ProposalMetadata = { + title: "Test Proposal", + summary: "This is a short description", + description: "This is a long description", + resources: [ + { + name: "Discord", + url: "https://discord.com/...", + }, + { + name: "Website", + url: "https://website...", + }, + ], + media: { + logo: "https://...", + header: "https://...", + }, +}; + +const proposalMetadataUri: string = await addresslistVotingClient.methods + .pinMetadata(proposalMetadata); +console.log(proposalMetadataUri); +``` + + +```javascript +"ipfs://Qm..." +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/13-prepare-installation.md b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/13-prepare-installation.md new file mode 100644 index 00000000..7a15c93c --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/13-prepare-installation.md @@ -0,0 +1,75 @@ +--- +title: Prepare Installation +--- + +## Prepare the Installation of a Addresslist Voting Plugin + +```ts +import { + AddresslistVotingPluginPrepareInstallationParams, + TokenVotingClient, + VotingMode, +} from "@aragon/sdk-client"; +import { PrepareInstallationStep } from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Create an TokenVoting client. +const tokenVotingClient: TokenVotingClient = new TokenVotingClient( + context, +); + +const installationParams: AddresslistVotingPluginPrepareInstallationParams = { + settings: { + votingSettings: { + supportThreshold: 0.5, + minParticipation: 0.5, + minDuration: 7200, + minProposerVotingPower: BigInt(1), + votingMode: VotingMode.STANDARD, + }, + addresses: [ + "0x1234567890123456789012345678901234567890", + ], + }, + daoAddressOrEns: "0x1234567890123456789012345678901234567890", +}; +const steps = tokenVotingClient.methods.prepareInstallation(installationParams); +for await (const step of steps) { + switch (step.key) { + case PrepareInstallationStep.PREPARING: + console.log(step.txHash); + break; + case PrepareInstallationStep.DONE: + console.log({ step }); + break; + } +} +``` + + +Returns: +```tsx +{ + txHash: "0xb1c14a49...3e8620b0f5832d61c" +} +{ + step:{ + helpers: ["0x12345...", "0x12345..."] + pluginRepo: "0x12345...", + pluginAdddres: "0x12345...", + versionTag: { + build: 1, + release: 1 + }, + permissions: [ + { + condition: "0x12345...", + who: "0x12345...", + where: "0x12345...", + operation: 1, // GRANT + permissionId: "0x1234567890..." + } + ] + } +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/14-prepare-update.md b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/14-prepare-update.md new file mode 100644 index 00000000..c914a843 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/14-prepare-update.md @@ -0,0 +1,100 @@ +--- +title: Prepare Update +--- + +### Prepare the Update of the AddresslistVoting plugin + +The `prepareUpdate` method performs the prior steps so that a DAO proposal can eventually apply the the update the AddresslistVoting plugin. +The proposal will need an Action calling the `applyUpdate` function. + +```ts +import { + AddresslistVotingClient, + AddresslistVotingPluginPrepareUpdateParams, + PrepareUpdateStep, +} from "@aragon/sdk-client"; +import { context } from "../index"; + +// Instantiate the general purpose client from the Aragon OSx SDK context. +const client: AddresslistVotingClient = new AddresslistVotingClient(context); + +const updateAbi = [/* ... */]; + +const prepareUpdateParams: AddresslistVotingPluginPrepareUpdateParams = { + daoAddressOrEns: "0x1234567890123456789012345678901234567890", // my-dao.dao.eth + pluginAddress: "0x2345678901234567890123456789012345678901", + newVersion: { + build: 2, + release: 1, + }, + updateParams: [ + // Example parameters needed by the plugin's prepareUpdate function + 1234, + "0x1234567890123456789012345678901234567890", + ], + updateAbi, +}; + +// Estimate how much gas the transaction will cost. +const estimatedGas = await client.estimation + .prepareUpdate( + prepareUpdateParams, + ); +console.log({ avg: estimatedGas.average, max: estimatedGas.max }); + +// Deposit the ERC20 tokens. +const steps = client.methods.prepareUpdate(prepareUpdateParams); +for await (const step of steps) { + try { + switch (step.key) { + case PrepareUpdateStep.PREPARING: + console.log({ txHash: step.txHash }); + break; + case PrepareUpdateStep.DONE: + console.log({ + permissions: step.permissions, + pluginAddress: step.pluginAddress, + pluginRepo: step.pluginRepo, + versionTag: step.versionTag, + initData: step.initData, + helpers: step.helpers, + }); + break; + } + } catch (err) { + console.error(err); + } +} +``` + + +Returns: + ```tsx + { + txhash: "0xb1c14a49...3e8620b0f5832d61c" + } + { + permissions: [ + { + operation: 1, // revoke + where: "0x12345...", + who: "0x23456...", + permissionId: "0x1234567890..." + }, + { + operation: 1, //REVOKE + where: "0x3456...", + who: "0x4567...", + permissionId: "0x1234567890..." + } + ], + pluginAddress: "0x1234567890...", + pluginRepo: "0x1234567890...", + initData: Uint8Array(0) [], + versionTag: { + build: 1, + release: 1 + }, + helpers: ["0x12345...", "0x12345..."] + } + ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/15-is-member.md b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/15-is-member.md new file mode 100644 index 00000000..9ed32c6f --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/15-is-member.md @@ -0,0 +1,29 @@ +--- +title: Is Member +--- + +### Check if an address is a member of an Addresslist DAO in a specific block and plugin + +The is member function receives the plugin address and the address to check as parameters and returns a boolean value. + +```ts +import { AddresslistVotingClient } from "@aragon/sdk-client"; +import { context } from "../index"; + +// Instantiate the addresslist voting client from the Aragon OSx SDK context. +const client: AddresslistVotingClient = new AddresslistVotingClient(context); + +const isMember = await client.methods.isMember({ + pluginAddress: "0x2345678901234567890123456789012345678901", + address: "0x1234567890123456789012345678901234567890", + blockNumber: 12345678, +}); + +console.log(isMember); +``` + + +Returns: + ```tsx + true + ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/index.md b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/index.md new file mode 100644 index 00000000..f62aed3b --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/04-addresslistVoting-client/index.md @@ -0,0 +1,19 @@ +--- +title: Addresslist Voting Client +--- + +## Create an Addresslist Voting Client + +Creates an AddresslistVoting client allowing you to access the AddresslistVoting plugin functionality. + +```ts +import { AddresslistVotingClient } from "@aragon/sdk-client"; +import { context } from "../index"; + +// Instantiate an AddresslistVoting client from the Aragon OSx SDK context. +const addresslistVotingClient: AddresslistVotingClient = + new AddresslistVotingClient(context); +console.log(addresslistVotingClient); +``` + + diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/01-find-interface.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/01-find-interface.md new file mode 100644 index 00000000..d03a3b29 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/01-find-interface.md @@ -0,0 +1,32 @@ +--- +title: Get Function Parameters +--- + +## Get Function Parameters from an Encoded Action + +Decodes the parameters of a function call. + +```ts +import { Client } from "@aragon/sdk-client"; +import { context } from "../index"; + +// Instantiates an Aragon OSx SDK client. +const client: Client = new Client(context); + +const data: Uint8Array = new Uint8Array([12, 56]); + +// Decodes the parameters of a function call. +const functionParams = client.decoding.findInterface(data); +console.log(functionParams); +``` + + +Returns: + +```json +{ + id: "function functionName(param1, param2)" + functionName: "functionName" + hash: "0x12345678" +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/02-grant-permission.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/02-grant-permission.md new file mode 100644 index 00000000..60f27cc4 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/02-grant-permission.md @@ -0,0 +1,72 @@ +--- +title: Grant Permissions +--- + +## Grant a Permission + +Grants permission with the name (`permission`) to an address (`who`) to perform on a target contract (`where`). + +### Encoding + +```ts +import { + Client, + GrantPermissionDecodedParams, + GrantPermissionParams, + Permissions, +} from "@aragon/sdk-client"; +import { DaoAction } from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Instantiates an Aragon OSx SDK client. +const client: Client = new Client(context); + +const params: GrantPermissionParams = { + who: "0x1234567890123456789012345678901234567890", + where: "0x1234567890123456789012345678901234567890", + permission: Permissions.UPGRADE_PERMISSION, +}; + +const daoAddress: string = "0x1234567890123456789012345678901234567890"; + +const action: DaoAction = await client.encoding.grantAction(daoAddress, params); +console.log({ action }); +``` + + +Returns: + +```json +{ action: + { + to: "0x1234567890...", + value: 0n, + data: Uint8Array[12,34,45...] + } +} +``` + +### Decoding + +```ts +// Decodes the data of a grant permission action. +const decodedParams: GrantPermissionDecodedParams = client.decoding + .grantAction( + action.data, + ); +console.log({ decodedParams }); +``` + + +Returns: + +```json +{ decodedParams: + { + who: "0x1234567890...", + where: "0x1234567890...", + permission: "UPGRADE_PERMISSION", + permissionId: "0x12345..." + } +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/03-grant-with-condition.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/03-grant-with-condition.md new file mode 100644 index 00000000..f47d5322 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/03-grant-with-condition.md @@ -0,0 +1,76 @@ +--- +title: Grant Conditional Permission +--- + +## Grant a Conditional Permission + +Grants permission with the name (`permission`) to an address (`who`) to perform on a target contract (`where`) with a condition (`condition`) defined by a contract. + +### Encoding + +```ts +import { + Client, + GrantPermissionWithConditionParams, + Permissions, +} from "@aragon/sdk-client"; +import { DaoAction } from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Instantiates an Aragon OSx SDK client. +const client: Client = new Client(context); + +const params: GrantPermissionWithConditionParams = { + who: "0x1234567890123456789012345678901234567890", // address to which the permission will be granted + where: "0x2345678901234567890123456789012345678901", // where the permission is granted + permission: Permissions.EXECUTE_PERMISSION, // the permission to grant + condition: "0x3456789012345678901234567890123456789012", // the contract address of the condition which needs to be met in order for the permission to be granted +}; + +const dao: string = "0x123123123123123123123123123123123123"; // or "my-dao" for my-dao.dao.eth address + +const action: DaoAction = client.encoding.grantWithConditionAction(dao, params); +console.log({ action }); +``` + + +Returns: +```json +{ action: + { + to: "0x123123123...", + value: 0n, + data: Uint8Array[12,34,45...] + } +} +``` + +```ts + +``` + + +### Decoding + +```ts +const decodedParams: GrantPermissionWithConditionParams = client.decoding + .grantWithConditionAction( + action.data, + ); +console.log({ decodedParams }); +``` + + +Returns: + +``` +{ decodedParams: + { + where: "0x1234567890...", + who: "0x2345678901...", + permission: "UPGRADE_PERMISSION" + condition: "0x3456789012..." + permissionId: "0x12345..." + } +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/04-revoke-permissions.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/04-revoke-permissions.md new file mode 100644 index 00000000..6fbdd405 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/04-revoke-permissions.md @@ -0,0 +1,76 @@ +--- +title: Revoke Permissions +--- + +## Revoke a Permission + +Revokes a permission to a given address (`who`) to perform an action on a contract (`where`). + +### Encoding + +```ts +import { + Client, + Permissions, + RevokePermissionDecodedParams, + RevokePermissionParams, +} from "@aragon/sdk-client"; +import { DaoAction } from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Instantiates an Aragon OSx SDK client. +const client: Client = new Client(context); + +const params: RevokePermissionParams = { + who: "0x1234567890123456789012345678901234567890", + where: "0x1234567890123456789012345678901234567890", + permission: Permissions.UPGRADE_PERMISSION, // other options: SET_METADATA_PERMISSION, EXECUTE_PERMISSION, WITHDRAW_PERMISSION, SET_SIGNATURE_VALIDATOR_PERMISSION, SET_TRUSTED_FORWARDER_PERMISSION, ROOT_PERMISSION, CREATE_VERSION_PERMISSION, REGISTER_PERMISSION, REGISTER_DAO_PERMISSION, REGISTER_ENS_SUBDOMAIN_PERMISSION, MINT_PERMISSION, MERKLE_MINT_PERMISSION, MODIFY_ALLOWLIST_PERMISSION, SET_CONFIGURATION_PERMISSION +}; + +const daoAddress: string = "0x1234567890123456789012345678901234567890"; + +// Revokes a permission to a given address to perform an action on a contract. +const action: DaoAction = await client.encoding.revokeAction( + daoAddress, + params, +); +console.log({ action }); +``` + + +Returns: + +```json +{ action: + { + to: "0x1234567890...", + value: 0n; + data: Uint8Array[12,34,45...] + } +} +``` + +### Decoding + +```ts +// Decodes the action of a revoke permission transaction. +const decodedParams: RevokePermissionDecodedParams = client.decoding + .revokeAction( + action.data, + ); +console.log({ decodedParams }); +``` + + +Returns: + +```json +{ decodedParams: + { + who: "0x1234567890...", + where: "0x1234567890...", + permission: "UPGRADE_PERMISSION", + permissionId: "0x12345..." + } +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/05-register-standard-callback.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/05-register-standard-callback.md new file mode 100644 index 00000000..0d2575c7 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/05-register-standard-callback.md @@ -0,0 +1,71 @@ +--- +title: Register Callback +--- + +## Register a New Standard Callback + +Register a new standard callback for the DAO. + +### Encoding + +```ts +import { Client, RegisterStandardCallbackParams } from "@aragon/sdk-client"; +import { DaoAction } from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Instantiates a general purpose Client from the Aragon OSx SDK context. +const client: Client = new Client(context); + +const params = { + interfaceId: "0x3134r1er213740123741207831238410972347", + callbackSelector: "0x382741239807410892375182734892", + magicNumber: "0x12192304781237401321329450123321", +}; + +const dao: string = "0x123123123123123123123123123123123123"; + +const action: DaoAction = client.encoding.registerStandardCallbackAction( + dao, + params, +); +console.log({ action }); +``` + + +Returns: + +```json +{ action: + { + to: "0x123123123...", + value: 0n, + data: Uint8Array[12,34,45...] + } +} +``` + +```ts + +``` + + +### Decoding + +```ts +const decodedParams: RegisterStandardCallbackParams = client.decoding + .registerStandardCallbackAction(action.data); +console.log({ decodedParams }); +``` + + +Returns: + +``` +{ decodedParams: + { + interfaceId: "0x12345678", + callbackSelector: "0x23456789", + magicNumber: "0x34567890" + } +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/06-withdraw.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/06-withdraw.md new file mode 100644 index 00000000..2e9ff0fa --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/06-withdraw.md @@ -0,0 +1,226 @@ +--- +title: Withdraw Tokens +--- + +## Withdraw Tokens From a DAO Vault + +:::info +This page is Work in progress. +::: + +Withdraws tokens from a DAO's vault and transfers them to another address. +In order for a withdrawal to be successful, the address executing it must have `WITHDRAW` permissions. + +### Native Tokens + +#### Encoding + +```ts +import { Client, WithdrawParams } from "@aragon/sdk-client"; +import { DaoAction, TokenType } from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Instantiates an Aragon OSx SDK client. +const client: Client = new Client(context); + +let params: WithdrawParams = { + type: TokenType.NATIVE, // "native" for ETH, otherwise use "ERC20" or "ERC721" for ERC-20 or ERC-721 Tokens, + amount: BigInt(10), // the amount in wei to withdraw + recipientAddressOrEns: "0x1234567890123456789012345678901234567890", // the address to transfer the funds to +}; + +// Withdraws ETH from a given DAO and transfers them to another address. +const nativeWithdrawAction: DaoAction = await client.encoding.withdrawAction( + params, +); +console.log({ nativeWithdrawAction }); +``` + + +Returns: + +```json +{ nativeWithdrawAction: + { + to: "0x1234567890...", + value: 0n; + data: Uint8Array[12,34,45...] + } +} +``` +#### Decoding + +```ts +// Decodes the withdraw action. +const nativeDecodedParams: WithdrawParams = client.decoding.withdrawAction( + nativeWithdrawAction.to, + nativeWithdrawAction.value, + nativeWithdrawAction.data, +); +console.log({ nativeDecodedParams }); +``` + + +Returns: + +```json +{ nativeDecodedParams: + { + type: "native", + recipientAddressOrEns: "0x1234567890123456789012345678901234567890", + amount: 10n, + } +} +``` + +```ts + +``` + + +### ERC-20 Tokens + +#### Encoding + +```ts +params = { + type: TokenType.ERC20, + tokenAddress: "0x1234567890123456789012345678901234567890", // ERC20 token's address + amount: BigInt(10), // the amount ignoring the decimals + recipientAddressOrEns: "0x1234567890123456789012345678901234567890", // the address to transfer the funds to +}; + +const erc20WithdrawAction: DaoAction = await client.encoding.withdrawAction( + params, +); +console.log({ erc20WithdrawAction }); +``` + + +Returns: + +```json +{ erc20WithdrawAction: + { + to: "0x1234567890...", + value: 0n; + data: Uint8Array[12,34,45...] + } +} +``` + +#### Decoding + +```ts +const erc20DecodedParams = client.decoding.withdrawAction( + erc20WithdrawAction.to, + erc20WithdrawAction.value, + erc20WithdrawAction.data, +); +console.log({ erc20DecodedParams }); +``` + + +Returns: + +``` +{ erc20DecodedParams: + { + type: "erc20", + recipientAddressOrEns: "0x1234567890123456789012345678901234567890", + amount: 10n, + tokenAddress: "0x1234567890123456789012345678901234567890", + } +} +``` + +```ts + +``` + + +### NFT (ERC-721) Tokens + +#### Encoding + +```ts +params = { + type: TokenType.ERC721, + tokenAddress: "0x1234567890123456789012345678901234567890", // ERFC721's token contract address + tokenId: BigInt(10), + recipientAddressOrEns: "0x1234567890123456789012345678901234567890", // the address to transfer the funds to + daoAddressOrEns: "0x1234567890123456789012345678901234567890", // the address of the DAO +}; + +const erc721WithdrawAction: DaoAction = await client.encoding.withdrawAction( + params, +); +console.log({ erc721WithdrawAction }); +``` + + +#### Decoding + +```ts +const erc721DecodedParams = client.decoding.withdrawAction( + erc721WithdrawAction.to, + erc721WithdrawAction.value, + erc721WithdrawAction.data, +); +console.log({ erc721DecodedParams }); +``` + + +Returns: +``` +{ + type: TokenType.ERC721; + tokenAddress: "0x1234567890123456789012345678901234567890"; + tokenId: 10n; + daoAddressOrEns: "0x1234567890123456789012345678901234567890"; + recipientAddressOrEns: "0x1234567890123456789012345678901234567890"; +} +```### NFT (ERC-1155) Tokens + +#### Encoding + +```ts +params = { + type: TokenType.ERC1155, + tokenAddress: "0x1234567890123456789012345678901234567890", // ERFC721's token contract address + tokenIds: [BigInt(10)], // array of token ids + amounts: [BigInt(20)], // array of amounts + recipientAddressOrEns: "0x1234567890123456789012345678901234567890", // the address to transfer the funds to + daoAddressOrEns: "0x1234567890123456789012345678901234567890", // the address of the DAO +}; + +const erc1155WithdrawAction: DaoAction = await client.encoding.withdrawAction( + params, +); +console.log({ erc1155WithdrawAction }); +``` + + +#### Decoding + +```ts +const erc1155WithdrawDecodedParams = client.decoding.withdrawAction( + erc1155WithdrawAction.to, + erc1155WithdrawAction.value, + erc1155WithdrawAction.data, +); +console.log({ erc1155WithdrawDecodedParams }); +``` + + +Returns: +``` +{ + type: TokenType.ERC1155, + tokenAddress: "0x1234567890123456789012345678901234567890", + tokenIds: [10n], + amounts: [20n], + daoAddressOrEns: "0x1234567890123456789012345678901234567890", + recipientAddressOrEns: "0x1234567890123456789012345678901234567890", +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/07-update-metadata.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/07-update-metadata.md new file mode 100644 index 00000000..ee2856e1 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/07-update-metadata.md @@ -0,0 +1,115 @@ +--- +title: Update DAO Metadata +--- + +## Update a DAO's Metadata + +Updates the metadata of a given DAO. + +### Encoding + +```ts +import { Client, DaoMetadata } from "@aragon/sdk-client"; +import { DaoAction } from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Instantiates an Aragon OSx SDK client. +const client: Client = new Client(context); + +const metadataParams: DaoMetadata = { + name: "New Name", + description: "New description", + avatar: "https://theavatar.com/image.jpg", + links: [ + { + url: "https://discord.com/...", + name: "Discord", + }, + { + url: "https://twitter.com/...", + name: "Twitter", + }, + ], +}; + +const daoAddressOrEns: string = "0x123458235832745982839878932332423"; // or my-dao.dao.eth + +// Pins the metadata in IPFS and returns the IPFS URI. +const ipfsUri: string = await client.methods.pinMetadata(metadataParams); + +// Update the metadata of a given DAO. +const action: DaoAction = await client.encoding.updateDaoMetadataAction( + daoAddressOrEns, + ipfsUri, +); +console.log({ action }); +``` + + +Returns: + +```json +{ action: + { + to: "0x123123123...", + value: 0n, + data: Uint8Array[12,34,45...] + } +} +``` + +### Decoding + +```ts +// Decodes the update metadata action. +const decodedParams: DaoMetadata = await client.decoding + .updateDaoMetadataAction( + action.data, + ); +console.log({ decodedParams }); +``` + + +Returns: + +```json +{ + "name":"New Name", + "description":"New description", + "avatar":"https://theavatar.com/image.jpg", + "links":[ + { + "url":"https://discord.com/...", + "name":"Discord" + }, + { + "url":"https://twitter.com/...", + "name":"Twitter" + } + ] +} +``` + +```ts + +``` + + +#### Raw Action + +Decode an update metadata action and expect an IPFS URI containing the CID of the metadata. + +```ts +// Decodes the parameters of an update metadata raw action. +const decodedParamsRaw: string = client.decoding.updateDaoMetadataRawAction( + action.data, +); +console.log({ decodedParamsRaw }); +``` + + +Returns: + +``` + { decodedParamsRaw: "ipfs://Qm..." } +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/08-set-dao-uri.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/08-set-dao-uri.md new file mode 100644 index 00000000..16b08d70 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/08-set-dao-uri.md @@ -0,0 +1,57 @@ +--- +title: Set DAO URI +--- + +## Set the DAO URI + +Encodes the action of setting the DAO's URI. + +### Encoding + +```ts +import { Client } from "@aragon/sdk-client"; +import { DaoAction } from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Instantiates an Aragon OSx SDK client. +const client: Client = new Client(context); + +const daoAddressOrEns: string = "0x123123123123123123123123123123123123"; + +const daoUri: string = "https://the.dao/uri"; // the URI to be defined for the DAO. + +const action: DaoAction = client.encoding.setDaoUriAction( + daoAddressOrEns, + daoUri, +); +console.log({ action }); +``` + + +Returns: + +```json +{ action: + { + to: "0x123123123...", + value: 0n, + data: Uint8Array[12,34,45...] + } +} +``` + +### Decoding + +Decodes the action of setting a DAO's URI + +```ts +const decodedParams: string = client.decoding.setDaoUriAction(action.data); +console.log({ decodedParams }); +``` + + +Returns: + +``` + { decodedParams: "https://the.dao.uri" } +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/09-set-signature-validator.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/09-set-signature-validator.md new file mode 100644 index 00000000..c3d9e23c --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/09-set-signature-validator.md @@ -0,0 +1,56 @@ +--- +title: Set Signature Validator +--- + +## Set the Signature Validator + +Encodes the action of setting the signatura validator of the DAO. + +### Encoding + +```ts +import { Client } from "@aragon/sdk-client"; +import { DaoAction } from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Instantiates an Aragon OSx SDK client. +const client: Client = new Client(context); + +const daoAddressOrEns: string = "0x123123123123123123123123123123123123"; +const signatureValidator: string = "0x1234567890123456789012345678901234567890"; + +const action: DaoAction = client.encoding.setSignatureValidatorAction( + daoAddressOrEns, + signatureValidator, +); +console.log({ action }); +``` + + +Returns: + +```json +{ action: + { + to: "0x123123123...", + value: 0n, + data: Uint8Array[12,34,45...] + } +} +``` + +### Decoding + +```ts +const decodedParams: string = client.decoding.setSignatureValidatorAction( + action.data, +); +console.log({ decodedParams }); +``` + + +Returns: + +``` + { decodedParams: "0x1234567890123456789012345678901234567890" } +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/10-upgrade-to.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/10-upgrade-to.md new file mode 100644 index 00000000..fe8a9a45 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/10-upgrade-to.md @@ -0,0 +1,53 @@ +--- +title: Upgrade To a Contract Implementation +--- + +## Upgrade To a Contract Implementation + +Encodes the action of upgrading the DAO proxy contract to a new implementation address. + +### Encoding + +```ts +import { Client } from "@aragon/sdk-client"; +import { DaoAction } from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Instantiates an Aragon OSx SDK client. +const client: Client = new Client(context); + +const daoAddressOrEns: string = "0x123123123123123123123123123123123123"; +const implementationAddress: string = + "0x1234567890123456789012345678901234567890"; + +const action: DaoAction = client.encoding.upgradeToAction( + daoAddressOrEns, + implementationAddress, +); +console.log({ action }); +``` + + +```json +{ action: + { + to: "0x123123123...", + value: 0n, + data: Uint8Array[12,34,45...] + } +} +``` + +### Decoding + +```ts +const decodedParams: string = client.decoding.upgradeToAction(action.data); +console.log({ decodedParams }); +``` + + +Returns: + +``` + { decodedParams: "0x1234567890123456789012345678901234567890" } +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/11-upgrade-to-and-call.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/11-upgrade-to-and-call.md new file mode 100644 index 00000000..ebf6f63d --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/11-upgrade-to-and-call.md @@ -0,0 +1,65 @@ +--- +title: Upgrade To And Call +--- + +## Upgrade the DAO and Call a Method + +Encodes the action of upgrading your DAO and doing a subsequent method call. + +### Encoding + +```ts +import { Client, UpgradeToAndCallParams } from "@aragon/sdk-client"; +import { DaoAction } from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Instantiates an Aragon OSx SDK client. +const client: Client = new Client(context); + +const upgradeToAndCallParams = { + implementationAddress: "0x1234567890123456789012345678901234567890", // the implementation address to be upgraded to. + data: new Uint8Array([10, 20, 130, 40]), +}; + +const daoAddressOrEns: string = "0x123123123123123123123123123123123123"; + +// Encodes the action of upgrading your DAO and doing a subsequent method call. +const action: DaoAction = client.encoding.upgradeToAndCallAction( + daoAddressOrEns, + upgradeToAndCallParams, +); +console.log({ action }); +``` + + +Returns: + +```json +{ action: + { + to: "0x123123123...", + value: 0n, + data: Uint8Array[12,34,45...] + } +} +``` + +### Decoding + +```ts +const decodedParams: UpgradeToAndCallParams = client.decoding + .upgradeToAndCallAction(action.data); +console.log({ decodedParams }); +``` + + +Returns: + +``` +{ decodedParams: + { + implementationAddress: "0x1234567890...", + data: Uint8Array[12,34,45...] + } +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-apply-installation.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-apply-installation.md new file mode 100644 index 00000000..3606ca7b --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-apply-installation.md @@ -0,0 +1,122 @@ +--- +title: Apply Installation +--- + +## Apply a Plugin Installation + +Encodes the action of applying a plugin installation. + +### Encoding + +```ts +import { Client, PermissionIds } from "@aragon/sdk-client"; +import { + ApplyInstallationParams, + DaoAction, + DecodedApplyInstallationParams, + PermissionOperationType, +} from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Instantiates an Aragon OSx SDK client. +const client: Client = new Client(context); + +// This variable contains the values received on the prepareInstallation() method +const applyInstallationParams: ApplyInstallationParams = { + helpers: [ + "0x1234567890123456789012345678901234567890", + "0x2345678901234567890123456789012345678901", + "0x3456789012345678901234567890123456789012", + "0x4567890123456789012345678901234567890123", + "0x5678901234567890123456789012345678901234", + ], + permissions: [{ + condition: "0x1234567890123456789012345678901234567890", + operation: PermissionOperationType.GRANT_WITH_CONDITION, + permissionId: PermissionIds.EXECUTE_PERMISSION_ID, // hash("EXECUTE_PERMISSION_ID") + where: "0x1234567890123456789012345678901234567890", + who: "0x2345678901234567890123456789012345678901", + }], + versionTag: { + build: 1, + release: 1, + }, + pluginRepo: "0x2345678901234567890123456789012345678901", + pluginAddress: "0x1234567890123456789012345678901234567890", +}; + +const daoAddressOrEns: string = "0x123123123123123123123123123123123123"; // "my-dao.eth" + +const actions: DaoAction[] = client.encoding.applyInstallationAction( + daoAddressOrEns, + applyInstallationParams, +); +console.log(actions); +``` + + +Returns three actions: + +- Grant root permission to the Plugin Setup Processor +- Ask it to apply the installation +- Revoke the root permission to the Plugin Setup Processor + +```json +[ + { + to: "0x123123123...", + value: 0n, + data: Uint8Array[12,34,45...] + }, + { + to: "0x123123123...", + value: 0n, + data: Uint8Array[12,34,45...] + }, + { + to: "0x123123123...", + value: 0n, + data: Uint8Array[12,34,45...] + } +] +``` + +### Decoding + +```ts +// Decodes the apply installation action for a Multisig plugin. +const decodedParams: DecodedApplyInstallationParams = client.decoding + .applyInstallationAction(actions[1].data); +console.log({ decodedParams }); +``` + + +Returns: + +```json +{ decodedParams: + { + helpers: [ + "0x1234567890123456789012345678901234567890", + "0x2345678901234567890123456789012345678901", + "0x3456789012345678901234567890123456789012", + "0x4567890123456789012345678901234567890123", + "0x5678901234567890123456789012345678901234", + ], + permissions: [{ + condition: "0x1234567890123456789012345678901234567890", + operation: 1, + permissionId: Uint8Array([10,20,30]), + where: "0x1234567890123456789012345678901234567890", + who: "0x2345678901234567890123456789012345678901", + }], + versionTag: { + build: 1, + release: 1, + }, + pluginRepo: "0x2345678901234567890123456789012345678901", + pluginAddress: "0x1234567890123456789012345678901234567890", + }; + } +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-multisig/01-find-interface.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-multisig/01-find-interface.md new file mode 100644 index 00000000..84c65428 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-multisig/01-find-interface.md @@ -0,0 +1,30 @@ +--- +title: Get Function Parameters +--- + +## Get Function Parameters from an Encoded Action + +Decodes the parameters of a function call from the Multisig plugin contract. + +### Decoding + +```ts +import { multisigClient } from "./index"; + +const data: Uint8Array = new Uint8Array([12, 56]); + +// Decodes the parameters of a function call from the Multisig plugin. +const functionParams = multisigClient.decoding.findInterface(data); +console.log(functionParams); +``` + + +Returns: + +``` +{ + id: "function functionName(param1, param2)" + functionName: "functionName" + hash: "0x12345678" +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-multisig/02-add-addresses.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-multisig/02-add-addresses.md new file mode 100644 index 00000000..fc3174ba --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-multisig/02-add-addresses.md @@ -0,0 +1,74 @@ +--- +title: Add Members +--- + +## Add Members from the Multisig Plugin + +Adds new address as members of the Multisig plugin installed in a DAO, so they are now able to vote on proposals. + +## Caveats + +This action is usually paired with `updatePluginSettingsAction` to update the minimum approvals required for a multisig proposal to pass. +In the case of adding addresses the order in which you execute actions matter, so if you are adding members and updating the plugin setting make sure that the order of the actions is first the `addAddressesAction` and then the `updatePluginSettingsAction`. +If this is not done correctly the transaction may fail and in the worst case brick the DAO. + +### Encoding + +```ts +import { AddAddressesParams } from "@aragon/sdk-client"; +import { DaoAction } from "@aragon/sdk-client-common"; +import { multisigClient } from "./index"; + +// The addresses to add as members. +const members: string[] = [ + "0x1357924680135792468013579246801357924680", + "0x2468013579246801357924680135792468013579", + "0x0987654321098765432109876543210987654321", +]; + +const addAddressesParams: AddAddressesParams = { + members, + pluginAddress: "0x0987654321098765432109876543210987654321", // the address of the Multisig plugin contract installed in the DAO +}; + +// Adds the addresses as members of the Multisig plugin for a DAO. +const action: DaoAction = multisigClient.encoding.addAddressesAction( + addAddressesParams, +); +console.log({ action }); +``` + + +Returns: + +``` +{ action: + { + to: "0x1234567890...", + value: 0n, + data: Uint8Array[12,34,45...] + } +} +``` + +### Decoding + +```ts +const decodedParams: string[] = multisigClient.decoding.addAddressesAction( + action.data, +); +console.log({ decodedParams }); +``` + + +Returns: + +``` +{ decodedParams: + [ + "0x12345...", + "0x56789...", + "0x13579..." + ] +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-multisig/03-remove-addresses.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-multisig/03-remove-addresses.md new file mode 100644 index 00000000..125818b7 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-multisig/03-remove-addresses.md @@ -0,0 +1,75 @@ +--- +title: Remove Members +--- + +## Remove Members from the Multisig Plugin + +Removes a list of addresses from the Multisig plugin of a given DAO so they are no longer able to vote on Multisig proposals for that DAO. + +## Caveats + +This action is usually paired with `updatePluginSettingsAction` to update the minimum approvals required for a multisig proposal to pass. +In the case of removing addresses the order in which you execute actions matter, so if you are removing members and updating the plugin setting make sure that the order of the actions is first the `updatePluginSettingsAction` and then the `removeAddressesAction`. +If this is not done correctly the transaction may fail and in the worst case brick the DAO. + +### Encoding + +```ts +import { RemoveAddressesParams } from "@aragon/sdk-client"; +import { DaoAction } from "@aragon/sdk-client-common"; +import { multisigClient } from "./index"; + +// List of members to remove from the multisig plugin. +const members: string[] = [ + "0x1357924680135792468013579246801357924680", + "0x2468013579246801357924680135792468013579", + "0x0987654321098765432109876543210987654321", +]; + +const removeAddressesParams: RemoveAddressesParams = { + members, + pluginAddress: "0x0987654321098765432109876543210987654321", // the address of the Multisig plugin contract installed in the DAO +}; + +// Removes the addresses from the Multisig plugin of a DAO. +const action: DaoAction = multisigClient.encoding.removeAddressesAction( + removeAddressesParams, +); +console.log({ action }); +``` + + +Returns: + +``` +{ action: + { + to: "0x1234567890...", + value: 0n, + data: Uint8Array[12,34,45...] + } +} +``` + +### Decoding + +```ts +// Decodes the parameters of the remove members action from the Multisig plugin. +const decodedParams: string[] = multisigClient.decoding.removeAddressesAction( + action.data, +); +console.log({ decodedParams }); +``` + + +Returns: + +``` +{ decodedParams: + [ + "0x12345...", + "0x56789...", + "0x13579..." + ] +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-multisig/04-update-plugin-settings.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-multisig/04-update-plugin-settings.md new file mode 100644 index 00000000..410875d4 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-multisig/04-update-plugin-settings.md @@ -0,0 +1,66 @@ +--- +title: Update Multisig Settings +--- + +## Update the Multisig Plugin Settings + +Allows you to update the configuration of a Multisig plugin installed in a DAO. + +### Encoding + +```ts +import { + MultisigVotingSettings, + UpdateMultisigVotingSettingsParams, +} from "@aragon/sdk-client"; +import { DaoAction } from "@aragon/sdk-client-common"; +import { multisigClient } from "./index"; + +const params: UpdateMultisigVotingSettingsParams = { + votingSettings: { + minApprovals: 2, + onlyListed: false, + }, + pluginAddress: "0x0987654321098765432109876543210987654321", // the address of the Multisig plugin contract installed in the DAO +}; + +// Updates the voting configuration of a Multisig plugin installed in a DAO. +const action: DaoAction = multisigClient.encoding.updateMultisigVotingSettings( + params, +); +console.log({ action }); +``` + + +Returns: + +``` +{ action: + { + to: "0x1234567890...", + value: 0n, + data: Uint8Array[12,34,45...] + } +} +``` + +### Decoding + +```ts +// Decodes the update settings action for a Multisig plugin. +const decodedParams: MultisigVotingSettings = multisigClient.decoding + .updateMultisigVotingSettings(action.data); +console.log({ decodedParams }); +``` + + +Returns: + +``` +{ decodedParams: + { + minApprovals: 2, + onlyListed: false + } +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-multisig/index.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-multisig/index.md new file mode 100644 index 00000000..8f00cbde --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/12-multisig/index.md @@ -0,0 +1,18 @@ +--- +title: Multisig +--- + +## Actions of the Multisig Plugin + +With an instance of the `MultisigClient` + +```ts +import { MultisigClient } from "@aragon/sdk-client"; +import { context } from "../../index"; + +// Instantiate a Multisig client. +export const multisigClient = new MultisigClient(context); +``` + + +actions can encoded and decoded as demonstrated in the following examples. \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/01-find-interface.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/01-find-interface.md new file mode 100644 index 00000000..61f35111 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/01-find-interface.md @@ -0,0 +1,29 @@ +--- +title: Get Function Parameters +--- + +## Get function parameters from encoded action (Addresslist) + +Decodes the parameters of a function call from the Addresslist plugin. + +### Encoding + +```ts +import { addresslistVotingClient } from "./index"; + +const data: Uint8Array = new Uint8Array([12, 56]); + +const functionParams = addresslistVotingClient.decoding.findInterface(data); +console.log(functionParams); +``` + + +Returns: + +``` +{ + id: "function functionName(param1, param2)" + functionName: "functionName" + hash: "0x12345678" +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/02-add-members.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/02-add-members.md new file mode 100644 index 00000000..27fd5289 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/02-add-members.md @@ -0,0 +1,61 @@ +--- +title: Add Members +--- + +## Add Members from the Addresslist Voting Plugin + +Adds a list of addresses to the AddressList plugin so that these new addresses are able to vote in AddresslistVoting proposals. + +### Encoding + +```ts +import { DaoAction } from "@aragon/sdk-client-common"; +import { addresslistVotingClient } from "./index"; + +const members: string[] = [ + "0x1357924680135792468013579246801357924680", + "0x2468013579246801357924680135792468013579", + "0x0987654321098765432109876543210987654321", +]; + +const pluginAddress = "0x0987654321098765432109876543210987654321"; // the address of the AddresslistVoting plugin contract installed in the DAO + +const action: DaoAction = addresslistVotingClient.encoding.addMembersAction( + pluginAddress, + members, +); +console.log({ action }); +``` + + +Returns: + +```json +{ action: + { + to: "0x1234567890...", + value: 0n, + data: Uint8Array[12,34,45...] + } +} +``` +### Decoding + +```ts +const decodedParams: string[] = addresslistVotingClient.decoding + .addMembersAction(action.data); +console.log({ decodedParams }); +``` + + +Returns: + +``` +{ decodedParams: + [ + "0x12345...", + "0x56789...", + "0x13579..." + ] +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/03-remove-members.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/03-remove-members.md new file mode 100644 index 00000000..b7cd7c07 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/03-remove-members.md @@ -0,0 +1,63 @@ +--- +title: Remove Members +--- + +## Remove Members from the Addresslist Voting Plugin + +Removes an address from the Addresslist plugin so that this address is no longer able to vote in AddresslistVoting proposals. + +### Encoding + +```ts +import { DaoAction } from "@aragon/sdk-client-common"; +import { addresslistVotingClient } from "./index"; + +// Addresses to remove from the AddressList plugin. +const members: string[] = [ + "0x1357924680135792468013579246801357924680", + "0x2468013579246801357924680135792468013579", + "0x0987654321098765432109876543210987654321", +]; + +const pluginAddress: string = "0x0987654321098765432109876543210987654321"; // the address of the AddresslistVoting plugin contract installed in the DAO + +const action: DaoAction = addresslistVotingClient.encoding.removeMembersAction( + pluginAddress, + members, +); +console.log({ action }); +``` + + +Returns: + +```json +{ action: + { + to: "0x1234567890...", + value: 0n, + data: Uint8Array[12,34,45...] + } +} +``` + +### Decoding + +```ts +const decodedParams: string[] = addresslistVotingClient.decoding + .removeMembersAction(action.data); +console.log({ decodedParams }); +``` + + +Returns: + +``` +{ decodedParams: + [ + "0x12345...", + "0x56789...", + "0x13579..." + ] +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/04-update-plugin-settings.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/04-update-plugin-settings.md new file mode 100644 index 00000000..c0045099 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/04-update-plugin-settings.md @@ -0,0 +1,65 @@ +--- +title: Update Addresslist Voting Settings +--- + +## Update the Addresslist Voting Plugin Settings + +Updates the settings of a given AddresslistVoting plugin. + +### Encoding + +```ts +import { VotingMode, VotingSettings } from "@aragon/sdk-client"; +import { DaoAction } from "@aragon/sdk-client-common"; +import { addresslistVotingClient } from "./index"; + +// The action object for updating the plugin settings. +const params: VotingSettings = { + minDuration: 60 * 60 * 24 * 2, // seconds + minParticipation: 0.25, // 25% + supportThreshold: 0.5, // 50% + minProposerVotingPower: BigInt("5000"), // default 0 + votingMode: VotingMode.STANDARD, // default STANDARD, otherwise EARLY_EXECUTION or VOTE_REPLACEMENT +}; + +const pluginAddress: string = "0x1234567890123456789012345678901234567890"; // the address of the AddresslistVoting plugin contract installed in the DAO + +const action: DaoAction = addresslistVotingClient.encoding + .updatePluginSettingsAction(pluginAddress, params); +console.log({ action }); +``` + + +Returns: + +``` +{ action: + { + to: "0x1234567890...", + value: 0n, + data: Uint8Array[12,34,45...] + } +} +``` + +### Decoding + +```ts +const decodedParams: VotingSettings = addresslistVotingClient.decoding + .updatePluginSettingsAction(action.data); +console.log({ decodedParams }); +``` + + +Returns: + +```json +{ decodedParams: + { + minDuration: 7200, // seconds + minParticipation: 0.25, // 25% + supportThreshold: 0.5, // 50% + minProposerVotingPower: BigInt("1") + } +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/index.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/index.md new file mode 100644 index 00000000..06334599 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-addresslist-voting/index.md @@ -0,0 +1,22 @@ +--- +title: Addresslist Voting +--- + +## Actions of the Addresslist Voting Plugin + +With an instance of the `AddresslistVotingClient` + +```ts +import { AddresslistVotingClient } from "@aragon/sdk-client"; +import { context } from "../../index"; + +// Instantiate a plugin context from the Aragon OSx SDK context + +// Instantiates an AddresslistVoting client. +export const addresslistVotingClient = new AddresslistVotingClient( + context, +); +``` + + +actions can encoded and decoded as demonstrated in the following examples. \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-apply-uninstallation.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-apply-uninstallation.md new file mode 100644 index 00000000..8a0cc723 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/13-apply-uninstallation.md @@ -0,0 +1,106 @@ +--- +title: Apply Uninstallation +--- + +## Apply a Plugin Uninstallation + +Encodes the action of applying a plugin uninstallation. + +### Encoding + +```ts +import { + ApplyUninstallationParams, + Client, + DecodedApplyUninstallationParams, + PermissionIds, +} from "@aragon/sdk-client"; +import { DaoAction, PermissionOperationType } from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Instantiates an Aragon OSx SDK client. +const client: Client = new Client(context); + +// This variable contains the values received on the prepareUninstallation() method +const applyUninstallationParams: ApplyUninstallationParams = { + permissions: [{ + operation: PermissionOperationType.REVOKE, + permissionId: PermissionIds.EXECUTE_PERMISSION_ID, + where: "0x1234567890123456789012345678901234567890", + who: "0x2345678901234567890123456789012345678901", + }], + versionTag: { + build: 1, + release: 1, + }, + pluginRepo: "0x2345678901234567890123456789012345678901", + pluginAddress: "0x1234567890123456789012345678901234567890", +}; + +const daoAddressOrEns: string = "0x123123123123123123123123123123123123"; // "my-dao.eth" + +const actions: DaoAction[] = client.encoding.applyUninstallationAction( + daoAddressOrEns, + applyUninstallationParams, +); +console.log(actions); +``` + + +Returns three actions: + +- Grant root permission to the Plugin Setup Processor +- Ask it to apply the uniinstallation +- Revoke the root permission to the Plugin Setup Processor + +```json +[ + { + to: "0x123123123...", + value: 0n, + data: Uint8Array[12,34,45...] + }, + { + to: "0x123123123...", + value: 0n, + data: Uint8Array[12,34,45...] + }, + { + to: "0x123123123...", + value: 0n, + data: Uint8Array[12,34,45...] + } +] +``` + +### Decoding + +```ts +// Decodes the apply uniinstallation action for a Multisig plugin. +const decodedParams: DecodedApplyUninstallationParams = client.decoding + .applyUninstallationAction(actions[1].data); +console.log({ decodedParams }); +``` + + +Returns: + +```json +{ decodedParams: + { + permissions: [{ + operation: 1, // REVOKE + permissionId: Uint8Array([10,20,30]), + where: "0x1234567890123456789012345678901234567890", + who: "0x2345678901234567890123456789012345678901", + }], + versionTag: { + build: 1, + release: 1, + }, + pluginRepo: "0x2345678901234567890123456789012345678901", + pluginAddress: "0x1234567890123456789012345678901234567890", + }; + } +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/14-initialize-from.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/14-initialize-from.md new file mode 100644 index 00000000..b8a5aea9 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/14-initialize-from.md @@ -0,0 +1,60 @@ +--- +title: Initialize From +--- + +## Upgrade a DAO to a new version + +Encodes the action for upgrading the dao to a new version and passing initialization data of the new version. + +### Encoding + +```ts +import { Client, InitializeFromParams } from "@aragon/sdk-client"; +import { DaoAction } from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Instantiates an Aragon OSx SDK client. +const client: Client = new Client(context); + +// This variable contains the values received on the ininitializeFrom() method +const initializeFromParams: InitializeFromParams = { + previousVersion: [1, 0, 0], + initData: new Uint8Array([12, 34, 45, 85, 95, 45, 73]), // initialization data for the new version to be pased to upgradeToAndCall() +}; + +const daoAddressOrEns: string = "0x123123123123123123123123123123123123"; // "my-dao.eth" + +const action: DaoAction = client.encoding.initializeFromAction( + daoAddressOrEns, + initializeFromParams, +); +console.log(action); +``` + + +```json + { + to: "0x123123123...", + value: 0n, + data: Uint8Array[12,34,45...] + } + ``` + + ### Decoding + +```ts +// Decodes the initialize from action. +const decodedParams: InitializeFromParams = client.decoding + .initializeFromAction(action.data); +console.log({ decodedParams }); +``` + + +Returns: + + ```json + { + previousVersion: [1, 0, 0], + initData: Uint8Array[12,34,45...] + } + ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/14-token-voting/01-find-interface.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/14-token-voting/01-find-interface.md new file mode 100644 index 00000000..5793b147 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/14-token-voting/01-find-interface.md @@ -0,0 +1,30 @@ +--- +title: Get Function Parameters +--- + +## Get Function Parameters from an Encoded Action + +Decodes the parameters of a function call from the TokenVoting plugin contract. + +### Decoding + +```ts +import { tokenVotingClient } from "./index"; + +const data: Uint8Array = new Uint8Array([12, 56]); + +// Decodes the parameters of a function call from the TokenVoting plugin. +const functionParams = tokenVotingClient.decoding.findInterface(data); +console.log(functionParams); +``` + + +Returns: + +``` +{ + id: "function functionName(param1, param2)" + functionName: "functionName" + hash: "0x12345678" +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/14-token-voting/02-mint-token.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/14-token-voting/02-mint-token.md new file mode 100644 index 00000000..0a0731f4 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/14-token-voting/02-mint-token.md @@ -0,0 +1,62 @@ +--- +title: Mint Tokens +--- + +## Mint Vote Tokens for the TokenVoting Plugin + +Mints vote tokens for an installed TokenVoting plugin. + +### Encoding + +```ts +import { MintTokenParams } from "@aragon/sdk-client"; +import { DaoAction } from "@aragon/sdk-client-common"; +import { tokenVotingClient } from "./index"; + +const params: MintTokenParams = { + address: "0x1234567890123456789012345678901234567890", // address which will receive the minted tokens + amount: BigInt(10), // amount of tokens they will receive +}; + +const minterAddress: string = "0x0987654321098765432109876543210987654321"; // the contract address of the token to mint + +const action: DaoAction = tokenVotingClient.encoding.mintTokenAction( + minterAddress, + params, +); +console.log({ action }); +``` + + +Returns: + +```json +{ action: + { + to: "0x0987654321098765432...", + value: 0n, + data: Uint8Array[12,34,45...] + } +} +``` + +### Decoding + +```ts +// Decodes the parameters of a mint token action. +const decodedParams: MintTokenParams = tokenVotingClient.decoding + .mintTokenAction(action.data); +console.log({ decodedParams }); +``` + + +Returns: + +```json +{ decodedParams: + { + address: "0x12345...", + amount: 10n + } +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/14-token-voting/03-update-plugin-settings.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/14-token-voting/03-update-plugin-settings.md new file mode 100644 index 00000000..49bce5c4 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/14-token-voting/03-update-plugin-settings.md @@ -0,0 +1,69 @@ +--- +title: Update Token Voting Settings +--- + +## Update the Token Voting Plugin Settings + +Updates the configuration of a given TokenVoting plugin for a DAO. + +### Encoding + +```ts +import { VotingMode, VotingSettings } from "@aragon/sdk-client"; +import { DaoAction } from "@aragon/sdk-client-common"; +import { tokenVotingClient } from "./index"; + +// The new configuration parameters for the plugin +const params: VotingSettings = { + minDuration: 60 * 60 * 24 * 2, // seconds + minParticipation: 0.25, // 25% + supportThreshold: 0.5, // 50% + minProposerVotingPower: BigInt("5000"), // default 0 + votingMode: VotingMode.STANDARD, // default standard, otherwise EARLY_EXECUTION or VOTE_REPLACEMENT +}; + +const pluginAddress: string = "0x1234567890123456789012345678901234567890"; // the address of the TokenVoting plugin contract installed in the DAO + +// Updates the configuration of a TokenVoting plugin for a DAO. +const action: DaoAction = tokenVotingClient.encoding.updatePluginSettingsAction( + pluginAddress, + params, +); +console.log({ action }); +``` + + +Returns: + +``` +{ action: + { + to: "0x1234567890...", + value: 0n, + data: Uint8Array[12,34,45...] + } +} +``` + +### Decoding + +```ts +// Decodes the parameters of an update plugin settings action. +const decodedParams: VotingSettings = tokenVotingClient + .decoding.updatePluginSettingsAction(action.data); +console.log({ decodedParams }); +``` + + +Returns: + +``` +{ decodedParams: + { + minDuration: 7200, // seconds + minParticipation: 0.25, // 25% + supportThreshold: 0.5, // 50% + minProposerVotingPower: BigInt("5000") + } +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/14-token-voting/index.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/14-token-voting/index.md new file mode 100644 index 00000000..d141ff6c --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/14-token-voting/index.md @@ -0,0 +1,22 @@ +--- +title: Token Voting +--- + +## Actions of the Token Voting Plugin + +With an instance of the `TokenVotingClient` + +```ts +import { TokenVotingClient } from "@aragon/sdk-client"; +import { context } from "../../index"; + +// Instantiates a plugin context from the Aragon OSx SDK context. + +// Instantiates a TokenVoting client. +export const tokenVotingClient: TokenVotingClient = new TokenVotingClient( + context, +); +``` + + +actions can encoded and decoded as demonstrated in the following examples. \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/15-apply-update.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/15-apply-update.md new file mode 100644 index 00000000..17d60c3f --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/15-apply-update.md @@ -0,0 +1,110 @@ +--- +title: Apply Update +--- + +## Apply a Plugin Update + +Encodes the action of applying a plugin update. + +### Encoding + +```ts +import { + ApplyUpdateParams, + Client, + DecodedApplyUpdateParams, + PermissionIds, +} from "@aragon/sdk-client"; +import { DaoAction, PermissionOperationType } from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Instantiates an Aragon OSx SDK client. +const client: Client = new Client(context); + +// This variable contains the values received on the prepareUpdate() method +const applyUpdateParams: ApplyUpdateParams = { + permissions: [{ + operation: PermissionOperationType.REVOKE, + permissionId: PermissionIds.EXECUTE_PERMISSION_ID, + where: "0x1234567890123456789012345678901234567890", + who: "0x2345678901234567890123456789012345678901", + }], + initData: new Uint8Array([12, 34, 45, 56]), + helpers: [], + versionTag: { + build: 1, + release: 1, + }, + pluginRepo: "0x2345678901234567890123456789012345678901", + pluginAddress: "0x1234567890123456789012345678901234567890", +}; + +const daoAddressOrEns: string = "0x123123123123123123123123123123123123"; // "my-dao.eth" + +const actions: DaoAction[] = client.encoding.applyUpdateAndPermissionsActionBlock( + daoAddressOrEns, + applyUpdateParams, +); +console.log(actions); +``` + + +Returns three actions: + +- Grant root permission to the Plugin Setup Processor +- Ask it to apply the update +- Revoke the root permission to the Plugin Setup Processor + +```json +[ + { + to: "0x123123123...", + value: 0n, + data: Uint8Array[12,34,45...] + }, + { + to: "0x123123123...", + value: 0n, + data: Uint8Array[12,34,45...] + }, + { + to: "0x123123123...", + value: 0n, + data: Uint8Array[12,34,45...] + } +] +``` + +### Decoding + +```ts +// Decodes the apply update action for a Multisig plugin. +const decodedParams: DecodedApplyUpdateParams = client.decoding + .applyUpdateAction(actions[1].data); +console.log({ decodedParams }); +``` + + +Returns: + +```json +{ decodedParams: + { + permissions: [{ + operation: 1, // REVOKE + permissionId: Uint8Array([10,20,30]), + where: "0x1234567890123456789012345678901234567890", + who: "0x2345678901234567890123456789012345678901", + }], + versionTag: { + build: 1, + release: 1, + }, + initData: Uint8Array[12,34,45...], + helpers: [], + pluginRepo: "0x2345678901234567890123456789012345678901", + pluginAddress: "0x1234567890123456789012345678901234567890", + }; + } +} +``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/16-dao-update.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/16-dao-update.md new file mode 100644 index 00000000..a132f386 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/16-dao-update.md @@ -0,0 +1,69 @@ +--- +title: Update a DAO +--- + +## Generate a DAO Update action + +Given a DAO address, the previous version and the new DAO Factory address, it generates the actions to update a DAO. + +### Encoding + +```ts +import { + Client, + DaoUpdateDecodedParams, + DaoUpdateParams, +} from "@aragon/sdk-client"; +import { + DaoAction, + LIVE_CONTRACTS, +} from "@aragon/sdk-client-common"; +import { context } from "../index"; + +// Instantiates an Aragon OSx SDK client. +const client: Client = new Client(context); + +const daoUpdateParams: DaoUpdateParams = { + previousVersion: [1, 0, 0], + daoFactoryAddress: LIVE_CONTRACTS["1.3.0"].base.daoFactoryAddress, // if not specified it will use the latest version in the context network + initData: new Uint8Array([12, 34, 45, 56]), // data needed to update specified, empty by default +}; + +const daoAddressOrEns: string = "0x123123123123123123123123123123123123"; // "my-dao.eth" + +const actions: DaoAction = await client.encoding.daoUpdateAction( + daoAddressOrEns, + daoUpdateParams, +); +console.log(actions); +``` + + +```json +{ + to: "0x123123123...", + value: 0n, + data: Uint8Array[12,34,45...] +}, + ``` + + ### Decoding + +```ts +// Decodes the apply update action for a Multisig plugin. +const decodedParams: DaoUpdateDecodedParams = client.decoding + .daoUpdateAction(actions[1].data); +console.log({ decodedParams }); +``` + + +Returns: + ```json + { decodedParams: + { + previousVersion: [1, 0, 0], + implementationAddress: "0x123123123...", // DAO base implementation address + initData: Uint8Array[12,34,45...] + } + } + ``` \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/index.md b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/index.md new file mode 100644 index 00000000..8737f75f --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/05-encoders-decoders/index.md @@ -0,0 +1,22 @@ +--- +title: Action Encoders & Decoders +--- + +## Encoding Actions + +Proposals will eventually need to execute some action on behalf of the DAO, which needs to be encoded in a low-level format. + +The action encoders help encoding the most typical DAO operations. The way they work is that they can only get executed once a proposal passes. + +Hence, the flow is the following: +1. Encode the actions that you want to execute +2. Create a proposal with these actions in the `actions` field +3. Vote until the proposal has a majority: if the voting mode is `EARLY_EXECUTION` or until the `endDate` is achieved if the `votingMode` is `STANDARD` or `VOTE_REPLACEMENT` +4. If the propoosal passes the required approvals and participation, execute the proposal +5. Success + +## Decoding Actions + +To obtain the encoded back in readable format, you can decode +After a sucessful transaction, you can de +Decodes the actions of a transaction to understand them in a human-readable format. \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/01-examples/index.md b/versioned_docs/version-1.3.0/sdk/01-examples/index.md new file mode 100644 index 00000000..d6d94495 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/01-examples/index.md @@ -0,0 +1,99 @@ +--- +title: Getting Started +--- + +## Getting Started With the Aragon SDK + +### Before You Begin + +The Aragon OSx SDK is Javascript agnostic, which means you can use it with any Javascript framework, including popular ones like React, Vite, or Vue. + +However, keep in mind that because server-side rendering is not supported yet for some crypto packages, you will not be able to use a framework like NextJS. Only frameworks that run entirely on client-side are supported. + +Also know that all documentation within this site is done with Typescript. You can read more about [Typescript here](https://www.typescriptlang.org/). + +### Installing the SDK + +First thing you want to do is install the Aragon OSx SDK package into your product. You can do this by using `npm` or `yarn`. + +```bash +npm install @aragon/sdk-client +``` +or +```bash +yarn add @aragon/sdk-client +``` + +### Setting up the Context + +Then, you'll want to set up the Aragon OSx SDK context within your application to have access to the SDK functions. You can do this at any point within your app. + +However, so you're not setting it up multiple times, we recommend you set it up as a [context hook](https://www.freecodecamp.org/news/react-context-for-beginners/) within Javascript application if you're using a framework like React, Vue, or other, or within the entry file of your app. + +```ts +import { Wallet } from "@ethersproject/wallet"; +import { Context, ContextParams } from "@aragon/sdk-client"; +import { SupportedNetwork } from "@aragon/sdk-client-common"; + +// Set up your IPFS API key. You can get one either by running a local node or by using a service like Infura or Alechmy. +// Make sure to always keep these private in a file that is not committed to your public repository. +export const IPFS_API_KEY: string = "ipfs-api-key"; + +// OPTION A: The simplest ContextParams you can have is this. This uses our default values and should work perfectly within your product. +const minimalContextParams: ContextParams = { + // Choose the network you want to use. You can use "goerli" (Ethereum) or "maticmum" (Polygon) for testing, or "mainnet" (Ethereum) and "polygon" (Polygon) for mainnet. + network: SupportedNetwork.MAINNET, + web3Providers: "https://eth.llamarpc.com", + // This is the signer account who will be signing transactions for your app. You can use also use a specific account where you have funds, through passing it `new Wallet("your-wallets-private-key")` or pass it in dynamically when someone connects their wallet to your dApp. + signer: Wallet.createRandom(), +}; + +// OPTION B: For a more advanced option, you can use the following ContextParams. This will allow you to use your own custom values if desired. +export const contextParams: ContextParams = { + // Choose the network you want to use. You can use "goerli" (Ethereum) or "maticmum" (Mumbai) for testing, or "mainnet" (Ethereum) and "polygon" (Polygon) for mainnet. + network: "goerli", + // This is the account that will be signing transactions for your app. You can use also use a specific account where you have funds, through passing it `new Wallet("your-wallets-private-key")` or pass it in dynamically when someone connects their wallet to your dApp. + signer: Wallet.createRandom(), + // Optional on "rinkeby", "arbitrum-rinkeby" or "mumbai" + // Pass the address of the `DaoFactory` contract you want to use. You can find it here based on your chain of choice: https://github.com/aragon/core/blob/develop/active_contracts.json + // Optional. Leave it empty to use Aragon's DAO Factory contract and claim a dao.eth subdomain + daoFactoryAddress: "0x1234381072385710239847120734123847123", + // Optional. Pass the address of the ensRegistry for networks other than Mainnet or Goerli. + // It will default to the registry deployed by Aragon. You can check them here: https://github.com/aragon/osx/blob/develop/active_contracts.json + ensRegistryAddress: "0x1234381072385710239847120734123847123", + // Choose your Web3 provider: Cloudfare, Infura, Alchemy, etc. + // Remember to change the list of providers if a different network is selected + web3Providers: ["https://rpc.ankr.com/eth_goerli"], + // Optional. By default, it will use Aragon's provided endpoints. + // They will switch depending on the network (production, development) + ipfsNodes: [ + { + url: "https://test.ipfs.aragon.network/api/v0", + headers: { "X-API-KEY": IPFS_API_KEY || "" }, + }, + ], + // Optional. By default it will use Aragon's provided endpoints. + // They will switch depending on the network (production, development) + graphqlNodes: [ + { + url: "https://subgraph.satsuma-prod.com/aragon/core-goerli/api", + }, + ], +}; + +// After defining the context parameters, you'll use them to instantiate the Aragon SDK context +export const context: Context = new Context(contextParams); // or minimalContextParams +// Instantiate the Aragon SDK context +export const minimalContext: Context = new Context(minimalContextParams); +``` + + +Update the context with new parameters if you wish to throughout your app. + +```ts +context.set({ network: 1 }); +context.set({ signer: new Wallet("private key") }); // if you're using wagmi library, you can also get the signer through their [`useSigner` method](https://wagmi.sh/react/hooks/useSigner) inside a `useEffect` hook. +context.set(contextParams); +``` + + diff --git a/versioned_docs/version-1.3.0/sdk/02-reference-guide/01-client.md b/versioned_docs/version-1.3.0/sdk/02-reference-guide/01-client.md new file mode 100644 index 00000000..ad3837fa --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/02-reference-guide/01-client.md @@ -0,0 +1,757 @@ +## Classes + +
+
Client
+

Provider a generic client with high level methods to manage and interact with DAO's

+
ClientDecoding
+

Decoding module the SDK Generic Client

+
ClientEncoding
+

Encoding module the SDK Generic Client

+
ClientEstimation
+

Estimation module the SDK Generic Client

+
ClientMethods
+

Methods module the SDK Generic Client

+
+ + + +## Client +

Provider a generic client with high level methods to manage and interact with DAO's

+ +**Kind**: global class + + +## ClientDecoding +

Decoding module the SDK Generic Client

+ +**Kind**: global class + +* [ClientDecoding](#clientdecoding) + * [.applyInstallationAction(Uint8Array)](#clientdecodingapplyinstallationactionuint8array--decodedapplyinstallationparams) ⇒ DecodedApplyInstallationParams + * [.applyUninstallationAction(Uint8Array)](#clientdecodingapplyuninstallationactionuint8array--decodedapplyinstallationparams) ⇒ DecodedApplyInstallationParams + * [.applyUpdateAction(data)](#clientdecodingapplyupdateactiondata--decodedapplyupdateparams) ⇒ DecodedApplyUpdateParams + * [.grantAction(data)](#clientdecodinggrantactiondata--grantpermissiondecodedparams) ⇒ GrantPermissionDecodedParams + * [.grantWithConditionAction(data)](#clientdecodinggrantwithconditionactiondata--grantpermissionwithconditionparams) ⇒ GrantPermissionWithConditionParams + * [.revokeAction(data)](#clientdecodingrevokeactiondata--revokepermissiondecodedparams) ⇒ RevokePermissionDecodedParams + * [.withdrawAction(data)](#clientdecodingwithdrawactiondata--withdrawparams) ⇒ WithdrawParams + * [.updateDaoMetadataRawAction(data)](#clientdecodingupdatedaometadatarawactiondata--string) ⇒ string + * [.updateDaoMetadataAction(data)](#clientdecodingupdatedaometadataactiondata--promisedaometadata) ⇒ Promise.<DaoMetadata> + * [.setDaoUriAction(data)](#clientdecodingsetdaouriactiondata--string) ⇒ string + * [.registerStandardCallbackAction(data)](#clientdecodingregisterstandardcallbackactiondata--registerstandardcallbackparams) ⇒ RegisterStandardCallbackParams + * [.setSignatureValidatorAction(data)](#clientdecodingsetsignaturevalidatoractiondata--string) ⇒ string + * [.upgradeToAndCallAction(data)](#clientdecodingupgradetoandcallactiondata--upgradetoandcallparams) ⇒ UpgradeToAndCallParams + * [.initializeFromAction(data)](#clientdecodinginitializefromactiondata--initializefromparams) ⇒ InitializeFromParams + * [.findInterface(data)](#clientdecodingfindinterfacedata--interfaceparams--null) ⇒ InterfaceParams \| null + * [.daoUpdateAction(data)](#clientdecodingdaoupdateactiondata--daoupdatedecodedparams) ⇒ DaoUpdateDecodedParams + + + +### clientDecoding.applyInstallationAction(Uint8Array) ⇒ DecodedApplyInstallationParams +**Kind**: instance method of [ClientDecoding](#clientdecoding) +**Returns**: DecodedApplyInstallationParams + +| Param | Type | +| --- | --- | +| Uint8Array | data | + + + +### clientDecoding.applyUninstallationAction(Uint8Array) ⇒ DecodedApplyInstallationParams +**Kind**: instance method of [ClientDecoding](#clientdecoding) +**Returns**: DecodedApplyInstallationParams + +| Param | Type | +| --- | --- | +| Uint8Array | data | + + + +### clientDecoding.applyUpdateAction(data) ⇒ DecodedApplyUpdateParams +

Decodes the apply update parameters from an encoded apply update action

+ +**Kind**: instance method of [ClientDecoding](#clientdecoding) +**Returns**: DecodedApplyUpdateParams + +| Param | Type | +| --- | --- | +| data | Uint8Array | + + + +### clientDecoding.grantAction(data) ⇒ GrantPermissionDecodedParams +

Decodes the permission parameters from an encoded grant action

+ +**Kind**: instance method of [ClientDecoding](#clientdecoding) +**Returns**: GrantPermissionDecodedParams + +| Param | Type | +| --- | --- | +| data | Uint8Array | + + + +### clientDecoding.grantWithConditionAction(data) ⇒ GrantPermissionWithConditionParams +

Decodes the grant permission with condition parameters from an encoded grant with condition action

+ +**Kind**: instance method of [ClientDecoding](#clientdecoding) +**Returns**: GrantPermissionWithConditionParams + +| Param | Type | +| --- | --- | +| data | Uint8Array | + + + +### clientDecoding.revokeAction(data) ⇒ RevokePermissionDecodedParams +

Decodes the permission parameters from an encoded revoke action

+ +**Kind**: instance method of [ClientDecoding](#clientdecoding) +**Returns**: RevokePermissionDecodedParams + +| Param | Type | +| --- | --- | +| data | Uint8Array | + + + +### clientDecoding.withdrawAction(data) ⇒ WithdrawParams +

Decodes the withdraw parameters from an encoded withdraw action

+ +**Kind**: instance method of [ClientDecoding](#clientdecoding) +**Returns**: WithdrawParams + +| Param | Type | +| --- | --- | +| data | Uint8Array | + + + +### clientDecoding.updateDaoMetadataRawAction(data) ⇒ string +

Decodes a dao metadata ipfs uri from an encoded update metadata action

+ +**Kind**: instance method of [ClientDecoding](#clientdecoding) +**Returns**: string + +| Param | Type | +| --- | --- | +| data | Uint8Array | + + + +### clientDecoding.updateDaoMetadataAction(data) ⇒ Promise.<DaoMetadata> +

Decodes a dao metadata from an encoded update metadata raw action

+ +**Kind**: instance method of [ClientDecoding](#clientdecoding) +**Returns**: Promise.<DaoMetadata> + +| Param | Type | +| --- | --- | +| data | Uint8Array | + + + +### clientDecoding.setDaoUriAction(data) ⇒ string +

Decodes the daoUri from a setDaoUriAction

+ +**Kind**: instance method of [ClientDecoding](#clientdecoding) +**Returns**: string + +| Param | Type | +| --- | --- | +| data | Uint8Array | + + + +### clientDecoding.registerStandardCallbackAction(data) ⇒ RegisterStandardCallbackParams +

Decodes the RegisterStandardCallbackParams from a registerStandardCallbackAction

+ +**Kind**: instance method of [ClientDecoding](#clientdecoding) +**Returns**: RegisterStandardCallbackParams + +| Param | Type | +| --- | --- | +| data | Uint8Array | + + + +### clientDecoding.setSignatureValidatorAction(data) ⇒ string +

Decodes the implementation address from an encoded upgradeToAction

+ +**Kind**: instance method of [ClientDecoding](#clientdecoding) +**Returns**: string + +| Param | Type | +| --- | --- | +| data | Uint8Array | + + + +### clientDecoding.upgradeToAndCallAction(data) ⇒ UpgradeToAndCallParams +

Decodes upgradeToAndCallback params from an upgradeToAndCallAction

+ +**Kind**: instance method of [ClientDecoding](#clientdecoding) +**Returns**: UpgradeToAndCallParams + +| Param | Type | +| --- | --- | +| data | Uint8Array | + + + +### clientDecoding.initializeFromAction(data) ⇒ InitializeFromParams +

Decodes the initializeFrom params from an initializeFromAction

+ +**Kind**: instance method of [ClientDecoding](#clientdecoding) +**Returns**: InitializeFromParams + +| Param | Type | +| --- | --- | +| data | Uint8Array | + + + +### clientDecoding.findInterface(data) ⇒ InterfaceParams \| null +

Returns the decoded function info given the encoded data of an action

+ +**Kind**: instance method of [ClientDecoding](#clientdecoding) +**Returns**: InterfaceParams \| null + +| Param | Type | +| --- | --- | +| data | Uint8Array | + + + +### clientDecoding.daoUpdateAction(data) ⇒ DaoUpdateDecodedParams +

Decodes the dao update params from a daoUpdateAction

+ +**Kind**: instance method of [ClientDecoding](#clientdecoding) +**Returns**: DaoUpdateDecodedParams + +| Param | Type | +| --- | --- | +| data | Uint8Array | + + + +## ClientEncoding +

Encoding module the SDK Generic Client

+ +**Kind**: global class + +* [ClientEncoding](#clientencoding) + * [.applyInstallationAction(daoAddress, params)](#clientencodingapplyinstallationactiondaoaddress-params--daoaction) ⇒ DaoAction + * [.applyUpdateAndPermissionsActionBlock(daoAddress, params)](#clientencodingapplyupdateandpermissionsactionblockdaoaddress-params--arraydaoaction) ⇒ Array.<DaoAction> + * [.grantAction(daoAddress, params)](#clientencodinggrantactiondaoaddress-params--daoaction) ⇒ DaoAction + * [.grantWithConditionAction(daoAddress, params)](#clientencodinggrantwithconditionactiondaoaddress-params--daoaction) ⇒ DaoAction + * [.revokeAction(daoAddress, params)](#clientencodingrevokeactiondaoaddress-params--daoaction) ⇒ DaoAction + * [.withdrawAction(recipientAddressOrEns, value)](#clientencodingwithdrawactionrecipientaddressorens-value--promisedaoaction) ⇒ Promise.<DaoAction> + * [.updateDaoMetadataAction(daoAddressOrEns, params)](#clientencodingupdatedaometadataactiondaoaddressorens-params--promisedaoaction) ⇒ Promise.<DaoAction> + * [.setDaoUriAction(daoAddressOrEns, daoUri)](#clientencodingsetdaouriactiondaoaddressorens-daouri--daoaction) ⇒ DaoAction + * [.registerStandardCallbackAction(daoAddressOrEns, daoUri)](#clientencodingregisterstandardcallbackactiondaoaddressorens-daouri--daoaction) ⇒ DaoAction + * [.setSignatureValidatorAction(daoAddressOrEns, signatureValidator)](#clientencodingsetsignaturevalidatoractiondaoaddressorens-signaturevalidator--daoaction) ⇒ DaoAction + * [.upgradeToAction(daoAddressOrEns, implementationAddress)](#clientencodingupgradetoactiondaoaddressorens-implementationaddress--daoaction) ⇒ DaoAction + * [.upgradeToAndCallAction(daoAddressOrEns, params)](#clientencodingupgradetoandcallactiondaoaddressorens-params--daoaction) ⇒ DaoAction + * [.initializeFromAction(daoAddressOrEns, params)](#clientencodinginitializefromactiondaoaddressorens-params--daoaction) ⇒ DaoAction + * [.daoUpdateAction(daoAddressOrEns, params)](#clientencodingdaoupdateactiondaoaddressorens-params--promisedaoaction) ⇒ Promise.<DaoAction> + + + +### clientEncoding.applyInstallationAction(daoAddress, params) ⇒ DaoAction +**Kind**: instance method of [ClientEncoding](#clientencoding) +**Returns**: DaoAction + +| Param | Type | +| --- | --- | +| daoAddress | string | +| params | ApplyInstallationParams | + + + +### clientEncoding.applyUpdateAndPermissionsActionBlock(daoAddress, params) ⇒ Array.<DaoAction> +

Computes the payload to be given when creating a proposal that applies an update to a plugin

+ +**Kind**: instance method of [ClientEncoding](#clientencoding) +**Returns**: Array.<DaoAction> + +| Param | Type | +| --- | --- | +| daoAddress | string | +| params | ApplyUpdateParams | + + + +### clientEncoding.grantAction(daoAddress, params) ⇒ DaoAction +

Computes the payload to be given when creating a proposal that grants a permission within a DAO

+ +**Kind**: instance method of [ClientEncoding](#clientencoding) +**Returns**: DaoAction + +| Param | Type | +| --- | --- | +| daoAddress | string | +| params | GrantPermissionParams | + + + +### clientEncoding.grantWithConditionAction(daoAddress, params) ⇒ DaoAction +

Computes the payload to be given when creating a proposal that grants a permission within a DAO given a certain condition

+ +**Kind**: instance method of [ClientEncoding](#clientencoding) +**Returns**: DaoAction + +| Param | Type | +| --- | --- | +| daoAddress | string | +| params | GrantPermissionWithConditionParams | + + + +### clientEncoding.revokeAction(daoAddress, params) ⇒ DaoAction +

Computes the payload to be given when creating a proposal that revokes a permission within a DAO

+ +**Kind**: instance method of [ClientEncoding](#clientencoding) +**Returns**: DaoAction + +| Param | Type | +| --- | --- | +| daoAddress | string | +| params | RevokePermissionParams | + + + +### clientEncoding.withdrawAction(recipientAddressOrEns, value) ⇒ Promise.<DaoAction> +

Computes the payload to be given when creating a proposal that withdraws ether from the DAO

+ +**Kind**: instance method of [ClientEncoding](#clientencoding) +**Returns**: Promise.<DaoAction> + +| Param | Type | +| --- | --- | +| recipientAddressOrEns | string | +| value | WithdrawParams | + + + +### clientEncoding.updateDaoMetadataAction(daoAddressOrEns, params) ⇒ Promise.<DaoAction> +

Computes the payload to be given when creating a proposal that updates the metadata the DAO

+ +**Kind**: instance method of [ClientEncoding](#clientencoding) +**Returns**: Promise.<DaoAction> + +| Param | Type | +| --- | --- | +| daoAddressOrEns | string | +| params | DaoMetadata | + + + +### clientEncoding.setDaoUriAction(daoAddressOrEns, daoUri) ⇒ DaoAction +

Computes the payload to be given when creating a proposal that sets the dao uri

+ +**Kind**: instance method of [ClientEncoding](#clientencoding) +**Returns**: DaoAction + +| Param | Type | +| --- | --- | +| daoAddressOrEns | string | +| daoUri | string | + + + +### clientEncoding.registerStandardCallbackAction(daoAddressOrEns, daoUri) ⇒ DaoAction +

Computes the payload to be given when creating a proposal that registers a new standard callback

+ +**Kind**: instance method of [ClientEncoding](#clientencoding) +**Returns**: DaoAction + +| Param | Type | +| --- | --- | +| daoAddressOrEns | string | +| daoUri | string | + + + +### clientEncoding.setSignatureValidatorAction(daoAddressOrEns, signatureValidator) ⇒ DaoAction +

Computes the payload to be given when creating a proposal that sets the signature validator

+ +**Kind**: instance method of [ClientEncoding](#clientencoding) +**Returns**: DaoAction + +| Param | Type | +| --- | --- | +| daoAddressOrEns | string | +| signatureValidator | string | + + + +### clientEncoding.upgradeToAction(daoAddressOrEns, implementationAddress) ⇒ DaoAction +

Computes the payload to be given when creating a proposal that sets a new implementation for the proxy

+ +**Kind**: instance method of [ClientEncoding](#clientencoding) +**Returns**: DaoAction + +| Param | Type | +| --- | --- | +| daoAddressOrEns | string | +| implementationAddress | string | + + + +### clientEncoding.upgradeToAndCallAction(daoAddressOrEns, params) ⇒ DaoAction +

Computes the payload to be given when creating a proposal that sets a new implementation for the proxy and calls the callback function with the specified data

+ +**Kind**: instance method of [ClientEncoding](#clientencoding) +**Returns**: DaoAction + +| Param | Type | +| --- | --- | +| daoAddressOrEns | string | +| params | UpgradeToAndCallParams | + + + +### clientEncoding.initializeFromAction(daoAddressOrEns, params) ⇒ DaoAction +

Computes an action to be passed to the upgradeToAndCallAction method when upgrading a DAO to a new version.

+ +**Kind**: instance method of [ClientEncoding](#clientencoding) +**Returns**: DaoAction + +| Param | Type | +| --- | --- | +| daoAddressOrEns | string | +| params | InitializeFromParams | + + + +### clientEncoding.daoUpdateAction(daoAddressOrEns, params) ⇒ Promise.<DaoAction> +

Does the necessary steps to encode an action that updates a DAO

+ +**Kind**: instance method of [ClientEncoding](#clientencoding) +**Returns**: Promise.<DaoAction> + +| Param | Type | +| --- | --- | +| daoAddressOrEns | string | +| params | DaoUpdateParams | + + + +## ClientEstimation +

Estimation module the SDK Generic Client

+ +**Kind**: global class + +* [ClientEstimation](#clientestimation) + * [.createDao(_params)](#clientestimationcreatedao_params--promisegasfeeestimation) ⇒ Promise.<GasFeeEstimation> + * [.deposit(params)](#clientestimationdepositparams--promisegasfeeestimation) ⇒ Promise.<GasFeeEstimation> + * [.setAllowance(_params)](#clientestimationsetallowance_params--promisegasfeeestimation) ⇒ Promise.<GasFeeEstimation> + * [.prepareUpdate(params)](#clientestimationprepareupdateparams--promisegasfeeestimation) ⇒ Promise.<GasFeeEstimation> + + + +### clientEstimation.createDao(_params) ⇒ Promise.<GasFeeEstimation> +

Estimates the gas fee of creating a DAO

+ +**Kind**: instance method of [ClientEstimation](#clientestimation) +**Returns**: Promise.<GasFeeEstimation> + +| Param | Type | +| --- | --- | +| _params | CreateDaoParams | + + + +### clientEstimation.deposit(params) ⇒ Promise.<GasFeeEstimation> +

Estimates the gas fee of depositing ether or an ERC20 token into the DAO +This does not estimate the gas cost of updating the allowance of an ERC20 token

+ +**Kind**: instance method of [ClientEstimation](#clientestimation) +**Returns**: Promise.<GasFeeEstimation> + +| Param | Type | +| --- | --- | +| params | DepositParams | + + + +### clientEstimation.setAllowance(_params) ⇒ Promise.<GasFeeEstimation> +

Estimates the gas fee of updating the allowance of an ERC20 token

+ +**Kind**: instance method of [ClientEstimation](#clientestimation) +**Returns**: Promise.<GasFeeEstimation> + +| Param | Type | +| --- | --- | +| _params | SetAllowanceParams | + + + +### clientEstimation.prepareUpdate(params) ⇒ Promise.<GasFeeEstimation> +

Estimates the gas fee of preparing an update

+ +**Kind**: instance method of [ClientEstimation](#clientestimation) +**Returns**: Promise.<GasFeeEstimation> + +| Param | Type | +| --- | --- | +| params | PrepareUpdateParams | + + + +## ClientMethods +

Methods module the SDK Generic Client

+ +**Kind**: global class + +* [ClientMethods](#clientmethods) + * [.createDao(params)](#clientmethodscreatedaoparams--asyncgeneratordaocreationstepvalue) ⇒ AsyncGenerator.<DaoCreationStepValue> + * [.pinMetadata(params)](#clientmethodspinmetadataparams--promisestring) ⇒ Promise.<string> + * [.deposit(params)](#clientmethodsdepositparams--asyncgeneratordaodepositstepvalue) ⇒ AsyncGenerator.<DaoDepositStepValue> + * [.setAllowance(params)](#clientmethodssetallowanceparams--asyncgeneratorsetallowancestepvalue) ⇒ AsyncGenerator.<SetAllowanceStepValue> + * [.prepareUninstallation(params)](#clientmethodsprepareuninstallationparams--asyncgeneratorprepareuninstallationstepvalue) ⇒ AsyncGenerator.<PrepareUninstallationStepValue> + * [.prepareUpdate(params)](#clientmethodsprepareupdateparams--asyncgeneratorprepareupdatestepvalue) ⇒ AsyncGenerator.<PrepareUpdateStepValue> + * [.hasPermission(params)](#clientmethodshaspermissionparams--promiseboolean) ⇒ Promise.<boolean> + * [.getDao(daoAddressOrEns)](#clientmethodsgetdaodaoaddressorens--promisedaodetailsnull) ⇒ Promise.<(DaoDetails\|null)> + * [.getDaos(params)](#clientmethodsgetdaosparams--promisearraydaolistitem) ⇒ Promise.<Array.<DaoListItem>> + * [.getDaoBalances(params)](#clientmethodsgetdaobalancesparams--promisearrayassetbalancenull) ⇒ Promise.<(Array.<AssetBalance>\|null)> + * [.getDaoTransfers(params)](#clientmethodsgetdaotransfersparams--promisearraytransfernull) ⇒ Promise.<(Array.<Transfer>\|null)> + * [.getPlugins(params)](#clientmethodsgetpluginsparams--promisearraypluginreponull) ⇒ Promise.<(Array.<PluginRepo>\|null)> + * [.getPlugin(pluginAddress)](#clientmethodsgetpluginpluginaddress--promisepluginrepo) ⇒ Promise.<PluginRepo> + * [.getProtocolVersion(contractAddress)](#clientmethodsgetprotocolversioncontractaddress--promisearraynumber) ⇒ Promise.<Array.<number>> + * [.isDaoUpdateProposal(proposalId)](#clientmethodsisdaoupdateproposalproposalid--promiseboolean) ⇒ Promise.<boolean> + * [.isPluginUpdateProposal(proposalId)](#clientmethodsispluginupdateproposalproposalid--promiseboolean) ⇒ Promise.<boolean> + * [.isPluginUpdateProposalValid(proposalId)](#clientmethodsispluginupdateproposalvalidproposalid--promisepluginupdateproposalvalidity) ⇒ Promise.<PluginUpdateProposalValidity> + * [.isDaoUpdateProposalValid(proposalId, [version])](#clientmethodsisdaoupdateproposalvalidproposalid-version--promisedaoupdateproposalvalidity) ⇒ Promise.<DaoUpdateProposalValidity> + * [.getDaoImplementation(daoFactoryAddress)](#clientmethodsgetdaoimplementationdaofactoryaddress--promisestring) ⇒ Promise.<string> + + + +### clientMethods.createDao(params) ⇒ AsyncGenerator.<DaoCreationStepValue> +

Creates a DAO with the given settings and plugins

+ +**Kind**: instance method of [ClientMethods](#clientmethods) +**Returns**: AsyncGenerator.<DaoCreationStepValue> + +| Param | Type | +| --- | --- | +| params | CreateDaoParams | + + + +### clientMethods.pinMetadata(params) ⇒ Promise.<string> +

Pins a metadata object into IPFS and retruns the generated hash

+ +**Kind**: instance method of [ClientMethods](#clientmethods) +**Returns**: Promise.<string> + +| Param | Type | +| --- | --- | +| params | DaoMetadata | + + + +### clientMethods.deposit(params) ⇒ AsyncGenerator.<DaoDepositStepValue> +

Deposits ether or an ERC20 token into the DAO

+ +**Kind**: instance method of [ClientMethods](#clientmethods) +**Returns**: AsyncGenerator.<DaoDepositStepValue> + +| Param | Type | +| --- | --- | +| params | DepositParams | + + + +### clientMethods.setAllowance(params) ⇒ AsyncGenerator.<SetAllowanceStepValue> +

Checks if the allowance is enough and updates it

+ +**Kind**: instance method of [ClientMethods](#clientmethods) +**Returns**: AsyncGenerator.<SetAllowanceStepValue> + +| Param | Type | +| --- | --- | +| params | SetAllowanceParams | + + + +### clientMethods.prepareUninstallation(params) ⇒ AsyncGenerator.<PrepareUninstallationStepValue> +

Prepare uninstallation of a plugin

+ +**Kind**: instance method of [ClientMethods](#clientmethods) +**Returns**: AsyncGenerator.<PrepareUninstallationStepValue> + +| Param | Type | +| --- | --- | +| params | PrepareUninstallationParams | + + + +### clientMethods.prepareUpdate(params) ⇒ AsyncGenerator.<PrepareUpdateStepValue> +

Prepare update of a plugin

+ +**Kind**: instance method of [ClientMethods](#clientmethods) +**Returns**: AsyncGenerator.<PrepareUpdateStepValue> + +| Param | Type | +| --- | --- | +| params | PrepareUpdateParams | + + + +### clientMethods.hasPermission(params) ⇒ Promise.<boolean> +

Checks whether a role is granted by the current DAO's ACL settings

+ +**Kind**: instance method of [ClientMethods](#clientmethods) +**Returns**: Promise.<boolean> + +| Param | Type | +| --- | --- | +| params | HasPermissionParams | + + + +### clientMethods.getDao(daoAddressOrEns) ⇒ Promise.<(DaoDetails\|null)> +

Retrieves metadata for DAO with given identifier (address or ens domain)

+ +**Kind**: instance method of [ClientMethods](#clientmethods) +**Returns**: Promise.<(DaoDetails\|null)> + +| Param | Type | +| --- | --- | +| daoAddressOrEns | string | + + + +### clientMethods.getDaos(params) ⇒ Promise.<Array.<DaoListItem>> +

Retrieves metadata for DAO with given identifier (address or ens domain)

+ +**Kind**: instance method of [ClientMethods](#clientmethods) +**Returns**: Promise.<Array.<DaoListItem>> + +| Param | Type | Description | +| --- | --- | --- | +| params | DaoQueryParams |
  • limit = 10
    • skip = 0
    • direction = SortDirection.ASC
    • sortBy = DaoSortBy.CREATED_AT
| + + + +### clientMethods.getDaoBalances(params) ⇒ Promise.<(Array.<AssetBalance>\|null)> +

Retrieves the asset balances of the given DAO, by default, ETH, DAI, USDC and USDT on Mainnet

+ +**Kind**: instance method of [ClientMethods](#clientmethods) +**Returns**: Promise.<(Array.<AssetBalance>\|null)> + +| Param | Type | Description | +| --- | --- | --- | +| params | DaoBalancesQueryParams |
  • daoAddressOrEns
    • limit = 10
    • skip = 0
    • direction = SortDirection.ASC
    • sortBy = AssetBalanceSortBy.LAST_UPDATED
| + + + +### clientMethods.getDaoTransfers(params) ⇒ Promise.<(Array.<Transfer>\|null)> +

Retrieves the list of asset transfers to and from the given DAO (by default, from ETH, DAI, USDC and USDT, on Mainnet)

+ +**Kind**: instance method of [ClientMethods](#clientmethods) +**Returns**: Promise.<(Array.<Transfer>\|null)> + +| Param | Type | Description | +| --- | --- | --- | +| params | TransferQueryParams |
  • daoAddressOrEns
    • type
    • limit = 10
    • skip = 0
    • direction = SortDirection.ASC
    • sortBy = TransferSortBy.CREATED_AT
| + + + +### clientMethods.getPlugins(params) ⇒ Promise.<(Array.<PluginRepo>\|null)> +

Retrieves the list of plugins available on the PluginRegistry

+ +**Kind**: instance method of [ClientMethods](#clientmethods) +**Returns**: Promise.<(Array.<PluginRepo>\|null)> + +| Param | Type | Description | +| --- | --- | --- | +| params | PluginQueryParams |
  • limit = 10
    • skip = 0
    • direction = SortDirection.ASC
    • sortBy = PluginSortBy.SUBDOMAIN
    • subdomain
| + + + +### clientMethods.getPlugin(pluginAddress) ⇒ Promise.<PluginRepo> +

Get plugin details given an address, release and build

+ +**Kind**: instance method of [ClientMethods](#clientmethods) +**Returns**: Promise.<PluginRepo> + +| Param | Type | +| --- | --- | +| pluginAddress | string | + + + +### clientMethods.getProtocolVersion(contractAddress) ⇒ Promise.<Array.<number>> +

Returns the protocol version of a contract +if the transaction fails returns [1,0,0]

+ +**Kind**: instance method of [ClientMethods](#clientmethods) +**Returns**: Promise.<Array.<number>> + +| Param | Type | +| --- | --- | +| contractAddress | string | + + + +### clientMethods.isDaoUpdateProposal(proposalId) ⇒ Promise.<boolean> +

Given a proposal id returns if that proposal is a dao update proposal

+ +**Kind**: instance method of [ClientMethods](#clientmethods) +**Returns**: Promise.<boolean> + +| Param | Type | +| --- | --- | +| proposalId | string | + + + +### clientMethods.isPluginUpdateProposal(proposalId) ⇒ Promise.<boolean> +

Given a proposal id returns if that proposal is a plugin update proposal

+ +**Kind**: instance method of [ClientMethods](#clientmethods) +**Returns**: Promise.<boolean> + +| Param | Type | +| --- | --- | +| proposalId | string | + + + +### clientMethods.isPluginUpdateProposalValid(proposalId) ⇒ Promise.<PluginUpdateProposalValidity> +

Check if the specified proposal id is valid for updating a plugin

+ +**Kind**: instance method of [ClientMethods](#clientmethods) +**Returns**: Promise.<PluginUpdateProposalValidity> + +| Param | Type | +| --- | --- | +| proposalId | string | + + + +### clientMethods.isDaoUpdateProposalValid(proposalId, [version]) ⇒ Promise.<DaoUpdateProposalValidity> +

Check if the specified proposalId actions are valid for updating a dao

+ +**Kind**: instance method of [ClientMethods](#clientmethods) +**Returns**: Promise.<DaoUpdateProposalValidity> + +| Param | Type | +| --- | --- | +| proposalId | string | +| [version] | SupportedVersion | + + + +### clientMethods.getDaoImplementation(daoFactoryAddress) ⇒ Promise.<string> +

Return the implementation address for the specified dao factory

+ +**Kind**: instance method of [ClientMethods](#clientmethods) +**Returns**: Promise.<string> + +| Param | Type | +| --- | --- | +| daoFactoryAddress | string | + diff --git a/versioned_docs/version-1.3.0/sdk/02-reference-guide/02-multisig.md b/versioned_docs/version-1.3.0/sdk/02-reference-guide/02-multisig.md new file mode 100644 index 00000000..4b337ced --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/02-reference-guide/02-multisig.md @@ -0,0 +1,404 @@ +## Classes + +
+
MultisigClient
+

Provider a generic client with high level methods to manage and interact an Address List Voting plugin installed in a DAO

+
MultisigClientDecoding
+

Decoding module for the SDK AddressList Client

+
MultisigClientEncoding
+

Encoding module for the SDK Multisig Client

+
MultisigClientEstimation
+

Estimation module the SDK Address List Client

+
MultisigClientMethods
+

Methods module the SDK Address List Client

+
+ + + +## MultisigClient +

Provider a generic client with high level methods to manage and interact an Address List Voting plugin installed in a DAO

+ +**Kind**: global class + + +### MultisigClient.getPluginInstallItem(params, [network]) ⇒ PluginInstallItem +

Computes the parameters to be given when creating the DAO, +so that the plugin is configured

+ +**Kind**: static method of [MultisigClient](#multisigclient) +**Returns**: PluginInstallItem + +| Param | Type | Default | +| --- | --- | --- | +| params | MultisigPluginInstallParams | | +| [network] | Networkish | "mainnet" | + + + +## MultisigClientDecoding +

Decoding module for the SDK AddressList Client

+ +**Kind**: global class + +* [MultisigClientDecoding](#multisigclientdecoding) + * [.addAddressesAction(data)](#multisigclientdecodingaddaddressesactiondata--arraystring) ⇒ Array.<string> + * [.removeAddressesAction(data)](#multisigclientdecodingremoveaddressesactiondata--arraystring) ⇒ Array.<string> + * [.updateMultisigVotingSettings(data)](#multisigclientdecodingupdatemultisigvotingsettingsdata--multisigvotingsettings) ⇒ MultisigVotingSettings + * [.findInterface(data)](#multisigclientdecodingfindinterfacedata--interfaceparams--null) ⇒ InterfaceParams \| null + + + +### multisigClientDecoding.addAddressesAction(data) ⇒ Array.<string> +

Decodes a list of addresses from an encoded add members action

+ +**Kind**: instance method of [MultisigClientDecoding](#multisigclientdecoding) +**Returns**: Array.<string> + +| Param | Type | +| --- | --- | +| data | Uint8Array | + + + +### multisigClientDecoding.removeAddressesAction(data) ⇒ Array.<string> +

Decodes a list of addresses from an encoded remove members action

+ +**Kind**: instance method of [MultisigClientDecoding](#multisigclientdecoding) +**Returns**: Array.<string> + +| Param | Type | +| --- | --- | +| data | Uint8Array | + + + +### multisigClientDecoding.updateMultisigVotingSettings(data) ⇒ MultisigVotingSettings +

Decodes a list of min approvals from an encoded update min approval action

+ +**Kind**: instance method of [MultisigClientDecoding](#multisigclientdecoding) +**Returns**: MultisigVotingSettings + +| Param | Type | +| --- | --- | +| data | Uint8Array | + + + +### multisigClientDecoding.findInterface(data) ⇒ InterfaceParams \| null +

Returns the decoded function info given the encoded data of an action

+ +**Kind**: instance method of [MultisigClientDecoding](#multisigclientdecoding) +**Returns**: InterfaceParams \| null + +| Param | Type | +| --- | --- | +| data | Uint8Array | + + + +## MultisigClientEncoding +

Encoding module for the SDK Multisig Client

+ +**Kind**: global class + +* [MultisigClientEncoding](#multisigclientencoding) + * _instance_ + * [.addAddressesAction(params)](#multisigclientencodingaddaddressesactionparams--arraydaoaction) ⇒ Array.<DaoAction> + * [.removeAddressesAction(params)](#multisigclientencodingremoveaddressesactionparams--arraydaoaction) ⇒ Array.<DaoAction> + * [.updateMultisigVotingSettings(params)](#multisigclientencodingupdatemultisigvotingsettingsparams--daoaction) ⇒ DaoAction + * _static_ + * [.getPluginInstallItem(params, network)](#multisigclientencodinggetplugininstallitemparams-network--plugininstallitem) ⇒ PluginInstallItem + + + +### multisigClientEncoding.addAddressesAction(params) ⇒ Array.<DaoAction> +

Computes the parameters to be given when creating a proposal that updates the governance configuration

+ +**Kind**: instance method of [MultisigClientEncoding](#multisigclientencoding) +**Returns**: Array.<DaoAction> + +| Param | Type | +| --- | --- | +| params | AddAddressesParams | + + + +### multisigClientEncoding.removeAddressesAction(params) ⇒ Array.<DaoAction> +

Computes the parameters to be given when creating a proposal that adds addresses to address list

+ +**Kind**: instance method of [MultisigClientEncoding](#multisigclientencoding) +**Returns**: Array.<DaoAction> + +| Param | Type | +| --- | --- | +| params | RemoveAddressesParams | + + + +### multisigClientEncoding.updateMultisigVotingSettings(params) ⇒ DaoAction +

Computes the parameters to be given when creating a proposal updates multisig settings

+ +**Kind**: instance method of [MultisigClientEncoding](#multisigclientencoding) +**Returns**: DaoAction + +| Param | Type | +| --- | --- | +| params | UpdateMultisigVotingSettingsParams | + + + +### MultisigClientEncoding.getPluginInstallItem(params, network) ⇒ PluginInstallItem +

Computes the parameters to be given when creating the DAO, +so that the plugin is configured

+ +**Kind**: static method of [MultisigClientEncoding](#multisigclientencoding) +**Returns**: PluginInstallItem + +| Param | Type | +| --- | --- | +| params | MultisigPluginInstallParams | +| network | Networkish | + + + +## MultisigClientEstimation +

Estimation module the SDK Address List Client

+ +**Kind**: global class + +* [MultisigClientEstimation](#multisigclientestimation) + * [.createProposal(params)](#multisigclientestimationcreateproposalparams--promisegasfeeestimation) ⇒ Promise.<GasFeeEstimation> + * [.approveProposal(params)](#multisigclientestimationapproveproposalparams--promisegasfeeestimation) ⇒ Promise.<GasFeeEstimation> + * [.executeProposal(proposalId)](#multisigclientestimationexecuteproposalproposalid--promisegasfeeestimation) ⇒ Promise.<GasFeeEstimation> + * [.prepareUpdate(params)](#multisigclientestimationprepareupdateparams--promisegasfeeestimation) ⇒ Promise.<GasFeeEstimation> + + + +### multisigClientEstimation.createProposal(params) ⇒ Promise.<GasFeeEstimation> +

Estimates the gas fee of creating a proposal on the plugin

+ +**Kind**: instance method of [MultisigClientEstimation](#multisigclientestimation) +**Returns**: Promise.<GasFeeEstimation> + +| Param | Type | +| --- | --- | +| params | CreateMultisigProposalParams | + + + +### multisigClientEstimation.approveProposal(params) ⇒ Promise.<GasFeeEstimation> +

Estimates the gas fee of approving a proposal

+ +**Kind**: instance method of [MultisigClientEstimation](#multisigclientestimation) +**Returns**: Promise.<GasFeeEstimation> + +| Param | Type | +| --- | --- | +| params | ApproveMultisigProposalParams | + + + +### multisigClientEstimation.executeProposal(proposalId) ⇒ Promise.<GasFeeEstimation> +

Estimates the gas fee of executing a proposal

+ +**Kind**: instance method of [MultisigClientEstimation](#multisigclientestimation) +**Returns**: Promise.<GasFeeEstimation> + +| Param | Type | +| --- | --- | +| proposalId | string | + + + +### multisigClientEstimation.prepareUpdate(params) ⇒ Promise.<GasFeeEstimation> +

Estimates the gas fee of preparing an update

+ +**Kind**: instance method of [MultisigClientEstimation](#multisigclientestimation) +**Returns**: Promise.<GasFeeEstimation> + +| Param | Type | +| --- | --- | +| params | MultisigPluginPrepareUpdateParams | + + + +## MultisigClientMethods +

Methods module the SDK Address List Client

+ +**Kind**: global class + +* [MultisigClientMethods](#multisigclientmethods) + * [.createProposal(params)](#multisigclientmethodscreateproposalparams--asyncgeneratorproposalcreationstepvalue) ⇒ AsyncGenerator.<ProposalCreationStepValue> + * [.pinMetadata(params)](#multisigclientmethodspinmetadataparams--promisestring) ⇒ Promise.<string> + * [.approveProposal(params)](#multisigclientmethodsapproveproposalparams--asyncgeneratorapproveproposalstepvalue) ⇒ AsyncGenerator.<ApproveProposalStepValue> + * [.executeProposal(proposalId)](#multisigclientmethodsexecuteproposalproposalid--asyncgeneratorexecutemultisigproposalstepvalue) ⇒ AsyncGenerator.<ExecuteMultisigProposalStepValue> + * [.prepareInstallation(params)](#multisigclientmethodsprepareinstallationparams--asyncgeneratorprepareinstallationstepvalue) ⇒ AsyncGenerator.<PrepareInstallationStepValue> + * [.prepareUpdate(params)](#multisigclientmethodsprepareupdateparams--asyncgeneratorprepareupdatestepvalue) ⇒ AsyncGenerator.<PrepareUpdateStepValue> + * [.canApprove(addressOrEns)](#multisigclientmethodscanapproveaddressorens--promiseboolean) ⇒ Promise.<boolean> + * [.canExecute(proposalId)](#multisigclientmethodscanexecuteproposalid--promiseboolean) ⇒ Promise.<boolean> + * [.getVotingSettings(addressOrEns, blockNumber)](#multisigclientmethodsgetvotingsettingsaddressorens-blocknumber--promisemultisigvotingsettings) ⇒ Promise.<MultisigVotingSettings> + * [.getMembers(params)](#multisigclientmethodsgetmembersparams--promisearraystring) ⇒ Promise.<Array.<string>> + * [.getProposal(proposalId)](#multisigclientmethodsgetproposalproposalid--promisemultisigproposalnull) ⇒ Promise.<(MultisigProposal\|null)> + * [.getProposals(params)](#multisigclientmethodsgetproposalsparams--promisearraymultisigproposallistitem) ⇒ Promise.<Array.<MultisigProposalListItem>> + * [.isMember(params)](#multisigclientmethodsismemberparams--boolean) ⇒ boolean + + + +### multisigClientMethods.createProposal(params) ⇒ AsyncGenerator.<ProposalCreationStepValue> +

Creates a new proposal on the given multisig plugin contract

+ +**Kind**: instance method of [MultisigClientMethods](#multisigclientmethods) +**Returns**: AsyncGenerator.<ProposalCreationStepValue> + +| Param | Type | +| --- | --- | +| params | CreateMultisigProposalParams | + + + +### multisigClientMethods.pinMetadata(params) ⇒ Promise.<string> +

Pins a metadata object into IPFS and retruns the generated hash

+ +**Kind**: instance method of [MultisigClientMethods](#multisigclientmethods) +**Returns**: Promise.<string> + +| Param | Type | +| --- | --- | +| params | ProposalMetadata | + + + +### multisigClientMethods.approveProposal(params) ⇒ AsyncGenerator.<ApproveProposalStepValue> +

Allow a wallet in the multisig give approval to a proposal

+ +**Kind**: instance method of [MultisigClientMethods](#multisigclientmethods) +**Returns**: AsyncGenerator.<ApproveProposalStepValue> + +| Param | Type | +| --- | --- | +| params | ApproveMultisigProposalParams | + + + +### multisigClientMethods.executeProposal(proposalId) ⇒ AsyncGenerator.<ExecuteMultisigProposalStepValue> +

Allow a wallet in the multisig give approval to a proposal

+ +**Kind**: instance method of [MultisigClientMethods](#multisigclientmethods) +**Returns**: AsyncGenerator.<ExecuteMultisigProposalStepValue> + +| Param | Type | +| --- | --- | +| proposalId | string | + + + +### multisigClientMethods.prepareInstallation(params) ⇒ AsyncGenerator.<PrepareInstallationStepValue> +

Prepares the installation of a multisig plugin in a given dao

+ +**Kind**: instance method of [MultisigClientMethods](#multisigclientmethods) +**Returns**: AsyncGenerator.<PrepareInstallationStepValue> + +| Param | Type | +| --- | --- | +| params | MultisigPluginPrepareInstallationParams | + + + +### multisigClientMethods.prepareUpdate(params) ⇒ AsyncGenerator.<PrepareUpdateStepValue> +

Prepares the update of a multisig plugin in a given dao

+ +**Kind**: instance method of [MultisigClientMethods](#multisigclientmethods) +**Returns**: AsyncGenerator.<PrepareUpdateStepValue> + +| Param | Type | +| --- | --- | +| params | MultisigPluginPrepareUpdateParams | + + + +### multisigClientMethods.canApprove(addressOrEns) ⇒ Promise.<boolean> +

Checks whether the current proposal can be approved by the given address

+ +**Kind**: instance method of [MultisigClientMethods](#multisigclientmethods) +**Returns**: Promise.<boolean> + +| Param | Type | +| --- | --- | +| addressOrEns | string | + + + +### multisigClientMethods.canExecute(proposalId) ⇒ Promise.<boolean> +

Checks whether the current proposal can be executed

+ +**Kind**: instance method of [MultisigClientMethods](#multisigclientmethods) +**Returns**: Promise.<boolean> + +| Param | Type | +| --- | --- | +| proposalId | string | + + + +### multisigClientMethods.getVotingSettings(addressOrEns, blockNumber) ⇒ Promise.<MultisigVotingSettings> +

Returns the voting settings

+ +**Kind**: instance method of [MultisigClientMethods](#multisigclientmethods) +**Returns**: Promise.<MultisigVotingSettings> + +| Param | Type | +| --- | --- | +| addressOrEns | string | +| blockNumber | number | + + + +### multisigClientMethods.getMembers(params) ⇒ Promise.<Array.<string>> +

returns the members of the multisig

+ +**Kind**: instance method of [MultisigClientMethods](#multisigclientmethods) +**Returns**: Promise.<Array.<string>> + +| Param | Type | Description | +| --- | --- | --- | +| params | MembersQueryParams |
  • pluginAddress
    • blockNumber
    • limit = 10
    • skip = 0
    • direction = SortDirection.ASC
    • sortBy = MembersSortBy.ADDRESS
| + + + +### multisigClientMethods.getProposal(proposalId) ⇒ Promise.<(MultisigProposal\|null)> +

Returns the details of the given proposal

+ +**Kind**: instance method of [MultisigClientMethods](#multisigclientmethods) +**Returns**: Promise.<(MultisigProposal\|null)> + +| Param | Type | +| --- | --- | +| proposalId | string | + + + +### multisigClientMethods.getProposals(params) ⇒ Promise.<Array.<MultisigProposalListItem>> +

Returns a list of proposals on the Plugin, filtered by the given criteria

+ +**Kind**: instance method of [MultisigClientMethods](#multisigclientmethods) +**Returns**: Promise.<Array.<MultisigProposalListItem>> + +| Param | Type | Description | +| --- | --- | --- | +| params | ProposalQueryParams |
  • daoAddressOrEns - limit = 10 - status - skip = 0 - direction = SortDirection.ASC - sortBy = ProposalSortBy.CREATED_AT
| + + + +### multisigClientMethods.isMember(params) ⇒ boolean +

Checks if a given address is a member of the tokenVoting contract.

+ +**Kind**: instance method of [MultisigClientMethods](#multisigclientmethods) +**Returns**: boolean - A boolean indicating whether the address is a member or not. + +| Param | Description | +| --- | --- | +| params |

The parameters for the isMember method.

| +| params.pluginAddress |

The address of the plugin.

| +| params.address |

The address to check.

| +| params.blockNumber |

The block number for specifying a specific block.

| + diff --git a/versioned_docs/version-1.3.0/sdk/02-reference-guide/03-token-voting.md b/versioned_docs/version-1.3.0/sdk/02-reference-guide/03-token-voting.md new file mode 100644 index 00000000..5cc52f9e --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/02-reference-guide/03-token-voting.md @@ -0,0 +1,463 @@ +## Classes + +
+
TokenVotingClient
+

Provider a generic client with high level methods to manage and interact a Token Voting plugin installed in a DAO

+
TokenVotingClientDecoding
+

Decoding module the SDK TokenVoting Client

+
TokenVotingClientEncoding
+

Encoding module the SDK TokenVoting Client

+
TokenVotingClientEstimation
+

Estimation module the SDK TokenVoting Client

+
TokenVotingClientMethods
+

Methods module the SDK TokenVoting Client

+
+ + + +## TokenVotingClient +

Provider a generic client with high level methods to manage and interact a Token Voting plugin installed in a DAO

+ +**Kind**: global class + +* [TokenVotingClient](#tokenvotingclient) + * [.getPluginInstallItem(params, [network])](#tokenvotingclientgetplugininstallitemparams-network--plugininstallitem) ⇒ PluginInstallItem + * [.TokenVotingClientMethods#createProposal(params)](#tokenvotingclienttokenvotingclientmethodscreateproposalparams--asyncgeneratorproposalcreationstepvalue) ⇒ AsyncGenerator.<ProposalCreationStepValue> + * [.TokenVotingClientMethods#voteProposal(params, vote)](#tokenvotingclienttokenvotingclientmethodsvoteproposalparams-vote--asyncgeneratorvoteproposalstepvalue) ⇒ AsyncGenerator.<VoteProposalStepValue> + * [.TokenVotingClientMethods#executeProposal(proposalId)](#tokenvotingclienttokenvotingclientmethodsexecuteproposalproposalid--asyncgeneratorexecuteproposalstepvalue) ⇒ AsyncGenerator.<ExecuteProposalStepValue> + * [.TokenVotingClientMethods#getProposal(proposalId)](#tokenvotingclienttokenvotingclientmethodsgetproposalproposalid--promisetokenvotingproposal) ⇒ Promise.<TokenVotingProposal> + * [.TokenVotingClientMethods#getProposals(params)](#tokenvotingclienttokenvotingclientmethodsgetproposalsparams--promisearraytokenvotingproposallistitem) ⇒ Promise.<Array.<TokenVotingProposalListItem>> + * [.TokenVotingClientMethods#getVotingSettings(pluginAddress, blockNumber)](#tokenvotingclienttokenvotingclientmethodsgetvotingsettingspluginaddress-blocknumber--promisevotingsettings) ⇒ Promise.<VotingSettings> + * [.TokenVotingClientMethods#getToken(pluginAddress)](#tokenvotingclienttokenvotingclientmethodsgettokenpluginaddress--promiseerc20tokendetailsnull) ⇒ Promise.<(Erc20TokenDetails\|null)> + + + +### TokenVotingClient.getPluginInstallItem(params, [network]) ⇒ PluginInstallItem +

Computes the parameters to be given when creating the DAO, +so that the plugin is configured

+ +**Kind**: static method of [TokenVotingClient](#tokenvotingclient) +**Returns**: PluginInstallItem + +| Param | Type | Default | +| --- | --- | --- | +| params | TokenVotingPluginInstall | | +| [network] | Networkish | "mainnet" | + + + +### TokenVotingClient.TokenVotingClientMethods#createProposal(params) ⇒ AsyncGenerator.<ProposalCreationStepValue> +

Creates a new proposal on the given TokenVoting plugin contract

+ +**Kind**: static method of [TokenVotingClient](#tokenvotingclient) +**Returns**: AsyncGenerator.<ProposalCreationStepValue> + +| Param | Type | +| --- | --- | +| params | CreateMajorityVotingProposalParams | + + + +### TokenVotingClient.TokenVotingClientMethods#voteProposal(params, vote) ⇒ AsyncGenerator.<VoteProposalStepValue> +

Cast a vote on the given proposal using the client's wallet. Depending on the proposal settings, an affirmative vote may execute the proposal's actions on the DAO.

+ +**Kind**: static method of [TokenVotingClient](#tokenvotingclient) +**Returns**: AsyncGenerator.<VoteProposalStepValue> + +| Param | Type | +| --- | --- | +| params | VoteProposalParams | +| vote | VoteValues | + + + +### TokenVotingClient.TokenVotingClientMethods#executeProposal(proposalId) ⇒ AsyncGenerator.<ExecuteProposalStepValue> +

Executes the given proposal, provided that it has already passed

+ +**Kind**: static method of [TokenVotingClient](#tokenvotingclient) +**Returns**: AsyncGenerator.<ExecuteProposalStepValue> + +| Param | Type | +| --- | --- | +| proposalId | string | + + + +### TokenVotingClient.TokenVotingClientMethods#getProposal(proposalId) ⇒ Promise.<TokenVotingProposal> +

Returns the details of the given proposal

+ +**Kind**: static method of [TokenVotingClient](#tokenvotingclient) +**Returns**: Promise.<TokenVotingProposal> + +| Param | Type | +| --- | --- | +| proposalId | string | + + + +### TokenVotingClient.TokenVotingClientMethods#getProposals(params) ⇒ Promise.<Array.<TokenVotingProposalListItem>> +

Returns a list of proposals on the Plugin, filtered by the given criteria

+ +**Kind**: static method of [TokenVotingClient](#tokenvotingclient) +**Returns**: Promise.<Array.<TokenVotingProposalListItem>> + +| Param | Type | +| --- | --- | +| params | ProposalQueryParams | + + + +### TokenVotingClient.TokenVotingClientMethods#getVotingSettings(pluginAddress, blockNumber) ⇒ Promise.<VotingSettings> +

Returns the settings of a plugin given the address of the plugin instance

+ +**Kind**: static method of [TokenVotingClient](#tokenvotingclient) +**Returns**: Promise.<VotingSettings> + +| Param | Type | +| --- | --- | +| pluginAddress | string | +| blockNumber | number | + + + +### TokenVotingClient.TokenVotingClientMethods#getToken(pluginAddress) ⇒ Promise.<(Erc20TokenDetails\|null)> +

Returns the details of the token used in a specific plugin instance

+ +**Kind**: static method of [TokenVotingClient](#tokenvotingclient) +**Returns**: Promise.<(Erc20TokenDetails\|null)> + +| Param | Type | +| --- | --- | +| pluginAddress | string | + + + +## TokenVotingClientDecoding +

Decoding module the SDK TokenVoting Client

+ +**Kind**: global class + +* [TokenVotingClientDecoding](#tokenvotingclientdecoding) + * [.updatePluginSettingsAction(data)](#tokenvotingclientdecodingupdatepluginsettingsactiondata--votingsettings) ⇒ VotingSettings + * [.mintTokenAction(data)](#tokenvotingclientdecodingminttokenactiondata--minttokenparams) ⇒ MintTokenParams + * [.findInterface(data)](#tokenvotingclientdecodingfindinterfacedata--interfaceparams--null) ⇒ InterfaceParams \| null + + + +### tokenVotingClientDecoding.updatePluginSettingsAction(data) ⇒ VotingSettings +

Decodes a dao metadata from an encoded update metadata action

+ +**Kind**: instance method of [TokenVotingClientDecoding](#tokenvotingclientdecoding) +**Returns**: VotingSettings + +| Param | Type | +| --- | --- | +| data | Uint8Array | + + + +### tokenVotingClientDecoding.mintTokenAction(data) ⇒ MintTokenParams +

Decodes the mint token params from an encoded mint token action

+ +**Kind**: instance method of [TokenVotingClientDecoding](#tokenvotingclientdecoding) +**Returns**: MintTokenParams + +| Param | Type | +| --- | --- | +| data | Uint8Array | + + + +### tokenVotingClientDecoding.findInterface(data) ⇒ InterfaceParams \| null +

Returns the decoded function info given the encoded data of an action

+ +**Kind**: instance method of [TokenVotingClientDecoding](#tokenvotingclientdecoding) +**Returns**: InterfaceParams \| null + +| Param | Type | +| --- | --- | +| data | Uint8Array | + + + +## TokenVotingClientEncoding +

Encoding module the SDK TokenVoting Client

+ +**Kind**: global class + +* [TokenVotingClientEncoding](#tokenvotingclientencoding) + * _instance_ + * [.updatePluginSettingsAction(pluginAddress, params)](#tokenvotingclientencodingupdatepluginsettingsactionpluginaddress-params--daoaction) ⇒ DaoAction + * [.mintTokenAction(minterAddress, params)](#tokenvotingclientencodingminttokenactionminteraddress-params--daoaction) ⇒ DaoAction + * _static_ + * [.getPluginInstallItem(params, network)](#tokenvotingclientencodinggetplugininstallitemparams-network--plugininstallitem) ⇒ PluginInstallItem + + + +### tokenVotingClientEncoding.updatePluginSettingsAction(pluginAddress, params) ⇒ DaoAction +

Computes the parameters to be given when creating a proposal that updates the governance configuration

+ +**Kind**: instance method of [TokenVotingClientEncoding](#tokenvotingclientencoding) +**Returns**: DaoAction + +| Param | Type | +| --- | --- | +| pluginAddress | string | +| params | VotingSettings | + + + +### tokenVotingClientEncoding.mintTokenAction(minterAddress, params) ⇒ DaoAction +

Computes the parameters to be given when creating a proposal that mints an amount of ERC-20 tokens to an address

+ +**Kind**: instance method of [TokenVotingClientEncoding](#tokenvotingclientencoding) +**Returns**: DaoAction + +| Param | Type | +| --- | --- | +| minterAddress | string | +| params | MintTokenParams | + + + +### TokenVotingClientEncoding.getPluginInstallItem(params, network) ⇒ PluginInstallItem +

Computes the parameters to be given when creating the DAO, +so that the plugin is configured

+ +**Kind**: static method of [TokenVotingClientEncoding](#tokenvotingclientencoding) +**Returns**: PluginInstallItem + +| Param | Type | +| --- | --- | +| params | TokenVotingPluginInstall | +| network | Networkish | + + + +## TokenVotingClientEstimation +

Estimation module the SDK TokenVoting Client

+ +**Kind**: global class + +* [TokenVotingClientEstimation](#tokenvotingclientestimation) + * [.createProposal(params)](#tokenvotingclientestimationcreateproposalparams--promisegasfeeestimation) ⇒ Promise.<GasFeeEstimation> + * [.voteProposal(params)](#tokenvotingclientestimationvoteproposalparams--promisegasfeeestimation) ⇒ Promise.<GasFeeEstimation> + * [.executeProposal(proposalId)](#tokenvotingclientestimationexecuteproposalproposalid--promisegasfeeestimation) ⇒ Promise.<GasFeeEstimation> + * [.delegateTokens(params)](#tokenvotingclientestimationdelegatetokensparams--promisegasfeeestimation) ⇒ Promise.<GasFeeEstimation> + * [.undelegateTokens(tokenAddress)](#tokenvotingclientestimationundelegatetokenstokenaddress--promisegasfeeestimation) ⇒ Promise.<GasFeeEstimation> + * [.prepareUpdate(params)](#tokenvotingclientestimationprepareupdateparams--promisegasfeeestimation) ⇒ Promise.<GasFeeEstimation> + + + +### tokenVotingClientEstimation.createProposal(params) ⇒ Promise.<GasFeeEstimation> +

Estimates the gas fee of creating a proposal on the plugin

+ +**Kind**: instance method of [TokenVotingClientEstimation](#tokenvotingclientestimation) +**Returns**: Promise.<GasFeeEstimation> + +| Param | Type | +| --- | --- | +| params | CreateMajorityVotingProposalParams | + + + +### tokenVotingClientEstimation.voteProposal(params) ⇒ Promise.<GasFeeEstimation> +

Estimates the gas fee of casting a vote on a proposal

+ +**Kind**: instance method of [TokenVotingClientEstimation](#tokenvotingclientestimation) +**Returns**: Promise.<GasFeeEstimation> + +| Param | Type | +| --- | --- | +| params | VoteProposalParams | + + + +### tokenVotingClientEstimation.executeProposal(proposalId) ⇒ Promise.<GasFeeEstimation> +

Estimates the gas fee of executing a TokenVoting proposal

+ +**Kind**: instance method of [TokenVotingClientEstimation](#tokenvotingclientestimation) +**Returns**: Promise.<GasFeeEstimation> + +| Param | Type | +| --- | --- | +| proposalId | string | + + + +### tokenVotingClientEstimation.delegateTokens(params) ⇒ Promise.<GasFeeEstimation> +

Estimates the gas fee of delegating voting power to a delegatee

+ +**Kind**: instance method of [TokenVotingClientEstimation](#tokenvotingclientestimation) +**Returns**: Promise.<GasFeeEstimation> + +| Param | Type | +| --- | --- | +| params | DelegateTokensParams | + + + +### tokenVotingClientEstimation.undelegateTokens(tokenAddress) ⇒ Promise.<GasFeeEstimation> +

Estimates the gas fee of undelegating voting power

+ +**Kind**: instance method of [TokenVotingClientEstimation](#tokenvotingclientestimation) +**Returns**: Promise.<GasFeeEstimation> + +| Param | Type | +| --- | --- | +| tokenAddress | string | + + + +### tokenVotingClientEstimation.prepareUpdate(params) ⇒ Promise.<GasFeeEstimation> +

Estimates the gas fee of preparing an update

+ +**Kind**: instance method of [TokenVotingClientEstimation](#tokenvotingclientestimation) +**Returns**: Promise.<GasFeeEstimation> + +| Param | Type | +| --- | --- | +| params | TokenVotingPluginPrepareUpdateParams | + + + +## TokenVotingClientMethods +

Methods module the SDK TokenVoting Client

+ +**Kind**: global class + +* [TokenVotingClientMethods](#tokenvotingclientmethods) + * [.prepareInstallation(params)](#tokenvotingclientmethodsprepareinstallationparams--asyncgeneratorprepareinstallationstepvalue) ⇒ AsyncGenerator.<PrepareInstallationStepValue> + * [.prepareUpdate(params)](#tokenvotingclientmethodsprepareupdateparams--asyncgeneratorprepareupdatestepvalue) ⇒ AsyncGenerator.<PrepareUpdateStepValue> + * [.delegateTokens(params)](#tokenvotingclientmethodsdelegatetokensparams--asyncgeneratordelegatetokensstepvalue) ⇒ AsyncGenerator.<DelegateTokensStepValue> + * [.undelegateTokens(tokenAddress)](#tokenvotingclientmethodsundelegatetokenstokenaddress--asyncgeneratorundelegatetokensstepvalue) ⇒ AsyncGenerator.<UndelegateTokensStepValue> + * [.getDelegatee(tokenAddress)](#tokenvotingclientmethodsgetdelegateetokenaddress--promisestringnull) ⇒ Promise.<(string\|null)> + * [.canVote(params)](#tokenvotingclientmethodscanvoteparams--promiseboolean) ⇒ Promise.<boolean> + * [.canExecute(proposalId)](#tokenvotingclientmethodscanexecuteproposalid--promiseboolean) ⇒ Promise.<boolean> + * [.getMembers(params)](#tokenvotingclientmethodsgetmembersparams--promisearraystring) ⇒ Promise.<Array.<string>> + * [.isTokenVotingCompatibleToken(tokenAddress)](#tokenvotingclientmethodsistokenvotingcompatibletokentokenaddress--promisetokenvotingtokencompatibility) ⇒ Promise.<TokenVotingTokenCompatibility> + * [.isMember(params)](#tokenvotingclientmethodsismemberparams--boolean) ⇒ boolean + + + +### tokenVotingClientMethods.prepareInstallation(params) ⇒ AsyncGenerator.<PrepareInstallationStepValue> +

Prepares the installation of a token voting plugin in a given dao

+ +**Kind**: instance method of [TokenVotingClientMethods](#tokenvotingclientmethods) +**Returns**: AsyncGenerator.<PrepareInstallationStepValue> + +| Param | Type | +| --- | --- | +| params | TokenVotingPluginPrepareInstallationParams | + + + +### tokenVotingClientMethods.prepareUpdate(params) ⇒ AsyncGenerator.<PrepareUpdateStepValue> +

Prepares the update of a token voting plugin in a given dao

+ +**Kind**: instance method of [TokenVotingClientMethods](#tokenvotingclientmethods) +**Returns**: AsyncGenerator.<PrepareUpdateStepValue> + +| Param | Type | +| --- | --- | +| params | TokenVotingPluginPrepareUpdateParams | + + + +### tokenVotingClientMethods.delegateTokens(params) ⇒ AsyncGenerator.<DelegateTokensStepValue> +

Delegates all the signer's voting power to a delegatee

+ +**Kind**: instance method of [TokenVotingClientMethods](#tokenvotingclientmethods) +**Returns**: AsyncGenerator.<DelegateTokensStepValue> + +| Param | Type | +| --- | --- | +| params | DelegateTokensParams | + + + +### tokenVotingClientMethods.undelegateTokens(tokenAddress) ⇒ AsyncGenerator.<UndelegateTokensStepValue> +

Delegates all the signer's tokens back to itself

+ +**Kind**: instance method of [TokenVotingClientMethods](#tokenvotingclientmethods) +**Returns**: AsyncGenerator.<UndelegateTokensStepValue> + +| Param | Type | +| --- | --- | +| tokenAddress | string | + + + +### tokenVotingClientMethods.getDelegatee(tokenAddress) ⇒ Promise.<(string\|null)> +

Retrieves the current signer's delegatee for the given token

+ +**Kind**: instance method of [TokenVotingClientMethods](#tokenvotingclientmethods) +**Returns**: Promise.<(string\|null)> + +| Param | Type | +| --- | --- | +| tokenAddress | string | + + + +### tokenVotingClientMethods.canVote(params) ⇒ Promise.<boolean> +

Checks if an user can vote in a proposal

+ +**Kind**: instance method of [TokenVotingClientMethods](#tokenvotingclientmethods) +**Returns**: Promise.<boolean> + +| Param | Type | +| --- | --- | +| params | CanVoteParams | + + + +### tokenVotingClientMethods.canExecute(proposalId) ⇒ Promise.<boolean> +

Checks whether the current proposal can be executed

+ +**Kind**: instance method of [TokenVotingClientMethods](#tokenvotingclientmethods) +**Returns**: Promise.<boolean> + +| Param | Type | +| --- | --- | +| proposalId | string | + + + +### tokenVotingClientMethods.getMembers(params) ⇒ Promise.<Array.<string>> +

Returns the list of wallet addresses holding tokens from the underlying Token contract used by the plugin

+ +**Kind**: instance method of [TokenVotingClientMethods](#tokenvotingclientmethods) +**Returns**: Promise.<Array.<string>> + +| Param | Type | Description | +| --- | --- | --- | +| params | MembersQueryParams |
  • pluginAddress
    • blockNumber
    • limit = 10
    • skip = 0
    • direction = SortDirection.ASC
    • sortBy = MembersSortBy.ADDRESS
| + + + +### tokenVotingClientMethods.isTokenVotingCompatibleToken(tokenAddress) ⇒ Promise.<TokenVotingTokenCompatibility> +

Checks if the given token is compatible with the TokenVoting plugin

+ +**Kind**: instance method of [TokenVotingClientMethods](#tokenvotingclientmethods) +**Returns**: Promise.<TokenVotingTokenCompatibility> + +| Param | Type | +| --- | --- | +| tokenAddress | string | + + + +### tokenVotingClientMethods.isMember(params) ⇒ boolean +

Checks if a given address is a member of the tokenVoting contract.

+ +**Kind**: instance method of [TokenVotingClientMethods](#tokenvotingclientmethods) +**Returns**: boolean - A boolean indicating whether the address is a member or not. + +| Param | Description | +| --- | --- | +| params |

The parameters for the isMember method.

| +| params.pluginAddress |

The address of the plugin.

| +| params.address |

The address to check.

| +| params.blockNumber |

The block number for specifying a specific block.

| + diff --git a/versioned_docs/version-1.3.0/sdk/02-reference-guide/04-addresslist-voting.md b/versioned_docs/version-1.3.0/sdk/02-reference-guide/04-addresslist-voting.md new file mode 100644 index 00000000..d7b2d34f --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/02-reference-guide/04-addresslist-voting.md @@ -0,0 +1,381 @@ +## Classes + +
+
AddresslistVotingClient
+

Provider a generic client with high level methods to manage and interact an Address List Voting plugin installed in a DAO

+
AddresslistVotingClientDecoding
+

Decoding module for the SDK AddressList Client

+
AddresslistVotingClientEncoding
+

Encoding module for the SDK AddressList Client

+
AddresslistVotingClientEstimation
+

Estimation module the SDK Address List Client

+
AddresslistVotingClientMethods
+

Methods module the SDK Address List Client

+
+ + + +## AddresslistVotingClient +

Provider a generic client with high level methods to manage and interact an Address List Voting plugin installed in a DAO

+ +**Kind**: global class + + +### AddresslistVotingClient.getPluginInstallItem(params, [network]) ⇒ PluginInstallItem +

Computes the parameters to be given when creating the DAO, +so that the plugin is configured

+ +**Kind**: static method of [AddresslistVotingClient](#addresslistvotingclient) +**Returns**: PluginInstallItem + +| Param | Type | Default | +| --- | --- | --- | +| params | AddresslistVotingPluginInstall | | +| [network] | Networkish | "mainnet" | + + + +## AddresslistVotingClientDecoding +

Decoding module for the SDK AddressList Client

+ +**Kind**: global class + +* [AddresslistVotingClientDecoding](#addresslistvotingclientdecoding) + * [.updatePluginSettingsAction(data)](#addresslistvotingclientdecodingupdatepluginsettingsactiondata--votingsettings) ⇒ VotingSettings + * [.addMembersAction(data)](#addresslistvotingclientdecodingaddmembersactiondata--arraystring) ⇒ Array.<string> + * [.removeMembersAction(data)](#addresslistvotingclientdecodingremovemembersactiondata--arraystring) ⇒ Array.<string> + * [.findInterface(data)](#addresslistvotingclientdecodingfindinterfacedata--interfaceparams--null) ⇒ InterfaceParams \| null + + + +### addresslistVotingClientDecoding.updatePluginSettingsAction(data) ⇒ VotingSettings +

Decodes a dao metadata from an encoded update metadata action

+ +**Kind**: instance method of [AddresslistVotingClientDecoding](#addresslistvotingclientdecoding) +**Returns**: VotingSettings + +| Param | Type | +| --- | --- | +| data | Uint8Array | + + + +### addresslistVotingClientDecoding.addMembersAction(data) ⇒ Array.<string> +

Decodes a list of addresses from an encoded add members action

+ +**Kind**: instance method of [AddresslistVotingClientDecoding](#addresslistvotingclientdecoding) +**Returns**: Array.<string> + +| Param | Type | +| --- | --- | +| data | Uint8Array | + + + +### addresslistVotingClientDecoding.removeMembersAction(data) ⇒ Array.<string> +

Decodes a list of addresses from an encoded remove members action

+ +**Kind**: instance method of [AddresslistVotingClientDecoding](#addresslistvotingclientdecoding) +**Returns**: Array.<string> + +| Param | Type | +| --- | --- | +| data | Uint8Array | + + + +### addresslistVotingClientDecoding.findInterface(data) ⇒ InterfaceParams \| null +

Returns the decoded function info given the encoded data of an action

+ +**Kind**: instance method of [AddresslistVotingClientDecoding](#addresslistvotingclientdecoding) +**Returns**: InterfaceParams \| null + +| Param | Type | +| --- | --- | +| data | Uint8Array | + + + +## AddresslistVotingClientEncoding +

Encoding module for the SDK AddressList Client

+ +**Kind**: global class + +* [AddresslistVotingClientEncoding](#addresslistvotingclientencoding) + * _instance_ + * [.updatePluginSettingsAction(pluginAddress, params)](#addresslistvotingclientencodingupdatepluginsettingsactionpluginaddress-params--daoaction) ⇒ DaoAction + * [.addMembersAction(pluginAddress, members)](#addresslistvotingclientencodingaddmembersactionpluginaddress-members--daoaction) ⇒ DaoAction + * [.removeMembersAction(pluginAddress, members)](#addresslistvotingclientencodingremovemembersactionpluginaddress-members--daoaction) ⇒ DaoAction + * _static_ + * [.getPluginInstallItem(params, network)](#addresslistvotingclientencodinggetplugininstallitemparams-network--plugininstallitem) ⇒ PluginInstallItem + + + +### addresslistVotingClientEncoding.updatePluginSettingsAction(pluginAddress, params) ⇒ DaoAction +

Computes the parameters to be given when creating a proposal that updates the governance configuration

+ +**Kind**: instance method of [AddresslistVotingClientEncoding](#addresslistvotingclientencoding) +**Returns**: DaoAction + +| Param | Type | +| --- | --- | +| pluginAddress | string | +| params | VotingSettings | + + + +### addresslistVotingClientEncoding.addMembersAction(pluginAddress, members) ⇒ DaoAction +

Computes the parameters to be given when creating a proposal that adds addresses to address list

+ +**Kind**: instance method of [AddresslistVotingClientEncoding](#addresslistvotingclientencoding) +**Returns**: DaoAction + +| Param | Type | +| --- | --- | +| pluginAddress | string | +| members | Array.<string> | + + + +### addresslistVotingClientEncoding.removeMembersAction(pluginAddress, members) ⇒ DaoAction +

Computes the parameters to be given when creating a proposal that removes addresses from the address list

+ +**Kind**: instance method of [AddresslistVotingClientEncoding](#addresslistvotingclientencoding) +**Returns**: DaoAction + +| Param | Type | +| --- | --- | +| pluginAddress | string | +| members | Array.<string> | + + + +### AddresslistVotingClientEncoding.getPluginInstallItem(params, network) ⇒ PluginInstallItem +

Computes the parameters to be given when creating the DAO, +so that the plugin is configured

+ +**Kind**: static method of [AddresslistVotingClientEncoding](#addresslistvotingclientencoding) +**Returns**: PluginInstallItem + +| Param | Type | +| --- | --- | +| params | AddresslistVotingPluginInstall | +| network | Networkish | + + + +## AddresslistVotingClientEstimation +

Estimation module the SDK Address List Client

+ +**Kind**: global class + +* [AddresslistVotingClientEstimation](#addresslistvotingclientestimation) + * [.createProposal(params)](#addresslistvotingclientestimationcreateproposalparams--promisegasfeeestimation) ⇒ Promise.<GasFeeEstimation> + * [.voteProposal(params)](#addresslistvotingclientestimationvoteproposalparams--promisegasfeeestimation) ⇒ Promise.<GasFeeEstimation> + * [.executeProposal(proposalId)](#addresslistvotingclientestimationexecuteproposalproposalid--promisegasfeeestimation) ⇒ Promise.<GasFeeEstimation> + * [.prepareUpdate(params)](#addresslistvotingclientestimationprepareupdateparams--promisegasfeeestimation) ⇒ Promise.<GasFeeEstimation> + + + +### addresslistVotingClientEstimation.createProposal(params) ⇒ Promise.<GasFeeEstimation> +

Estimates the gas fee of creating a proposal on the plugin

+ +**Kind**: instance method of [AddresslistVotingClientEstimation](#addresslistvotingclientestimation) +**Returns**: Promise.<GasFeeEstimation> + +| Param | Type | +| --- | --- | +| params | CreateMajorityVotingProposalParams | + + + +### addresslistVotingClientEstimation.voteProposal(params) ⇒ Promise.<GasFeeEstimation> +

Estimates the gas fee of casting a vote on a proposal

+ +**Kind**: instance method of [AddresslistVotingClientEstimation](#addresslistvotingclientestimation) +**Returns**: Promise.<GasFeeEstimation> + +| Param | Type | +| --- | --- | +| params | VoteProposalParams | + + + +### addresslistVotingClientEstimation.executeProposal(proposalId) ⇒ Promise.<GasFeeEstimation> +

Estimates the gas fee of executing an AddressList proposal

+ +**Kind**: instance method of [AddresslistVotingClientEstimation](#addresslistvotingclientestimation) +**Returns**: Promise.<GasFeeEstimation> + +| Param | Type | +| --- | --- | +| proposalId | string | + + + +### addresslistVotingClientEstimation.prepareUpdate(params) ⇒ Promise.<GasFeeEstimation> +

Estimates the gas fee of preparing an update

+ +**Kind**: instance method of [AddresslistVotingClientEstimation](#addresslistvotingclientestimation) +**Returns**: Promise.<GasFeeEstimation> + +| Param | Type | +| --- | --- | +| params | AddresslistVotingPluginPrepareUpdateParams | + + + +## AddresslistVotingClientMethods +

Methods module the SDK Address List Client

+ +**Kind**: global class + +* [AddresslistVotingClientMethods](#addresslistvotingclientmethods) + * [.createProposal(params)](#addresslistvotingclientmethodscreateproposalparams--asyncgeneratorproposalcreationstepvalue) ⇒ AsyncGenerator.<ProposalCreationStepValue> + * [.voteProposal(params)](#addresslistvotingclientmethodsvoteproposalparams--asyncgeneratorvoteproposalstepvalue) ⇒ AsyncGenerator.<VoteProposalStepValue> + * [.executeProposal(proposalId)](#addresslistvotingclientmethodsexecuteproposalproposalid--asyncgeneratorexecuteproposalstepvalue) ⇒ AsyncGenerator.<ExecuteProposalStepValue> + * [.prepareUpdate(params)](#addresslistvotingclientmethodsprepareupdateparams--asyncgeneratorprepareupdatestepvalue) ⇒ AsyncGenerator.<PrepareUpdateStepValue> + * [.canVote(params)](#addresslistvotingclientmethodscanvoteparams--promiseboolean) ⇒ Promise.<boolean> + * [.canExecute(proposalId)](#addresslistvotingclientmethodscanexecuteproposalid--promiseboolean) ⇒ Promise.<boolean> + * [.getMembers(params)](#addresslistvotingclientmethodsgetmembersparams--promisearraystring) ⇒ Promise.<Array.<string>> + * [.getProposal(proposalId)](#addresslistvotingclientmethodsgetproposalproposalid--promiseaddresslistvotingproposalnull) ⇒ Promise.<(AddresslistVotingProposal\|null)> + * [.getProposals(params)](#addresslistvotingclientmethodsgetproposalsparams--promisearrayaddresslistvotingproposallistitem) ⇒ Promise.<Array.<AddresslistVotingProposalListItem>> + * [.getVotingSettings(pluginAddress, blockNumber)](#addresslistvotingclientmethodsgetvotingsettingspluginaddress-blocknumber--promisevotingsettingsnull) ⇒ Promise.<(VotingSettings\|null)> + * [.isMember(params)](#addresslistvotingclientmethodsismemberparams--boolean) ⇒ boolean + + + +### addresslistVotingClientMethods.createProposal(params) ⇒ AsyncGenerator.<ProposalCreationStepValue> +

Creates a new proposal on the given AddressList plugin contract

+ +**Kind**: instance method of [AddresslistVotingClientMethods](#addresslistvotingclientmethods) +**Returns**: AsyncGenerator.<ProposalCreationStepValue> + +| Param | Type | +| --- | --- | +| params | CreateMajorityVotingProposalParams | + + + +### addresslistVotingClientMethods.voteProposal(params) ⇒ AsyncGenerator.<VoteProposalStepValue> +

Cast a vote on the given proposal using the client's wallet. Depending on the proposal settings, an affirmative vote may execute the proposal's actions on the DAO.

+ +**Kind**: instance method of [AddresslistVotingClientMethods](#addresslistvotingclientmethods) +**Returns**: AsyncGenerator.<VoteProposalStepValue> + +| Param | Type | +| --- | --- | +| params | VoteProposalParams | + + + +### addresslistVotingClientMethods.executeProposal(proposalId) ⇒ AsyncGenerator.<ExecuteProposalStepValue> +

Executes the given proposal, provided that it has already passed

+ +**Kind**: instance method of [AddresslistVotingClientMethods](#addresslistvotingclientmethods) +**Returns**: AsyncGenerator.<ExecuteProposalStepValue> + +| Param | Type | +| --- | --- | +| proposalId | string | + + + +### addresslistVotingClientMethods.prepareUpdate(params) ⇒ AsyncGenerator.<PrepareUpdateStepValue> +

Prepares the update of a token voting plugin in a given dao

+ +**Kind**: instance method of [AddresslistVotingClientMethods](#addresslistvotingclientmethods) +**Returns**: AsyncGenerator.<PrepareUpdateStepValue> + +| Param | Type | +| --- | --- | +| params | AddresslistVotingPluginPrepareUpdateParams | + + + +### addresslistVotingClientMethods.canVote(params) ⇒ Promise.<boolean> +

Checks if an user can vote in a proposal

+ +**Kind**: instance method of [AddresslistVotingClientMethods](#addresslistvotingclientmethods) +**Returns**: Promise.<boolean> + +| Param | Type | +| --- | --- | +| params | CanVoteParams | + + + +### addresslistVotingClientMethods.canExecute(proposalId) ⇒ Promise.<boolean> +

Checks whether the current proposal can be executed

+ +**Kind**: instance method of [AddresslistVotingClientMethods](#addresslistvotingclientmethods) +**Returns**: Promise.<boolean> + +| Param | Type | +| --- | --- | +| proposalId | string | + + + +### addresslistVotingClientMethods.getMembers(params) ⇒ Promise.<Array.<string>> +

Returns the list of wallet addresses with signing capabilities on the plugin

+ +**Kind**: instance method of [AddresslistVotingClientMethods](#addresslistvotingclientmethods) +**Returns**: Promise.<Array.<string>> + +| Param | Type | Description | +| --- | --- | --- | +| params | MembersQueryParams |
  • pluginAddress
    • blockNumber
    • limit = 10
    • skip = 0
    • direction = SortDirection.ASC
    • sortBy = MembersSortBy.ADDRESS
| + + + +### addresslistVotingClientMethods.getProposal(proposalId) ⇒ Promise.<(AddresslistVotingProposal\|null)> +

Returns the details of the given proposal

+ +**Kind**: instance method of [AddresslistVotingClientMethods](#addresslistvotingclientmethods) +**Returns**: Promise.<(AddresslistVotingProposal\|null)> + +| Param | Type | +| --- | --- | +| proposalId | string | + + + +### addresslistVotingClientMethods.getProposals(params) ⇒ Promise.<Array.<AddresslistVotingProposalListItem>> +

Returns a list of proposals on the Plugin, filtered by the given criteria

+ +**Kind**: instance method of [AddresslistVotingClientMethods](#addresslistvotingclientmethods) +**Returns**: Promise.<Array.<AddresslistVotingProposalListItem>> + +| Param | Type | Description | +| --- | --- | --- | +| params | ProposalQueryParams |
  • daoAddressOrEns - limit = 10 - status - skip = 0 - direction = SortDirection.ASC - sortBy = ProposalSortBy.CREATED_AT
| + + + +### addresslistVotingClientMethods.getVotingSettings(pluginAddress, blockNumber) ⇒ Promise.<(VotingSettings\|null)> +

Returns the settings of a plugin given the address of the plugin instance

+ +**Kind**: instance method of [AddresslistVotingClientMethods](#addresslistvotingclientmethods) +**Returns**: Promise.<(VotingSettings\|null)> + +| Param | Type | +| --- | --- | +| pluginAddress | string | +| blockNumber | number | + + + +### addresslistVotingClientMethods.isMember(params) ⇒ boolean +

Checks if a given address is a member of the AddresslistVoting contract.

+ +**Kind**: instance method of [AddresslistVotingClientMethods](#addresslistvotingclientmethods) +**Returns**: boolean - A boolean indicating whether the address is a member or not. + +| Param | Description | +| --- | --- | +| params |

The parameters for the isMember method.

| +| params.pluginAddress |

The address of the plugin.

| +| params.address |

The address to check.

| +| params.blockNumber |

The block number for specifying a specific block.

| + diff --git a/versioned_docs/version-1.3.0/sdk/02-reference-guide/index.md b/versioned_docs/version-1.3.0/sdk/02-reference-guide/index.md new file mode 100644 index 00000000..5e57cd92 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/02-reference-guide/index.md @@ -0,0 +1,12 @@ +--- +title: Reference Guide +--- + +## Overview + +This section contains the auto-generated documentation of the individual clients that the `@aragon/sdk-client` is offering: + +- [Generic SDK Client](./01-client.md) +- [Multisig Client](./02-multisig.md) +- [Token Voting Client](./03-token-voting.md) +- [Addresslist Voting Client](./04-addresslist-voting.md) diff --git a/versioned_docs/version-1.3.0/sdk/03-update-security-check/index.md b/versioned_docs/version-1.3.0/sdk/03-update-security-check/index.md new file mode 100644 index 00000000..212b1bae --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/03-update-security-check/index.md @@ -0,0 +1,179 @@ +--- +title: Update Security Check +--- + +## Context + +Aragon DAOs and the plugins installed can be updated via proposals. Upon execution, the proposal will call the DAO's [`execute` function][execute] and execute whatever action are specified inside its action list. +Accordingly, proposals must be checked thoroughly, especially when it comes to DAO or plugin updates. This happens automatically on the Aragon App frontend. + +All proposals scheduled in the DAO are checked via their proposal ID. A proposal is identified as an update proposals if it contains + +- one call to either + - [`upgradeTo(address newImplementation)`][oz-upgradeto] + OR + - [`upgradeToAndCall(address newImplementation, bytes memory data)`][oz-upgradetoandcall] +- one or more calls to [`applyUpdate(address _dao, ApplyUpdateParams _params)`][applyupdate] + +If a proposal is identified as an update proposal, we conduct general and specific checks on it. + +## General Proposal Checks + +After a proposal was identified as an update proposal, we check that only allowed actions are part of the action list and that none of them is allowed to fail. + +| Error | Explanation | +| ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `"invalidActions"` | The proposal contains unexpected actions that are not allowed for update proposals. | +| `"nonZeroAllowFailureMapValue"` | The allow failure map is not zero (see [the Aragon OSX docs](https://devs.aragon.org/docs/osx/how-it-works/core/dao/actions#the-allowfailuremap-input-argument)). | +| `"proposalNotFound"` | The proposal could not be found. | + +## Action-Specific Checks + +After the general checks, we check every action in the `Action[]` array separately. An action has three fields [see][action]: + +```solidity title="@aragon/osx/core/dao/IDAO.sol" +/// @notice The action struct to be consumed by the DAO's `execute` function resulting in an external call. +/// @param to The address to call. +/// @param value The native token value to be sent with the call. +/// @param data The bytes-encoded function selector and calldata for the call. +struct Action { + address to; + uint256 value; + bytes data; +} + +``` + +In the following, we explain the action specific checks. + +### DAO Update + +For DAO updates, we expect single action at position 0 of the action array. This action, must call + +- `upgradeTo(address newImplementation)` + OR +- `upgradeToAndCall(address newImplementation, bytes memory data)` + +#### Checking the `upgradeTo` Calldata + +| Item | Error | Explanation | +| ------- | ----------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | +| `to` | `"invalidToAddress"` | The `to` address of the action must be the DAO contract. | +| | | | +| `value` | `"nonZeroCallValue"` | The `value` native token value send with the call must be zero. | +| | | | +| `data` | `"invalidActions"` | The first 4 bytes must match the [`upgradeTo` function][oz-upgradeto] selector (see [General Proposal Checks](#general-proposal-checks)). | +| | `"invalidUpgradeToImplementationAddress"` | The `newImplementation` address must match with a newer DAO implementation contract developed by Aragon. | + +#### Checking the Action `data` calling `upgradeToAndCall` + +| Item | Error | Explanation | +| ------- | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `to` | `"invalidToAddress"` | The `to` address of the action must be the DAO contract. | +| | | | +| `value` | `"nonZeroCallValue"` | The `value` native token value send with the call must be zero. | +| | | | +| `data` | `"invalidActions"` | The first 4 bytes must match the [`upgradeToAndCall` function][oz-upgradetoandcall] selector (see [General Proposal Checks](#general-proposal-checks)). | +| | `"invalidUpgradeToAndCallImplementationAddress"` | The `newImplementation` address must match with a newer DAO implementation contract developed by Aragon. | +| | `"invalidUpgradeToAndCallData"` | The `data` passed into `upgradeToAndCall` must call the [`initializeFrom(uint8[3] _previousProtocolVersion, bytes _initData)` function][initializefrom]. The first 96 bytes of `data` must be occupied by an `uint[3] _previousProtocolVersion` semantic version number. The sub `_initData` must be empty for the current Aragon updates. | +| | `"invalidUpgradeToAndCallVersion"` | `uint[3] _previousProtocolVersion` must match with the semantic version number of the DAO the upgrade is transitioning from. | + +### Plugin Update + +For each plugin update, we expect a block of associated actions. There can be multiple, independent plugin updates happening in one update proposal. +We expect two types of blocks: + +```solidity +[ + grant({_where: plugin, _who: pluginSetupProcessor, _permissionId: UPGRADE_PLUGIN_PERMISSION_ID}), + applyUpdate({_dao: dao, _params: applyUpdateParams}), + revoke({_where: plugin, _who: pluginSetupProcessor, _permissionId: UPGRADE_PLUGIN_PERMISSION_ID}) +] +``` + +or + +```solidity +[ + grant({_where: plugin, _who: pluginSetupProcessor, _permissionId: UPGRADE_PLUGIN_PERMISSION_ID}), + grant({_where: dao, _who: pluginSetupProcessor, _permissionId: ROOT_PERMISSION_ID}), + applyUpdate({_dao: dao, _params: applyUpdateParams}), + revoke({_where: dao, _who: pluginSetupProcessor, _permissionId: ROOT_PERMISSION_ID}), + revoke({_where: plugin, _who: pluginSetupProcessor, _permissionId: UPGRADE_PLUGIN_PERMISSION_ID}) +] +``` + +#### Mandatory `applyUpdate` Call + +Each block being related to a plugin update must contain an action calling the [`applyUpdate(address _dao, ApplyUpdateParams _params)` function][applyupdate] exactly once. +This action is composed as follows: + +This action calls the [`applyUpdate(address _dao, ApplyUpdateParams _params)` function][applyupdate] + +| `Action` field | Error | Explanation | +| -------------- | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | +| `to` | `"invalidToAddress"` | The `to` address of the action must be Aragon's `PluginSetupProcessor` contract. | +| | | | +| `value` | `"nonZeroApplyUpdateCallValue"` | The `value` send with the call must be zero. | +| | | | +| `data` | `"invalidActions"` | The first 4 bytes must match the [`applyUpdate` function][applyupdate] selector (see [General Proposal Checks](#general-proposal-checks)). | +| | `"invalidData"` | The bytes must be decodable as specified in the plugins `_metadata` [see our specs][build-metadata] (**currently we skip this**). | +| | `"invalidPluginRepoMetadata"` | The [`build-metadata`][build-metadata] could not be found or is incorrectly formatted. | +| | `"pluginNotInstalled"` | The plugin address referenced in the `_params` is not installed. | +| | `"missingPluginRepo"` | The plugin repo referenced in the `_params` is not existing. | +| | `"notAragonPluginRepo"` | The plugin repo referenced in the `_params` is not an Aragon plugin repo. | +| | `"missingPluginPreparation"` | The update was not prepared in Aragon's `PluginSetupProcessor` contract. | +| | `"updateToOlderOrSameBuild"` | The update wants to transition to the same or an older build. | +| | `"updateToIncompatibleRelease"` | The update wants to transition to a different, incompatible release. | + +#### Mandatory `grant`/`revoke` `UPGRADE_PLUGIN_PERMISSION` Calls + +The `applyUpdate` action must be wrapped by `grant` and `revoke` actions: + +| `Action` field | Error | Explanation | +| -------------- | ------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- | +| `to` | `"invalidGrantUpgradePluginPermissionToAddress"` | The `to` address must be the DAO contract. | +| | | | +| `value` | `"nonZeroGrantUpgradePluginPermissionCallValue"` | The `value` send with the call must be zero. | +| | `"nonZeroRevokeUpgradePluginPermissionCallValue"` | " | +| | | | +| `data` | `"invalidActions"` | The first 4 bytes must match the [`grant` or][grant] [`revoke` function][revoke] selector (see [General Proposal Checks](#general-proposal-checks)). | +| | `"invalidGrantUpgradePluginPermissionWhereAddress"` | The `where` address must be the plugin proxy contract. | +| | `"invalidRevokeUpgradePluginPermissionWhereAddress"` | " | +| | `"invalidGrantUpgradePluginPermissionWhoAddress"` | The `who` address must be Aragon's `PluginSetupProcessor` contract. | +| | `"invalidRevokeUpgradePluginPermissionWhoAddress"` | " | +| | `"invalidGrantUpgradePluginPermissionPermissionId"` | `permissionId` must be `keccak256("UPGRADE_PLUGIN_PERMISSION")`. | +| | `"invalidRevokeUpgradePluginPermissionPermissionId"` | " | +| | `"invalidGrantUpgradePluginPermissionPermissionName"` | `permissionName` must be `UPGRADE_PLUGIN_PERMISSION`. | +| | `"invalidRevokeUpgradePluginPermissionPermissionName"` | " | + +#### Optional `grant`/`revoke` `ROOT_PERMISSION` Calls + +The `applyUpdate` action CAN be wrapped by `grant` and `revoke` actions: + +| `Action` field | Error | Explanation | +| -------------- | --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | +| `to` | `"invalidGrantRootPermissionToAddress"` | The `to` address must be the DAO contract. | +| | | | +| `value` | `"nonZeroGrantRootPermissionCallValue"` | The `value` send with the call must be zero. | +| | `"nonZeroRevokeRootPermissionCallValue"` | The `value` send with the call must be zero. | +| | | | +| `data` | `"invalidActions"` | The first 4 bytes must match the [`grant` or][grant] [`revoke` function][revoke] selector (see [General Proposal Checks](#general-proposal-checks)). | +| | `"invalidGrantRootPermissionWhereAddress"` | The `where` address must be the DAO contract. | +| | `"invalidRevokeRootPermissionWhereAddress"` | " | +| | `"invalidGrantRootPermissionWhoAddress"` | The `who` address must be Aragon's `PluginSetupProcessor`. | +| | `"invalidRevokeRootPermissionWhoAddress"` | " | +| | `"invalidGrantRootPermissionPermissionId"` | The `permissionId` must be `keccak256("ROOT_PERMISSION")`. | +| | `"invalidRevokeRootPermissionPermissionId"` | " | +| | `"invalidGrantRootPermissionPermissionName"` | The `permissionName` must be `ROOT_PERMISSION`. | +| | `"invalidRevokeRootPermissionPermissionName"` | " | + +[execute]: ../../osx/01-how-it-works/01-core/01-dao/01-actions.md#a-deep-dive-into-actions-and-execution +[action]: ../../osx/01-how-it-works/01-core/01-dao/01-actions.md#actions +[allowfailuremap]: ../../osx/01-how-it-works/01-core/01-dao/01-actions.md#allowing-for-failure +[initializefrom]: ../../osx/03-reference-guide/core/dao/DAO.md#external-function-initializefrom +[oz-upgradeto]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/3d4c0d5741b131c231e558d7a6213392ab3672a5/contracts/proxy/utils/UUPSUpgradeable.sol#L74-L77 +[oz-upgradetoandcall]: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/3d4c0d5741b131c231e558d7a6213392ab3672a5/contracts/proxy/utils/UUPSUpgradeable.sol#L89-L92 +[applyupdate]: ../../osx/03-reference-guide/framework/plugin/setup/PluginSetupProcessor.md#external-function-applyupdate +[grant]: ../../osx/03-reference-guide/core/permission/PermissionManager.md#external-function-grant +[revoke]: ../../osx/03-reference-guide/core/permission/PermissionManager.md#external-function-revoke \ No newline at end of file diff --git a/versioned_docs/version-1.3.0/sdk/index.md b/versioned_docs/version-1.3.0/sdk/index.md new file mode 100644 index 00000000..200aab32 --- /dev/null +++ b/versioned_docs/version-1.3.0/sdk/index.md @@ -0,0 +1,84 @@ +--- +title: Aragon SDK +sidebar_label: Intro +sidebar_position: 0 +--- + +## The JavaScript/TypeScript SDK for Aragon OSx + +`@aragon/sdk-client` provides easy access to the high level interactions to be +made with an Aragon DAO. It consists of three different components: + +- General-purpose DAO client +- Custom clients for specific DAO plugins +- Context for holding inheritable configuration + +Contributors: See [development](#development) below + +### Installation + +Use [npm](https://www.npmjs.com/) or [yarn](https://yarnpkg.com/) to install +@aragon/sdk-client. + +```bash +npm install @aragon/sdk-client +yarn add @aragon/sdk-client +``` + +### Usage + +The use of the different SDK features and methods is demonstrated in the [Examples (coming soon)](./01-examples/index.md) section. + +An extensive documentation of the different clients can be found in the auto-generated [Reference Guide](./02-reference-guide/index.md) section. + +#### React Native + +In order for the SDK to be used in restricted environments like react native install the following polyfills into your project: + +- [@ethersproject/shims](https://www.npmjs.com/package/@ethersproject/shims) +- [react-native-url-polyfill](https://www.npmjs.com/package/react-native-url-polyfill) + +Then import them like the following **before** you import the Aragon SDK package: + +```javascript +import '@ethersproject/shims'; +import 'react-native-url-polyfill/auto'; +import {Client} from '@aragon/sdk-client'; +``` + +### Development + +The building blocks are defined within the `src/internal` folder. The high level +client wrappers are implemented in `src/client*.ts` + +#### Low level networking + +See `ClientCore` (`/src/internal/core.ts`): + +- Abstract class implementing primitives for: + - Web3, contracts, signing + - IPFS + - GraphQL +- Inherited by classes like `Client` and all plugin classes like `TokenVotingClient`. + +#### Common interfaces, types, enums + +When updating a `ClientXXX` (plugin) class: + +- **Update first** all affected enums, types and interfaces in + `src/internal/interfaces/plugins.ts` + +When updating the `Client` class: + +- **Update first** all affected enums, types and interfaces in + `src/internal/interfaces/client.ts` + +When updating the `ClientCore` class: + +- **Update first** all affected enums, types and interfaces in + `src/internal/interfaces/core.ts` + +#### Developing a new Plugin client + +Create a new class that `extends` from `ClientCore`, receives a `Context` on the +`constructor` and follows the structure of `TokenVotingClient` (`./src/tokenVoting/client.ts`). diff --git a/versioned_sidebars/version-1.3.0-sidebars.json b/versioned_sidebars/version-1.3.0-sidebars.json new file mode 100644 index 00000000..0e685b54 --- /dev/null +++ b/versioned_sidebars/version-1.3.0-sidebars.json @@ -0,0 +1,14 @@ +{ + "osxSidebar": [ + { + "type": "autogenerated", + "dirName": "osx" + } + ], + "sdkSidebar": [ + { + "type": "autogenerated", + "dirName": "sdk" + } + ] +} diff --git a/versions.json b/versions.json new file mode 100644 index 00000000..1b35b6f4 --- /dev/null +++ b/versions.json @@ -0,0 +1,3 @@ +[ + "1.3.0" +]