prettier and lint

This commit is contained in:
dextracker
2023-02-23 15:11:52 -05:00
parent 4aaba03847
commit 29b7095a00
4 changed files with 16 additions and 17 deletions

View File

@@ -31,7 +31,7 @@ import "./libs/LibNativeOrder.sol";
import "./libs/LibSignature.sol"; import "./libs/LibSignature.sol";
/// @dev Feature for interacting with OTC orders. /// @dev Feature for interacting with OTC orders.
contract OtcOrdersFeature is IFeature, IOtcOrdersFeature, FixinCommon, FixinEIP712, FixinTokenSpender{ contract OtcOrdersFeature is IFeature, IOtcOrdersFeature, FixinCommon, FixinEIP712, FixinTokenSpender {
using LibSafeMathV06 for uint256; using LibSafeMathV06 for uint256;
using LibSafeMathV06 for uint128; using LibSafeMathV06 for uint128;

View File

@@ -534,12 +534,11 @@ contract MultiplexFeature is
} else { } else {
target = address(this); target = address(this);
} }
} else if(subcall.id == MultiplexSubcall.OTC) { } else if (subcall.id == MultiplexSubcall.OTC) {
//on the first call we want to pull tokens from the taker, subsequent calls should use the EP balance //on the first call we want to pull tokens from the taker, subsequent calls should use the EP balance
if( i == 0) { if (i == 0) {
target = msg.sender; target = msg.sender;
} } else {
else {
target = address(this); target = address(this);
} }
} else { } else {

View File

@@ -21,7 +21,7 @@ import "../interfaces/IMultiplexFeature.sol";
import "../interfaces/IOtcOrdersFeature.sol"; import "../interfaces/IOtcOrdersFeature.sol";
import "../libs/LibNativeOrder.sol"; import "../libs/LibNativeOrder.sol";
abstract contract MultiplexOtc is FixinEIP712{ abstract contract MultiplexOtc is FixinEIP712 {
using LibSafeMathV06 for uint256; using LibSafeMathV06 for uint256;
event ExpiredOtcOrder(bytes32 orderHash, address maker, uint64 expiry); event ExpiredOtcOrder(bytes32 orderHash, address maker, uint64 expiry);

View File

@@ -29,9 +29,9 @@ import "src/transformers/bridges/BridgeProtocols.sol";
import "src/features/OtcOrdersFeature.sol"; import "src/features/OtcOrdersFeature.sol";
contract MultiplexRfqtTest is Test, ForkUtils, TestUtils { contract MultiplexRfqtTest is Test, ForkUtils, TestUtils {
using LibERC20TokenV06 for IERC20Token; using LibERC20TokenV06 for IERC20Token;
using LibERC20TokenV06 for IEtherToken; using LibERC20TokenV06 for IEtherToken;
function setUp() public { function setUp() public {
_setup(); _setup();
} }
@@ -67,7 +67,10 @@ contract MultiplexRfqtTest is Test, ForkUtils, TestUtils {
bytes32(0) // sushiswapPairInitCodeHash bytes32(0) // sushiswapPairInitCodeHash
); );
OtcOrdersFeature otcOrdersFeature = new OtcOrdersFeature(address(addresses.exchangeProxy), tokens.WrappedNativeToken); OtcOrdersFeature otcOrdersFeature = new OtcOrdersFeature(
address(addresses.exchangeProxy),
tokens.WrappedNativeToken
);
vm.label(address(multiplexFeature), "zeroEx/NewMultiplexFeature"); vm.label(address(multiplexFeature), "zeroEx/NewMultiplexFeature");
vm.label(address(otcOrdersFeature), "zeroEx/NewOtcOrdersFeature"); vm.label(address(otcOrdersFeature), "zeroEx/NewOtcOrdersFeature");
@@ -95,7 +98,6 @@ contract MultiplexRfqtTest is Test, ForkUtils, TestUtils {
ContractAddresses memory addresses, ContractAddresses memory addresses,
LiquiditySources memory sources LiquiditySources memory sources
) public onlyForked { ) public onlyForked {
IZERO_EX = IZeroEx(addresses.exchangeProxy); IZERO_EX = IZeroEx(addresses.exchangeProxy);
address[] memory tradeTokens = new address[](3); address[] memory tradeTokens = new address[](3);
@@ -139,7 +141,7 @@ contract MultiplexRfqtTest is Test, ForkUtils, TestUtils {
subcalls[1] = subcall2; subcalls[1] = subcall2;
uint balanceBefore = tokens.DAI.balanceOf(address(this)); uint balanceBefore = tokens.DAI.balanceOf(address(this));
emit log_named_uint("DAI Balance Before",balanceBefore); emit log_named_uint("DAI Balance Before", balanceBefore);
emit log_string("Multihop Rfqt: WETH->USDC->DAI"); emit log_string("Multihop Rfqt: WETH->USDC->DAI");
/// @dev Sells `sellAmount` of the input token (`tokens[0]`) /// @dev Sells `sellAmount` of the input token (`tokens[0]`)
@@ -193,8 +195,6 @@ contract MultiplexRfqtTest is Test, ForkUtils, TestUtils {
vm.startPrank(order.maker); vm.startPrank(order.maker);
IERC20Token(order.makerToken).approveIfBelow(addresses.exchangeProxy, 2e20); IERC20Token(order.makerToken).approveIfBelow(addresses.exchangeProxy, 2e20);
order.taker = address(0); order.taker = address(0);
order.txOrigin = address(tx.origin); order.txOrigin = address(tx.origin);
order.expiryAndNonce = encodeExpiryAndNonce(order.maker, bump); order.expiryAndNonce = encodeExpiryAndNonce(order.maker, bump);