Inspiration

Having previously participated in DeFi staking and recently completed the 32 hour long Blockchain, Solidity and Full Stack Web3 Development course by Patrick Collins, it has never been a better time applying the knowledge gained from the course by joining this hackathon.

What it does

It primarily aims at promoting the utility token, Achiever (ACH), serving as rewards to users staking it with WETH. To begin with, you would need to first swap some WETH to ACH, which is the only token accepted when attempting to mint an NFT in our ecosystem. If users plan on becoming a liquidity provider, we even have a one-sided optimizer that will help calculate the right amount of WETH (or ACH if down the road you have accumulated more rewards than you would need) to swap prior to fully utilizing the token pair for staking.

How we built it

We started off with some sample codes tinkering them on Remix and etherscan. We then moved on to refactoring the contracts and began testing them out piece by piece and more robustly on VS Code, using hardhat localhost. With all unit tests passing, a frontend user interface was then built upon turning it into a full stack DAPP.

Challenges we ran into

It took us quite a while integrating the reward logics with Constant Product Automated Market Maker. And while doing unit testing, we ran into issues with BigInt and that's where we realized calculated results on both sides of an equation often don't exactly equate each other particularly when dealing with irrational numbers. We also noticed some functionalities working flawlessly on a local host would cause a glitch on the testnet. For instance, you would need a block of wait time when approving an ERC20 "transferFrom" function, failure of which would cause the transaction to revert due to a delay in corresponding allowance showing up on-chain. Multiple sets of errors encountered when dealing with the frontend ui is another hurdle taking us days and weeks to resolve.

Accomplishments that we're proud of

Seeing the entire app eventually linking up well both front and backend is very satisfying. It proves that no problem is too big that our team could not solve it, granted a humble and teachable spirit is paramount to all achievements accomplished.

What we learned

Going the hard way coding from scratch really pays. When the web3ui kit functioning well on localhost:3000 couldn't seem to render its supposed styling on a demo site, we could quickly and comfortably switch to material ui for all needed forms considering the former technologies had already been well learned. Working on a hackathon project truly makes us gain a lot more practical skills by looking at the roots of many other problems.

What's next for MJET Achiever DeFi Tokenomics

A DAO template has been formulated with its timelock and governor contracts already deployed and linked up with Achiever as a governance token. We are excited in turning it DAO-driven and hopefully a small community could be formed and constructively connected to an active and transparent forum.

Built With

Share this project:

Updates