A hackathon project showcasing an efficient (both in terms of gas, and UX) micropayments protocol implemented on Ethereum
yarn install
Deploy a fake ERC20 token that implements permit
. the address corresponding to your
PRIVATE_KEY
environment variable will be given 1_000 TEST token:
npx hardhat run scripts/deploy_permit_erc20.ts --network sepolia
set the NEXT_PUBLIC_ERC20_ADDRESS
environment variable to the address deployed by the above script.
Deploy the PaymentChannel.sol contract:
npx hardhat run scripts/deploy_payment_channel.ts --network sepolia
set the NEXT_PUBLIC_PAYMENT_CHANNEL_ADDRESS
environment variable to the address deployed by the above script.
Finally, set the NEXT_PUBLIC_RECIPIENT_ADDRESS
environment variable to be the address that you want to receive payment
to via the micropayment channel.
The rest of the environment variables are self explanatory (if not, please reach out via an issue!):
OPENAI_API_KEY
SEPOLIA_URL
PRIVATE_KEY
Getting the app working locally:
docker-compose up # run local Postgres database
yarn dev # run migrations and start app
- DEV API url example: http://localhost:3000/api/signature
- PROD API url example: https://micropayments.vercel.app/api/signature