diff --git a/.vscode/settings.json b/.vscode/settings.json index 5ff542f72..8919568db 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,5 +6,6 @@ "search.exclude": { "lib": true }, "files.associations": { ".gas-snapshot": "julia" - } + }, + "makefile.configureOnOpen": false } diff --git a/lib/forge-std b/lib/forge-std index 5a802d7c1..e04104ab9 160000 --- a/lib/forge-std +++ b/lib/forge-std @@ -1 +1 @@ -Subproject commit 5a802d7c10abb4bbfb3e7214c75052ef9e6a06f8 +Subproject commit e04104ab93e771441eab03fb76eda1402cb5927b diff --git a/lib/solady b/lib/solady index 42af395e6..156317831 160000 --- a/lib/solady +++ b/lib/solady @@ -1 +1 @@ -Subproject commit 42af395e631fcc9d640eddf11c57c6f1ca3f9103 +Subproject commit 1563178312d50496373c8abeddb37c09db48d7cf diff --git a/src/contracts/examples/v4-example/V4DAppControl.sol b/src/contracts/examples/v4-example/V4DAppControl.sol index 3eb4d198f..11167a6ec 100644 --- a/src/contracts/examples/v4-example/V4DAppControl.sol +++ b/src/contracts/examples/v4-example/V4DAppControl.sol @@ -142,8 +142,7 @@ contract V4DAppControl is DAppControl { } else { if (params.amountSpecified > 0) { // Buying Pool's token0 with amountSpecified of User's token1 - } - else { + } else { // Buying amountSpecified of Pool's token0 with User's token1 } } diff --git a/src/contracts/types/AtlasConstants.sol b/src/contracts/types/AtlasConstants.sol index 89e4f5e23..ada48bbf1 100644 --- a/src/contracts/types/AtlasConstants.sol +++ b/src/contracts/types/AtlasConstants.sol @@ -13,12 +13,12 @@ contract AtlasConstants { // ------------------------------------------------------- // // Atlas constants - uint256 internal constant _GAS_VALUE_DECIMALS_TO_DROP = 1e9; // measured in gwei + uint256 internal constant _GAS_VALUE_DECIMALS_TO_DROP = 0x3b9aca00; // 1e9; // measured in gwei uint256 internal constant _UNLOCKED = 0; // Atlas constants used in `_bidFindingIteration()` uint256 internal constant _BITS_FOR_INDEX = 16; - uint256 internal constant _FIRST_16_BITS_TRUE_MASK = uint256(0xFFFF); + uint256 internal constant _FIRST_16_BITS_TRUE_MASK = 0xFFFF; // Escrow constants uint256 internal constant _VALIDATION_GAS_LIMIT = 500_000; @@ -35,12 +35,13 @@ contract AtlasConstants { // First 160 bits of _solverLock are the address of the current solver. // The 161st bit represents whether the solver has called back via `reconcile`. // The 162nd bit represents whether the solver's outstanding debt has been repaid via `reconcile`. - uint256 internal constant _SOLVER_CALLED_BACK_MASK = 1 << 161; - uint256 internal constant _SOLVER_FULFILLED_MASK = 1 << 162; + uint256 internal constant _SOLVER_CALLED_BACK_MASK = + 2_923_003_274_661_805_836_407_369_665_432_566_039_311_865_085_952; // 1 << 161; + uint256 internal constant _SOLVER_FULFILLED_MASK = 5_846_006_549_323_611_672_814_739_330_865_132_078_623_730_171_904; // 1 + // << 162; // Used to set Lock phase without changing the activeEnvironment or callConfig. - uint256 internal constant _LOCK_PHASE_MASK = - uint256(0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00); + uint256 internal constant _LOCK_PHASE_MASK = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00; // ValidCalls error threshold before which the metacall reverts, and after which it returns gracefully to store // nonces as used. @@ -50,5 +51,5 @@ contract AtlasConstants { // ATLAS VERIFICATION CONSTANTS // // ------------------------------------------------------- // - uint8 internal constant _MAX_SOLVERS = type(uint8).max - 1; + uint8 internal constant _MAX_SOLVERS = 254; // type(uint8).max - 1; } diff --git a/src/contracts/types/DAppOperation.sol b/src/contracts/types/DAppOperation.sol index 82a3b1d1c..f5b5fc466 100644 --- a/src/contracts/types/DAppOperation.sol +++ b/src/contracts/types/DAppOperation.sol @@ -1,9 +1,9 @@ //SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.28; -bytes32 constant DAPP_TYPEHASH = keccak256( - "DAppOperation(address from,address to,uint256 nonce,uint256 deadline,address control,address bundler,bytes32 userOpHash,bytes32 callChainHash)" -); +//keccak256("DAppOperation(address from,address to,uint256 nonce,uint256 deadline,address control,address +// bundler,bytes32 userOpHash,bytes32 callChainHash)"); +bytes32 constant DAPP_TYPEHASH = 0x88ef8fc82c1c9cd8c70c0ba2062b71d8e01324e34aea7264c6a6f2220a2e21a5; struct DAppOperation { address from; // signer of the DAppOperation diff --git a/src/contracts/types/SolverOperation.sol b/src/contracts/types/SolverOperation.sol index d58c73952..330f18bd7 100644 --- a/src/contracts/types/SolverOperation.sol +++ b/src/contracts/types/SolverOperation.sol @@ -1,9 +1,9 @@ //SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.28; -bytes32 constant SOLVER_TYPEHASH = keccak256( - "SolverOperation(address from,address to,uint256 value,uint256 gas,uint256 maxFeePerGas,uint256 deadline,address solver,address control,bytes32 userOpHash,address bidToken,uint256 bidAmount,bytes data)" -); +// keccak256("SolverOperation(address from,address to,uint256 value,uint256 gas,uint256 maxFeePerGas,uint256 +// deadline,address solver,address control,bytes32 userOpHash,address bidToken,uint256 bidAmount,bytes data)"); +bytes32 constant SOLVER_TYPEHASH = 0x57d8655e41f8b345d65e4e5aad590481b56d0ebc5b7a589653f3f46f30ba3076; // NOTE: The calldata length of this SolverOperation struct is 608 bytes when the `data` field is excluded. This value // is stored in the `_SOLVER_OP_BASE_CALLDATA` constant in AtlasConstants.sol and must be kept up-to-date with any diff --git a/src/contracts/types/UserOperation.sol b/src/contracts/types/UserOperation.sol index 3a6d06600..94592f704 100644 --- a/src/contracts/types/UserOperation.sol +++ b/src/contracts/types/UserOperation.sol @@ -2,18 +2,18 @@ pragma solidity 0.8.28; // Default UserOperation typehash -bytes32 constant USER_TYPEHASH_DEFAULT = keccak256( - "UserOperation(address from,address to,uint256 value,uint256 gas,uint256 maxFeePerGas,uint256 nonce,uint256 deadline,address dapp,address control,uint32 callConfig,address sessionKey,bytes data)" -); +// keccak256("UserOperation(address from,address to,uint256 value,uint256 gas,uint256 maxFeePerGas,uint256 nonce,uint256 +// deadline,address dapp,address control,uint32 callConfig,address sessionKey,bytes data)"); +bytes32 constant USER_TYPEHASH_DEFAULT = 0xf31c75b3100e5767eb039f15afcdf4cefd3b35ea6ae27ffc4135a27b83d0610e; // Trusted UserOperation typehash // NOTE: This is explicitly for the 'trustedOpHash' configuration option meant so that solvers can submit // SolverOperations // prior to seeing the UserOperation or its hash. In this scenario, the Solvers should trust the signer of the // UserOperation. -bytes32 constant USER_TYPEHASH_TRUSTED = keccak256( - "UserOperation(address from,address to,address dapp,address control,uint32 callConfig,address sessionKey)" -); +// keccak256("UserOperation(address from,address to,address dapp,address control,uint32 callConfig,address +// sessionKey)"); +bytes32 constant USER_TYPEHASH_TRUSTED = 0xca1d2fd72c857f54b9c8b2576463534d8f4df0fcd25f408c17991285b16ca41a; struct UserOperation { address from; // User address