-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* wip: borrowToken wrapper extension * wip: Trying credit delegation * testing * updated fork * fix: TokenBorrow working --------- Co-authored-by: Mark Hinschberger <foodaka@users.noreply.github.com>
- Loading branch information
1 parent
50f3eb7
commit d3784d0
Showing
5 changed files
with
151 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
/** | ||
* @title ICreditDelegationToken | ||
* @author Aave | ||
* @notice Defines the basic interface for a token supporting credit delegation. | ||
**/ | ||
interface ICreditDelegationToken { | ||
/** | ||
* @notice Delegates borrowing power to a user on the specific debt token. | ||
* Delegation will still respect the liquidation constraints (even if delegated, a | ||
* delegatee cannot force a delegator HF to go below 1) | ||
* @param delegatee The address receiving the delegated borrowing power | ||
* @param amount The maximum amount being delegated. | ||
**/ | ||
function approveDelegation(address delegatee, uint256 amount) external; | ||
|
||
/** | ||
* @notice Returns the borrow allowance of the user | ||
* @param fromUser The user to giving allowance | ||
* @param toUser The user to give allowance to | ||
* @return The current allowance of `toUser` | ||
**/ | ||
function borrowAllowance( | ||
address fromUser, | ||
address toUser | ||
) external view returns (uint256); | ||
|
||
/** | ||
* @notice Delegates borrowing power to a user on the specific debt token via ERC712 signature | ||
* @param delegator The delegator of the credit | ||
* @param delegatee The delegatee that can use the credit | ||
* @param value The amount to be delegated | ||
* @param deadline The deadline timestamp, type(uint256).max for max deadline | ||
* @param v The V signature param | ||
* @param s The S signature param | ||
* @param r The R signature param | ||
*/ | ||
function delegationWithSig( | ||
address delegator, | ||
address delegatee, | ||
uint256 value, | ||
uint256 deadline, | ||
uint8 v, | ||
bytes32 r, | ||
bytes32 s | ||
) external; | ||
} |
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