amadeobrands / blacksmith

πŸ”¨ An adaptive frontend for smart contract interaction

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Blacksmith

Blacksmith generates a simple frontend for interacting with smart contracts.

This tool is specifically intended to be used with Foundry.

Installation

Clone the repo.

git clone https://github.com/blacksmith-eth/blacksmith.git

Quick Start

Start the Blacksmith application.

cd blacksmith
yarn
yarn dev

In a second terminal window start a local testnet node.

anvil

In a third terminal window create a foundry project in a separate directory.

forge init example
cd example

From the foundry directory deploy the counter contract to your local testnet node.

forge create src/Counter.sol:Counter --verify --unlocked \
--from 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 \
--rpc-url http://localhost:8545 \
--verifier-url http://localhost:3000/api/verify \
--etherscan-api-key blacksmith

Navigate to http://localhost:3000, click the connect wallet button, and choose Blacksmith.

Note: Refresh the page if the wallet modal fails to dismiss.

Select the Counter contract in the contracts sidebar and begin interacting!

Forking Mainnet

Replace the $INFURA_KEY with your personal API key.

anvil --fork-url https://mainnet.infura.io/v3/$INFURA_KEY

Navigate to the Blacksmith "Getting Started" page by clicking the "Blacksmith" heading.

In the "Contract Management" section enter the contract address for Dai 0x6b175474e89094c44da98b954eedeac495271d0f and click the import button.

Select the Dai contract in the contracts sidebar and begin interacting!

Example: Try entering 0xad0135af20fa82e106607257143d0060a7eb5cbf into the balanceOf function.

Hardhat

If you're working with Hardhat check out πŸ— scaffold-eth!

About

πŸ”¨ An adaptive frontend for smart contract interaction

License:MIT License


Languages

Language:TypeScript 99.0%Language:JavaScript 0.9%Language:CSS 0.1%