Inspiration

Three days before the initial deadline of the hackathon, I thought of a concept where people could buy anything using any ERC20 tokens. I looked into existing solutions, but it was mostly centralized solutions. With some experience with Chainlink data feeds, the idea of drafting it in a smart contract came naturally. In a short time, I managed to build the core logic with solidity and then validated the features with test cases in the foundry. I was in the zone!

What it does

The core product is the decentralized payment gateway for tokens with USD-paired data feeds on Chainlink. It calculates how many tokens you need to pay, given the dollar value of the product. You can also manage most of the business processes like sales and profits by streaming all sale events and checking the balance of the contract. So in a way, the contract also doubles as your business process that you can integrate with things either on-chain or off-chain.

To demonstrate capability, I also developed an e-commerce site that shows the experience of both buyers and sellers. Buyers can buy things with their ERC20 tokens, while sellers can withdraw their profits and see their sales in the admin dashboard. The fun part is that it supports all EVM chains enabling payments across all of them.

How we built it

The main component of the project is the onchen smart contracts. Everything is written on Solidity, and functions are validated using tests built on Foundry. It has 100% line coverage and 87.50% line coverage.

I also built an e-commerce site built on NextJS using the web-3 template of TurboEth. The site was then deployed in vercel

Challenges we ran into

It was my first time using TurboEth, and it was overwhelming at first. I broke my front end a couple of times, good thing the deadline was extended.

Time was also my enemy, I have always thought of joining the hackathon since its inception, but things got busy at work. People might say that being a one-man team doing all the work is stupid, but I guess it's the best way to learn and validate all the knowledge I have in my web3 journey.

Accomplishments that we're proud of

Finishing this project in less than a week alone. 😅

What we learned

I learned a lot of new front-end libraries in the process. It's been a while since I coded in React/NextJS so knowing libraries such as wagmi made me appreciate the growth of web3 since it was just custom hooks on ethersJS.

I also recently switched from a hardhat stack to just foundry. This project was like a drill to me, and I was able to speed run development in just one and a half days.

What's next for Onchen

Some features I'm thinking of are doing a lot of integrations with Defi platforms to enable more liquidity inside the system. This will also reduce the friction of enabling economic activity on and between chains. Funds would no longer be just locked inside protocols, but we will be able to do more things without compromising yield generation.

Built With

Share this project:

Updates