# sourcify-snap

> Metamask Snap used to get human-readable transaction description from Sourcify

Latest version **0.1.2** (published 2022-12-27) · (MIT-0 OR Apache-2.0) license · 0 weekly downloads

## Install

```sh
npm install sourcify-snap
pnpm add sourcify-snap
yarn add sourcify-snap
bun add sourcify-snap
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2022-12-27 |
| First published | 2022-12-27 |
| Weekly downloads | 0 |
| License | (MIT-0 OR Apache-2.0) |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=16.0.0 |
| Dependencies | 3 |
| Unpacked size | 2.5 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Maintainers | harpaljadeja |

## Links

- npm: https://www.npmjs.com/package/sourcify-snap
- Repository: https://github.com/therealharpaljadeja/sourcify-snap
- Homepage: https://github.com/therealharpaljadeja/sourcify-snap#readme
- Issues: https://github.com/therealharpaljadeja/sourcify-snap/issues
- npm.io page: https://npm.io/package/sourcify-snap

## Dependencies (3)

- [ethers](https://npm.io/package/ethers.md) ^5.7.2
- [@metamask/utils](https://npm.io/package/@metamask/utils.md) ^3.3.1
- [@ethereum-sourcify/contract-call-decoder](https://npm.io/package/@ethereum-sourcify/contract-call-decoder.md) ^0.2.0

## Recent versions

- 0.1.2 (latest) — 2022-12-27
- 0.1.1 — 2022-12-27
- 0.1.0 — 2022-12-27

## README

# Sourcify Metamask Snap

![Screen-Recording-2022-12-20-at-7](https://user-images.githubusercontent.com/38040789/208689315-76f3e13e-cd7a-4145-86d1-c3ea616ab5f4.gif)

MetaMask Snaps is a system that allows anyone to safely expand the capabilities of MetaMask. A _snap_ is a program that we run in an isolated environment that can customize the wallet experience.

This snap uses Sourcify to get information about the contract with which the transaction is about to happen and provides a human-readable description of what is about to happen in the transaction.

[Demo](https://sourcify-snap-site.vercel.app/)

> **Warning**
> The human-readable description of the funciton is generated from the NatSpec comment on the function. So don't trust it blindly!

> **Note**
> The site has a example tx inside `packages/site/pages/index.tsx`

## Getting Started

Clone the repository and setup the development environment:

```shell
yarn install && yarn start
```

## Cloning

This repository contains GitHub Actions that you may find useful, see `.github/workflows` and [Releasing & Publishing](https://github.com/MetaMask/template-snap-monorepo/edit/main/README.md#releasing--publishing) below for more information.

If you clone or create this repository outside the MetaMask GitHub organization, you probably want to run `./scripts/cleanup.sh` to remove some files that will not work properly outside the MetaMask GitHub organization.

Note that the `action-publish-relase.yml` workflow contains a step that publishes the frontend of this snap (contained in the `public/` directory) to GitHub pages. If you do not want to publish the frontend to GitHub pages, simply remove the step named "Publish to GitHub Pages" in that workflow.

If you don't wish to use any of the existing GitHub actions in this repository, simply delete the `.github/workflows` directory.

## Contributing

- Snap Code is in `packages/snap`

### Testing and Linting

Run `yarn test` to run the tests once.

Run `yarn lint` to run the linter, or run `yarn lint:fix` to run the linter and fix any automatically fixable issues.

## Notes

- Babel is used for transpiling TypeScript to JavaScript, so when building with the CLI,
  `transpilationMode` must be set to `localOnly` (default) or `localAndDeps`.
- For the global `wallet` type to work, you have to add the following to your `tsconfig.json`:
  ```json
  {
    "files": ["./node_modules/@metamask/snap-types/global.d.ts"]
  }
  ```
- [Sourcify Repo for Contract includes code and metadata file](https://repo.sourcify.dev/contracts/full_match/80001/0xcDcE084825c30a919FA74B55903a974511f131E7/)

_Questions? Dm @harpaljadeja11 on twitter_

---
_Source: https://npm.io/package/sourcify-snap · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
