Skip to content

Commit

Permalink
Add Velodrome V2 support on Base (#747)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyu-c authored Aug 29, 2023
1 parent 5a49be1 commit e5cbfd8
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 2 deletions.
8 changes: 8 additions & 0 deletions contracts/zero-ex/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
[
{
"version": "0.48.0",
"changes": [
{
"note": "Add VelodromeV2 support on Base"
}
]
},
{
"version": "0.47.0",
"changes": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import "./mixins/MixinCurve.sol";
import "./mixins/MixinCurveV2.sol";
import "./mixins/MixinMaverickV1.sol";
import "./mixins/MixinSolidly.sol";
import "./mixins/MixinVelodromeV2.sol";

contract BaseBridgeAdapter is
AbstractBridgeAdapter(8453, "Base"),
Expand All @@ -33,7 +34,8 @@ contract BaseBridgeAdapter is
MixinCurve,
MixinCurveV2,
MixinMaverickV1,
MixinSolidly
MixinSolidly,
MixinVelodromeV2
{
constructor(IEtherToken weth) public MixinCurve(weth) {}

Expand Down Expand Up @@ -80,6 +82,11 @@ contract BaseBridgeAdapter is
return (0, true);
}
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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,12 @@ contract BaseBridgeAdapterTest is Test {
function testSupportMaverickV1() public {
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)));
}
}
8 changes: 8 additions & 0 deletions packages/contract-addresses/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
[
{
"version": "8.12.0",
"changes": [
{
"note": "Add VelodromeV2 support on Base"
}
]
},
{
"version": "8.11.0",
"changes": [
Expand Down
2 changes: 1 addition & 1 deletion packages/contract-addresses/addresses.json
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@
"wethTransformer": "0x63186ea36e78ecbf0128e448362f1b81e9bf7412",
"payTakerTransformer": "0x5cc22a0e06ea11097c612a962e63674b90e96099",
"affiliateFeeTransformer": "0x9e52d8b32d835206d09810c310593bcc77264066",
"fillQuoteTransformer": "0xab93d03a3e7e51ec5edaef75d27f20917da4c18e",
"fillQuoteTransformer": "0x2c46d57bb5af87a13a51dd5b62ba7d3bc7e12e9c",
"positiveSlippageFeeTransformer": "0xf98a130d3b4029c70e6d93098cb82a003421341e"
}
}
Expand Down

0 comments on commit e5cbfd8

Please sign in to comment.