Space controller actions

In this section we will go over the actions that can be made by the Space Controller. Note that we use Open Zeppelin's OwnableUpgradable module to gate access to this functions, and therefore at the contract level we use the term owner instead of controller.

Cancel a proposal

A proposal can be cancelled as long as it has not already been executed.

function cancel(uint256 proposalId) external;
  • proposalId: The ID of the proposal

This can be used to prevent damage from malicious or broken proposals.

Update space settings

All Space settings can be updated using the updateSettings function:

function updateSettings(UpdateSettingsInput calldata input) external;

struct UpdateSettingsInput {
    uint32 minVotingDuration;
    uint32 maxVotingDuration;
    uint32 votingDelay;
    string metadataURI;
    string daoURI;
    Strategy proposalValidationStrategy;
    string proposalValidationStrategyMetadataURI;
    address[] authenticatorsToAdd;
    address[] authenticatorsToRemove;
    Strategy[] votingStrategiesToAdd;
    string[] votingStrategyMetadataURIsToAdd;
    uint8[] votingStrategiesToRemove;
}

A single entrypoint is used instead of separate ones for each value so that a single transaction can be used to update a large number of settings. This improves the UX while also preventing undesired behaviour that may arise if proposals are created half way though the settings update process.

If one does not want to update a certain value, then the following placeholder values can be used in the function call (arrays can just be left empty):

    /// @dev Evaluates to: `0xf2cda9b13ed04e585461605c0d6e804933ca828111bd94d4e6a96c75e8b048ba`.
    bytes32 NO_UPDATE_HASH = keccak256(abi.encodePacked("No update"));

    /// @dev Evaluates to: `0xf2cda9b13ed04e585461605c0d6e804933ca8281`.
    address NO_UPDATE_ADDRESS = address(bytes20(keccak256(abi.encodePacked("No update"))));

    /// @dev Evaluates to: `0xf2cda9b1`.
    uint32 NO_UPDATE_UINT32 = uint32(bytes4(keccak256(abi.encodePacked("No update"))));
    
    Strategy NO_UPDATE_STRATEGY = Strategy(NO_UPDATE_ADDRESS, new bytes(0));

Note that Space setting updates will not affect the functioning of ongoing proposals at the time of the settings update since we store the necessary settings data inside the state of each proposal.

Upgrade implementation

A Space contract's implementation can be upgraded to a new version using the following methods:

function upgradeTo(address newImplementation) external; 

function upgradeToAndCall(address newImplementation, bytes memory data) external;
  • newImplementation: The address of the new space implementation.

  • data: A encoded function call to initialize the new implementation.

Refer to Open Zeppelin's UUPS guide for more information.

Manage ownership

function transferOwnership(address newOwner) external;

function renounceOwnership() external; 

The owner can be transferred to a new address or renounced entirely.

Last updated