-
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.
- Loading branch information
Showing
9 changed files
with
143 additions
and
51 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
Submodule collateral
deleted from
ae76e3
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 |
---|---|---|
@@ -1,8 +1,5 @@ | ||
forge-std/=lib/forge-std/src/ | ||
@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/ | ||
@symbiotic/core/contracts/=lib/core/src/contracts/ | ||
@symbiotic/core/interfaces/=lib/core/src/interfaces/ | ||
@symbiotic/core/mocks/=lib/core/test/mocks/ | ||
@symbiotic/collateral/contracts/=lib/collateral/src/contracts/ | ||
@symbiotic/collateral/interfaces/=lib/collateral/src/interfaces/ | ||
@symbiotic/collateral/mocks/=lib/collateral/test/mocks/ | ||
@symbioticfi/core/src/contracts/=lib/core/src/contracts/ | ||
@symbioticfi/core/src/interfaces/=lib/core/src/interfaces/ | ||
@symbioticfi/core/test/mocks/=lib/core/test/mocks/ |
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,76 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.25; | ||
|
||
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; | ||
|
||
interface IDefaultCollateral is IERC20 { | ||
/** | ||
* @notice Get the collateral's underlying asset. | ||
* @return asset address of the underlying asset | ||
*/ | ||
function asset() external view returns (address); | ||
|
||
/** | ||
* @notice Get a maximum possible collateral total supply. | ||
* @return maximum collateral total supply | ||
*/ | ||
function limit() external view returns (uint256); | ||
|
||
/** | ||
* @notice Get an address of the limit increaser. | ||
* @return address of the limit increaser | ||
*/ | ||
function limitIncreaser() external view returns (address); | ||
|
||
/** | ||
* @notice Deposit a given amount of the underlying asset, and mint the collateral to a particular recipient. | ||
* @param recipient address of the collateral's recipient | ||
* @param amount amount of the underlying asset | ||
* @return amount of the collateral minted | ||
*/ | ||
function deposit(address recipient, uint256 amount) external returns (uint256); | ||
|
||
/** | ||
* @notice Deposit a given amount of the underlying asset using a permit functionality, and mint the collateral to a particular recipient. | ||
* @param recipient address of the collateral's recipient | ||
* @param amount amount of the underlying asset | ||
* @param deadline timestamp of the signature's deadline | ||
* @param v v component of the signature | ||
* @param r r component of the signature | ||
* @param s s component of the signature | ||
* @return amount of the collateral minted | ||
*/ | ||
function deposit( | ||
address recipient, | ||
uint256 amount, | ||
uint256 deadline, | ||
uint8 v, | ||
bytes32 r, | ||
bytes32 s | ||
) external returns (uint256); | ||
|
||
/** | ||
* @notice Withdraw a given amount of the underlying asset, and transfer it to a particular recipient. | ||
* @param recipient address of the underlying asset's recipient | ||
* @param amount amount of the underlying asset | ||
*/ | ||
function withdraw(address recipient, uint256 amount) external; | ||
|
||
/** | ||
* @notice Increase a limit of maximum collateral total supply. | ||
* @param amount amount to increase the limit by | ||
* @dev Called only by limitIncreaser. | ||
*/ | ||
function increaseLimit( | ||
uint256 amount | ||
) external; | ||
|
||
/** | ||
* @notice Set a new limit increaser. | ||
* @param limitIncreaser address of the new limit increaser | ||
* @dev Called only by limitIncreaser. | ||
*/ | ||
function setLimitIncreaser( | ||
address limitIncreaser | ||
) external; | ||
} |
13 changes: 13 additions & 0 deletions
13
src/interfaces/defaultCollateral/IDefaultCollateralFactory.sol
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: MIT | ||
pragma solidity 0.8.25; | ||
|
||
interface IDefaultCollateralFactory { | ||
/** | ||
* @notice Create a default collateral with a given asset. | ||
* @param asset address of the underlying asset | ||
* @param initialLimit initial limit for maximum collateral total supply | ||
* @param limitIncreaser address of the limit increaser (optional) | ||
* @return address of the created collateral | ||
*/ | ||
function create(address asset, uint256 initialLimit, address limitIncreaser) external returns (address); | ||
} |
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