Skip to content

Commit ed3a62a

Browse files
committed
Merge branch 'dcmt/balv3-more-chains'
2 parents 737f199 + 82c9187 commit ed3a62a

File tree

7 files changed

+99
-2
lines changed

7 files changed

+99
-2
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ Master list of UniV3 forks:
4747
* Add UniswapV3 UniV3 fork to Monad Testnet
4848
* Add UniswapV4 actions to Sepolia
4949
* Add UniswapV4 actions to Ink
50+
* Add BalancerV3 actions to Base
51+
* Add BalancerV3 actions to Arbitrum
5052

5153
## 2025-02-12
5254

src/chains/Arbitrum/Common.sol

+24-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {DodoV1, IDodoV1} from "../../core/DodoV1.sol";
1010
import {DodoV2, IDodoV2} from "../../core/DodoV2.sol";
1111
import {UniswapV4} from "../../core/UniswapV4.sol";
1212
import {IPoolManager} from "../../core/UniswapV4Types.sol";
13+
import {BalancerV3} from "../../core/BalancerV3.sol";
1314
import {FreeMemory} from "../../utils/FreeMemory.sol";
1415

1516
import {ISettlerActions} from "../../ISettlerActions.sol";
@@ -44,7 +45,16 @@ import {ARBITRUM_POOL_MANAGER} from "../../core/UniswapV4Addresses.sol";
4445
// Solidity inheritance is stupid
4546
import {SettlerAbstract} from "../../SettlerAbstract.sol";
4647

47-
abstract contract ArbitrumMixin is FreeMemory, SettlerBase, MaverickV2, CurveTricrypto, DodoV1, DodoV2, UniswapV4 {
48+
abstract contract ArbitrumMixin is
49+
FreeMemory,
50+
SettlerBase,
51+
MaverickV2,
52+
CurveTricrypto,
53+
DodoV1,
54+
DodoV2,
55+
UniswapV4,
56+
BalancerV3
57+
{
4858
constructor() {
4959
assert(block.chainid == 42161 || block.chainid == 31337);
5060
}
@@ -71,6 +81,19 @@ abstract contract ArbitrumMixin is FreeMemory, SettlerBase, MaverickV2, CurveTri
7181
) = abi.decode(data, (address, IERC20, uint256, bool, uint256, uint256, bytes, uint256));
7282

7383
sellToUniswapV4(recipient, sellToken, bps, feeOnTransfer, hashMul, hashMod, fills, amountOutMin);
84+
} else if (action == uint32(ISettlerActions.BALANCERV3.selector)) {
85+
(
86+
address recipient,
87+
IERC20 sellToken,
88+
uint256 bps,
89+
bool feeOnTransfer,
90+
uint256 hashMul,
91+
uint256 hashMod,
92+
bytes memory fills,
93+
uint256 amountOutMin
94+
) = abi.decode(data, (address, IERC20, uint256, bool, uint256, uint256, bytes, uint256));
95+
96+
sellToBalancerV3(recipient, sellToken, bps, feeOnTransfer, hashMul, hashMod, fills, amountOutMin);
7497
} else if (action == uint32(ISettlerActions.MAVERICKV2.selector)) {
7598
(
7699
address recipient,

src/chains/Arbitrum/MetaTxn.sol

+14
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,20 @@ contract ArbitrumSettlerMetaTxn is SettlerMetaTxn, ArbitrumMixin {
4040
);
4141

4242
sellToUniswapV4VIP(recipient, feeOnTransfer, hashMul, hashMod, fills, permit, sig, amountOutMin);
43+
} else if (action == uint32(ISettlerActions.METATXN_BALANCERV3_VIP.selector)) {
44+
(
45+
address recipient,
46+
bool feeOnTransfer,
47+
uint256 hashMul,
48+
uint256 hashMod,
49+
bytes memory fills,
50+
ISignatureTransfer.PermitTransferFrom memory permit,
51+
uint256 amountOutMin
52+
) = abi.decode(
53+
data, (address, bool, uint256, uint256, bytes, ISignatureTransfer.PermitTransferFrom, uint256)
54+
);
55+
56+
sellToBalancerV3VIP(recipient, feeOnTransfer, hashMul, hashMod, fills, permit, sig, amountOutMin);
4357
} else if (action == uint32(ISettlerActions.METATXN_MAVERICKV2_VIP.selector)) {
4458
(
4559
address recipient,

src/chains/Arbitrum/TakerSubmitted.sol

+15
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,21 @@ contract ArbitrumSettler is Settler, ArbitrumMixin {
3636
);
3737

3838
sellToUniswapV4VIP(recipient, feeOnTransfer, hashMul, hashMod, fills, permit, sig, amountOutMin);
39+
} else if (action == uint32(ISettlerActions.BALANCERV3_VIP.selector)) {
40+
(
41+
address recipient,
42+
bool feeOnTransfer,
43+
uint256 hashMul,
44+
uint256 hashMod,
45+
bytes memory fills,
46+
ISignatureTransfer.PermitTransferFrom memory permit,
47+
bytes memory sig,
48+
uint256 amountOutMin
49+
) = abi.decode(
50+
data, (address, bool, uint256, uint256, bytes, ISignatureTransfer.PermitTransferFrom, bytes, uint256)
51+
);
52+
53+
sellToBalancerV3VIP(recipient, feeOnTransfer, hashMul, hashMod, fills, permit, sig, amountOutMin);
3954
} else if (action == uint32(ISettlerActions.MAVERICKV2_VIP.selector)) {
4055
(
4156
address recipient,

src/chains/Base/Common.sol

+15-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {DodoV2, IDodoV2} from "../../core/DodoV2.sol";
88
import {MaverickV2, IMaverickV2Pool} from "../../core/MaverickV2.sol";
99
import {UniswapV4} from "../../core/UniswapV4.sol";
1010
import {IPoolManager} from "../../core/UniswapV4Types.sol";
11+
import {BalancerV3} from "../../core/BalancerV3.sol";
1112
import {FreeMemory} from "../../utils/FreeMemory.sol";
1213

1314
import {ISettlerActions} from "../../ISettlerActions.sol";
@@ -46,7 +47,7 @@ import {BASE_POOL_MANAGER} from "../../core/UniswapV4Addresses.sol";
4647
// Solidity inheritance is stupid
4748
import {SettlerAbstract} from "../../SettlerAbstract.sol";
4849

49-
abstract contract BaseMixin is FreeMemory, SettlerBase, MaverickV2, DodoV2, UniswapV4 {
50+
abstract contract BaseMixin is FreeMemory, SettlerBase, MaverickV2, DodoV2, UniswapV4, BalancerV3 {
5051
constructor() {
5152
assert(block.chainid == 8453 || block.chainid == 31337);
5253
}
@@ -73,6 +74,19 @@ abstract contract BaseMixin is FreeMemory, SettlerBase, MaverickV2, DodoV2, Unis
7374
) = abi.decode(data, (address, IERC20, uint256, bool, uint256, uint256, bytes, uint256));
7475

7576
sellToUniswapV4(recipient, sellToken, bps, feeOnTransfer, hashMul, hashMod, fills, amountOutMin);
77+
} else if (action == uint32(ISettlerActions.BALANCERV3.selector)) {
78+
(
79+
address recipient,
80+
IERC20 sellToken,
81+
uint256 bps,
82+
bool feeOnTransfer,
83+
uint256 hashMul,
84+
uint256 hashMod,
85+
bytes memory fills,
86+
uint256 amountOutMin
87+
) = abi.decode(data, (address, IERC20, uint256, bool, uint256, uint256, bytes, uint256));
88+
89+
sellToBalancerV3(recipient, sellToken, bps, feeOnTransfer, hashMul, hashMod, fills, amountOutMin);
7690
} else if (action == uint32(ISettlerActions.MAVERICKV2.selector)) {
7791
(
7892
address recipient,

src/chains/Base/MetaTxn.sol

+14
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,20 @@ contract BaseSettlerMetaTxn is SettlerMetaTxn, BaseMixin {
4040
);
4141

4242
sellToUniswapV4VIP(recipient, feeOnTransfer, hashMul, hashMod, fills, permit, sig, amountOutMin);
43+
} else if (action == uint32(ISettlerActions.METATXN_BALANCERV3_VIP.selector)) {
44+
(
45+
address recipient,
46+
bool feeOnTransfer,
47+
uint256 hashMul,
48+
uint256 hashMod,
49+
bytes memory fills,
50+
ISignatureTransfer.PermitTransferFrom memory permit,
51+
uint256 amountOutMin
52+
) = abi.decode(
53+
data, (address, bool, uint256, uint256, bytes, ISignatureTransfer.PermitTransferFrom, uint256)
54+
);
55+
56+
sellToBalancerV3VIP(recipient, feeOnTransfer, hashMul, hashMod, fills, permit, sig, amountOutMin);
4357
} else if (action == uint32(ISettlerActions.METATXN_MAVERICKV2_VIP.selector)) {
4458
(
4559
address recipient,

src/chains/Base/TakerSubmitted.sol

+15
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,21 @@ contract BaseSettler is Settler, BaseMixin {
3636
);
3737

3838
sellToUniswapV4VIP(recipient, feeOnTransfer, hashMul, hashMod, fills, permit, sig, amountOutMin);
39+
} else if (action == uint32(ISettlerActions.BALANCERV3_VIP.selector)) {
40+
(
41+
address recipient,
42+
bool feeOnTransfer,
43+
uint256 hashMul,
44+
uint256 hashMod,
45+
bytes memory fills,
46+
ISignatureTransfer.PermitTransferFrom memory permit,
47+
bytes memory sig,
48+
uint256 amountOutMin
49+
) = abi.decode(
50+
data, (address, bool, uint256, uint256, bytes, ISignatureTransfer.PermitTransferFrom, bytes, uint256)
51+
);
52+
53+
sellToBalancerV3VIP(recipient, feeOnTransfer, hashMul, hashMod, fills, permit, sig, amountOutMin);
3954
} else if (action == uint32(ISettlerActions.MAVERICKV2_VIP.selector)) {
4055
(
4156
address recipient,

0 commit comments

Comments
 (0)