snapshot
Blog
  • Welcome to Snapshot docs
  • User guides
    • Spaces
      • What is a space?
      • Create a space
        • Register an ENS domain
        • Alternative way to create a space
      • Settings
      • Sub-spaces
      • Space verification
      • Space hibernation
      • Add a custom domain
      • Add a skin
      • Space roles
      • Space badges
      • Snapshot Pro
      • Space handbook
        • Most common
        • Voting threshold
        • Anti-whale
        • Sybil resistance, scam & spam prevention
        • Liquidity / staking pool
        • Delegation
        • NFT voting
          • Most common: ERC-721
          • Multi-token: ERC-1155
          • POAP - Proof of Attendance
        • Custom calculations
    • Create a proposal
    • Voting
      • Vote on a proposal
      • Delegate your voting power
    • Voting strategies
    • Validation strategies
    • Using Safe multi-sig
    • Delegation
  • Developer Guides
    • Create a voting strategy
    • Create a validation strategy
    • Identify integrator activity
    • Add a network
  • Tools
    • Tools overview
    • Snapshot.js
    • API
      • API Keys
    • Webhooks
    • Subgraphs
    • Mobile notifications
    • Bots
  • Snapshot X
    • Overview
    • User guides
      • Create a space
      • Proposals
      • Voting
      • Safe execution setup
    • Protocol
      • Overview
      • Space actions
      • Space controller actions
      • Authenticators
      • Proposal validations
      • Voting strategies
      • Starknet specifics
      • Execution strategies
      • Audits
    • Services
      • Architecture
      • API
      • SX.js
      • UI
      • Mana
  • V1 interface
    • Email notifications
    • Plugins
      • What is a plugin?
      • Create a plugin
      • oSnap
      • SafeSnap
      • POAP
      • Quorum
      • Domino notifications
      • Galxe
    • Boost
  • Community
    • Help center
    • Discord
    • X (Twitter)
    • GitHub
Powered by GitBook
On this page
  • Cancel a proposal
  • Update space settings
  • Upgrade implementation
  • Manage ownership

Was this helpful?

Edit on GitHub
Export as PDF
  1. Snapshot X
  2. Protocol

Space controller actions

PreviousSpace actionsNextAuthenticators

Last updated 5 months ago

Was this helpful?

In this section we will go over the actions that can be made by the Space Controller. Note that we use Open Zeppelin's 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.

Manage ownership

function transferOwnership(address newOwner) external;

function renounceOwnership() external; 

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

Refer to for more information.

OwnableUpgradable
Open Zeppelin's UUPS guide