Spout RWA Token is a project focused on the tokenization of Real World Assets (RWA) on the Ethereum blockchain. This repository provides a robust starting point for developing, deploying, and interacting with smart contracts that represent real-world assets as on-chain tokens.
This project leverages Hardhat for smart contract development, testing, and deployment, and includes a sample frontend Dapp for interacting with your RWA tokens.
Clone this repository and install its dependencies:
git clone <your-repo-url>
cd spout-rwa-token
npm installStart the local Hardhat network:
npx hardhat nodeIn a new terminal, deploy your RWA token contract:
npx hardhat run scripts/deploy.js --network localhostTo run the frontend Dapp:
cd frontend
npm install
npm startOpen http://localhost:3000/ to interact with your RWA token. You will need a wallet like Coinbase Wallet or Metamask connected to localhost 8545.
- Write and compile your RWA token contracts in the
contractsdirectory. - Use the
scriptsdirectory for deployment and interaction scripts. - Test your contracts in the
testdirectory using Mocha and Chai. - The
frontenddirectory contains a React-based Dapp for interacting with your deployed contracts.
For more information on Hardhat, see the Hardhat documentation.
This repository uses the recommended Hardhat setup with @nomicfoundation/hardhat-toolbox, enabling you to:
- Deploy and interact with contracts using ethers.js.
- Test contracts with Mocha, Chai, and Hardhat Chai Matchers.
- Interact with Hardhat Network Helpers.
- Verify contract source code with hardhat-etherscan.
- Get gas usage metrics with hardhat-gas-reporter.
- Measure test coverage with solidity-coverage.
A sample frontend Dapp is included in the frontend directory, built with Create React App.
Invalid nonceerrors: If you see this error on thenpx hardhat nodeconsole, try resetting your Metamask account. This will reset the account's transaction history and nonce. Open Metamask, go toSettings > Advanced > Clear activity tab data.
Hardhat for Visual Studio Code is the official extension for Solidity support in VSCode. If you use VSCode, give it a try!
For help with this project or Hardhat in general, see the Hardhat help guide.
Stay updated by following Hardhat on Twitter and starring their GitHub repository.
Happy building Real World Asset tokens with Spout!