This project demonstrates a cross-chain presale contract using Router Nitro's cross-chain bridge. The goal is to allow users to purchase tokens from different networks with their assets. This project was built using Hardhat for the smart contract development and React for the frontend.
- Smart Contracts: Developed using Hardhat.
- Frontend: Built with React.
- Cross-Chain Bridge: Implemented using Router Nitro's PATH_FINDER_API.
- Cross-Chain Asset Purchases: Users can buy tokens using assets from different networks.
- Seamless User Experience: The frontend provides an intuitive interface for interacting with the cross-chain presale contract.
- Node.js (v14 or later)
- npm (v6 or later)
- Hardhat
- React
git clone https://github.com/Bryanmankind/cross-chain-presale.git
cd crosschain_presale_dapp
Navigate to the project root directory and install the required dependencies:
npm install
Compile the smart contracts using Hardhat:
npx hardhat compile
Deploy the smart contracts to your chosen network:
npx hardhat run scripts/deploy.js --network your_network
If you want to test locally, you can start a local Hardhat node:
npx hardhat node
Deploy the contracts to the local node:
npx hardhat run scripts/deploy.js --network localhost
cross-chain-presale/
├── contracts/ # Solidity smart contracts
│ └── Presale.sol # Presale contract
├── scripts/ # Deployment and interaction scripts
│ └── deploy.js # Deployment script
├── test/ # Contract tests
│ └── presale-test.js # Test file for presale contract
├── frontend/ # React frontend
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── App.js # Main React component
│ │ └── index.js # Entry point for React
│ └── public/ # Public assets
├── hardhat.config.js # Hardhat configuration file
├── package.json # Node.js dependencies and scripts
└── README.md # Project documentation
- Access the Frontend: Open your browser and navigate to
http://localhost:3000
. - Connect Wallet: Connect your cryptocurrency wallet (e.g., MetaMask) to the desired network.
- Participate in Presale: Use the interface to participate in the presale by purchasing tokens with assets from different networks.
- Solidity: Smart contract language.
- Hardhat: Development environment for compiling, testing, and deploying Ethereum smart contracts.
- React: Frontend library for building user interfaces.
- Router Nitro: Cross-chain bridge API for seamless asset transfers.
Contributions are welcome! Please open an issue or submit a pull request for any changes or improvements.
This project is licensed under the MIT License.
Feel free to modify this README as per your project's specifics and requirements.