Skip to content

Commit

Permalink
spearbit 94
Browse files Browse the repository at this point in the history
  • Loading branch information
dianakocsis committed Sep 3, 2024
1 parent 473ba4f commit 23944ab
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 91 deletions.
13 changes: 0 additions & 13 deletions contracts/base/Callbacks.sol

This file was deleted.

3 changes: 1 addition & 2 deletions contracts/base/Dispatcher.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {BytesLib} from '../modules/uniswap/v3/BytesLib.sol';
import {Payments} from '../modules/Payments.sol';
import {PaymentsImmutables} from '../modules/PaymentsImmutables.sol';
import {V3ToV4Migrator} from '../modules/V3ToV4Migrator.sol';
import {Callbacks} from '../base/Callbacks.sol';
import {Commands} from '../libraries/Commands.sol';
import {Lock} from './Lock.sol';
import {ERC20} from 'solmate/src/tokens/ERC20.sol';
Expand All @@ -18,7 +17,7 @@ import {ActionConstants} from '@uniswap/v4-periphery/src/libraries/ActionConstan

/// @title Decodes and Executes Commands
/// @notice Called by the UniversalRouter contract to efficiently decode and execute a singular command
abstract contract Dispatcher is Payments, V2SwapRouter, V3SwapRouter, V4SwapRouter, V3ToV4Migrator, Callbacks, Lock {
abstract contract Dispatcher is Payments, V2SwapRouter, V3SwapRouter, V4SwapRouter, V3ToV4Migrator, Lock {
using BytesLib for bytes;

error InvalidCommandType(uint256 commandType);
Expand Down
9 changes: 0 additions & 9 deletions test/foundry-tests/UniversalRouter.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {Payments} from '../../contracts/modules/Payments.sol';
import {Constants} from '../../contracts/libraries/Constants.sol';
import {Commands} from '../../contracts/libraries/Commands.sol';
import {MockERC20} from './mock/MockERC20.sol';
import {Callbacks} from '../../contracts/base/Callbacks.sol';
import {ExampleModule} from '../../contracts/test/ExampleModule.sol';
import {RouterParameters} from '../../contracts/base/RouterImmutables.sol';
import {ERC20} from 'solmate/src/tokens/ERC20.sol';
Expand All @@ -21,7 +20,6 @@ contract UniversalRouterTest is Test {
UniversalRouter router;
ExampleModule testModule;
MockERC20 erc20;
Callbacks callbacks;

function setUp() public {
RouterParameters memory params = RouterParameters({
Expand All @@ -38,7 +36,6 @@ contract UniversalRouterTest is Test {
router = new UniversalRouter(params);
testModule = new ExampleModule();
erc20 = new MockERC20();
callbacks = new Callbacks();
}

event ExampleModuleEvent(string message);
Expand Down Expand Up @@ -99,10 +96,4 @@ contract UniversalRouterTest is Test {
vm.expectRevert(Payments.InsufficientETH.selector);
router.execute(commands, inputs);
}

function testSupportsInterface() public {
bool supportsERC165 = callbacks.supportsInterface(type(IERC165).interfaceId);

assertEq(supportsERC165, true);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
exports[`Check Ownership Gas gas: balance check ERC20 1`] = `
Object {
"calldataByteLength": 356,
"gasUsed": 37731,
"gasUsed": 37701,
}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -3,48 +3,48 @@
exports[`Payments Gas Tests Individual Command Tests gas: SWEEP with ERC20 1`] = `
Object {
"calldataByteLength": 356,
"gasUsed": 37042,
"gasUsed": 37012,
}
`;

exports[`Payments Gas Tests Individual Command Tests gas: SWEEP_WITH_FEE 1`] = `
Object {
"calldataByteLength": 516,
"gasUsed": 65756,
"gasUsed": 65726,
}
`;

exports[`Payments Gas Tests Individual Command Tests gas: TRANSFER with ERC20 1`] = `
Object {
"calldataByteLength": 356,
"gasUsed": 36070,
"gasUsed": 36040,
}
`;

exports[`Payments Gas Tests Individual Command Tests gas: TRANSFER with ETH 1`] = `
Object {
"calldataByteLength": 356,
"gasUsed": 31635,
"gasUsed": 31605,
}
`;

exports[`Payments Gas Tests Individual Command Tests gas: UNWRAP_WETH 1`] = `
Object {
"calldataByteLength": 324,
"gasUsed": 44614,
"gasUsed": 44579,
}
`;

exports[`Payments Gas Tests Individual Command Tests gas: UNWRAP_WETH_WITH_FEE 1`] = `
Object {
"calldataByteLength": 644,
"gasUsed": 51041,
"gasUsed": 51006,
}
`;

exports[`Payments Gas Tests Individual Command Tests gas: WRAP_ETH 1`] = `
Object {
"calldataByteLength": 324,
"gasUsed": 53413,
"gasUsed": 53389,
}
`;
Loading

0 comments on commit 23944ab

Please sign in to comment.