-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #434 from morpho-org/style/rootbundler
`BaseBundler` renaming
- Loading branch information
Showing
27 changed files
with
57 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,15 +7,15 @@ import {ErrorsLib} from "./libraries/ErrorsLib.sol"; | |
import {UNSET_INITIATOR} from "./libraries/ConstantsLib.sol"; | ||
import {SafeTransferLib, ERC20} from "../lib/solmate/src/utils/SafeTransferLib.sol"; | ||
|
||
/// @title BaseBundler | ||
/// @title CoreBundler | ||
/// @author Morpho Labs | ||
/// @custom:contact [email protected] | ||
/// @notice Enables calling multiple functions in a single call to the same contract (self). | ||
/// @dev Every bundler must inherit from this contract. | ||
/// @dev Every bundler inheriting from this contract must have their external functions payable as they will be | ||
/// delegate called by the `multicall` function (which is payable, and thus might pass a non-null ETH value). It is | ||
/// recommended not to rely on `msg.value` as the same value can be reused for multiple calls. | ||
abstract contract BaseBundler is IMulticall { | ||
abstract contract CoreBundler is IMulticall { | ||
using SafeTransferLib for ERC20; | ||
|
||
/* STORAGE */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,13 +7,13 @@ import {Math} from "../lib/morpho-utils/src/math/Math.sol"; | |
import {ErrorsLib} from "./libraries/ErrorsLib.sol"; | ||
import {SafeTransferLib, ERC20} from "../lib/solmate/src/utils/SafeTransferLib.sol"; | ||
|
||
import {BaseBundler} from "./BaseBundler.sol"; | ||
import {CoreBundler} from "./CoreBundler.sol"; | ||
|
||
/// @title ERC4626Bundler | ||
/// @author Morpho Labs | ||
/// @custom:contact [email protected] | ||
/// @notice Bundler contract managing interactions with ERC4626 compliant tokens. | ||
abstract contract ERC4626Bundler is BaseBundler { | ||
abstract contract ERC4626Bundler is CoreBundler { | ||
using SafeTransferLib for ERC20; | ||
|
||
/* ACTIONS */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,13 +8,13 @@ import {MarketParams, Signature, Authorization, IMorpho} from "../lib/morpho-blu | |
import {ErrorsLib} from "./libraries/ErrorsLib.sol"; | ||
import {SafeTransferLib, ERC20} from "../lib/solmate/src/utils/SafeTransferLib.sol"; | ||
|
||
import {BaseBundler} from "./BaseBundler.sol"; | ||
import {CoreBundler} from "./CoreBundler.sol"; | ||
|
||
/// @title MorphoBundler | ||
/// @author Morpho Labs | ||
/// @custom:contact [email protected] | ||
/// @notice Bundler contract managing interactions with Morpho. | ||
abstract contract MorphoBundler is BaseBundler, IMorphoBundler { | ||
abstract contract MorphoBundler is CoreBundler, IMorphoBundler { | ||
using SafeTransferLib for ERC20; | ||
|
||
/* IMMUTABLES */ | ||
|
@@ -264,7 +264,7 @@ abstract contract MorphoBundler is BaseBundler, IMorphoBundler { | |
_multicall(abi.decode(data, (bytes[]))); | ||
} | ||
|
||
/// @inheritdoc BaseBundler | ||
/// @inheritdoc CoreBundler | ||
function _isSenderAuthorized() internal view virtual override returns (bool) { | ||
return super._isSenderAuthorized() || msg.sender == address(MORPHO); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,13 +9,13 @@ import {Permit2Lib} from "../lib/permit2/src/libraries/Permit2Lib.sol"; | |
import {SafeCast160} from "../lib/permit2/src/libraries/SafeCast160.sol"; | ||
import {ERC20} from "../lib/solmate/src/tokens/ERC20.sol"; | ||
|
||
import {BaseBundler} from "./BaseBundler.sol"; | ||
import {CoreBundler} from "./CoreBundler.sol"; | ||
|
||
/// @title Permit2Bundler | ||
/// @author Morpho Labs | ||
/// @custom:contact [email protected] | ||
/// @notice Bundler contract managing interactions with Uniswap's Permit2. | ||
abstract contract Permit2Bundler is BaseBundler { | ||
abstract contract Permit2Bundler is CoreBundler { | ||
using SafeCast160 for uint256; | ||
|
||
/* ACTIONS */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,13 +3,13 @@ pragma solidity 0.8.24; | |
|
||
import {IERC20Permit} from "../lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Permit.sol"; | ||
|
||
import {BaseBundler} from "./BaseBundler.sol"; | ||
import {CoreBundler} from "./CoreBundler.sol"; | ||
|
||
/// @title PermitBundler | ||
/// @author Morpho Labs | ||
/// @custom:contact [email protected] | ||
/// @notice Bundler contract managing interactions with tokens implementing EIP-2612. | ||
abstract contract PermitBundler is BaseBundler { | ||
abstract contract PermitBundler is CoreBundler { | ||
/// @notice Permits the given `amount` of `asset` from sender to be spent by the bundler via EIP-2612 Permit with | ||
/// the given `deadline` & EIP-712 signature's `v`, `r` & `s`. | ||
/// @param asset The address of the token to be permitted. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,13 +8,13 @@ import {Math} from "../lib/morpho-utils/src/math/Math.sol"; | |
import {ErrorsLib} from "./libraries/ErrorsLib.sol"; | ||
import {SafeTransferLib, ERC20} from "../lib/solmate/src/utils/SafeTransferLib.sol"; | ||
|
||
import {BaseBundler} from "./BaseBundler.sol"; | ||
import {CoreBundler} from "./CoreBundler.sol"; | ||
|
||
/// @title StEthBundler | ||
/// @author Morpho Labs | ||
/// @custom:contact [email protected] | ||
/// @notice Contract allowing to bundle multiple interactions with stETH together. | ||
abstract contract StEthBundler is BaseBundler { | ||
abstract contract StEthBundler is CoreBundler { | ||
using SafeTransferLib for ERC20; | ||
|
||
/* IMMUTABLES */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,14 +5,14 @@ import {Math} from "../lib/morpho-utils/src/math/Math.sol"; | |
import {ErrorsLib} from "./libraries/ErrorsLib.sol"; | ||
import {SafeTransferLib, ERC20} from "../lib/solmate/src/utils/SafeTransferLib.sol"; | ||
|
||
import {BaseBundler} from "./BaseBundler.sol"; | ||
import {CoreBundler} from "./CoreBundler.sol"; | ||
|
||
/// @title TransferBundler | ||
/// @author Morpho Labs | ||
/// @custom:contact [email protected] | ||
/// @notice Enables transfer of ERC20 and native tokens. | ||
/// @dev Assumes that any tokens left on the contract can be seized by anyone. | ||
abstract contract TransferBundler is BaseBundler { | ||
abstract contract TransferBundler is CoreBundler { | ||
using SafeTransferLib for ERC20; | ||
|
||
/* TRANSFER ACTIONS */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,13 +6,13 @@ import {IUniversalRewardsDistributor} from | |
|
||
import {ErrorsLib} from "./libraries/ErrorsLib.sol"; | ||
|
||
import {BaseBundler} from "./BaseBundler.sol"; | ||
import {CoreBundler} from "./CoreBundler.sol"; | ||
|
||
/// @title UrdBundler | ||
/// @author Morpho Labs | ||
/// @custom:contact [email protected] | ||
/// @notice Bundler that allows to claim token rewards on the Universal Rewards Distributor. | ||
abstract contract UrdBundler is BaseBundler { | ||
abstract contract UrdBundler is CoreBundler { | ||
/// @notice Claims `amount` of `reward` on behalf of `account` on the given rewards distributor, using `proof`. | ||
/// @dev Assumes the given distributor implements IUniversalRewardsDistributor. | ||
/// @param distributor The address of the reward distributor contract. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,14 +7,14 @@ import {Math} from "../lib/morpho-utils/src/math/Math.sol"; | |
import {ErrorsLib} from "./libraries/ErrorsLib.sol"; | ||
import {SafeTransferLib, ERC20} from "../lib/solmate/src/utils/SafeTransferLib.sol"; | ||
|
||
import {BaseBundler} from "./BaseBundler.sol"; | ||
import {CoreBundler} from "./CoreBundler.sol"; | ||
|
||
/// @title WNativeBundler | ||
/// @author Morpho Labs | ||
/// @custom:contact [email protected] | ||
/// @notice Bundler contract managing interactions with network's wrapped native token. | ||
/// @notice "wrapped native" refers to forks of WETH. | ||
abstract contract WNativeBundler is BaseBundler { | ||
abstract contract WNativeBundler is CoreBundler { | ||
using SafeTransferLib for ERC20; | ||
|
||
/* IMMUTABLES */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
pragma solidity ^0.8.0; | ||
|
||
import "../../CoreBundler.sol"; | ||
|
||
contract CoreBundlerMock is CoreBundler {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.