# 2nd GUniPool Review [commit d608864] * Proxy: https://etherscan.io/address/0xAbDDAfB225e10B90D798bB8A886238Fb835e2053 * Implementation (latest): https://etherscan.io/address/0xb542d5cb34ef265fb87c170181127332f7797369#code * Diffcheck (latest version against github): https://www.diffchecker.com/55VKzrkq ## Links: * https://docs-g-uni.gelato.network/#contact * https://en.wikipedia.org/wiki/Q_(number_format) * https://github.com/gelatodigital/g-uni-v1-core/compare/0faae15cb5dfdadf413a7908232b1be209507ee9...master * https://marketplace.visualstudio.com/items?itemName=tintinweb.solidity-visual-auditor ## Tests * Run Unit Tests (commit d608864) `$ yarn test` ![](https://i.imgur.com/7rC56WP.png) ## Slither * [GitHub](https://github.com/crytic/slither) * Run Slither `$ slither .` ![](https://i.imgur.com/FDcbAwP.png) ## Slither Summary * [Wiki](https://github.com/crytic/slither/wiki/Printer-documentation) * Run Slither Print Human Summary `$ slither . --print human-summary` ![](https://i.imgur.com/TAINlAH.png) ## Slither ERC Conformance * [Wiki](https://github.com/crytic/slither/wiki/ERC-Conformance) * Run Slither ERC20 Check `$ slither-check-erc . GUniPool` # Check GUniPool ## Check functions * [✓] totalSupply() is present * [✓] totalSupply() -> () (correct return value) * [✓] totalSupply() is view * [✓] balanceOf(address) is present * [✓] balanceOf(address) -> () (correct return value) * [✓] balanceOf(address) is view * [✓] transfer(address,uint256) is present * [✓] transfer(address,uint256) -> () (correct return value) * [✓] Transfer(address,address,uint256) is emitted * [✓] transferFrom(address,address,uint256) is present * [✓] transferFrom(address,address,uint256) -> () (correct return value) * [✓] Transfer(address,address,uint256) is emitted * [✓] approve(address,uint256) is present * [✓] approve(address,uint256) -> () (correct return value) * [✓] Approval(address,address,uint256) is emitted * [✓] allowance(address,address) is present * [✓] allowance(address,address) -> () (correct return value) * [✓] allowance(address,address) is view * [✓] name() is present * [✓] name() -> () (correct return value) * [✓] name() is view * [✓] symbol() is present * [✓] symbol() -> () (correct return value) * [✓] symbol() is view * [✓] decimals() is present * [✓] decimals() -> () (correct return value) * [✓] decimals() is view ## Check events * [✓] Transfer(address,address,uint256) is present * [✓] parameter 0 is indexed * [✓] parameter 1 is indexed * [✓] Approval(address,address,uint256) is present * [✓] parameter 0 is indexed * [✓] parameter 1 is indexed * [✓] GUniPool has increaseAllowance(address,uint256) ## Slither Upgradeability Checks * [Wiki](https://github.com/crytic/slither/wiki/Upgradeability-Checks) * `$ slither-check-upgradeability . GUniPool --proxy-name EIP173Proxy` ![](https://i.imgur.com/tb9GUQH.png) ## Inheritance Diagram * `$ surya inheritance contracts/* | dot -Tpng > GUniPool.png` ![](https://i.imgur.com/m7Luc9h.png) ## Sūrya's Graph (commit d608864) * [GitHub](https://github.com/ConsenSys/surya) * `$ surya graph contracts/*.sol | dot -Tpng > graph.png` ![](https://i.imgur.com/TmAtvKM.jpg) ## Sūrya's Description Report ### Files Description Table | File Name | SHA-1 Hash | |-------------|--------------| | contracts/GUniFactory.sol | f8a9ef1635f5f933026bf6c6a4329354932216df | | contracts/GUniPool.sol | c17093f69908cbacbd3083883b0202279bd5b802 | ### Contracts Description Table | Contract | Type | Bases | | | |:----------:|:-------------------:|:----------------:|:----------------:|:---------------:| | └ | **Function Name** | **Visibility** | **Mutability** | **Modifiers** | |||||| | **GUniFactory** | Implementation | GUniFactoryStorage, IGUniFactory ||| | └ | <Constructor> | Public ❗️ | 🛑 | GUniFactoryStorage | | └ | createPool | External ❗️ | 🛑 |NO❗️ | | └ | getTokenName | External ❗️ | |NO❗️ | | └ | upgradePools | External ❗️ | 🛑 | onlyManager | | └ | upgradePoolsAndCall | External ❗️ | 🛑 | onlyManager | | └ | makePoolsImmutable | External ❗️ | 🛑 | onlyManager | | └ | isPoolImmutable | External ❗️ | |NO❗️ | | └ | getGelatoPools | External ❗️ | |NO❗️ | | └ | getDeployers | Public ❗️ | |NO❗️ | | └ | getPools | Public ❗️ | |NO❗️ | | └ | numPools | Public ❗️ | |NO❗️ | | └ | numDeployers | Public ❗️ | |NO❗️ | | └ | numPools | Public ❗️ | |NO❗️ | | └ | getProxyAdmin | Public ❗️ | |NO❗️ | | └ | _getDeployer | Internal 🔒 | | | | └ | _getPool | Internal 🔒 | | | | └ | _getTokenOrder | Internal 🔒 | | | | └ | _append | Internal 🔒 | | | |||||| | **GUniPool** | Implementation | IUniswapV3MintCallback, IUniswapV3SwapCallback, GUniPoolStorage ||| | └ | <Constructor> | Public ❗️ | 🛑 | GUniPoolStorage | | └ | uniswapV3MintCallback | External ❗️ | 🛑 |NO❗️ | | └ | uniswapV3SwapCallback | External ❗️ | 🛑 |NO❗️ | | └ | mint | External ❗️ | 🛑 | nonReentrant | | └ | burn | External ❗️ | 🛑 | nonReentrant | | └ | executiveRebalance | External ❗️ | 🛑 | onlyManager | | └ | rebalance | External ❗️ | 🛑 | gelatofy | | └ | withdrawManagerBalance | External ❗️ | 🛑 | gelatofy | | └ | withdrawGelatoBalance | External ❗️ | 🛑 | gelatofy | | └ | _balancesToWithdraw | Internal 🔒 | | | | └ | getMintAmounts | External ❗️ | |NO❗️ | | └ | getUnderlyingBalances | Public ❗️ | |NO❗️ | | └ | getUnderlyingBalancesAtPrice | External ❗️ | |NO❗️ | | └ | _getUnderlyingBalances | Internal 🔒 | | | | └ | _rebalance | Private 🔐 | 🛑 | | | └ | _withdraw | Private 🔐 | 🛑 | | | └ | _deposit | Private 🔐 | 🛑 | | | └ | _swapAndDeposit | Private 🔐 | 🛑 | | | └ | _computeMintAmounts | Private 🔐 | | | | └ | _computeFeesEarned | Private 🔐 | | | | └ | _applyFees | Private 🔐 | 🛑 | | | └ | _subtractAdminFees | Private 🔐 | | | | └ | _checkSlippage | Private 🔐 | | | ### Legend | Symbol | Meaning | |:--------:|-----------| | 🛑 | Function can modify state | | 💵 | Function is payable |