-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* test: New utility contracts: Defaults.sol, Types.sol Constants.sol test: Add constructor test test: Use constants from Defaults contract test: Replace StdUtils with PRBMathUtils test: Replace StdAssertions with PRBMathAssertions test: inherit Defaults in Base contract test: remove redundant variables * test: merge Defaults and Constants --------- Co-authored-by: andreivladbrg <andreivladbrg@gmail.com>
- Loading branch information
1 parent
be51f6f
commit b5f70b6
Showing
8 changed files
with
64 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity >=0.8.22; | ||
|
||
import { SablierV2OpenEnded } from "src/SablierV2OpenEnded.sol"; | ||
import { Integration_Test } from "./Integration.t.sol"; | ||
|
||
contract Constructor_Integration_Concrete_Test is Integration_Test { | ||
function test_Constructor() external { | ||
// Construct the contract. | ||
SablierV2OpenEnded constructedOpenEnded = new SablierV2OpenEnded(); | ||
|
||
uint256 actualStreamId = constructedOpenEnded.nextStreamId(); | ||
uint256 expectedStreamId = 1; | ||
assertEq(actualStreamId, expectedStreamId, "nextStreamId"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
pragma solidity >=0.8.22; | ||
|
||
abstract contract Constants { | ||
uint128 public constant DEPOSIT_AMOUNT = 50_000e18; | ||
uint128 public constant DEPOSIT_AMOUNT_WITH_FEE = 50_251.256281407035175879e18; // deposit + broker fee | ||
bool public constant IS_TRANFERABLE = true; | ||
uint40 internal constant MAY_1_2024 = 1_714_518_000; | ||
uint40 public immutable ONE_MONTH = 30 days; // "30/360" convention | ||
uint128 public constant ONE_MONTH_STREAMED_AMOUNT = 2592e18; // 86.4 * 30 | ||
uint128 public constant ONE_MONTH_REFUNDABLE_AMOUNT = DEPOSIT_AMOUNT - ONE_MONTH_STREAMED_AMOUNT; | ||
uint128 public constant RATE_PER_SECOND = 0.001e18; // 86.4 daily | ||
uint128 public constant REFUND_AMOUNT = 10_000e18; | ||
uint40 public immutable WARP_ONE_MONTH = MAY_1_2024 + ONE_MONTH; | ||
uint128 public constant WITHDRAW_AMOUNT = 2500e18; | ||
uint40 public immutable WITHDRAW_TIME = MAY_1_2024 + 2_500_000; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
pragma solidity >=0.8.22; | ||
|
||
struct Users { | ||
// Default stream broker. | ||
address payable broker; | ||
// Malicious user. | ||
address payable eve; | ||
// Default stream recipient. | ||
address payable recipient; | ||
// Default stream sender. | ||
address payable sender; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters