Skip to content

Commit

Permalink
chore: remove unchecked and inc to 0.8.23
Browse files Browse the repository at this point in the history
  • Loading branch information
sujithsomraaj committed Nov 20, 2023
1 parent 6ccf843 commit 8bc1d1b
Show file tree
Hide file tree
Showing 108 changed files with 208 additions and 212 deletions.
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
src = 'src'
out = 'out'
libs = ['lib']
solc_version = "0.8.21" # Override for the solc version (setting this ignores `auto_detect_solc`)
solc_version = "0.8.23" # Override for the solc version (setting this ignores `auto_detect_solc`)
evm_version = "paris" # to prevent usage of PUSH0, which is not supported on all chains


Expand Down
2 changes: 1 addition & 1 deletion src/_global/swapUtils.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.23;

import {SafeTransferLib} from "solmate/utils/SafeTransferLib.sol";
import {ERC20} from "solmate/tokens/ERC20.sol";
Expand Down
2 changes: 1 addition & 1 deletion src/aave-v2/AaveV2ERC4626Reinvest.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.23;

import {ERC20} from "solmate/tokens/ERC20.sol";
import {ERC4626} from "solmate/mixins/ERC4626.sol";
Expand Down
2 changes: 1 addition & 1 deletion src/aave-v2/AaveV2ERC4626ReinvestFactory.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.23;

import {ERC20} from "solmate/tokens/ERC20.sol";
import {ERC4626} from "solmate/mixins/ERC4626.sol";
Expand Down
2 changes: 1 addition & 1 deletion src/aave-v2/AaveV2ERC4626ReinvestIncentive.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.23;

import {ERC20} from "solmate/tokens/ERC20.sol";
import {ERC4626} from "solmate/mixins/ERC4626.sol";
Expand Down
2 changes: 1 addition & 1 deletion src/aave-v2/AaveV2ERC4626ReinvestIncentiveFactory.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.23;

import {ERC20} from "solmate/tokens/ERC20.sol";
import {ERC4626} from "solmate/mixins/ERC4626.sol";
Expand Down
2 changes: 1 addition & 1 deletion src/aave-v2/aave/IAaveMining.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.23;

interface IAaveMining {
function claimRewards(address[] calldata assets, uint256 amount, address to) external returns (uint256);
Expand Down
2 changes: 1 addition & 1 deletion src/aave-v2/aave/ILendingPool.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.23;

// Aave lending pool interface
// Documentation: https://docs.aave.com/developers/the-core-protocol/lendingpool/ilendingpool
Expand Down
2 changes: 1 addition & 1 deletion src/aave-v2/test/AaveV2ERC4626Reinvest.t.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.23;

import "forge-std/Test.sol";
import {ERC20} from "solmate/tokens/ERC20.sol";
Expand Down
2 changes: 1 addition & 1 deletion src/aave-v2/utils/ISwapRouter.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.21;
pragma solidity ^0.8.23;
pragma abicoder v2;

import "./IUniswapV3SwapCallback.sol";
Expand Down
2 changes: 1 addition & 1 deletion src/aave-v2/utils/IUniswapV3SwapCallback.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.21;
pragma solidity ^0.8.23;

/// @title Callback for IUniswapV3PoolActions#swap
/// @notice Any contract that calls IUniswapV3PoolActions#swap must implement this interface
Expand Down
2 changes: 1 addition & 1 deletion src/aave-v3/AaveV3ERC4626Reinvest.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.23;

import {ERC20} from "solmate/tokens/ERC20.sol";
import {ERC4626} from "solmate/mixins/ERC4626.sol";
Expand Down
2 changes: 1 addition & 1 deletion src/aave-v3/AaveV3ERC4626ReinvestFactory.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.23;

import {ERC20} from "solmate/tokens/ERC20.sol";
import {ERC4626} from "solmate/mixins/ERC4626.sol";
Expand Down
2 changes: 1 addition & 1 deletion src/aave-v3/AaveV3ERC4626ReinvestIncentive.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.23;

import {ERC20} from "solmate/tokens/ERC20.sol";
import {ERC4626} from "solmate/mixins/ERC4626.sol";
Expand Down
2 changes: 1 addition & 1 deletion src/aave-v3/AaveV3ERC4626ReinvestIncentiveFactory.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.23;

import {ERC20} from "solmate/tokens/ERC20.sol";
import {ERC4626} from "solmate/mixins/ERC4626.sol";
Expand Down
2 changes: 1 addition & 1 deletion src/aave-v3/AaveV3ERC4626ReinvestUni.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.23;

import {ERC20} from "solmate/tokens/ERC20.sol";
import {ERC4626} from "solmate/mixins/ERC4626.sol";
Expand Down
2 changes: 1 addition & 1 deletion src/aave-v3/AaveV3ERC4626ReinvestUniFactory.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.23;

import {ERC20} from "solmate/tokens/ERC20.sol";
import {ERC4626} from "solmate/mixins/ERC4626.sol";
Expand Down
2 changes: 1 addition & 1 deletion src/aave-v3/external/IPool.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.23;

/**
* @title IPool
Expand Down
2 changes: 1 addition & 1 deletion src/aave-v3/external/IRewardsController.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.23;

/**
* @title IRewardsController
Expand Down
2 changes: 1 addition & 1 deletion src/aave-v3/test/AaveV3ERC4626Reinvest.t.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.23;

import "forge-std/Test.sol";
import {ERC20} from "solmate/tokens/ERC20.sol";
Expand Down
2 changes: 1 addition & 1 deletion src/aave-v3/test/AaveV3ERC4626ReinvestIncentive.t.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.23;

import "forge-std/Test.sol";
import {ERC20} from "solmate/tokens/ERC20.sol";
Expand Down
2 changes: 1 addition & 1 deletion src/aave-v3/test/AaveV3ERC4626ReinvestUni.t.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.23;

import "forge-std/Test.sol";
import {ERC20} from "solmate/tokens/ERC20.sol";
Expand Down
2 changes: 1 addition & 1 deletion src/alpaca/AlpacaERC4626Reinvest.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.23;

import {ERC20} from "solmate/tokens/ERC20.sol";
import {ERC4626} from "solmate/mixins/ERC4626.sol";
Expand Down
2 changes: 1 addition & 1 deletion src/alpaca/interfaces/IBToken.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.23;

interface IBToken {
function deposit(uint256) external payable;
Expand Down
2 changes: 1 addition & 1 deletion src/alpaca/interfaces/IFairLaunch.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.23;

interface IFairLaunch {
function alpacaPerBlock() external view returns (uint256);
Expand Down
2 changes: 1 addition & 1 deletion src/alpaca/interfaces/IRewardsCore.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.23;

interface IRewardsCore {
function claimRewards(address, address, bytes memory) external;
Expand Down
2 changes: 1 addition & 1 deletion src/alpaca/interfaces/IVaultConfig.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.23;

interface IVaultConfig {
/// @dev Return the bps rate for reserve pool.
Expand Down
2 changes: 1 addition & 1 deletion src/alpaca/interfaces/WrappedNative.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.23;

interface WrappedNative {
function deposit() external payable;
Expand Down
2 changes: 1 addition & 1 deletion src/alpaca/test/AlpacaERC4626Reinvest.t.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.23;

import "forge-std/Test.sol";
import {ERC20} from "solmate/tokens/ERC20.sol";
Expand Down
2 changes: 1 addition & 1 deletion src/arrakis/Arrakis_Factory.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.23;

import {ERC20} from "solmate/tokens/ERC20.sol";
import {ERC4626} from "solmate/mixins/ERC4626.sol";
Expand Down
2 changes: 1 addition & 1 deletion src/arrakis/Arrakis_Non_Native_LP_Vault.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.23;

import {ERC4626} from "solmate/mixins/ERC4626.sol";
import {ERC20} from "solmate/tokens/ERC20.sol";
Expand Down
2 changes: 1 addition & 1 deletion src/arrakis/interfaces/IArrakisRouter.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.23;

import {IGauge} from "./IGauge.sol";

Expand Down
2 changes: 1 addition & 1 deletion src/arrakis/interfaces/IGauge.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.23;

interface IGauge {
function withdraw(uint256 amount) external;
Expand Down
2 changes: 1 addition & 1 deletion src/arrakis/interfaces/IStakePool.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.21;
pragma solidity ^0.8.23;

interface IStakePool {
function staking_token() external view returns (address);
Expand Down
36 changes: 17 additions & 19 deletions src/arrakis/test/Arrakis_Non_Native_LP_Vault.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -133,26 +133,24 @@ contract Arrakis_LP_Test is Test {
(,,, feeGrowthOutsideUpper,,,,) = pool.ticks(gUniPool.upperTick());
}

unchecked {
// calculate fee growth below
uint256 feeGrowthBelow;
if (tick >= vault.arrakisVault().lowerTick()) {
feeGrowthBelow = feeGrowthOutsideLower;
} else {
feeGrowthBelow = feeGrowthGlobal - feeGrowthOutsideLower;
}

// calculate fee growth above
uint256 feeGrowthAbove;
if (tick < vault.arrakisVault().upperTick()) {
feeGrowthAbove = feeGrowthOutsideUpper;
} else {
feeGrowthAbove = feeGrowthGlobal - feeGrowthOutsideUpper;
}

uint256 feeGrowthInside = feeGrowthGlobal - feeGrowthBelow - feeGrowthAbove;
fee = (liquidity * (feeGrowthInside - feeGrowthInsideLast)) / 0x100000000000000000000000000000000;
// calculate fee growth below
uint256 feeGrowthBelow;
if (tick >= vault.arrakisVault().lowerTick()) {
feeGrowthBelow = feeGrowthOutsideLower;
} else {
feeGrowthBelow = feeGrowthGlobal - feeGrowthOutsideLower;
}

// calculate fee growth above
uint256 feeGrowthAbove;
if (tick < vault.arrakisVault().upperTick()) {
feeGrowthAbove = feeGrowthOutsideUpper;
} else {
feeGrowthAbove = feeGrowthGlobal - feeGrowthOutsideUpper;
}

uint256 feeGrowthInside = feeGrowthGlobal - feeGrowthBelow - feeGrowthAbove;
fee = (liquidity * (feeGrowthInside - feeGrowthInsideLast)) / 0x100000000000000000000000000000000;
}

function getUnderlyingBalances() external view returns (uint256 amount0Current, uint256 amount1Current) {
Expand Down
Loading

0 comments on commit 8bc1d1b

Please sign in to comment.