From c8ade2d7e8215dab3bb32c8e20e8292b38073dff Mon Sep 17 00:00:00 2001 From: Jean-Grimal <83286814+Jean-Grimal@users.noreply.github.com> Date: Mon, 14 Oct 2024 15:50:11 +0200 Subject: [PATCH] test: setup --- foundry.toml | 3 +++ test/MorphoToken.t.sol | 18 ++++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/foundry.toml b/foundry.toml index 25b918f..3ce3272 100644 --- a/foundry.toml +++ b/foundry.toml @@ -3,4 +3,7 @@ src = "src" out = "out" libs = ["lib"] +[rpc_endpoints] +mainnet = "https://eth-mainnet.g.alchemy.com/v2/${ALCHEMY_KEY}" + # See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options diff --git a/test/MorphoToken.t.sol b/test/MorphoToken.t.sol index 5d288c6..7e66a2c 100644 --- a/test/MorphoToken.t.sol +++ b/test/MorphoToken.t.sol @@ -3,6 +3,9 @@ pragma solidity ^0.8.13; import {Test, console} from "forge-std/Test.sol"; import {MorphoToken} from "../src/MorphoToken.sol"; +import {Wrapper} from "../src/Wrapper.sol"; +import {ERC1967Proxy} from + "lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol"; // TODO: Test the following: // - Test every paths @@ -12,7 +15,18 @@ import {MorphoToken} from "../src/MorphoToken.sol"; // - Test voting // - Test delegation contract MorphoTokenTest is Test { - MorphoToken public token; + address public constant MORPHO_DAO = 0xcBa28b38103307Ec8dA98377ffF9816C164f9AFa; - function setUp() public {} + MorphoToken public tokenImplem; + MorphoToken public newMorpho; + ERC1967Proxy public tokenProxy; + Wrapper public wrapper; + + function setUp() public { + tokenImplem = new MorphoToken(); + tokenProxy = new ERC1967Proxy(address(tokenImplem), hex""); + wrapper = new Wrapper(address(tokenProxy)); + newMorpho = MorphoToken(payable(address(tokenProxy))); + newMorpho.initialize(MORPHO_DAO, address(wrapper)); + } }