The ApeSwap Jungle is #SAFU
ApeSwap.Finance is dedicated to keeping our users and their funds safe. We take this very seriously, so below is a breakdown on exactly how we honor that commitment 🔒
The Background
In the tech industry, we’ve gotten accustomed to newer = better. Fast-paced innovation has always been king.
As recent events in the Binance Smart Chain ecosystem have shown, this couldn’t be further from the truth when dealing with smart contracts.
When building complex decentralized applications, usually it is safest to avoid reinventing the wheel, and instead fork established protocols that have been battle tested. This is exactly what ApeSwap (and prior to us, PancakeSwap) did when deploying our DEX, by forking UniSwap’s code and changing only the most essential items.
Uniswap has led the way for decentralized exchanges with an excellent security track record from when they launched in 2018. When Uniswap launches a new version, they go through an extensive audit to make sure all of their code is safe. This in-depth auditing process allows them to fix any security issues before releasing their DEX to the public. ApeSwap is based off of Uniswap V2, where there were no major findings uncovered during their audit. You can read more about this audit here.
Safety First: ApeSwap’s Golden Rules
More specifically, ApeSwap’s approach to security manifests itself in a few Golden Rules of security that we hold near and dear at ApeSwap.
- Move Slow, Don’t Break Anything — When it comes to innovating from a smart contract perspective, we’re intentionally slow to move. We would much prefer to take our time on getting a new feature out rather than putting our users at risk.
- Move Fast Where There is Low Risk — When it comes to innovating on the business development side of things, we want to move as fast as possible. Low-risk updates like new farms, pools, and UI features are where we drive most of our innovation and change.
- Audit First, then Deploy — Before we launch anything of importance or that could impose a substantial risk to our users, we make sure to get it cleared through an audit. For example, before the launch of Golden Banana, we had BSC GEMZ perform an in-depth audit on our contract code.
- Don’t Reinvent the Wheel — As you’ll see throughout the rest of the article, we’ve stuck with the most battle-tested DEX smart contracts in existence, ensuring the safety and longevity of ApeSwap.
The Nitty Gritty Details
For those who want ALL (and we mean all) the details, the rest of the article will compare Uniswap’s DEX contracts with ApeSwap’s DEX contracts to show the similarity and reassure all Apes in the jungle that your funds are Safe.
PAIR CONTRACT
Let’s start with Uniswap UniswapV2Pair compared to the ApeSwap ApePair contract that keeps track of all of your beloved pool token balances. This contract serves two purposes for the ApeSwap DEX.
- Serves as an Automated Market Maker
- Keeps track of pool token balances.
As you can see with the code comparison below, we are a carbon copy, with the only differences being in our variable names to match the ApeSwap brand and a reduction in swap fees from .03% to .02%.
To read more in depth about the Pair contract, click here.
FACTORY CONTRACT
The next contract we are comparing is the UniswapV2Factory contract with the ApeFactory contract. The factory contract serves one purpose for the ApeSwap DEX, and that is to deploy a single unique smart contract per token pair.
As you can see below, the ApeSwap factory contract is an exact copy of the UniSwap factory contract with one additional constant INIT_CODE_PAIR seen on line 2. This constant is used because the initial hash changes when we add social comments to the pair, but it does not change the functionality of the contracts whatsoever.
To read more in depth about the Factory contract click here
ERC20 CONTRACT
We will now be comparing the Uniswap ERC20 contract with the ApeSwap ERC20 contract. The ERC20 contract is used for denominating pool tokens. This is the reason you see APE-LPs after adding liquidity to the ApeSwap DEX. Looking below at the contracts you can see that ApeSwap ERC20 is an exact copy of the Uniswap ERC20 contract with variable name changes to match the ApeSwap brand.
To read more in depth about the ERC20 contract, click here.
ROUTER CONTRACT
Finally, we will take a look at the Uniswap router contract and the ApeSwap router contract. The router contract is used to help the front end support trading tokens and to add liquidity. The router contract is what allows all of you crazy apes to stack $BANANA. Looking below, we can see that the ApeSwap router contract is exactly the same as the Uniswap router contract with variable name changes to match the ApeSwap brand.
To read more in depth about the router contract click here.
The Security Conclusion
In conclusion, we essentially have the same security standards as Uniswap. While there have been general security concerns in the DeFi space, the ApeSwap team is confident in our security standards and want to reassure you all that your funds are SAFU.
To read more about Uniswap V2 and their DEX contracts you can click on the sources below.