Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gas surcharge flashloan test #72

Merged
merged 29 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down
2 changes: 1 addition & 1 deletion script/base/deploy-base.s.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion script/deploy-atlas.s.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion script/deploy-exec-env.s.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion script/deploy-solver.s.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion script/deploy-swap-intent-control.s.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion script/deploy-tx-builder.s.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion script/log-balances.s.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion script/solver-deposit.s.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/atlas/AtlETH.sol
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
2 changes: 1 addition & 1 deletion src/contracts/atlas/Atlas.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/atlas/AtlasVerification.sol
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
2 changes: 1 addition & 1 deletion src/contracts/atlas/DAppIntegration.sol
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
4 changes: 3 additions & 1 deletion src/contracts/atlas/Escrow.sol
Original file line number Diff line number Diff line change
@@ -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";

Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/atlas/ExecutionEnvironment.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/atlas/Factory.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/atlas/GasAccounting.sol
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
2 changes: 1 addition & 1 deletion src/contracts/atlas/Mimic.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.21;
pragma solidity 0.8.22;

contract Mimic {
/*
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/atlas/SafetyLocks.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/atlas/Storage.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/common/ExecutionBase.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/common/Permit69.sol
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
2 changes: 1 addition & 1 deletion src/contracts/dapp/ControlTemplate.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/dapp/DAppControl.sol
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
2 changes: 1 addition & 1 deletion src/contracts/examples/intents-example/StateIntent.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/examples/intents-example/SwapIntent.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/examples/v2-example/V2DAppControl.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/examples/v4-example/IHooks.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.22;

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

Expand Down
2 changes: 1 addition & 1 deletion src/contracts/examples/v4-example/IPoolManager.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.22;

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

Expand Down
2 changes: 1 addition & 1 deletion src/contracts/examples/v4-example/UniV4Hook.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/examples/v4-example/V4DAppControl.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.22;

// Base Imports
import { SafeTransferLib, ERC20 } from "solmate/utils/SafeTransferLib.sol";
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/helpers/Simulator.sol
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
2 changes: 1 addition & 1 deletion src/contracts/helpers/Sorter.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
7 changes: 4 additions & 3 deletions src/contracts/helpers/TxBuilder.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -82,7 +82,8 @@ contract TxBuilder {
bytes memory solverOpData,
address solverEOA,
address solverContract,
uint256 bidAmount
uint256 bidAmount,
uint256 value
)
public
view
Expand All @@ -91,7 +92,7 @@ contract TxBuilder {
solverOp = SolverOperation({
from: solverEOA,
to: atlas,
value: 0,
value: value,
gas: gas,
maxFeePerGas: userOp.maxFeePerGas,
deadline: userOp.deadline,
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/helpers/Utilities.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/interfaces/IAtlETH.sol
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/interfaces/IAtlas.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/interfaces/IAtlasVerification.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/interfaces/IDAppControl.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/interfaces/IDAppIntegration.sol
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/interfaces/IEscrow.sol
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
2 changes: 1 addition & 1 deletion src/contracts/interfaces/IExecutionEnvironment.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/interfaces/IFactory.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/interfaces/IPermit69.sol
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/interfaces/ISafetyLocks.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/interfaces/ISimulator.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/interfaces/ISolverContract.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.21;
pragma solidity 0.8.22;

import "../types/SolverCallTypes.sol";

Expand Down
2 changes: 1 addition & 1 deletion src/contracts/libraries/CallBits.sol
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
2 changes: 1 addition & 1 deletion src/contracts/libraries/CallVerification.sol
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
2 changes: 1 addition & 1 deletion src/contracts/libraries/EscrowBits.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.21;
pragma solidity 0.8.22;

import "../types/EscrowTypes.sol";

Expand Down
2 changes: 1 addition & 1 deletion src/contracts/libraries/SafetyBits.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.21;
pragma solidity 0.8.22;

import "../types/LockTypes.sol";

Expand Down
Loading
Loading