Computable-Finance / CoFiX

Core Smart Contracts of CoFiX: A Computable Financial Transaction Model. The Future of On-Chain Market Making is Here.
https://cofix.io
GNU General Public License v3.0
54 stars 21 forks source link

CertiK 2nd audit fix #5

Closed kazamio closed 4 years ago

kazamio commented 4 years ago
CertiK Exhibits Responses
1. Unlock solidity version https://github.com/Computable-Finance/CoFiX/pull/5/commits/4d45edbf4ed5bfff4414ef4b85e8e6228dbffca3
2. State variables that could be declared constant https://github.com/Computable-Finance/CoFiX/blob/2950bb6a9910ee6121df1a5206c598af1c3a7aa4/contracts/CoFiXVaultForTrader.sol#L26-L42 Most state variables are constant now
3. Add “emit event” in important functions https://github.com/Computable-Finance/CoFiX/pull/5/commits/e37ce453099be4f4fb89cc8d20bfbff858893a2f
4. Compares to a boolean constant We do not compare to a boolean constant now in CoFiXVaultForLP after updating.
5. Simplifying Existing Code https://github.com/Computable-Finance/CoFiX/pull/5/commits/a4d658e87969780e716d5c65f7ee416fa08dbe62
6. Confirm calculation formula https://github.com/Computable-Finance/Doc/blob/master/README.md#72-details-about-the-trading-mining Please check section 7.2
7. Greater-Than Comparison with Zero https://github.com/Computable-Finance/CoFiX/commit/40c2d6cedc4b0fbaadfc8de3433c2616662632b6
8. Question about the function “currentCoFiRate” The latest version implemented the section 7.1 https://github.com/Computable-Finance/CoFiX/blob/2950bb6a9910ee6121df1a5206c598af1c3a7aa4/contracts/CoFiXVaultForTrader.sol#L111
9. Use of function stakeForOther The stakeForOther is used in CoFiXRouter::addLiquidityAndStake which provides a shortcut for users to provide liquidity and stake to staking rewards pool directly.
10. Use of function addReward The addReward func is used to add reward from trading pool or anyone else in the future. Rewards are distributed to totalSupply and added to rewardPerTokenStored.