BalancerPairOracle#getPrice will revert due to division by zero in some cases
`BalancerPairOracle#getPrice` internally calls `computeFairReserves`, which returns fair reserve amounts given spot reserves, weights, and fair prices. When the parameter `resA` passed to `computeFairReserves` is smaller than `resB`, division by 0 will occur.\\nIn `BalancerPairOracle#getPrice`, resA and resB passed to `computeFairReserves` are the balance of TokenA and TokenB of the pool respectively. It is common for the balance of TokenB to be greater than the balance of TokenA.\\n```\\nfunction computeFairReserves(\\n        uint256 resA,\\n        uint256 resB,\\n        uint256 wA,\\n        uint256 wB,\\n        uint256 pxA,\\n        uint256 pxB\\n    ) internal pure returns (uint256 fairResA, uint256 fairResB) {\\n     // rest of code\\n     //@audit r0 = 0 when resA < resB.\\n->      uint256 r0 = resA / resB;\\n        uint256 r1 = (wA * pxB) / (wB * pxA);\\n        // fairResA = resA * (r1 / r0) ^ wB\\n        // fairResB = resB * (r0 / r1) ^ wA\\n        if (r0 > r1) {\\n            uint256 ratio = r1 / r0;\\n            fairResA = resA * (ratio ** wB);\\n            fairResB = resB / (ratio ** wA);\\n        } else {\\n->          uint256 ratio = r0 / r1;  // radio = 0 when r0 = 0\\n->          fairResA = resA / (ratio ** wB);    // revert divided by 0\\n            fairResB = resB * (ratio ** wA);\\n        }\\n    }\\n```\\n\\nAnother case is when the decimals of tokenA is smaller than the decimals of tokenB, such as usdc(e6)-weth(e18).
```\\n// Remove the line below\\n// Remove the line below\\n// Remove the line below\\n a/blueberry// Remove the line below\\ncore/contracts/oracle/BalancerPairOracle.sol\\n// Add the line below\\n// Add the line below\\n// Add the line below\\n b/blueberry// Remove the line below\\ncore/contracts/oracle/BalancerPairOracle.sol\\n@@ // Remove the line below\\n50,7 // Add the line below\\n50,7 @@ contract BalancerPairOracle is UsingBaseOracle, IBaseOracle {\\n         // // Remove the line below\\n// Remove the line below\\n> fairResA / r1^wB = constant product\\n         // // Remove the line below\\n// Remove the line below\\n> fairResA = resA^wA * resB^wB * r1^wB\\n         // // Remove the line below\\n// Remove the line below\\n> fairResA = resA * (resB/resA)^wB * r1^wB = resA * (r1/r0)^wB\\n// Remove the line below\\n        uint256 r0 = resA / resB;\\n// Add the line below\\n        uint256 r0 = resA * 10**(decimalsB) / resB;\\n         uint256 r1 = (wA * pxB) / (wB * pxA);\\n         // fairResA = resA * (r1 / r0) ^ wB\\n         // fairResB = resB * (r0 / r1) ^ wA\\n```\\n
All functions that subcall `BalancerPairOracle#getPrice` will be affected.
```\\nfunction computeFairReserves(\\n        uint256 resA,\\n        uint256 resB,\\n        uint256 wA,\\n        uint256 wB,\\n        uint256 pxA,\\n        uint256 pxB\\n    ) internal pure returns (uint256 fairResA, uint256 fairResB) {\\n     // rest of code\\n     //@audit r0 = 0 when resA < resB.\\n->      uint256 r0 = resA / resB;\\n        uint256 r1 = (wA * pxB) / (wB * pxA);\\n        // fairResA = resA * (r1 / r0) ^ wB\\n        // fairResB = resB * (r0 / r1) ^ wA\\n        if (r0 > r1) {\\n            uint256 ratio = r1 / r0;\\n            fairResA = resA * (ratio ** wB);\\n            fairResB = resB / (ratio ** wA);\\n        } else {\\n->          uint256 ratio = r0 / r1;  // radio = 0 when r0 = 0\\n->          fairResA = resA / (ratio ** wB);    // revert divided by 0\\n            fairResB = resB * (ratio ** wA);\\n        }\\n    }\\n```\\n