Skip to content

Commit

Permalink
docs: added security contract email address (#458)
Browse files Browse the repository at this point in the history
  • Loading branch information
heueristik authored Sep 13, 2023
1 parent defaea0 commit 8c20c5f
Show file tree
Hide file tree
Showing 61 changed files with 78 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/contracts/src/core/dao/DAO.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {IDAO} from "./IDAO.sol";
/// @author Aragon Association - 2021-2023
/// @notice This contract is the entry point to the Aragon DAO framework and provides our users a simple and easy to use public interface.
/// @dev Public API of the Aragon DAO framework.
/// @custom:security-contact [email protected]
contract DAO is
IEIP4824,
Initializable,
Expand Down
1 change: 1 addition & 0 deletions packages/contracts/src/core/dao/IDAO.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pragma solidity ^0.8.8;
/// @title IDAO
/// @author Aragon Association - 2022-2023
/// @notice The interface required for DAOs within the Aragon App DAO framework.
/// @custom:security-contact [email protected]
interface IDAO {
/// @notice The action struct to be consumed by the DAO's `execute` function resulting in an external call.
/// @param to The address to call.
Expand Down
1 change: 1 addition & 0 deletions packages/contracts/src/core/dao/IEIP4824.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pragma solidity 0.8.17;
/// @title EIP-4824 Common Interfaces for DAOs
/// @dev See https://eips.ethereum.org/EIPS/eip-4824
/// @author Aragon Association - 2021-2023
/// @custom:security-contact [email protected]
interface IEIP4824 {
/// @notice 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.
/// @return _daoURI The DAO URI.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ pragma solidity ^0.8.8;
/// @author Aragon Association - 2021-2023
/// @notice An interface to be implemented to support custom permission logic.
/// @dev To attach a condition to a permission, the `grantWithCondition` function must be used and refer to the implementing contract's address with the `condition` argument.
/// @custom:security-contact [email protected]
interface IPermissionCondition {
/// @notice Checks if a call is permitted.
/// @param _where The address of the target contract.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {IPermissionCondition} from "./IPermissionCondition.sol";
/// @title PermissionCondition
/// @author Aragon Association - 2023
/// @notice An abstract contract for non-upgradeable contracts instantiated via the `new` keyword to inherit from to support customary permissions depending on arbitrary on-chain state.
/// @custom:security-contact [email protected]
abstract contract PermissionCondition is ERC165, IPermissionCondition {
/// @notice Checks if an interface is supported by this or its parent contract.
/// @param _interfaceId The ID of the interface.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {IPermissionCondition} from "./IPermissionCondition.sol";
/// @title PermissionConditionUpgradeable
/// @author Aragon Association - 2023
/// @notice An abstract contract for upgradeable or cloneable contracts to inherit from and to support customary permissions depending on arbitrary on-chain state.
/// @custom:security-contact [email protected]
abstract contract PermissionConditionUpgradeable is ERC165Upgradeable, IPermissionCondition {
/// @notice Checks if an interface is supported by this or its parent contract.
/// @param _interfaceId The ID of the interface.
Expand Down
1 change: 1 addition & 0 deletions packages/contracts/src/core/permission/PermissionLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pragma solidity ^0.8.8;
/// @title PermissionLib
/// @author Aragon Association - 2021-2023
/// @notice A library containing objects for permission processing.
/// @custom:security-contact [email protected]
library PermissionLib {
/// @notice A constant expressing that no condition is applied to a permission.
address public constant NO_CONDITION = address(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import "./PermissionLib.sol";
/// @title PermissionManager
/// @author Aragon Association - 2021-2023
/// @notice The abstract permission manager used in a DAO, its associated plugins, and other framework-related components.
/// @custom:security-contact [email protected]
abstract contract PermissionManager is Initializable {
using AddressUpgradeable for address;

Expand Down
1 change: 1 addition & 0 deletions packages/contracts/src/core/plugin/IPlugin.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pragma solidity ^0.8.8;
/// @title IPlugin
/// @author Aragon Association - 2022-2023
/// @notice An interface defining the traits of a plugin.
/// @custom:security-contact [email protected]
interface IPlugin {
enum PluginType {
UUPS,
Expand Down
1 change: 1 addition & 0 deletions packages/contracts/src/core/plugin/Plugin.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {IPlugin} from "./IPlugin.sol";
/// @title Plugin
/// @author Aragon Association - 2022-2023
/// @notice An abstract, non-upgradeable contract to inherit from when creating a plugin being deployed via the `new` keyword.
/// @custom:security-contact [email protected]
abstract contract Plugin is IPlugin, ERC165, DaoAuthorizable {
/// @notice Constructs the plugin by storing the associated DAO.
/// @param _dao The DAO contract.
Expand Down
1 change: 1 addition & 0 deletions packages/contracts/src/core/plugin/PluginCloneable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {IPlugin} from "./IPlugin.sol";
/// @title PluginCloneable
/// @author Aragon Association - 2022-2023
/// @notice An abstract, non-upgradeable contract to inherit from when creating a plugin being deployed via the minimal clones pattern (see [ERC-1167](https://eips.ethereum.org/EIPS/eip-1167)).
/// @custom:security-contact [email protected]
abstract contract PluginCloneable is IPlugin, ERC165Upgradeable, DaoAuthorizableUpgradeable {
/// @notice Disables the initializers on the implementation contract to prevent it from being left uninitialized.
/// @custom:oz-upgrades-unsafe-allow constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {IPlugin} from "./IPlugin.sol";
/// @title PluginUUPSUpgradeable
/// @author Aragon Association - 2022-2023
/// @notice An abstract, upgradeable contract to inherit from when creating a plugin being deployed via the UUPS pattern (see [ERC-1822](https://eips.ethereum.org/EIPS/eip-1822)).
/// @custom:security-contact [email protected]
abstract contract PluginUUPSUpgradeable is
IPlugin,
ERC165Upgradeable,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {_auth} from "../../utils/auth.sol";
/// @title DaoAuthorizable
/// @author Aragon Association - 2022-2023
/// @notice An abstract contract providing a meta-transaction compatible modifier for non-upgradeable contracts instantiated via the `new` keyword to authorize function calls through an associated DAO.
/// @custom:security-contact [email protected]
abstract contract DaoAuthorizable is Context {
/// @notice The associated DAO managing the permissions of inheriting contracts.
IDAO private immutable dao_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {_auth} from "../../utils/auth.sol";
/// @author Aragon Association - 2022-2023
/// @notice An abstract contract providing a meta-transaction compatible modifier for upgradeable or cloneable contracts to authorize function calls through an associated DAO.
/// @dev Make sure to call `__DaoAuthorizableUpgradeable_init` during initialization of the inheriting contract.
/// @custom:security-contact [email protected]
abstract contract DaoAuthorizableUpgradeable is ContextUpgradeable {
/// @notice The associated DAO managing the permissions of inheriting contracts.
IDAO private dao_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pragma solidity ^0.8.8;
/// @title IMembership
/// @author Aragon Association - 2022-2023
/// @notice An interface to be implemented by DAO plugins that define membership.
/// @custom:security-contact [email protected]
interface IMembership {
/// @notice Emitted when members are added to the DAO plugin.
/// @param members The list of new members being added.
Expand Down
1 change: 1 addition & 0 deletions packages/contracts/src/core/plugin/proposal/IProposal.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {IDAO} from "../../dao/IDAO.sol";
/// @title IProposal
/// @author Aragon Association - 2022-2023
/// @notice An interface to be implemented by DAO plugins that create and execute proposals.
/// @custom:security-contact [email protected]
interface IProposal {
/// @notice Emitted when a proposal is created.
/// @param proposalId The ID of the proposal.
Expand Down
1 change: 1 addition & 0 deletions packages/contracts/src/core/plugin/proposal/Proposal.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import "./IProposal.sol";
/// @title Proposal
/// @author Aragon Association - 2022-2023
/// @notice An abstract contract containing the traits and internal functionality to create and execute proposals that can be inherited by non-upgradeable DAO plugins.
/// @custom:security-contact [email protected]
abstract contract Proposal is IProposal, ERC165 {
using Counters for Counters.Counter;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import "./IProposal.sol";
/// @title ProposalUpgradeable
/// @author Aragon Association - 2022-2023
/// @notice An abstract contract containing the traits and internal functionality to create and execute proposals that can be inherited by upgradeable DAO plugins.
/// @custom:security-contact [email protected]
abstract contract ProposalUpgradeable is IProposal, ERC165Upgradeable {
using CountersUpgradeable for CountersUpgradeable.Counter;

Expand Down
2 changes: 2 additions & 0 deletions packages/contracts/src/core/utils/BitMap.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pragma solidity 0.8.17;
/// @param bitmap The `uint256` representation of bits.
/// @param index The index number to check whether 1 or 0 is set.
/// @return Returns `true` if the bit is set at `index` on `bitmap`.
/// @custom:security-contact [email protected]
function hasBit(uint256 bitmap, uint8 index) pure returns (bool) {
uint256 bitValue = bitmap & (1 << index);
return bitValue > 0;
Expand All @@ -13,6 +14,7 @@ function hasBit(uint256 bitmap, uint8 index) pure returns (bool) {
/// @param bitmap The `uint256` representation of bits.
/// @param index The index number to set the bit.
/// @return Returns a new number in which the bit is set at `index`.
/// @custom:security-contact [email protected]
function flipBit(uint256 bitmap, uint8 index) pure returns (uint256) {
return bitmap ^ (1 << index);
}
1 change: 1 addition & 0 deletions packages/contracts/src/core/utils/CallbackHandler.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ pragma solidity 0.8.17;
/// @author Aragon Association - 2022-2023
/// @notice 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.
/// @dev This callback handling functionality is intented to be used by executor contracts (i.e., `DAO.sol`).
/// @custom:security-contact [email protected]
abstract contract CallbackHandler {
/// @notice A mapping between callback function selectors and magic return numbers.
mapping(bytes4 => bytes4) internal callbackMagicNumbers;
Expand Down
1 change: 1 addition & 0 deletions packages/contracts/src/core/utils/auth.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ error DaoUnauthorized(address dao, address where, address who, bytes32 permissio
/// @param _who The address (EOA or contract) owning the permission.
/// @param _permissionId The permission identifier.
/// @param _data The optional data passed to the `PermissionCondition` registered.
/// @custom:security-contact [email protected]
function _auth(
IDAO _dao,
address _where,
Expand Down
1 change: 1 addition & 0 deletions packages/contracts/src/framework/dao/DAOFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {DAORegistry} from "./DAORegistry.sol";
/// @title DAOFactory
/// @author Aragon Association - 2022-2023
/// @notice This contract is used to create a DAO.
/// @custom:security-contact [email protected]
contract DAOFactory is ERC165, ProtocolVersion {
/// @notice The DAO base contract, to be used for creating new `DAO`s via `createERC1967Proxy` function.
address public immutable daoBase;
Expand Down
1 change: 1 addition & 0 deletions packages/contracts/src/framework/dao/DAORegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {isSubdomainValid} from "../utils/RegistryUtils.sol";
/// @title Register your unique DAO subdomain
/// @author Aragon Association - 2022-2023
/// @notice This contract provides the possibility to register a DAO.
/// @custom:security-contact [email protected]
contract DAORegistry is InterfaceBasedRegistry {
/// @notice The ID of the permission required to call the `register` function.
bytes32 public constant REGISTER_DAO_PERMISSION_ID = keccak256("REGISTER_DAO_PERMISSION");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pragma solidity 0.8.17;
/// @title IPluginRepo
/// @author Aragon Association - 2022-2023
/// @notice The interface required for a plugin repository.
/// @custom:security-contact [email protected]
interface IPluginRepo {
/// @notice Updates the metadata for release with content `@fromHex(_releaseMetadata)`.
/// @param _release The release number.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {IPluginRepo} from "./IPluginRepo.sol";
/// @title PluginRepo
/// @author Aragon Association - 2020 - 2023
/// @notice The plugin repository contract required for managing and publishing different plugin versions within the Aragon DAO framework.
/// @custom:security-contact [email protected]
contract PluginRepo is
Initializable,
ERC165Upgradeable,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {PluginRepo} from "./PluginRepo.sol";
/// @title PluginRepoFactory
/// @author Aragon Association - 2022-2023
/// @notice This contract creates `PluginRepo` proxies and registers them on a `PluginRepoRegistry` contract.
/// @custom:security-contact [email protected]
contract PluginRepoFactory is ERC165, ProtocolVersion {
/// @notice The Aragon plugin registry contract.
PluginRepoRegistry public pluginRepoRegistry;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {IPluginRepo} from "./IPluginRepo.sol";
/// @title PluginRepoRegistry
/// @author Aragon Association - 2022-2023
/// @notice This contract maintains an address-based registry of plugin repositories in the Aragon App DAO framework.
/// @custom:security-contact [email protected]
contract PluginRepoRegistry is InterfaceBasedRegistry {
/// @notice The ID of the permission required to call the `register` function.
bytes32 public constant REGISTER_PLUGIN_REPO_PERMISSION_ID =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {IDAO} from "../../../core/dao/IDAO.sol";
/// @title IPluginSetup
/// @author Aragon Association - 2022-2023
/// @notice The interface required for a plugin setup contract to be consumed by the `PluginSetupProcessor` for plugin installations, updates, and uninstallations.
/// @custom:security-contact [email protected]
interface IPluginSetup {
/// @notice The data associated with a prepared setup.
/// @param helpers The address array of helpers (contracts or EOAs) associated with this plugin version after the installation or update.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {IPluginSetup} from "./IPluginSetup.sol";
/// @title PluginSetup
/// @author Aragon Association - 2022-2023
/// @notice An abstract contract that developers have to inherit from to write the setup of a plugin.
/// @custom:security-contact [email protected]
abstract contract PluginSetup is ERC165, IPluginSetup {
/// @inheritdoc IPluginSetup
function prepareUpdate(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {PluginSetupRef, hashHelpers, hashPermissions, _getPreparedSetupId, _getA
/// @author Aragon Association - 2022-2023
/// @notice This contract processes the preparation and application of plugin setups (installation, update, uninstallation) on behalf of a requesting DAO.
/// @dev This contract is temporarily granted the `ROOT_PERMISSION_ID` permission on the applying DAO and therefore is highly security critical.
/// @custom:security-contact [email protected]
contract PluginSetupProcessor {
using ERC165Checker for address;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ enum PreparationType {
/// @notice Returns an ID for plugin installation by hashing the DAO and plugin address.
/// @param _dao The address of the DAO conducting the setup.
/// @param _plugin The plugin address.
/// @custom:security-contact [email protected]
function _getPluginInstallationId(address _dao, address _plugin) pure returns (bytes32) {
return keccak256(abi.encode(_dao, _plugin));
}
Expand All @@ -40,6 +41,7 @@ function _getPluginInstallationId(address _dao, address _plugin) pure returns (b
/// @param _data The bytes-encoded initialize data for the upgrade that is returned by `prepareUpdate`.
/// @param _preparationType The type of preparation the plugin is currently undergoing. Without this, it is possible to call `applyUpdate` even after `applyInstallation` is called.
/// @return The prepared setup id.
/// @custom:security-contact [email protected]
function _getPreparedSetupId(
PluginSetupRef memory _pluginSetupRef,
bytes32 _permissionsHash,
Expand All @@ -64,6 +66,7 @@ function _getPreparedSetupId(
/// @param _pluginSetupRef The reference of the plugin setup containing plugin setup repo and version tag.
/// @param _helpersHash The hash of the helper contract addresses.
/// @return The applied setup id.
/// @custom:security-contact [email protected]
function _getAppliedSetupId(
PluginSetupRef memory _pluginSetupRef,
bytes32 _helpersHash
Expand All @@ -76,13 +79,15 @@ function _getAppliedSetupId(

/// @notice Returns a hash of an array of helper addresses (contracts or EOAs).
/// @param _helpers The array of helper addresses (contracts or EOAs) to be hashed.
/// @custom:security-contact [email protected]
function hashHelpers(address[] memory _helpers) pure returns (bytes32) {
return keccak256(abi.encode(_helpers));
}

/// @notice Returns a hash of an array of multi-targeted permission operations.
/// @param _permissions The array of of multi-targeted permission operations.
/// @return The hash of the array of permission operations.
/// @custom:security-contact [email protected]
function hashPermissions(
PermissionLib.MultiTargetPermission[] memory _permissions
) pure returns (bytes32) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import {IDAO} from "../../core/dao/IDAO.sol";

/// @title InterfaceBasedRegistry
/// @author Aragon Association - 2022-2023
/// @notice An [ERC-165](https://eips.ethereum.org/EIPS/eip-165)-based registry for contracts
/// @notice An [ERC-165](https://eips.ethereum.org/EIPS/eip-165)-based registry for contracts.
/// @custom:security-contact [email protected]
abstract contract InterfaceBasedRegistry is UUPSUpgradeable, DaoAuthorizableUpgradeable {
using ERC165CheckerUpgradeable for address;

Expand Down
1 change: 1 addition & 0 deletions packages/contracts/src/framework/utils/RegistryUtils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ pragma solidity 0.8.17;
/// @param subDomain The name of the DAO.
/// @return `true` if the name is valid or `false` if at least one char is invalid.
/// @dev Aborts on the first invalid char found.
/// @custom:security-contact [email protected]
function isSubdomainValid(string calldata subDomain) pure returns (bool) {
bytes calldata nameBytes = bytes(subDomain);
uint256 nameLength = nameBytes.length;
Expand Down
1 change: 1 addition & 0 deletions packages/contracts/src/framework/utils/TokenFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {IDAO} from "../../core/dao/IDAO.sol";
/// @title TokenFactory
/// @author Aragon Association - 2022-2023
/// @notice This contract creates [ERC-20](https://eips.ethereum.org/EIPS/eip-20) governance tokens.
/// @custom:security-contact [email protected]
contract TokenFactory {
using Address for address;
using Clones for address;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {IDAO} from "../../../core/dao/IDAO.sol";
/// @title ENSSubdomainRegistrar
/// @author Aragon Association - 2022-2023
/// @notice 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.
/// @custom:security-contact [email protected]
contract ENSSubdomainRegistrar is UUPSUpgradeable, DaoAuthorizableUpgradeable {
/// @notice The ID of the permission required to call the `_authorizeUpgrade` function.
bytes32 public constant UPGRADE_REGISTRAR_PERMISSION_ID =
Expand Down
1 change: 1 addition & 0 deletions packages/contracts/src/plugins/governance/admin/Admin.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {IDAO} from "../../../core/dao/IDAO.sol";
/// @title Admin
/// @author Aragon Association - 2022-2023
/// @notice The admin governance plugin giving execution permission on the DAO to a single address.
/// @custom:security-contact [email protected]
contract Admin is IMembership, PluginCloneable, ProposalUpgradeable {
using SafeCastUpgradeable for uint256;

Expand Down
Loading

0 comments on commit 8c20c5f

Please sign in to comment.