Resources
People often ask me "How did you learn how to hack?" The answer: by reading. This page is a collection of the blog posts and other articles that I have accumulated over the years of my journey. Enjoy!
bDollar is a algorithmic stablecoin on the Binance Smartchain. It is pegged to multiply assets.
The contract attempts to do some asset rebalancing depending on what assets are in or out of the contract. When using CAKE tokens for conversion, it will try to judge the amount of WBNB exchanged. From this, it will exchange half of the WBNB for BDO tokens and use to this add liquidity to the pool.
If the value of the BDO token is raised during that process, the project will use more WBNB to add liquidity to the pool. To raise the price of BDO, they exchanged a large amount of BDO tokens in several other pools to create a price raise with flash loaned funds.
The key problem is that the contract will automatically replenish the liquidity for the pool without considering if the token price is out of balance. So, the project will supplement the liquidity at a high price to over the order at a higher price. The exploit happens when performing a swap call.