STAKING SYSTEM DEVELOPMENT FOR THE DEFI SECURITY PLATFORM HACKLESS
The Hackless platform aims to bolster the security of DeFi protocols by offering a comprehensive package of monitoring tools, analytics, and security services. Hackless provides a complex and reliable toolkit that helps boost a DeFi protocol’s security and protects it from hacks and malicious attacks. The platform’s services aim to help developers detect potential hacker attacks and save funds in case of an attack on the protocol.
The platform combines multiple security features to provide DeFi protocols with multi-sided protection. Hackless works at the infrastructure level of EVM-compatible blockchains and unites several elements from the blockchain ecosystem to strengthen the smart contract’s security from the fundamental levels of the blockchain ecosystem.
WHAT WAS THE TASK?
The goal was to create a standard DeFi staking system for the Hackless platform. The system includes a MasterChief-like staking contract written in Solidity. Though, despite the standard concept, the contract included custom features:
- custom commissions system
- lock/unlock periods;safe rewards distribution;
- the ability to re-invest rewards in staking in one transaction.
The scope of work also included dApp implementation and UI design preparation.
PROJECT ARCHITECTURE
As per the business logic of the Hackless staking system, Blaize experts have included the following functionality:
- Approve staking token to staking contract
- Deposit to the pool
- Claim pending rewards from the pool
- Initiate withdrawal from the pool
The charts below show the full staking system architecture.
THE DEVELOPMENT PROCESS
We had a powerful development team that included a blockchain Tech Lead, a Solidity developer, a frontend developer, a blockchain architect (for review and acceptance), a QA, a project manager, and a designer.
Here’s a brief list of what the team has done so far, divided by the main milestones of the development process:
The milestone includes:
Clarification of the requirements for smart contracts
Requirements collection for UI – the list of necessary fields and screens
Clarification of the staking scheme
Milestone 2: Development
The milestone includes:
- Smart contracts development over the prepared specification
- Full unit-test coverage
- Necessary documentation and schemes, including the docgen and architectural scheme
- Deployment scripts preparation
- UI/UX design preparation
- dApp preparation based on the finalized wireframes and UX
ATTRACT MORE USERS AND INVESTORS BY BUILDING AN EFFICIENT AND HIGHLY SECURE DECENTRALIZED APP WITH BLAIZE.
CHALLENGES WE CONFRONTED
The goal was to distribute a certain amount of funds in a certain period and be able to prolong this period and increase the reward amount at any time. For this reason, a standard Master-chief solution wasn’t a good fit for us.
On the dApp page, we needed to implement a dynamic APY/APR, which would show actual data instead of just hardcode values.
RESULT
Our work resulted in the Hackless team receiving a well-designed, standard for DeFi, staking system written in Solidity. The system includes a customized MasterChief staking contract (with additional changes to reflect commissions and lock periods) with Rewards System designed for Hackless needs and dApp implementation.
The system includes the following:
- Two pools for the HKLS token and LP token, with the ability to add more pools.
- Depositing and withdrawing functions.
- Rewards distribution of the HKLS token.
- Claiming and re-investing of rewards.
- A deployed staking system in BSC testnet.
- A dApp designed for Hackles UI guidelines.
- Displaying information about the pools such as TVL, TVL in USD, a dynamic APR/APY, accrued rewards, and information about lock periods.
- User-friendly interface (for example, with notifications when rewards are ended).
The Blaize team tested the staking process and functions as intended according to the Hackless business logic.