Skip to main content

Introduction

With Moonbeam Safe, it’s easy to perform contract interactions with verified contracts. Moonbeam’s StakingInterface.sol, while more accurately described as a precompile than a contract, has been verified on Moonscan, enabling seamless GLMR and MOVR staking via Moonbeam Safe (a friendly fork of Gnosis). This guide assumes you’re familiar with staking on Moonbeam – if you’d like a refresher you can check out this written guide or video tutorial.

Delegating to a Collator

To get started head to your Moonbeam Safe and click on New Transaction. On the resulting pop-up, click on Contract Interaction.

Moonbeam Safe Dashboard

A contract interaction pop-up will subsequently appear. Then, take the following steps:

  1. In the Contract Address field, paste the address of the staking precompile: 0x0000000000000000000000000000000000000800.
  2. Then, open up the Method drop down.
  3. Select the delegate function.

Contract Information

There are several required parameters you need in order to make a delegation. First and foremost, you’ll need the address of the collator you want to delegate to. To locate it, head to the Moonbeam Staking dApp or the Moonriver Staking dApp in a second window. Ensure you’re on the correct network, then press Select a Collator. Next to your desired collator, press the Copy icon. You’ll also need to remember the number of delegations your collator has. The PureStake-02 collator shown below has 319 at the time of writing.

Collator Candidates

After choosing a collator, take the following steps:

  1. Copy and paste the collator’s address into the candidate field.
  2. In the amount field, input the amount of GLMR / MOVR you’d like to delegate to the collator. Importantly, this amount must be specified in Wei, the lowest unit of measurement of GLMR / MOVR tokens, and it must be greater than or equal to the collator’s minimum bond amount. You can use this converter here on Moonscan to convert your desired stake amount to Wei.
  3. Copy and paste the collator’s number of existing delegations as seen in the Moonbeam Staking dApp into the candidateDelegationCount field.
  4. delegatorDelegationCount refers to the number of existing delegations that you have. More specifically, this field is an upper bound – so you can simply enter 68, the max number of collators in Moonbeam.
  5. Review all of the fields for accuracy, then press Review.

Choosing a collator

In this example, we’re delegating 5001 GLMR to the Purestake-02 Collator. On the confirmation page that follows, take the following steps:

  1. Depending on the configuration of your Moonbeam Safe, you may have the option of immediately executing the transaction. If you left unchecked, you or another signer will need to return to Moonbeam Safe to execute the transaction.
  2. After verifying the transaction details, press Submit.
  3. Press Confirm in your wallet. If your Moonbeam Safe configuration requires other signers to approve the transaction, they’ll need to do so before the delegation takes effect.

Confirm Transaction

Initiating a Request to Reduce or Revoke a Delegation

In order to reduce or revoke your delegation, you’ll need to know the address of your collator. If you’re unsure of your collator’s address, you can perform a chain state query to retrieve it in Polkadot.js Apps as follows:

  1. Head to Developer -> Chain state
  2. Select the parachainStaking pallet
  3. Select the delegatorState Query.
  4. Paste the address of your Moonbeam Safe next in the include option address box.
  5. The owner address returned is the address of your collator.

Developer Chain State

Reducing or revoking a delegation is a two-step process involving initiation and execution of the request after an exit delay period. As before, to get started, head to your Moonbeam Safe and click on New Transaction. On the resulting pop-up, click on Contract Interaction, and take the following steps:

  1. In the Contract Address field, paste the address of the staking precompile: 0x0000000000000000000000000000000000000800.
    Then, from the method dropdown, select either schedule_delegator_bond_less (to reduce your delegation) or schedule_revoke_delegation (to remove your delegation to a collator in its entirety).
  2. Input the address of your collator.
  3. If you’re reducing your delegation, you’ll need to specify in Wei the amount by which you’d like to reduce it. You can use this converter here on Moonscan to convert GLMR / MOVR to Wei.
  4. Review all of the details to ensure accuracy, then press Review.

Review Interaction

In this example, the delegation to the PureStake-02 Collator is being reduced by 20 GLMR. On the confirmation page that follows, take the following steps:

  1. Depending on the configuration of your Moonbeam Safe, you may have the option of immediately executing the transaction. If you left unchecked, you or another signer will need to return to Moonbeam Safe to execute the transaction.
  2. After verifying the transaction details, press Submit.
  3. Press Confirm in your wallet. If your Moonbeam Safe configuration requires other signers to approve the transaction, they’ll need to do so before the reduce / revoke request is initiated.

Execute Transaction

Executing a Request to Reduce or Revoke a Delegation

After initiating a request to reduce or revoke a delegation and waiting for the exit delay period to pass, you can return to your Moonbeam Safe to execute the reduce / revoke request and see the tokens returned to your free balance. This guide will show you how to take these steps from your Moonbeam safe, but following the design of Moonbeam’s staking pallet, a revoke or reduce request that’s eligible to be executed can be completed by anyone on the network. It is not a requirement to submit it from your safe and therefore, not a requirement to have multiple signers.

To get started, click New Transaction. On the resulting pop-up, click on Contract Interaction, and take the following steps:

  1. In the Contract Address field, paste the address of the staking precompile: 0x0000000000000000000000000000000000000800.
  2. Then, from the method dropdown, select execute_delegation_request. This step is the same regardless of whether you’re reducing or revoking your delegation entirely.
  3. Copy the address of your Moonbeam Safe from the top of the window but make sure to remove the prepended “mbeam:” or “mriver:” annotation.
  4. In the delegator field, paste the address of your Moonbeam Safe.
  5. For the candidate field, provide your collator’s address (the same one you specified when you initiated the revoke / reduce request).
  6. Review all of the details to ensure accuracy, then press Review.

Change a Delegation

In the above example, the prior 20 GLMR delegation reduction request to the PureStake-02 Collator is being executed. On the confirmation page that follows, take the following steps:

  1. Depending on the configuration of your Moonbeam Safe, you may have the option of immediately executing the transaction. If you left unchecked, you or another signer will need to return to Moonbeam Safe to execute the transaction.
  2. After verifying the transaction details, press Submit.
  3. Press Confirm in your wallet. If your Moonbeam Safe configuration requires other signers to approve the transaction, they’ll need to do so before the execute request is finalized.

Confirm Change

And that’s it! The Moonbeam Docs site features additional information on interacting with Moonbeam Safe and Staking in Moonbeam and Moonriver.

Kevin Neilson, PaperMoon

Author Kevin Neilson, PaperMoon

More posts by Kevin Neilson, PaperMoon