Skip to content

Commit

Permalink
test: improve wrapper tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MathisGD committed Nov 7, 2024
1 parent 9e0c4cd commit dfd7cb2
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions test/MorphoTokenMigrationTest.sol → test/WrapperTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,26 @@ import {EncodeLib} from "./helpers/libraries/EncodeLib.sol";
import {IERC20} from
"../lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";

contract MorphoTokenEthereumMigrationTest is BaseTest {
contract WrapperTest is BaseTest {
address internal constant BUNDLER_ADDRESS = 0x4095F064B8d3c3548A3bebfd0Bbfd04750E30077;
address internal constant LEGACY_MORPHO = 0x9994E35Db50125E0DF82e4c2dde62496CE330999;

IMulticall internal bundler;
IERC20 internal legacyMorpho;
IMulticall internal bundler = IMulticall(0x4095F064B8d3c3548A3bebfd0Bbfd04750E30077);
IERC20 internal legacyMorpho = IERC20(0x9994E35Db50125E0DF82e4c2dde62496CE330999);

uint256 internal forkId;

bytes[] internal bundle;

function setUp() public virtual override {
super.setUp();

_fork();

vm.startPrank(MORPHO_DAO);
// Enable `transferFrom` on the legacy MORPHO token.
RolesAuthority(LEGACY_MORPHO).setPublicCapability(0x23b872dd, true);
// Enable `transfer` on the legacy MORPHO token.
RolesAuthority(LEGACY_MORPHO).setPublicCapability(0xa9059cbb, true);
RolesAuthority(LEGACY_MORPHO).setUserRole(address(wrapper), 0, true);
RolesAuthority(LEGACY_MORPHO).setUserRole(address(bundler), 0, true);
vm.stopPrank();

bundler = IMulticall(BUNDLER_ADDRESS);
legacyMorpho = IERC20(LEGACY_MORPHO);

super.setUp();
}

function _fork() internal virtual {
Expand Down Expand Up @@ -185,4 +180,6 @@ contract MorphoTokenEthereumMigrationTest is BaseTest {

interface RolesAuthority {
function setPublicCapability(bytes4 functionSig, bool enabled) external;
function setUserRole(address user, uint8 role, bool enabled) external;
function setRoleCapability(uint8 role, bytes4 functionSig, bool enabled) external;
}

0 comments on commit dfd7cb2

Please # to comment.