-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* test: refactor changePrank with resetPrank test: update blockNumber in createSelectFork * feat: new interfaces to support Blast assets * test: add mock assets for integration tests * test: update precompiles * refactor: BlastGovernor function names * build: update bun lockfile * refactor: reorder struct to match v1.1.1 * fix: configure ERC20 yield to Claimable * refactor: SablierV2Blast contract * test: integration and fork tests for Blast configuration * ci: add fork test for Blast * refactor: avoid configuring yield in MerkleStreamer constructor test: add test_ConstructorWhen_RebasingAsset test: update mock contracts * build: update lockfile * test: update precompile test: polish tests * test: use mint for funding addresses with rebasing asset * test: removed BWETH forked asset * test: remove redundant tests * test: update mainnet details * test: add core mainnet addresses * test: remove BlastMock
- Loading branch information
1 parent
730566c
commit 62cb598
Showing
18 changed files
with
117 additions
and
55 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
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
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
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 was deleted.
Oops, something went wrong.
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
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,64 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity >=0.8.22; | ||
|
||
import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | ||
|
||
import { IERC20Rebasing, YieldMode } from "@sablier/v2-core/src/interfaces/blast/IERC20Rebasing.sol"; | ||
|
||
/// @dev The following mock contract is inspired from Blast repository | ||
/// https://github.com/blast-io/blast/blob/master/blast-optimism/packages/contracts-bedrock/src/L2/ERC20Rebasing.sol | ||
/// https://github.com/blast-io/blast/blob/master/blast-optimism/packages/contracts-bedrock/src/L2/Shares.sol | ||
/// https://github.com/blast-io/blast/blob/master/blast-optimism/packages/contracts-bedrock/src/L2/USDB.sol | ||
contract ERC20RebasingMock is ERC20("ERC20Rebasing Mock", "REB-MOCK"), IERC20Rebasing { | ||
mapping(address account => uint256 amount) private _claimable; | ||
mapping(address account => YieldMode mode) private _yieldMode; | ||
|
||
// Bool to handle default yield modes | ||
bool private isYieldSet; | ||
|
||
function addValue(uint256 value) external { } | ||
|
||
function bridge() external view returns (address) { } | ||
|
||
function getClaimableAmount(address account) public view override returns (uint256 amount) { | ||
require(getConfiguration(account) == YieldMode.CLAIMABLE, "ERC20RebasingMock: not claimable"); | ||
|
||
return _claimable[account]; | ||
} | ||
|
||
function getConfiguration(address account) public view override returns (YieldMode) { | ||
if (!isYieldSet) { | ||
return YieldMode.AUTOMATIC; | ||
} | ||
return _yieldMode[account]; | ||
} | ||
|
||
function claim(address recipient, uint256 amount) public override returns (uint256 claimed) { | ||
require(recipient != address(0), "ERC20RebasingMock: zero address"); | ||
require(getConfiguration(msg.sender) == YieldMode.CLAIMABLE, "ERC20RebasingMock: not claimable"); | ||
require(_claimable[msg.sender] >= amount, "ERC20RebasingMock: insufficient"); | ||
|
||
_claimable[msg.sender] -= amount; | ||
_mint(recipient, amount); | ||
|
||
return amount; | ||
} | ||
|
||
function configure(YieldMode yieldMode) public override returns (uint256) { | ||
_yieldMode[msg.sender] = yieldMode; | ||
return balanceOf(msg.sender); | ||
} | ||
|
||
function mint(address _to, uint256 _amount) external { } | ||
|
||
function price() external view returns (uint256) { } | ||
|
||
function REPORTER() public view returns (address) { } | ||
|
||
// Test helper function | ||
function setClaimableAmount(address account, uint256 amount) public { | ||
_claimable[account] = amount; | ||
} | ||
|
||
function symbol() public view override returns (string memory) { } | ||
} |