Skip to content

Commit

Permalink
refactor: update sepolia addresses from v2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
smol-ninja committed Jul 4, 2024
1 parent 4f877a8 commit 6bd7d0b
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 17 deletions.
3 changes: 1 addition & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export FOUNDRY_PROFILE="default"
export RPC_URL_MAINNET="YOUR_RPC_URL_MAINNET"
export RPC_URL_SEPOLIA="YOUR_RPC_URL_SEPOLIA"
Binary file modified bun.lockb
Binary file not shown.
9 changes: 4 additions & 5 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -23,5 +23,4 @@
wrap_comments = true

[rpc_endpoints]
localhost = "http://localhost:8545"
mainnet = "${RPC_URL_MAINNET}"
sepolia = "${RPC_URL_SEPOLIA}"
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/StreamCreator.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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) {
Expand Down
8 changes: 4 additions & 4 deletions test/StreamCreator.t.sol
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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;
Expand All @@ -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);
Expand All @@ -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
Expand Down

0 comments on commit 6bd7d0b

Please sign in to comment.