delegatable / MobyMask

A browser extension for reporting phishers built on the Delegatable.eth framework.
MIT License
50 stars 12 forks source link

MobyMask

A lightweight, viral invite-based phishing report system with accountability and revocation. Available at https://mobymask.com.

Based on the Delegatable Eth framework for making counterfactually mintable soulbound tokens (or off chain delegations).

Workflow

Various components can be found in the packages folder.

Delegatable

An abstract solidity contract that any contract can easily integrate to add a ton of improvements to that contract's user and developer experience for all of its functions:

You can read about the theory behind this library here.

Integration in a Solidity project

pragma solidity ^0.8.13;

import "./Delegatable.sol";

contract YourContract is Delegatable {

  constructor(string memory name) Delegatable(name, "1") {}

  function _msgSender () internal view override(Delegatable, Context) returns (address sender) {
    if(msg.sender == address(this)) {
      bytes memory array = msg.data;
      uint256 index = msg.data.length;
      assembly {
        // Load the 32 bytes word from memory with the address on the lower 20 bytes, and mask those.
        sender := and(mload(add(array, index)), 0xffffffffffffffffffffffffffffffffffffffff)
      }
    } else {
      sender = msg.sender;
    }
    return sender;
  }

}

To use this in your own contract, follow these simple steps:

Integration into a web frontend

These contracts should be compatible with any signer or wallet that supports signTypedData_v4, like MetaMask.

You will be calling the eth_signTypedData method with the V4 parameter, as seen in the test files.

How it's set up

A fork of Scaffold-ETH boilerplate

Currently most of the good stuff is going on in packages/hardhat.

everything you need to build on Ethereum! ๐Ÿš€

๐Ÿงช Quickly experiment with Solidity using a frontend that adapts to your smart contract:

image

๐Ÿ„โ€โ™‚๏ธ Quick Start

Prerequisites: Node plus Yarn and Git

clone/fork ๐Ÿ— scaffold-eth:

git clone https://github.com/austintgriffith/scaffold-eth.git

install and start your ๐Ÿ‘ทโ€ Hardhat chain:

cd scaffold-eth
yarn install
yarn chain

in a second terminal window, start your ๐Ÿ“ฑ frontend:

cd scaffold-eth
yarn start

in a third terminal window, ๐Ÿ›ฐ deploy your contract:

cd scaffold-eth
yarn deploy

๐Ÿ” Edit your smart contract YourContract.sol in packages/hardhat/contracts

๐Ÿ“ Edit your frontend App.jsx in packages/react-app/src

๐Ÿ’ผ Edit your deployment scripts in packages/hardhat/deploy

๐Ÿ“ฑ Open http://localhost:3000 to see the app

๐Ÿ“š Documentation

Documentation, tutorials, challenges, and many more resources, visit: docs.scaffoldeth.io

๐Ÿ”ญ Learning Solidity

๐Ÿ“• Read the docs: https://docs.soliditylang.org

๐Ÿ“š Go through each topic from solidity by example editing YourContract.sol in ๐Ÿ— scaffold-eth

๐Ÿ“ง Learn the Solidity globals and units

๐Ÿ›  Buidl

Check out all the active branches, open issues, and join/fund the ๐Ÿฐ BuidlGuidl!

๐Ÿ’ฌ Support Chat

Join the telegram support chat ๐Ÿ’ฌ to ask questions and find others building with ๐Ÿ— scaffold-eth!


๐Ÿ™ Please check out our Gitcoin grant too!