Using Glif with MetaMask

Using Glif with MetaMask

Glif uses MetaMask's new "Snaps" feature to allow people to approve Filecoin transactions with MetaMask. Read more about Snaps here.

This post will cover how to approve Filecoin transactions with MetaMask, using the Filecoin snap!

Install MetaMask Flask

First, you'll have to install the latest version of MetaMask that includes support for Snaps. Download link. Once you're logged in to MetaMask, you're good to go!

Simple (Wallet) Transactions

When using the Glif Wallet, you will be asked to approve simple transactions. When approving, it's important to verify that what you see on the Glif website matches what you see on the MetaMask extension.

For example, let's say you want to send someone with the address t1ludcntvmqrkuqjasbizabpmd5kqaechxzg2kxaq 1 FIL from your wallet with the address t13koa6kz5otquokcgwusvtsxcdymuq7lqe4twb4i.

Your Glif Wallet screen would look like this:

Your MetaMask extension should display matching details:

It's important to make sure:

  1. The To address is the recipient you intend to send FIL
  2. The Value is the right amount of FIL you intend to send

As long as those fields match, you can safely approve the transaction.

Multisig (Safe) Transactions

When using the Glif Safe, you will be asked to approve more complex transactions with "parameters".

Let's say you (t13koa6kz5otquokcgwusvtsxcdymuq7lqe4twb4i) want to Propose a 0.5 FIL Transfer from your Glif Safe (t2i43oi6rnf2s6rp544rcegfbcdp5l62cayz2btmy) to another Wallet Address (t1ludcntvmqrkuqjasbizabpmd5kqaechxzg2kxaq).

On the Glif Safe screen, you should see this:

On MetaMask, you should make sure the following fields match:

  1. The To address is your Safe address (not the recipient!).
  2. The From address is your Wallet address.
  3. No Value is being sent.

Note that there are two extra fields here worth understanding:

  1. Params - the params (short for "parameters") of this transaction contain extra instructions which Filecoin will use as instructions when processing this transaction. In this case, the params tell Filecoin we want to withdraw 0.5 FIL to the recipient with address t1ludcntvmqrkuqjasbizabpmd5kqaechxzg2kxaq.
  2. Method - the method is a number that tells Filecoin exactly what to do with the supplied parameters. For the Glif Safe, a Method (2) means a Safe proposal, a method (3) means a Safe approval, and a method (4) means a Safe proposal cancellation.