Metamask: How to deploy gnosis safe proxy contracts on Mumbai testnet(Polygon) using Safe Core SDK?

Here is an article based on your query:


Deploying Gnosis Safe Proxy Contracts on the Mumbai Testnet using Safe Core SDK





Metamask: How to deploy gnosis safe proxy contracts on Mumbai testnet(Polygon) using Safe Core SDK?

Introduction

------------

Gnosis Safe provides a secure way to delegate and manage cross-chain assets. One of the key components of this ecosystem is the secure proxy contract, which allows users to earn rewards and tokens by delegating their assets to a trusted proxy. In this article, we will demonstrate how to deploy a secure Gnosis proxy contract on the Mumbai testnet using the Safe Core SDK.

Prerequisites

--------------

To complete this lesson you will need:

  • Gnosis Safe account with a valid wallet (e.g. MetaMask)

  • Safe Core SDK installed and configured on your computer

  • Mumbai testnet URL: “

Step 1: Create a new wallet

-----------------------------

Before we begin, create a new wallet for the Mumbai testnet using the following command:

npx safe-core-wallets --network mumbai --create-wallet --wallet-name MySafeProxyWallet

This will create a new wallet named “MySafeProxyWallet”.

Step 2: Configure Safe Core SDK

--------------------------------

In this step we need to configure the Safe Core SDK to use our newly created wallet. Run the following command:

npx safe-core setup --network mumbai --wallet-name MySafeProxyWallet --proxy-type Gnosis --proxy-identity-id MY_SAFE_PROXY_ID

Replace "MY_SAFE_PROXY_ID" with the actual ID of your proxy contract on the Mumbai test network.

Step 3: Create a Proxy Contract

--------------------------------

We will create a new proxy contract using the Safe Core SDK. Run the following command:

npx safe-core create contracts --network mumbai --contract-name MyProxyContract --proxy-contract-id MY_SAFE_PROXY_ID

This will create a new Gnosis Safe Proxy Contract "MyProxyContract" with the specified identifier.

Step 4: Deploy a proxy contract on the testnet

----------------------------------------------

We need to deploy the proxy contract on the Mumbai testnet. Run the following command:

npx deploy safe-core contracts --network mumbai --contract-address

Replace with the actual address of your proxy contract on the Mumbai testnet.

Step 5: Verify the proxy contract implementation

----------------------------------------------

We can confirm that our proxy contract is deployed correctly by checking its status:

npx get safe-core-contracts --network mumbai --contract-address

This should show the implementation details of your proxy contract.

Troubleshooting Error: Invalid Safe Proxy Factory Contract Address

If you get an error like "Error: Invalid Safe Proxy Factory Contract Address" when switching to..., it may mean that your wallet or proxy ID is incorrect. To resolve this issue, make sure that:

  • Your wallet address is correct.

  • The proxy ID in the Safe Core SDK configuration matches the one used in the Mumbai test network.

Example Use Case

----------------

Here is an example use case for deploying the Gnosis Safe proxy contract on the Mumbai testnet:

``Javascript

const { createProxyContract } = require('@gnosis-safe/safe-core');

//Create a new wallet and proxy ID

const walletName = "MySafeWallet";

const proxyId = "MY_SAFE_PROXY_ID";

//Create a new proxy contract

async function main() {

const contractAddress = await createProxyContract({

network: "Mumbai",

wallet: walletName,

proxyID: proxyID,

});

console.log(Proxy Contract Address: ${contractAddress}`);

// Deploy the proxy contract to the testnet

wait for contracts.

ETHEREUM MINER OFFLINE

Leave a Reply

Your email address will not be published.