-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
181 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
181978 | ||
150745 |
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 +1 @@ | ||
137605 | ||
157505 |
2 changes: 1 addition & 1 deletion
2
.forge-snapshots/Base-ExclusiveDutchOrder-BaseExecuteSingleWithFee.snap
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 +1 @@ | ||
150633 | ||
150961 |
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 +1 @@ | ||
197283 | ||
197273 |
2 changes: 1 addition & 1 deletion
2
.forge-snapshots/Base-ExclusiveDutchOrder-ExecuteBatchMultipleOutputs.snap
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 +1 @@ | ||
207049 | ||
207039 |
2 changes: 1 addition & 1 deletion
2
.forge-snapshots/Base-ExclusiveDutchOrder-ExecuteBatchMultipleOutputsDifferentTokens.snap
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 +1 @@ | ||
260720 | ||
260710 |
2 changes: 1 addition & 1 deletion
2
.forge-snapshots/Base-ExclusiveDutchOrder-ExecuteBatchNativeOutput.snap
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 +1 @@ | ||
190809 | ||
190799 |
2 changes: 1 addition & 1 deletion
2
.forge-snapshots/Base-ExclusiveDutchOrder-ExecuteSingleNativeOutput.snap
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 +1 @@ | ||
95568 | ||
133968 |
2 changes: 1 addition & 1 deletion
2
.forge-snapshots/Base-LimitOrderReactor-BaseExecuteSingleWithFee.snap
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 +1 @@ | ||
178116 | ||
146554 |
2 changes: 1 addition & 1 deletion
2
.forge-snapshots/Base-LimitOrderReactor-ExecuteSingleValidation.snap
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 +1 @@ | ||
133743 | ||
153643 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
pragma solidity ^0.8.0; | ||
|
||
import {Owned} from "solmate/src/auth/Owned.sol"; | ||
import {ResolvedOrder, OutputToken} from "../../../src/base/ReactorStructs.sol"; | ||
import {IProtocolFeeController} from "../../../src/interfaces/IProtocolFeeController.sol"; | ||
import {ERC20} from "solmate/src/tokens/ERC20.sol"; | ||
|
||
/// @notice Mock protocol fee controller taking fee on input tokens | ||
contract MockFeeControllerInputFees is IProtocolFeeController, Owned(msg.sender) { | ||
uint256 private constant BPS = 10000; | ||
address public immutable feeRecipient; | ||
|
||
constructor(address _feeRecipient) { | ||
feeRecipient = _feeRecipient; | ||
} | ||
|
||
mapping(ERC20 tokenIn => uint256) public fees; | ||
|
||
/// @inheritdoc IProtocolFeeController | ||
function getFeeOutputs(ResolvedOrder memory order) external view override returns (OutputToken[] memory result) { | ||
result = new OutputToken[](1); | ||
|
||
uint256 fee = fees[order.input.token]; | ||
uint256 feeAmount = order.input.amount * fee / BPS; | ||
result[0] = OutputToken({token: address(order.input.token), amount: feeAmount, recipient: feeRecipient}); | ||
} | ||
|
||
function setFee(ERC20 tokenIn, uint256 fee) external onlyOwner { | ||
fees[tokenIn] = fee; | ||
} | ||
} |