diff --git a/.vscode/settings.json b/.vscode/settings.json index f58053ba0..906ba6841 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,7 @@ { "solidity.packageDefaultDependenciesContractsDirectory": "src", "solidity.packageDefaultDependenciesDirectory": "lib", - "solidity.compileUsingRemoteVersion": "v0.8.21", + "solidity.compileUsingRemoteVersion": "v0.8.22+commit.4fc1097e", "solidity.formatter": "forge", "search.exclude": { "lib": true }, "files.associations": { diff --git a/foundry.toml b/foundry.toml index f70c049c3..d3c2e5244 100644 --- a/foundry.toml +++ b/foundry.toml @@ -5,7 +5,7 @@ block_gas_limit = 300000000 gas_limit = 3000000000 gas_price = 1500000000 - solc_version = "0.8.21" + solc_version = "0.8.22" evm_version = 'paris' gas_reports = ["Atlas", "AtlasVerification", "Simulator", "ExecutionEnvironment"] diff --git a/script/base/deploy-base.s.sol b/script/base/deploy-base.s.sol index bdf28fca7..8d4af986b 100644 --- a/script/base/deploy-base.s.sol +++ b/script/base/deploy-base.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "forge-std/Script.sol"; import "forge-std/Test.sol"; diff --git a/script/deploy-atlas.s.sol b/script/deploy-atlas.s.sol index a58be2549..a60cc8f6b 100644 --- a/script/deploy-atlas.s.sol +++ b/script/deploy-atlas.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "forge-std/Script.sol"; import "forge-std/Test.sol"; diff --git a/script/deploy-exec-env.s.sol b/script/deploy-exec-env.s.sol index 5eaa88129..5d2c9ed37 100644 --- a/script/deploy-exec-env.s.sol +++ b/script/deploy-exec-env.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "forge-std/Script.sol"; import "forge-std/Test.sol"; diff --git a/script/deploy-solver.s.sol b/script/deploy-solver.s.sol index 599b0443d..bc390e16b 100644 --- a/script/deploy-solver.s.sol +++ b/script/deploy-solver.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "forge-std/Script.sol"; import "forge-std/Test.sol"; diff --git a/script/deploy-swap-intent-control.s.sol b/script/deploy-swap-intent-control.s.sol index 1c386399f..60e18de56 100644 --- a/script/deploy-swap-intent-control.s.sol +++ b/script/deploy-swap-intent-control.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "forge-std/Script.sol"; import "forge-std/Test.sol"; diff --git a/script/deploy-tx-builder.s.sol b/script/deploy-tx-builder.s.sol index f33c6de9d..01c596d73 100644 --- a/script/deploy-tx-builder.s.sol +++ b/script/deploy-tx-builder.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "forge-std/Script.sol"; import "forge-std/Test.sol"; diff --git a/script/log-balances.s.sol b/script/log-balances.s.sol index 007846a51..d6e973db5 100644 --- a/script/log-balances.s.sol +++ b/script/log-balances.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "forge-std/Script.sol"; import "forge-std/Test.sol"; diff --git a/script/solver-deposit.s.sol b/script/solver-deposit.s.sol index c16ca3d21..550023abd 100644 --- a/script/solver-deposit.s.sol +++ b/script/solver-deposit.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "forge-std/Script.sol"; import "forge-std/Test.sol"; diff --git a/src/contracts/atlas/AtlETH.sol b/src/contracts/atlas/AtlETH.sol index 9be52ad75..fe2f110ef 100644 --- a/src/contracts/atlas/AtlETH.sol +++ b/src/contracts/atlas/AtlETH.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPL-3.0-only -pragma solidity 0.8.21; +pragma solidity 0.8.22; import { SafeTransferLib } from "solmate/utils/SafeTransferLib.sol"; diff --git a/src/contracts/atlas/Atlas.sol b/src/contracts/atlas/Atlas.sol index 1501cdc63..db0f425a5 100644 --- a/src/contracts/atlas/Atlas.sol +++ b/src/contracts/atlas/Atlas.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; import { IExecutionEnvironment } from "../interfaces/IExecutionEnvironment.sol"; import { IDAppControl } from "../interfaces/IDAppControl.sol"; diff --git a/src/contracts/atlas/AtlasVerification.sol b/src/contracts/atlas/AtlasVerification.sol index f7e914d6c..ef8112748 100644 --- a/src/contracts/atlas/AtlasVerification.sol +++ b/src/contracts/atlas/AtlasVerification.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "openzeppelin-contracts/contracts/utils/cryptography/EIP712.sol"; diff --git a/src/contracts/atlas/DAppIntegration.sol b/src/contracts/atlas/DAppIntegration.sol index f930ec6f4..e1a0aa91e 100644 --- a/src/contracts/atlas/DAppIntegration.sol +++ b/src/contracts/atlas/DAppIntegration.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; import { IDAppControl } from "../interfaces/IDAppControl.sol"; diff --git a/src/contracts/atlas/Escrow.sol b/src/contracts/atlas/Escrow.sol index c3fef5ecc..0b21a6bc8 100644 --- a/src/contracts/atlas/Escrow.sol +++ b/src/contracts/atlas/Escrow.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; import { IExecutionEnvironment } from "../interfaces/IExecutionEnvironment.sol"; @@ -18,6 +18,8 @@ import { EscrowBits } from "../libraries/EscrowBits.sol"; import { CallBits } from "../libraries/CallBits.sol"; import { SafetyBits } from "../libraries/SafetyBits.sol"; +import "forge-std/Test.sol"; + // import "forge-std/Test.sol"; abstract contract Escrow is AtlETH { diff --git a/src/contracts/atlas/ExecutionEnvironment.sol b/src/contracts/atlas/ExecutionEnvironment.sol index a3724efd5..35928d063 100644 --- a/src/contracts/atlas/ExecutionEnvironment.sol +++ b/src/contracts/atlas/ExecutionEnvironment.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; import { ISolverContract } from "../interfaces/ISolverContract.sol"; import { ISafetyLocks } from "../interfaces/ISafetyLocks.sol"; diff --git a/src/contracts/atlas/Factory.sol b/src/contracts/atlas/Factory.sol index f95592617..6e12716e3 100644 --- a/src/contracts/atlas/Factory.sol +++ b/src/contracts/atlas/Factory.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; import { IDAppControl } from "../interfaces/IDAppControl.sol"; import { Mimic } from "./Mimic.sol"; diff --git a/src/contracts/atlas/GasAccounting.sol b/src/contracts/atlas/GasAccounting.sol index fb820b34b..d7d9b9902 100644 --- a/src/contracts/atlas/GasAccounting.sol +++ b/src/contracts/atlas/GasAccounting.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; import { SafetyLocks } from "../atlas/SafetyLocks.sol"; diff --git a/src/contracts/atlas/Mimic.sol b/src/contracts/atlas/Mimic.sol index 159a2e472..5144f066f 100644 --- a/src/contracts/atlas/Mimic.sol +++ b/src/contracts/atlas/Mimic.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; contract Mimic { /* diff --git a/src/contracts/atlas/SafetyLocks.sol b/src/contracts/atlas/SafetyLocks.sol index ef6647cb5..0bcc17d65 100644 --- a/src/contracts/atlas/SafetyLocks.sol +++ b/src/contracts/atlas/SafetyLocks.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; import { SafetyBits } from "../libraries/SafetyBits.sol"; import { CallBits } from "../libraries/CallBits.sol"; diff --git a/src/contracts/atlas/Storage.sol b/src/contracts/atlas/Storage.sol index 3b5173001..8af87c080 100644 --- a/src/contracts/atlas/Storage.sol +++ b/src/contracts/atlas/Storage.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "../types/EscrowTypes.sol"; import "../types/LockTypes.sol"; diff --git a/src/contracts/common/ExecutionBase.sol b/src/contracts/common/ExecutionBase.sol index 5bd6cd968..604c323a7 100644 --- a/src/contracts/common/ExecutionBase.sol +++ b/src/contracts/common/ExecutionBase.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; import { IPermit69 } from "../interfaces/IPermit69.sol"; import { ISafetyLocks } from "../interfaces/ISafetyLocks.sol"; diff --git a/src/contracts/common/Permit69.sol b/src/contracts/common/Permit69.sol index 754090dd9..ee9665a24 100644 --- a/src/contracts/common/Permit69.sol +++ b/src/contracts/common/Permit69.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; import { SafeTransferLib, ERC20 } from "solmate/utils/SafeTransferLib.sol"; diff --git a/src/contracts/dapp/ControlTemplate.sol b/src/contracts/dapp/ControlTemplate.sol index d35163493..0faf9b157 100644 --- a/src/contracts/dapp/ControlTemplate.sol +++ b/src/contracts/dapp/ControlTemplate.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "../types/SolverCallTypes.sol"; import "../types/UserCallTypes.sol"; diff --git a/src/contracts/dapp/DAppControl.sol b/src/contracts/dapp/DAppControl.sol index 0cd4169e5..0d478b597 100644 --- a/src/contracts/dapp/DAppControl.sol +++ b/src/contracts/dapp/DAppControl.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; import { ExecutionPhase } from "../types/LockTypes.sol"; diff --git a/src/contracts/examples/intents-example/StateIntent.sol b/src/contracts/examples/intents-example/StateIntent.sol index 228ad9e11..74770d0f1 100644 --- a/src/contracts/examples/intents-example/StateIntent.sol +++ b/src/contracts/examples/intents-example/StateIntent.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; // Base Imports import { SafeTransferLib, ERC20 } from "solmate/utils/SafeTransferLib.sol"; diff --git a/src/contracts/examples/intents-example/SwapIntent.sol b/src/contracts/examples/intents-example/SwapIntent.sol index 831786cd1..f78809447 100644 --- a/src/contracts/examples/intents-example/SwapIntent.sol +++ b/src/contracts/examples/intents-example/SwapIntent.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; // Base Imports import { SafeTransferLib, ERC20 } from "solmate/utils/SafeTransferLib.sol"; diff --git a/src/contracts/examples/v2-example/V2DAppControl.sol b/src/contracts/examples/v2-example/V2DAppControl.sol index eb41a7d02..3d722a6e0 100644 --- a/src/contracts/examples/v2-example/V2DAppControl.sol +++ b/src/contracts/examples/v2-example/V2DAppControl.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; // Base Imports import { SafeTransferLib, ERC20 } from "solmate/utils/SafeTransferLib.sol"; diff --git a/src/contracts/examples/v4-example/IHooks.sol b/src/contracts/examples/v4-example/IHooks.sol index 793faf7c6..6232a9083 100644 --- a/src/contracts/examples/v4-example/IHooks.sol +++ b/src/contracts/examples/v4-example/IHooks.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-or-later -pragma solidity 0.8.21; +pragma solidity 0.8.22; import { IPoolManager } from "./IPoolManager.sol"; diff --git a/src/contracts/examples/v4-example/IPoolManager.sol b/src/contracts/examples/v4-example/IPoolManager.sol index 634e63a70..1f2727770 100644 --- a/src/contracts/examples/v4-example/IPoolManager.sol +++ b/src/contracts/examples/v4-example/IPoolManager.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-or-later -pragma solidity 0.8.21; +pragma solidity 0.8.22; import { IHooks } from "./IHooks.sol"; diff --git a/src/contracts/examples/v4-example/UniV4Hook.sol b/src/contracts/examples/v4-example/UniV4Hook.sol index bedb5a20a..18ead7d53 100644 --- a/src/contracts/examples/v4-example/UniV4Hook.sol +++ b/src/contracts/examples/v4-example/UniV4Hook.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; // Base Imports import { SafeTransferLib, ERC20 } from "solmate/utils/SafeTransferLib.sol"; diff --git a/src/contracts/examples/v4-example/V4DAppControl.sol b/src/contracts/examples/v4-example/V4DAppControl.sol index 14ad4aec6..393dd01fb 100644 --- a/src/contracts/examples/v4-example/V4DAppControl.sol +++ b/src/contracts/examples/v4-example/V4DAppControl.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-or-later -pragma solidity 0.8.21; +pragma solidity 0.8.22; // Base Imports import { SafeTransferLib, ERC20 } from "solmate/utils/SafeTransferLib.sol"; diff --git a/src/contracts/helpers/Simulator.sol b/src/contracts/helpers/Simulator.sol index e051830e0..28d3b7e6f 100644 --- a/src/contracts/helpers/Simulator.sol +++ b/src/contracts/helpers/Simulator.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; import { IAtlas } from "../interfaces/IAtlas.sol"; diff --git a/src/contracts/helpers/Sorter.sol b/src/contracts/helpers/Sorter.sol index 5a23eca0c..7c9a3a24a 100644 --- a/src/contracts/helpers/Sorter.sol +++ b/src/contracts/helpers/Sorter.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; import { IDAppControl } from "../interfaces/IDAppControl.sol"; import { IAtlETH } from "../interfaces/IAtlETH.sol"; diff --git a/src/contracts/helpers/TxBuilder.sol b/src/contracts/helpers/TxBuilder.sol index 1cab5ca3a..d494a509a 100644 --- a/src/contracts/helpers/TxBuilder.sol +++ b/src/contracts/helpers/TxBuilder.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.21; +pragma solidity 0.8.22; import { IDAppControl } from "../interfaces/IDAppControl.sol"; import { IDAppIntegration } from "../interfaces/IDAppIntegration.sol"; @@ -82,7 +82,8 @@ contract TxBuilder { bytes memory solverOpData, address solverEOA, address solverContract, - uint256 bidAmount + uint256 bidAmount, + uint256 value ) public view @@ -91,7 +92,7 @@ contract TxBuilder { solverOp = SolverOperation({ from: solverEOA, to: atlas, - value: 0, + value: value, gas: gas, maxFeePerGas: userOp.maxFeePerGas, deadline: userOp.deadline, diff --git a/src/contracts/helpers/Utilities.sol b/src/contracts/helpers/Utilities.sol index feeb5be8f..1b316d385 100644 --- a/src/contracts/helpers/Utilities.sol +++ b/src/contracts/helpers/Utilities.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "forge-std/Script.sol"; import "forge-std/Test.sol"; diff --git a/src/contracts/interfaces/IAtlETH.sol b/src/contracts/interfaces/IAtlETH.sol index 1de1b969f..6004d4134 100644 --- a/src/contracts/interfaces/IAtlETH.sol +++ b/src/contracts/interfaces/IAtlETH.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; interface IAtlETH { function deposit() external payable; diff --git a/src/contracts/interfaces/IAtlas.sol b/src/contracts/interfaces/IAtlas.sol index cfb1ac872..51fb49f8d 100644 --- a/src/contracts/interfaces/IAtlas.sol +++ b/src/contracts/interfaces/IAtlas.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "../types/SolverCallTypes.sol"; import "../types/UserCallTypes.sol"; diff --git a/src/contracts/interfaces/IAtlasVerification.sol b/src/contracts/interfaces/IAtlasVerification.sol index 7660e23d5..e3409fb79 100644 --- a/src/contracts/interfaces/IAtlasVerification.sol +++ b/src/contracts/interfaces/IAtlasVerification.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "../types/UserCallTypes.sol"; import "../types/DAppApprovalTypes.sol"; diff --git a/src/contracts/interfaces/IDAppControl.sol b/src/contracts/interfaces/IDAppControl.sol index 7e8864b94..1c8a335ae 100644 --- a/src/contracts/interfaces/IDAppControl.sol +++ b/src/contracts/interfaces/IDAppControl.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "../types/UserCallTypes.sol"; import "../types/SolverCallTypes.sol"; diff --git a/src/contracts/interfaces/IDAppIntegration.sol b/src/contracts/interfaces/IDAppIntegration.sol index 9a038c3d9..117621f98 100644 --- a/src/contracts/interfaces/IDAppIntegration.sol +++ b/src/contracts/interfaces/IDAppIntegration.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; interface IDAppIntegration { function initializeGovernance(address controller) external; diff --git a/src/contracts/interfaces/IEscrow.sol b/src/contracts/interfaces/IEscrow.sol index 72f77c26a..07de79e84 100644 --- a/src/contracts/interfaces/IEscrow.sol +++ b/src/contracts/interfaces/IEscrow.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; import { Party } from "../types/EscrowTypes.sol"; diff --git a/src/contracts/interfaces/IExecutionEnvironment.sol b/src/contracts/interfaces/IExecutionEnvironment.sol index cf509f1bd..9f7eb00f9 100644 --- a/src/contracts/interfaces/IExecutionEnvironment.sol +++ b/src/contracts/interfaces/IExecutionEnvironment.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "../types/SolverCallTypes.sol"; import "../types/UserCallTypes.sol"; diff --git a/src/contracts/interfaces/IFactory.sol b/src/contracts/interfaces/IFactory.sol index af8456b35..fcc20fe7d 100644 --- a/src/contracts/interfaces/IFactory.sol +++ b/src/contracts/interfaces/IFactory.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; import { DAppConfig } from "src/contracts/types/DAppApprovalTypes.sol"; import { UserOperation } from "../types/UserCallTypes.sol"; diff --git a/src/contracts/interfaces/IPermit69.sol b/src/contracts/interfaces/IPermit69.sol index c5c9fd47a..13a9fe66b 100644 --- a/src/contracts/interfaces/IPermit69.sol +++ b/src/contracts/interfaces/IPermit69.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; interface IPermit69 { // NOTE: IPermit69 only works inside of the Atlas environment - specifically diff --git a/src/contracts/interfaces/ISafetyLocks.sol b/src/contracts/interfaces/ISafetyLocks.sol index e0fce2815..e6e22ea88 100644 --- a/src/contracts/interfaces/ISafetyLocks.sol +++ b/src/contracts/interfaces/ISafetyLocks.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "../types/SolverCallTypes.sol"; import "../types/UserCallTypes.sol"; diff --git a/src/contracts/interfaces/ISimulator.sol b/src/contracts/interfaces/ISimulator.sol index 2ee83a4bc..dba8ab784 100644 --- a/src/contracts/interfaces/ISimulator.sol +++ b/src/contracts/interfaces/ISimulator.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "../types/SolverCallTypes.sol"; import "../types/UserCallTypes.sol"; diff --git a/src/contracts/interfaces/ISolverContract.sol b/src/contracts/interfaces/ISolverContract.sol index 29f690249..e6c6d4bf6 100644 --- a/src/contracts/interfaces/ISolverContract.sol +++ b/src/contracts/interfaces/ISolverContract.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "../types/SolverCallTypes.sol"; diff --git a/src/contracts/libraries/CallBits.sol b/src/contracts/libraries/CallBits.sol index f61e10235..3ee9239ef 100644 --- a/src/contracts/libraries/CallBits.sol +++ b/src/contracts/libraries/CallBits.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; import { IDAppControl } from "../interfaces/IDAppControl.sol"; diff --git a/src/contracts/libraries/CallVerification.sol b/src/contracts/libraries/CallVerification.sol index 01483ed74..8514b629c 100644 --- a/src/contracts/libraries/CallVerification.sol +++ b/src/contracts/libraries/CallVerification.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; import { IDAppControl } from "../interfaces/IDAppControl.sol"; diff --git a/src/contracts/libraries/EscrowBits.sol b/src/contracts/libraries/EscrowBits.sol index 2e0e40865..7ce781755 100644 --- a/src/contracts/libraries/EscrowBits.sol +++ b/src/contracts/libraries/EscrowBits.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "../types/EscrowTypes.sol"; diff --git a/src/contracts/libraries/SafetyBits.sol b/src/contracts/libraries/SafetyBits.sol index a604b986a..52e4dc841 100644 --- a/src/contracts/libraries/SafetyBits.sol +++ b/src/contracts/libraries/SafetyBits.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "../types/LockTypes.sol"; diff --git a/src/contracts/solver/SolverBase.sol b/src/contracts/solver/SolverBase.sol index 6035e24de..385cbb54b 100644 --- a/src/contracts/solver/SolverBase.sol +++ b/src/contracts/solver/SolverBase.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; import { SafeTransferLib, ERC20 } from "solmate/utils/SafeTransferLib.sol"; diff --git a/src/contracts/solver/src/TestSolver.sol b/src/contracts/solver/src/TestSolver.sol index fed001351..c5755a989 100644 --- a/src/contracts/solver/src/TestSolver.sol +++ b/src/contracts/solver/src/TestSolver.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.21; +pragma solidity 0.8.22; import { SolverBase } from "../SolverBase.sol"; diff --git a/src/contracts/types/DAppApprovalTypes.sol b/src/contracts/types/DAppApprovalTypes.sol index a92a3a681..ead608c4a 100644 --- a/src/contracts/types/DAppApprovalTypes.sol +++ b/src/contracts/types/DAppApprovalTypes.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; bytes32 constant DAPP_TYPE_HASH = keccak256( "DAppApproval(address from,address to,uint256 value,uint256 gas,uint256 maxFeePerGas,uint256 nonce,uint256 deadline,address control,address bundler,bytes32 userOpHash,bytes32 callChainHash)" diff --git a/src/contracts/types/Emissions.sol b/src/contracts/types/Emissions.sol index 5d19e67cd..ec83ddaeb 100644 --- a/src/contracts/types/Emissions.sol +++ b/src/contracts/types/Emissions.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "../types/ValidCallsTypes.sol"; diff --git a/src/contracts/types/EscrowTypes.sol b/src/contracts/types/EscrowTypes.sol index 8d1c22219..bc69b30f1 100644 --- a/src/contracts/types/EscrowTypes.sol +++ b/src/contracts/types/EscrowTypes.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; uint256 constant CALLDATA_LENGTH_PREMIUM = 32; // 16 (default) * 2 diff --git a/src/contracts/types/GovernanceTypes.sol b/src/contracts/types/GovernanceTypes.sol index 0da8ea5ef..8b4181234 100644 --- a/src/contracts/types/GovernanceTypes.sol +++ b/src/contracts/types/GovernanceTypes.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; struct GovernanceData { address governance; diff --git a/src/contracts/types/LockTypes.sol b/src/contracts/types/LockTypes.sol index b868dbe30..fea3240d2 100644 --- a/src/contracts/types/LockTypes.sol +++ b/src/contracts/types/LockTypes.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; struct EscrowKey { address approvedCaller; diff --git a/src/contracts/types/SolverCallTypes.sol b/src/contracts/types/SolverCallTypes.sol index 3410cf98f..33bd55ebb 100644 --- a/src/contracts/types/SolverCallTypes.sol +++ b/src/contracts/types/SolverCallTypes.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; bytes32 constant SOLVER_TYPE_HASH = keccak256( "SolverOperation(address from,address to,uint256 value,uint256 gas,uint256 maxFeePerGas,uint256 deadline,address dapp,address control,bytes32 userOpHash,address bidToken,uint256 bidAmount,bytes32 data)" diff --git a/src/contracts/types/UserCallTypes.sol b/src/contracts/types/UserCallTypes.sol index 6bb390078..58971d267 100644 --- a/src/contracts/types/UserCallTypes.sol +++ b/src/contracts/types/UserCallTypes.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; bytes32 constant USER_TYPE_HASH = keccak256( "UserOperation(address from,address to,uint256 value,uint256 gas,uint256 maxFeePerGas,uint256 nonce,uint256 deadline,address dapp,address control,address sessionKey,bytes32 data)" diff --git a/src/contracts/types/ValidCallsTypes.sol b/src/contracts/types/ValidCallsTypes.sol index e6af969da..e59975251 100644 --- a/src/contracts/types/ValidCallsTypes.sol +++ b/src/contracts/types/ValidCallsTypes.sol @@ -1,5 +1,5 @@ //SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.21; +pragma solidity 0.8.22; enum ValidCallsResult { Valid, diff --git a/test/Accounting.t.sol b/test/Accounting.t.sol index 6dc8c5c9c..4414ee3c4 100644 --- a/test/Accounting.t.sol +++ b/test/Accounting.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "forge-std/Test.sol"; @@ -173,7 +173,8 @@ contract AccountingTest is BaseTest { solverOpData: solverOpData, solverEOA: solverOneEOA, solverContract: rfqSolver, - bidAmount: solverMsgValue + bidAmount: solverMsgValue, + value: 0 }); solverOps[0].value = solverMsgValue; diff --git a/test/AtlETH.t.sol b/test/AtlETH.t.sol index 8f3731ea2..8e40efbcc 100644 --- a/test/AtlETH.t.sol +++ b/test/AtlETH.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "forge-std/Test.sol"; diff --git a/test/DAppIntegration.t.sol b/test/DAppIntegration.t.sol index d09e2d2cd..02047bdc2 100644 --- a/test/DAppIntegration.t.sol +++ b/test/DAppIntegration.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "forge-std/Test.sol"; diff --git a/test/ExecutionEnvironment.t.sol b/test/ExecutionEnvironment.t.sol index ac54d301f..b99b24982 100644 --- a/test/ExecutionEnvironment.t.sol +++ b/test/ExecutionEnvironment.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "forge-std/Test.sol"; import { BaseTest } from "./base/BaseTest.t.sol"; diff --git a/test/Factory.t.sol b/test/Factory.t.sol index 4440445f3..9814b198b 100644 --- a/test/Factory.t.sol +++ b/test/Factory.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "forge-std/Test.sol"; diff --git a/test/FlashLoan.t.sol b/test/FlashLoan.t.sol new file mode 100644 index 000000000..b3701fced --- /dev/null +++ b/test/FlashLoan.t.sol @@ -0,0 +1,344 @@ +// SPDX-License-Identifier: MIT +pragma solidity 0.8.22; + +import "forge-std/Test.sol"; + +import { SafeTransferLib, ERC20 } from "solmate/utils/SafeTransferLib.sol"; +import { TxBuilder } from "src/contracts/helpers/TxBuilder.sol"; +import { BaseTest } from "./base/BaseTest.t.sol"; +import { ArbitrageTest } from "./base/ArbitrageTest.t.sol"; +import { SolverBase } from "src/contracts/solver/SolverBase.sol"; +import { DAppControl } from "src/contracts/dapp/DAppControl.sol"; +import { CallConfig } from "src/contracts/types/DAppApprovalTypes.sol"; +import { SolverOutcome } from "src/contracts/types/EscrowTypes.sol"; +import { UserOperation } from "src/contracts/types/UserCallTypes.sol"; +import { SolverOperation } from "src/contracts/types/SolverCallTypes.sol"; +import { DAppOperation } from "src/contracts/types/DAppApprovalTypes.sol"; +import { FastLaneErrorsEvents } from "src/contracts/types/Emissions.sol"; +import { IEscrow } from "src/contracts/interfaces/IEscrow.sol"; +import { UserOperationBuilder } from "./base/builders/UserOperationBuilder.sol"; +import { SolverOperationBuilder } from "./base/builders/SolverOperationBuilder.sol"; +import { DAppOperationBuilder } from "./base/builders/DAppOperationBuilder.sol"; + +interface IWETH { + function withdraw(uint256 wad) external; +} + +contract FlashLoanTest is BaseTest { + DummyDAppControlBuilder public controller; + + struct Sig { + uint8 v; + bytes32 r; + bytes32 s; + } + + Sig public sig; + + function setUp() public virtual override { + BaseTest.setUp(); + + // Creating new gov address (ERR-V49 OwnerActive if already registered with controller) + governancePK = 11_112; + governanceEOA = vm.addr(governancePK); + + // Deploy + vm.startPrank(governanceEOA); + + controller = new DummyDAppControlBuilder(address(escrow), WETH_ADDRESS); + atlasVerification.initializeGovernance(address(controller)); + vm.stopPrank(); + } + + function testFlashLoan() public { + vm.startPrank(solverOneEOA); + SimpleSolver solver = new SimpleSolver(WETH_ADDRESS, escrow); + deal(WETH_ADDRESS, address(solver), 1e18); // 1 WETH to solver to pay bid + atlas.bond(1 ether); // gas for solver to pay + vm.stopPrank(); + + vm.startPrank(userEOA); + deal(userEOA, 100e18); // eth to solver for atleth deposit + atlas.deposit{ value: 100e18 }(); + vm.stopPrank(); + + // Input params for Atlas.metacall() - will be populated below + + UserOperation memory userOp = new UserOperationBuilder() + .withFrom(userEOA) + .withTo(address(atlas)) + .withGas(1_000_000) + .withMaxFeePerGas(tx.gasprice + 1) + .withNonce(address(atlasVerification)) + .withDapp(address(controller)) + .withControl(address(controller)) + .withDeadline(block.number + 2) + .withData(new bytes(0)) + .build(); + + SolverOperation[] memory solverOps = new SolverOperation[](1); + solverOps[0] = new SolverOperationBuilder() + .withFrom(solverOneEOA) + .withTo(address(atlas)) + .withGas(1_000_000) + .withMaxFeePerGas(userOp.maxFeePerGas) + .withDeadline(userOp.deadline) + .withSolver(address(solver)) + .withControl(address(controller)) + .withUserOpHash(userOp) + .withBidToken(userOp) + .withBidAmount(1e18) + .withData(abi.encodeWithSelector(SimpleSolver.noPayback.selector)) + .withValue(10e18) + .sign(address(atlasVerification), solverOnePK) + .build(); + + // Solver signs the solverOp + (sig.v, sig.r, sig.s) = vm.sign(solverOnePK, atlasVerification.getSolverPayload(solverOps[0])); + solverOps[0].signature = abi.encodePacked(sig.r, sig.s, sig.v); + + // Frontend creates dAppOp calldata after seeing rest of data + DAppOperation memory dAppOp = new DAppOperationBuilder() + .withFrom(governanceEOA) + .withTo(address(atlas)) + .withGas(2_000_000) + .withMaxFeePerGas(userOp.maxFeePerGas) + .withNonce(address(atlasVerification), governanceEOA) + .withDeadline(userOp.deadline) + .withControl(address(controller)) + .withUserOpHash(userOp) + .withCallChainHash(userOp, solverOps) + .sign(address(atlasVerification), governancePK) + .build(); + + // Frontend signs the dAppOp payload + (sig.v, sig.r, sig.s) = vm.sign(governancePK, atlasVerification.getDAppOperationPayload(dAppOp)); + dAppOp.signature = abi.encodePacked(sig.r, sig.s, sig.v); + + // make the actual atlas call that should revert + vm.startPrank(userEOA); + vm.expectEmit(true, true, true, true); + uint256 result = (1 << uint256(SolverOutcome.BidNotPaid)) | (1 << uint256(SolverOutcome.ExecutionCompleted)); + emit FastLaneErrorsEvents.SolverTxResult(address(solver), solverOneEOA, true, false, result); + vm.expectRevert(); + atlas.metacall({ userOp: userOp, solverOps: solverOps, dAppOp: dAppOp }); + vm.stopPrank(); + + // now try it again with a valid solverOp - but dont fully pay back + solverOps[0] = new SolverOperationBuilder() + .withFrom(solverOneEOA) + .withTo(address(atlas)) + .withGas(1_000_000) + .withMaxFeePerGas(userOp.maxFeePerGas) + .withDeadline(userOp.deadline) + .withSolver(address(solver)) + .withControl(address(controller)) + .withUserOpHash(userOp) + .withBidToken(userOp) + .withBidAmount(1e18) + .withData(abi.encodeWithSelector(SimpleSolver.onlyPayBid.selector, 1e18)) + .withValue(10e18) + .sign(address(atlasVerification), solverOnePK) + .build(); + + (sig.v, sig.r, sig.s) = vm.sign(solverOnePK, atlasVerification.getSolverPayload(solverOps[0])); + solverOps[0].signature = abi.encodePacked(sig.r, sig.s, sig.v); + + dAppOp = new DAppOperationBuilder() + .withFrom(governanceEOA) + .withTo(address(atlas)) + .withGas(2_000_000) + .withMaxFeePerGas(userOp.maxFeePerGas) + .withNonce(address(atlasVerification), governanceEOA) + .withDeadline(userOp.deadline) + .withControl(address(controller)) + .withUserOpHash(userOp) + .withCallChainHash(userOp, solverOps) + .sign(address(atlasVerification), governancePK) + .build(); + + (sig.v, sig.r, sig.s) = vm.sign(governancePK, atlasVerification.getDAppOperationPayload(dAppOp)); + dAppOp.signature = abi.encodePacked(sig.r, sig.s, sig.v); + + // Call again with partial payback, should still revert + vm.startPrank(userEOA); + vm.expectEmit(true, true, true, true); + result = (1 << uint256(SolverOutcome.CallValueTooHigh)) | (1 << uint256(SolverOutcome.ExecutionCompleted)); + emit FastLaneErrorsEvents.SolverTxResult(address(solver), solverOneEOA, true, false, result); + vm.expectRevert(); + atlas.metacall({ userOp: userOp, solverOps: solverOps, dAppOp: dAppOp }); + vm.stopPrank(); + + // final try, should be successful with full payback + solverOps[0] = new SolverOperationBuilder() + .withFrom(solverOneEOA) + .withTo(address(atlas)) + .withGas(1_000_000) + .withMaxFeePerGas(userOp.maxFeePerGas) + .withDeadline(userOp.deadline) + .withSolver(address(solver)) + .withControl(address(controller)) + .withUserOpHash(userOp) + .withBidToken(userOp) + .withBidAmount(1e18) + .withData(abi.encodeWithSelector(SimpleSolver.payback.selector, 1e18)) + .withValue(10e18) + .sign(address(atlasVerification), solverOnePK) + .build(); + + (sig.v, sig.r, sig.s) = vm.sign(solverOnePK, atlasVerification.getSolverPayload(solverOps[0])); + solverOps[0].signature = abi.encodePacked(sig.r, sig.s, sig.v); + + dAppOp = new DAppOperationBuilder() + .withFrom(governanceEOA) + .withTo(address(atlas)) + .withGas(2_000_000) + .withMaxFeePerGas(userOp.maxFeePerGas) + .withNonce(address(atlasVerification), governanceEOA) + .withDeadline(userOp.deadline) + .withControl(address(controller)) + .withUserOpHash(userOp) + .withCallChainHash(userOp, solverOps) + .sign(address(atlasVerification), governancePK) + .build(); + + (sig.v, sig.r, sig.s) = vm.sign(governancePK, atlasVerification.getDAppOperationPayload(dAppOp)); + dAppOp.signature = abi.encodePacked(sig.r, sig.s, sig.v); + + uint256 solverStartingWETH = WETH.balanceOf(address(solver)); + uint256 atlasStartingETH = address(atlas).balance; + uint256 userStartingETH = address(userEOA).balance; + + assertEq(solverStartingWETH, 1e18, "solver incorrect starting WETH"); + assertEq(atlasStartingETH, 102e18, "atlas incorrect starting ETH"); // 2e initial + 1e solver + 100e user deposit + + // Last call - should succeed + vm.startPrank(userEOA); + result = (1 << uint256(SolverOutcome.Success)) | (1 << uint256(SolverOutcome.ExecutionCompleted)); + vm.expectEmit(true, true, true, true); + emit FastLaneErrorsEvents.SolverTxResult(address(solver), solverOneEOA, true, true, result); + atlas.metacall({ userOp: userOp, solverOps: solverOps, dAppOp: dAppOp }); + vm.stopPrank(); + + uint256 solverEndingWETH = WETH.balanceOf(address(solver)); + uint256 atlasEndingETH = address(atlas).balance; + uint256 userEndingETH = address(userEOA).balance; + + // atlas 2e beginning bal + 1e from solver +100e eth from user = 103e atlas total + // after metacall 1e user payout + 0.0001e bundler(user) gas refund = 101.9999e after metacall + + console.log("solverWETH", solverStartingWETH, solverEndingWETH); + console.log("solveratlETH", atlas.balanceOf(solverOneEOA)); + console.log("atlasETH", atlasStartingETH, atlasEndingETH); + console.log("userETH", userStartingETH, userEndingETH); + + assertEq(solverEndingWETH, 0, "solver WETH not used"); + assertEq(atlas.balanceOf(solverOneEOA), 0, "solver atlETH not used"); + assertTrue(atlasEndingETH < atlasStartingETH, "atlas incorrect ending ETH"); // atlas should lose a bit of eth used for gas refund + assertTrue((userEndingETH - userStartingETH) > 1 ether, "user incorrect ending ETH"); // user bal should increase by more than 1e (bid + gas refund) + } +} + +contract DummyDAppControlBuilder is DAppControl { + address immutable weth; + + constructor( + address _escrow, + address _weth + ) + DAppControl( + _escrow, + msg.sender, + CallConfig({ + sequenced: false, + requirePreOps: false, + trackPreOpsReturnData: false, + trackUserReturnData: false, + delegateUser: true, + preSolver: false, + postSolver: false, + requirePostOps: false, + zeroSolvers: false, + reuseUserOp: false, + userAuctioneer: true, + solverAuctioneer: true, + unknownAuctioneer: true, + verifyCallChainHash: true, + forwardReturnData: false, + requireFulfillment: true + }) + ) + { + weth = _weth; + } + + function _allocateValueCall(address bidToken, uint256 bidAmount, bytes calldata) internal override { + if (bidToken != address(0)) { + revert("not supported"); + } else { + SafeTransferLib.safeTransferETH(_user(), address(this).balance); + } + } + + function getBidFormat(UserOperation calldata) public view override returns (address bidToken) { + bidToken = address(0); + } + + function getBidValue(SolverOperation calldata solverOp) public pure override returns (uint256) { + return solverOp.bidAmount; + } + + fallback() external { } +} + +contract SimpleSolver { + address weth; + address msgSender; + address escrow; + + constructor(address _weth, address _escrow) { + weth = _weth; + escrow = _escrow; + } + + function atlasSolverCall( + address sender, + address bidToken, + uint256 bidAmount, + bytes calldata solverOpData, + bytes calldata extraReturnData + ) + external + payable + returns (bool success, bytes memory data) + { + msgSender = msg.sender; + (success, data) = address(this).call{ value: msg.value }(solverOpData); + + if (bytes4(solverOpData[:4]) == SimpleSolver.payback.selector) { + uint256 shortfall = IEscrow(escrow).shortfall(); + + if (shortfall < msg.value) shortfall = 0; + else shortfall -= msg.value; + + IEscrow(escrow).reconcile{ value: msg.value }(msg.sender, sender, shortfall); + } + } + + function noPayback() external payable { + address(0).call{ value: msg.value }(""); // do something with the eth and dont pay it back + } + + function onlyPayBid(uint256 bidAmount) external payable { + IWETH(weth).withdraw(bidAmount); + payable(msgSender).transfer(bidAmount); // pay back to atlas + address(0).call{ value: msg.value }(""); // do something with the remaining eth + } + + function payback(uint256 bidAmount) external payable { + IWETH(weth).withdraw(bidAmount); + payable(msgSender).transfer(bidAmount); // pay back to atlas + } + + receive() external payable { } +} diff --git a/test/GasAccounting.t.sol b/test/GasAccounting.t.sol index 30991401f..156cdcc31 100644 --- a/test/GasAccounting.t.sol +++ b/test/GasAccounting.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "forge-std/Test.sol"; diff --git a/test/MainTest.t.sol b/test/MainTest.t.sol index dc03a37df..b11e767e4 100644 --- a/test/MainTest.t.sol +++ b/test/MainTest.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.21; +pragma solidity 0.8.22; import { SafeTransferLib, ERC20 } from "solmate/utils/SafeTransferLib.sol"; @@ -64,7 +64,7 @@ contract MainTest is BaseTest { // First SolverOperation solverOpData = helper.buildV2SolverOperationData(POOL_TWO, POOL_ONE); solverOps[1] = helper.buildSolverOperation( - userOp, solverOpData, solverOneEOA, address(solverOne), WETH.balanceOf(address(solverOne)) / 20 + userOp, solverOpData, solverOneEOA, address(solverOne), WETH.balanceOf(address(solverOne)) / 20, 0 ); (v, r, s) = vm.sign(solverOnePK, atlasVerification.getSolverPayload(solverOps[1])); @@ -75,7 +75,7 @@ contract MainTest is BaseTest { // Second SolverOperation solverOpData = helper.buildV2SolverOperationData(POOL_ONE, POOL_TWO); solverOps[0] = helper.buildSolverOperation( - userOp, solverOpData, solverTwoEOA, address(solverTwo), WETH.balanceOf(address(solverTwo)) / 3000 + userOp, solverOpData, solverTwoEOA, address(solverTwo), WETH.balanceOf(address(solverTwo)) / 3000, 0 ); (v, r, s) = vm.sign(solverTwoPK, atlasVerification.getSolverPayload(solverOps[0])); @@ -351,7 +351,7 @@ contract MainTest is BaseTest { SolverOperation[] memory solverOps = new SolverOperation[](1); bytes memory solverOpData = helper.buildV2SolverOperationData(POOL_TWO, POOL_ONE); - solverOps[0] = helper.buildSolverOperation(userOp, solverOpData, solverOneEOA, address(solverOne), 2e17); + solverOps[0] = helper.buildSolverOperation(userOp, solverOpData, solverOneEOA, address(solverOne), 2e17, 0); (v, r, s) = vm.sign(solverOnePK, atlasVerification.getSolverPayload(solverOps[0])); solverOps[0].signature = abi.encodePacked(r, s, v); @@ -417,7 +417,7 @@ contract MainTest is BaseTest { atlas.bond(1 ether); bytes memory solverOpData = helper.buildV2SolverOperationData(POOL_TWO, POOL_ONE); - solverOps[0] = helper.buildSolverOperation(userOp, solverOpData, solverOneEOA, address(solverOne), 2e17); + solverOps[0] = helper.buildSolverOperation(userOp, solverOpData, solverOneEOA, address(solverOne), 2e17, 0); (v, r, s) = vm.sign(solverOnePK, atlasVerification.getSolverPayload(solverOps[0])); solverOps[0].signature = abi.encodePacked(r, s, v); DAppOperation memory dAppOp = helper.buildDAppOperation(governanceEOA, userOp, solverOps); @@ -437,7 +437,7 @@ contract MainTest is BaseTest { // Failure case solverOpData = helper.buildV2SolverOperationData(POOL_TWO, POOL_TWO); // this will make the solver operation // revert - solverOps[0] = helper.buildSolverOperation(userOp, solverOpData, solverOneEOA, address(solverOne), 2e17); + solverOps[0] = helper.buildSolverOperation(userOp, solverOpData, solverOneEOA, address(solverOne), 2e17, 0); (v, r, s) = vm.sign(solverOnePK, atlasVerification.getSolverPayload(solverOps[0])); solverOps[0].signature = abi.encodePacked(r, s, v); dAppOp = helper.buildDAppOperation(governanceEOA, userOp, solverOps); diff --git a/test/Permit69.t.sol b/test/Permit69.t.sol index 32485a129..f59b295e6 100644 --- a/test/Permit69.t.sol +++ b/test/Permit69.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "forge-std/Test.sol"; diff --git a/test/SafetyLocks.t.sol b/test/SafetyLocks.t.sol index 0366d3117..d4541f2a1 100644 --- a/test/SafetyLocks.t.sol +++ b/test/SafetyLocks.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "forge-std/Test.sol"; diff --git a/test/Storage.t.sol b/test/Storage.t.sol index 4d9325e02..0a6780cab 100644 --- a/test/Storage.t.sol +++ b/test/Storage.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "forge-std/Test.sol"; diff --git a/test/SwapIntent.t.sol b/test/SwapIntent.t.sol index 7057fb514..08fda0d13 100644 --- a/test/SwapIntent.t.sol +++ b/test/SwapIntent.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "forge-std/Test.sol"; @@ -144,7 +144,8 @@ contract SwapIntentTest is BaseTest { solverOpData: solverOpData, solverEOA: solverOneEOA, solverContract: address(rfqSolver), - bidAmount: 1e18 + bidAmount: 1e18, + value: 0 }); // Solver signs the solverOp @@ -263,7 +264,8 @@ contract SwapIntentTest is BaseTest { solverOpData: solverOpData, solverEOA: solverOneEOA, solverContract: address(uniswapSolver), - bidAmount: 1e18 + bidAmount: 1e18, + value: 0 }); // Solver signs the solverOp diff --git a/test/V2Helper.sol b/test/V2Helper.sol index 09cf1d312..525773840 100644 --- a/test/V2Helper.sol +++ b/test/V2Helper.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.21; +pragma solidity 0.8.22; import { TxBuilder } from "src/contracts/helpers/TxBuilder.sol"; diff --git a/test/base/ArbitrageTest.t.sol b/test/base/ArbitrageTest.t.sol index 0a6f65f81..ca9b03a0d 100644 --- a/test/base/ArbitrageTest.t.sol +++ b/test/base/ArbitrageTest.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "forge-std/Test.sol"; @@ -127,7 +127,7 @@ contract ArbitrageTest is BaseTest { uint24 c, uint24 m ) - internal + public returns (uint256 revenue, uint256 optimalAmountIn) { uint256 mid1 = left + (right - left) / 3; diff --git a/test/base/AtlasBaseTest.t.sol b/test/base/AtlasBaseTest.t.sol index f83f0eeb6..50f2e22c4 100644 --- a/test/base/AtlasBaseTest.t.sol +++ b/test/base/AtlasBaseTest.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "forge-std/Test.sol"; diff --git a/test/base/BaseTest.t.sol b/test/base/BaseTest.t.sol index 5a6d4bb34..8e9c8ec4c 100644 --- a/test/base/BaseTest.t.sol +++ b/test/base/BaseTest.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "forge-std/Test.sol"; diff --git a/test/base/DummyDAppControl.sol b/test/base/DummyDAppControl.sol index 94dc3f3e1..45b32a7f2 100644 --- a/test/base/DummyDAppControl.sol +++ b/test/base/DummyDAppControl.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.21; +pragma solidity 0.8.22; import { DAppControl } from "src/contracts/dapp/DAppControl.sol"; diff --git a/test/base/TestConstants.sol b/test/base/TestConstants.sol index c79ba1dfa..87bf5303a 100644 --- a/test/base/TestConstants.sol +++ b/test/base/TestConstants.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.21; +pragma solidity 0.8.22; import { ERC20 } from "solmate/tokens/ERC20.sol"; diff --git a/test/base/TestUtils.sol b/test/base/TestUtils.sol index 416177b28..fe99f1803 100644 --- a/test/base/TestUtils.sol +++ b/test/base/TestUtils.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.21; +pragma solidity 0.8.22; import { IDAppControl } from "src/contracts/interfaces/IDAppControl.sol"; import { Mimic } from "src/contracts/atlas/Mimic.sol"; diff --git a/test/base/builders/DAppOperationBuilder.sol b/test/base/builders/DAppOperationBuilder.sol index da6699d66..a428b131b 100644 --- a/test/base/builders/DAppOperationBuilder.sol +++ b/test/base/builders/DAppOperationBuilder.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "forge-std/Test.sol"; diff --git a/test/base/builders/SolverOperationBuilder.sol b/test/base/builders/SolverOperationBuilder.sol index e3fb81b61..6b87ae23d 100644 --- a/test/base/builders/SolverOperationBuilder.sol +++ b/test/base/builders/SolverOperationBuilder.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "forge-std/Test.sol"; diff --git a/test/base/builders/UserOperationBuilder.sol b/test/base/builders/UserOperationBuilder.sol index 0b15977c3..2e3cce178 100644 --- a/test/base/builders/UserOperationBuilder.sol +++ b/test/base/builders/UserOperationBuilder.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "forge-std/Test.sol"; diff --git a/test/base/interfaces/IUniswapV2Router.sol b/test/base/interfaces/IUniswapV2Router.sol index 48565ad09..7e230da5c 100644 --- a/test/base/interfaces/IUniswapV2Router.sol +++ b/test/base/interfaces/IUniswapV2Router.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.21; +pragma solidity 0.8.22; interface IUniswapV2Router01 { function factory() external pure returns (address); diff --git a/test/helpers/CallConfigBuilder.sol b/test/helpers/CallConfigBuilder.sol index 627f333cf..0e8ef013a 100644 --- a/test/helpers/CallConfigBuilder.sol +++ b/test/helpers/CallConfigBuilder.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.21; +pragma solidity 0.8.22; import { CallConfig } from "src/contracts/types/DAppApprovalTypes.sol"; diff --git a/test/helpers/DummyDAppControlBuilder.sol b/test/helpers/DummyDAppControlBuilder.sol index 09acf3319..3972b2b26 100644 --- a/test/helpers/DummyDAppControlBuilder.sol +++ b/test/helpers/DummyDAppControlBuilder.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.21; +pragma solidity 0.8.22; import { DummyDAppControl } from "../base/DummyDAppControl.sol"; import { CallConfig } from "src/contracts/types/DAppApprovalTypes.sol"; diff --git a/test/libraries/CallBits.t.sol b/test/libraries/CallBits.t.sol index d35de9e2d..f106053ab 100644 --- a/test/libraries/CallBits.t.sol +++ b/test/libraries/CallBits.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "forge-std/Test.sol"; diff --git a/test/libraries/CallVerification.t.sol b/test/libraries/CallVerification.t.sol index 7fa92833d..4c7301abc 100644 --- a/test/libraries/CallVerification.t.sol +++ b/test/libraries/CallVerification.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "forge-std/Test.sol"; diff --git a/test/libraries/EscrowBits.t.sol b/test/libraries/EscrowBits.t.sol index 407a236e0..2f532a1e9 100644 --- a/test/libraries/EscrowBits.t.sol +++ b/test/libraries/EscrowBits.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "forge-std/Test.sol"; diff --git a/test/libraries/SafetyBits.t.sol b/test/libraries/SafetyBits.t.sol index 264c13d5c..844e7279b 100644 --- a/test/libraries/SafetyBits.t.sol +++ b/test/libraries/SafetyBits.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.21; +pragma solidity 0.8.22; import "forge-std/Test.sol";