-
Notifications
You must be signed in to change notification settings - Fork 13
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 #301 from morpho-labs/main
update `review-cantina`
- Loading branch information
Showing
54 changed files
with
197 additions
and
202 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
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
Submodule morpho-blue
updated
from 5de355 to 720953
Submodule universal-rewards-distributor
updated
12 files
+24 −4 | .github/workflows/foundry.yml | |
+389 −0 | LICENSE | |
+12 −4 | foundry.toml | |
+0 −8 | remappings.txt | |
+71 −38 | src/UniversalRewardsDistributor.sol | |
+26 −17 | src/UrdFactory.sol | |
+4 −6 | src/interfaces/IUniversalRewardsDistributor.sol | |
+15 −9 | src/libraries/ErrorsLib.sol | |
+16 −17 | src/libraries/EventsLib.sol | |
+0 −47 | test/URDFactoryTest.sol | |
+85 −39 | test/UniversalRewardsDistributorTest.sol | |
+46 −0 | test/UrdFactoryTest.sol |
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 |
---|---|---|
@@ -1,22 +1,5 @@ | ||
config/=config/ | ||
src/=src/ | ||
test/=test/ | ||
config/=config/ | ||
|
||
solmate/=lib/solmate/ | ||
|
||
@forge-std/=lib/morpho-blue/lib/forge-std/src/ | ||
@solmate/=lib/solmate/src/ | ||
@morpho-v1/=lib/morpho-v1/src/ | ||
@morpho-blue/=lib/morpho-blue/src/ | ||
@morpho-utils/=lib/morpho-utils/src/ | ||
@universal-rewards-distributor/=lib/universal-rewards-distributor/src/ | ||
@morpho-aave-v3/=lib/morpho-aave-v3/src | ||
@openzeppelin/=lib/openzeppelin-contracts/contracts/ | ||
@permit2/=lib/permit2/src/ | ||
|
||
@uniswap/v3-core=lib/v3-core/contracts/ | ||
@uniswap/v3-periphery=lib/v3-periphery/contracts/ | ||
|
||
@aave/v3-core=lib/aave-v3-core/contracts/ | ||
|
||
@murky/=lib/murky/ | ||
solmate/=lib/morpho-aave-v3/lib/permit2/lib/solmate/ |
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 |
---|---|---|
|
@@ -4,12 +4,13 @@ pragma solidity 0.8.21; | |
import {IMulticall} from "./interfaces/IMulticall.sol"; | ||
|
||
import {ErrorsLib} from "./libraries/ErrorsLib.sol"; | ||
import {UNSET_INITIATOR} from "./libraries/ConstantsLib.sol"; | ||
|
||
/// @title BaseBundler | ||
/// @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 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. | ||
|
@@ -18,19 +19,27 @@ abstract contract BaseBundler is IMulticall { | |
|
||
/// @notice Keeps track of the bundler's latest bundle initiator. | ||
/// @dev Also prevents interacting with the bundler outside of an initiated execution context. | ||
address public initiator; | ||
address private _initiator = UNSET_INITIATOR; | ||
|
||
/* PUBLIC */ | ||
|
||
/// @notice Returns the address of the initiator of the multicall transaction. | ||
/// @dev Specialized getter to prevent using `_initiator` directly. | ||
function initiator() public view returns (address) { | ||
return _initiator; | ||
} | ||
|
||
/* EXTERNAL */ | ||
|
||
/// @notice Executes a series of delegate calls to the contract itself. | ||
/// @dev Locks the initiator so that the sender can uniquely be identified in callbacks. | ||
/// @dev All functions delegatecalled must be `payable` if `msg.value` is non-zero. | ||
function multicall(bytes[] memory data) external payable { | ||
initiator = msg.sender; | ||
_initiator = msg.sender; | ||
|
||
_multicall(data); | ||
|
||
delete initiator; | ||
_initiator = UNSET_INITIATOR; | ||
} | ||
|
||
/* INTERNAL */ | ||
|
@@ -48,7 +57,7 @@ abstract contract BaseBundler is IMulticall { | |
|
||
/// @dev Checks that the contract is in an initiated execution context. | ||
function _checkInitiated() internal view { | ||
require(initiator != address(0), ErrorsLib.UNINITIATED); | ||
require(_initiator != UNSET_INITIATOR, ErrorsLib.UNINITIATED); | ||
} | ||
|
||
/// @dev Bubbles up the revert reason / custom error encoded in `returnData`. | ||
|
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 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.