From 6bd7d0b78542638417bfb8a630f53e0fec2cc0e6 Mon Sep 17 00:00:00 2001 From: smol-ninja Date: Thu, 4 Jul 2024 20:16:28 +0100 Subject: [PATCH] refactor: update sepolia addresses from v2.2 --- .env.example | 3 +-- bun.lockb | Bin 42235 -> 42235 bytes foundry.toml | 9 ++++----- package.json | 8 ++++---- src/StreamCreator.sol | 4 ++-- test/StreamCreator.t.sol | 8 ++++---- 6 files changed, 15 insertions(+), 17 deletions(-) diff --git a/.env.example b/.env.example index 2277e3d..8ec2836 100644 --- a/.env.example +++ b/.env.example @@ -1,2 +1 @@ -export FOUNDRY_PROFILE="default" -export RPC_URL_MAINNET="YOUR_RPC_URL_MAINNET" +export RPC_URL_SEPOLIA="YOUR_RPC_URL_SEPOLIA" diff --git a/bun.lockb b/bun.lockb index d58daa9965a5d4a1acaeb6f6fb69136239ef9400..1ff1a62e93f9ac1a29e2751123bc3bc092815313 100755 GIT binary patch delta 523 zcmex;lIizJrU`lqKWv}9X@0)cV8y-3yw@7zX4xDK?t8Z(Yj5jIvy?;M_wU>2H;sLA z3a80r2@W1G9l;?mc?q}1^R>dXsU1A0yVsf896q;k@0q`Id)CW)vNCbnq#l2DEh0|n zm2A-T$-UYV_1pYTeKPuZY{9XeRedYZ-pt#$WBq42?i-W!`aBY}wKhGxxX&Od!hBoy z3b~@UX1>36Zs{!FB#l@OafWLFCQ(^+@#La8vJ6% z54C{rvs0(J#qWOm)urL*{4K`rL19;>2yC9J6YR-ss%J2HVVN|e@#Oq6ab_bRPq9o~ z8b|}(>kh=?z;F#_^9YbEe>anf5k)m&Rh##gt>k4in*4FG^5m`-X)sG^@`)A^pmm9D R@{|9xsDK=>S-JIwJOFV)*+~EZ delta 526 zcmex;lIizJrU`lqSLf=yUHaktucZB|Ggt1}Ai4dmqRJ%YABBz+BW5xk%38P4ZyNjL zC!(g4B{{e!rzo0Cj^GfOyn@4k*OQTf!GnRJfrWvAfphXhcJ0j`V{5uTf`FoY+r75nD3QD${~R@T6Kq?O4{>wSCuj{$?vR~vD|7(_>Gm1j=uFy zeqk74zhQR3?6^XXmB*{d7gF5?JXpe_09v1r-kUwq=5mYJ_E-z~4k z=(joE)g>aQXtJ%2gu{&Yn_f&?6=yonNIqd|YjN0n_Jog1<}j#7>jb+A&MR_Wy<7Ey z!Of?Ic^m%N)Ye_Pr^sn#{>)SCX_`M{^%N)8b(^Q^1bZ@@=vhu)SSHPAG&#RaoY_#% zXtH9NxU`|3A<(t%Kr9Xn+h8`20Lk)qGnp7sR0CBR;a9bJZ`n#-CPTf+jy(#K?OS*z iPiYZkG@N{)TXFL77SYKUyA>w?X;A^WVY71U4S4|D7Soad diff --git a/foundry.toml b/foundry.toml index bd61c9d..1b34e3a 100644 --- a/foundry.toml +++ b/foundry.toml @@ -3,12 +3,12 @@ [profile.default] auto_detect_solc = false bytecode_hash = "none" - emv_version = "paris" + evm_version = "shanghai" fuzz = { runs = 1_000 } optimizer = true - optimizer_runs = 10_000 + optimizer_runs = 5000 out = "out" - solc = "0.8.23" + solc = "0.8.26" src = "src" test = "test" @@ -23,5 +23,4 @@ wrap_comments = true [rpc_endpoints] - localhost = "http://localhost:8545" - mainnet = "${RPC_URL_MAINNET}" + sepolia = "${RPC_URL_SEPOLIA}" diff --git a/package.json b/package.json index a305d3e..9d977f9 100644 --- a/package.json +++ b/package.json @@ -10,10 +10,10 @@ "url": "https://github.com/sablier-labs/sablier-integration-template/issues" }, "dependencies": { - "@openzeppelin/contracts": "4.9.2", - "@prb/math": "4.0.2", - "@sablier/v2-core": "1.1.2", - "@sablier/v2-periphery": "1.1.1" + "@openzeppelin/contracts": "5.0.2", + "@prb/math": "4.0.3", + "@sablier/v2-core": "1.2.0", + "@sablier/v2-periphery": "1.2.0" }, "devDependencies": { "forge-std": "github:foundry-rs/forge-std#v1.8.1", diff --git a/src/StreamCreator.sol b/src/StreamCreator.sol index 94ac574..a77195a 100644 --- a/src/StreamCreator.sol +++ b/src/StreamCreator.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity >=0.8.19; +pragma solidity >=0.8.22; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { ud60x18 } from "@prb/math/src/UD60x18.sol"; @@ -9,7 +9,7 @@ import { Broker, LockupLinear } from "@sablier/v2-core/src/types/DataTypes.sol"; /// @title StreamCreator /// @dev This contract allows users to create Sablier streams using the Lockup Linear contract. contract StreamCreator { - IERC20 public constant DAI = IERC20(0x6B175474E89094C44Da98b954EedeAC495271d0F); + IERC20 public constant DAI = IERC20(0x68194a729C2450ad26072b3D33ADaCbcef39D574); ISablierV2LockupLinear public immutable SABLIER; constructor(ISablierV2LockupLinear sablier) { diff --git a/test/StreamCreator.t.sol b/test/StreamCreator.t.sol index 5c4f85d..93f4a28 100644 --- a/test/StreamCreator.t.sol +++ b/test/StreamCreator.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -pragma solidity >=0.8.19; +pragma solidity >=0.8.22; import { Test } from "forge-std/src/Test.sol"; import { ISablierV2LockupLinear } from "@sablier/v2-core/src/interfaces/ISablierV2LockupLinear.sol"; @@ -8,7 +8,7 @@ import { StreamCreator } from "../src/StreamCreator.sol"; contract StreamCreatorTest is Test { // Get the latest deployment address from the docs: https://docs.sablier.com/contracts/v2/deployments - address internal constant SABLIER_ADDRESS = address(0xAFb979d9afAd1aD27C5eFf4E27226E3AB9e5dCC9); + address internal constant SABLIER_ADDRESS = address(0x3E435560fd0a03ddF70694b35b673C25c65aBB6C); // Test contracts StreamCreator internal creator; @@ -17,7 +17,7 @@ contract StreamCreatorTest is Test { function setUp() public { // Fork Ethereum Mainnet - vm.createSelectFork({ blockNumber: 18_821_300, urlOrAlias: "mainnet" }); + vm.createSelectFork({ blockNumber: 6_239_031, urlOrAlias: "sepolia" }); // Load the Sablier contract from Ethereum Mainnet sablier = ISablierV2LockupLinear(SABLIER_ADDRESS); @@ -36,7 +36,7 @@ contract StreamCreatorTest is Test { vm.startPrank({ msgSender: user }); // Approve the creator contract to pull DAI tokens from the test user - creator.DAI().approve({ spender: address(creator), amount: 1337e18 }); + creator.DAI().approve({ spender: address(creator), value: 1337e18 }); } // Test that creating streams works by checking the stream ids