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).
Various components can be found in the packages
folder.
hardhat
contains the solidity and its tests.server
includes a server that could eventually index the results, and generates root-level invitation links.react-app
contains the front-end.js-eth-delegatable-utils
is a JS utility I made for more easily and reliably making signatures in the Astral format.extension
is the beginnings of a browser extension that could flag phishers on Twitter. It is able to add a badge to people, but does not yet have a data source.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.
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:
Delegatable
class a name for your contract, and a version string, per EIP 712._msgSender()
method to your contract, as seen in our sample contract.msg.sender
to identify a user, you should now use the _msgSender()
method instead, to benefit from this framework. Conveniently, it seems that most OpenZeppelin libraries already use an internal _msgSender()
implementation, and so overriding it as shown should be enough to use those libraries.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.
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:
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, tutorials, challenges, and many more resources, visit: docs.scaffoldeth.io
๐ 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
Check out all the active branches, open issues, and join/fund the ๐ฐ BuidlGuidl!
๐ซ Extend the NFT example to make a "buyer mints" marketplace
โ๏ธ Learn how ecrecover works
๐ฉโ๐ฉโ๐งโ๐ง Build a multi-sig that uses off-chain signatures
โ๏ธ Learn how a simple DEX works
๐ฆ Ape into learning!
Join the telegram support chat ๐ฌ to ask questions and find others building with ๐ scaffold-eth!
๐ Please check out our Gitcoin grant too!