STAKING SYSTEM DEVELOPMENT FOR THE DEFI SECURITY PLATFORM HACKLESS
The Hackless platform is being designed to bolster the security of DeFi protocols by offering a comprehensive package of monitoring tools, analytics, and security services. Hackless offers a complex and reliable toolkit that helps boost a DeFi protocol’s security and protect it from hacks and malicious attacks. The platform’s services are aimed at helping developers both to detect a potential hacker attack and save funds in case the protocol is attacked.
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 had to include a MasterChief-like staking contract written in Solidity. Though, in spite of 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.
Scope of work also included dApp implementation, and UI design preparation.
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 full staking system architecture can be seen on the charts below.
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:
Milestone 1: Discovery
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 of time and be able to prolong this period and increase the amount of the reward 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.
As a result of our work, the Hackless team has received a well-designed, standard for DeFi, staking system written in Solidity that 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.
- dApp designed for Hackles UI guidelines;
- Displaying information about the pools such as TVL, TVL in USD, a dynamic APR/APY, accrued rewards, information about lock periods.
- User-friendly interface (for example, with notifications when rewards are ended).
The staking process was tested by the Blaize team and functions as intended according to the Hackless business logic.