GithubHelp home page GithubHelp logo

abhishekthak344 / blacksmith Goto Github PK

View Code? Open in Web Editor NEW

This project forked from blacksmith-eth/blacksmith

0.0 0.0 0.0 2.71 MB

๐Ÿ”จ An adaptive frontend for smart contract interaction

License: MIT License

Shell 0.05% JavaScript 0.75% TypeScript 99.13% CSS 0.06%

blacksmith's Introduction

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
pnpm install
pnpm 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 \
--verifier sourcify

Note: If this command fails see the Foundry Configuration section at the bottom of the README.

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.

Note: In order for the contract import to succeed, the contract must be verified on Etherscan.

Advanced Usage

Create a .env.local in the root directory of Blacksmith and include your API key to avoid rate limits.

echo "ETHERSCAN_API_KEY=XXX" >> .env.local

Script Imports

An example of the CLI arguments needed to import contracts via forge script can be found below.

forge script script/Counter.s.sol:CounterScript --broadcast --verify --unlocked \
--sender 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266 \
--fork-url http://localhost:8545 \
--verifier-url http://localhost:3000/api/verify \
--verifier sourcify

Hardhat

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

blacksmith's People

Contributors

clement-mikula avatar endziu avatar leovct avatar sambarnes avatar unholypanda avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.