Skip to content

POC for using metamask snap to send transactions without a confirmation modal

Notifications You must be signed in to change notification settings

zaqk/metamask-snap-permissionless-transactions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Metamask Snaps Permissionless Transactions

Proof of concept for a metamask snap that does not prompt the user with a metamask confirmation modal before transactions. Requires the installation of a metamask snap that has access to the users private key.

Installation and running locally

First install metamask flask to use snaps.

(I reccomend installing this on a second browser that does not have metamask already installed. two instance of metamask running at the same time will cause issues)

  1. Start up hardhat local node
- cd hardhat
- update hardhat/.env with your metamask secret phrase
- yarn install
- yarn start
  1. connect metamask to your hardhat local node
- metamask => settings => networks => add network
- network name: "hardhat local"
- new rpc url: "http://127.0.0.1:8545" 
- chain id: 31337
- Currency Symbol: ETH
  1. Start up local snap installation page
- cd snap
- yarn install
- yarn start
- navigate to localhost:8080 and install metamask snap by clicking the connect button
  1. Start up local http server
- cd frontend
- yarn install
- yarn start
- navigate to localhost:3000

Usage

- Go to localhost:8080 click "approve". this will approve the metamask snap for localhost:3000
- To send a small amount of ETH to the zero address click the "send to zero address" button.
- confirm transaction was sent successfully by checking the console logs and verifying metamask ETH amount has changed.

About

POC for using metamask snap to send transactions without a confirmation modal

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published