Add Velodrome V2 support on Base (#747)

This commit is contained in:
Kyu 2023-08-29 14:43:23 -07:00 committed by GitHub
parent 5a49be1322
commit e5cbfd87bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 33 additions and 2 deletions

View File

@ -1,4 +1,12 @@
[ [
{
"version": "0.48.0",
"changes": [
{
"note": "Add VelodromeV2 support on Base"
}
]
},
{ {
"version": "0.47.0", "version": "0.47.0",
"changes": [ "changes": [

View File

@ -24,6 +24,7 @@ import "./mixins/MixinCurve.sol";
import "./mixins/MixinCurveV2.sol"; import "./mixins/MixinCurveV2.sol";
import "./mixins/MixinMaverickV1.sol"; import "./mixins/MixinMaverickV1.sol";
import "./mixins/MixinSolidly.sol"; import "./mixins/MixinSolidly.sol";
import "./mixins/MixinVelodromeV2.sol";
contract BaseBridgeAdapter is contract BaseBridgeAdapter is
AbstractBridgeAdapter(8453, "Base"), AbstractBridgeAdapter(8453, "Base"),
@ -33,7 +34,8 @@ contract BaseBridgeAdapter is
MixinCurve, MixinCurve,
MixinCurveV2, MixinCurveV2,
MixinMaverickV1, MixinMaverickV1,
MixinSolidly MixinSolidly,
MixinVelodromeV2
{ {
constructor(IEtherToken weth) public MixinCurve(weth) {} constructor(IEtherToken weth) public MixinCurve(weth) {}
@ -80,6 +82,11 @@ contract BaseBridgeAdapter is
return (0, true); return (0, true);
} }
boughtAmount = _tradeMaverickV1(sellToken, buyToken, sellAmount, order.bridgeData); boughtAmount = _tradeMaverickV1(sellToken, buyToken, sellAmount, order.bridgeData);
} else if (protocolId == BridgeProtocols.VELODROMEV2) {
if (dryRun) {
return (0, true);
}
boughtAmount = _tradeVelodromeV2(sellToken, sellAmount, order.bridgeData);
} }
emit BridgeFill(order.source, sellToken, buyToken, sellAmount, boughtAmount); emit BridgeFill(order.source, sellToken, buyToken, sellAmount, boughtAmount);
} }

View File

@ -36,4 +36,12 @@ contract BaseBridgeAdapterTest is Test {
function testSupportMaverickV1() public { function testSupportMaverickV1() public {
assertTrue(adapter.isSupportedSource(bytes32(uint256(BridgeProtocols.MAVERICKV1) << 128))); assertTrue(adapter.isSupportedSource(bytes32(uint256(BridgeProtocols.MAVERICKV1) << 128)));
} }
function testSupportSolidly() public {
assertTrue(adapter.isSupportedSource(bytes32(uint256(BridgeProtocols.SOLIDLY) << 128)));
}
function testSupportVelodromeV2() public {
assertTrue(adapter.isSupportedSource(bytes32(uint256(BridgeProtocols.VELODROMEV2) << 128)));
}
} }

View File

@ -1,4 +1,12 @@
[ [
{
"version": "8.12.0",
"changes": [
{
"note": "Add VelodromeV2 support on Base"
}
]
},
{ {
"version": "8.11.0", "version": "8.11.0",
"changes": [ "changes": [

View File

@ -271,7 +271,7 @@
"wethTransformer": "0x63186ea36e78ecbf0128e448362f1b81e9bf7412", "wethTransformer": "0x63186ea36e78ecbf0128e448362f1b81e9bf7412",
"payTakerTransformer": "0x5cc22a0e06ea11097c612a962e63674b90e96099", "payTakerTransformer": "0x5cc22a0e06ea11097c612a962e63674b90e96099",
"affiliateFeeTransformer": "0x9e52d8b32d835206d09810c310593bcc77264066", "affiliateFeeTransformer": "0x9e52d8b32d835206d09810c310593bcc77264066",
"fillQuoteTransformer": "0xab93d03a3e7e51ec5edaef75d27f20917da4c18e", "fillQuoteTransformer": "0x2c46d57bb5af87a13a51dd5b62ba7d3bc7e12e9c",
"positiveSlippageFeeTransformer": "0xf98a130d3b4029c70e6d93098cb82a003421341e" "positiveSlippageFeeTransformer": "0xf98a130d3b4029c70e6d93098cb82a003421341e"
} }
} }