This repo contains demo code for interacting with the Ethereum blockchain using the Ethers.js library and Metamask browser plugin.
Pull requests welcome.
- react.js
- ethereum basics
- metamask
- asynchronous javascript
- Metamask browser plugin
- Node & NPM
- VS Code (or similar)
- Terminal window (VS Code inbuilt, powershell, gitbash)
- Compiler requirements
- See https://docs.soliditylang.org/en/v0.7.4/installing-solidity.html for further details.
- Most of these requirements may already be installed already (eg git).
- clone the repo:
git clone https://github.com/severalpens/metamaskdemo.git
- run
npm install
to install npm packages - start the app:
npm start
- visit http://localhost:3000 and open developer tools (f12) to see console.log outputs
- To compile contracts, run
npm i -g truffle
thentruffle compile
t1_generateAccounts
: Generate new Ethereum Accountst2_getBalance
: Get the balance of an Ethereum Accountt3_transferEth
: Transfer Eth balance between two Ethereum Accountstc1_createFungibleContract
: Create a new contract using ERC20 spec (Fungible Token)tc2_transferTokens
: Transfer tokens between accountst6_createNFT
: Create a new contract using ERC720 spec (Non Fungible Token)tc4_transferNFT
: Transfer an NFT between Ethereum Accounts