Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: run fork test against mainnet deployment #345

Merged
merged 2 commits into from
Dec 7, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions tests/fork/Fork.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pragma solidity >=0.8.22;

import { IERC20Metadata } from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { SablierFlow } from "src/SablierFlow.sol";

import { Base_Test } from "../Base.t.sol";

Expand Down Expand Up @@ -37,11 +38,16 @@ abstract contract Fork_Test is Base_Test {
//////////////////////////////////////////////////////////////////////////*/

function setUp() public virtual override {
// Fork Ethereum Mainnet at a specific block number. The block number is for the `OCT_1_2024` date.
vm.createSelectFork({ blockNumber: 20_866_919, urlOrAlias: "mainnet" });
// Fork Ethereum Mainnet at a block number during the Sablier deployment.
smol-ninja marked this conversation as resolved.
Show resolved Hide resolved
vm.createSelectFork({ blockNumber: 21_330_577, urlOrAlias: "mainnet" });

// The base is set up after the fork is selected so that the base test contracts are deployed on the fork.
Base_Test.setUp();
// Load mainnet address of flow.
flow = SablierFlow(0x2D9221a63E12AA796619cb381Ec4A71b201281f5);
smol-ninja marked this conversation as resolved.
Show resolved Hide resolved

// Label the flow contract.
vm.label(address(flow), "Flow");

resetPrank(users.sender);
smol-ninja marked this conversation as resolved.
Show resolved Hide resolved

// Label the tokens.
for (uint256 i = 0; i < tokens.length; ++i) {
Expand Down
Loading