mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
Added Vault Transfer function
This commit is contained in:
parent
9dffaa5f6b
commit
395a98a640
|
@ -5,7 +5,7 @@ pragma solidity ^0.7.0;
|
|||
* @dev Collateralized Borrowing.
|
||||
*/
|
||||
|
||||
import { TokenInterface } from "../../common/interfaces.sol";
|
||||
import { TokenInterface, AccountInterface } from "../../common/interfaces.sol";
|
||||
import { Helpers } from "./helpers.sol";
|
||||
import { Events } from "./events.sol";
|
||||
import { VatLike, TokenJoinInterface } from "./interface.sol";
|
||||
|
@ -44,6 +44,29 @@ abstract contract MakerResolver is Helpers, Events {
|
|||
_eventParam = abi.encode(_vault, ilk);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Transfer Vault
|
||||
* @notice Transfer a MakerDAO Vault to "nextOwner"
|
||||
* @param vault Vault ID to close.
|
||||
* @param nextOwner Address of the next owner of the vault.
|
||||
*/
|
||||
function transfer(
|
||||
uint vault,
|
||||
address nextOwner
|
||||
) external payable returns (string memory _eventName, bytes memory _eventParam) {
|
||||
require(AccountInterface(address(this)).isAuth(nextOwner), "nextOwner-is-not-auth");
|
||||
|
||||
uint256 _vault = getVault(vault);
|
||||
(bytes32 ilk,) = getVaultData(_vault);
|
||||
|
||||
require(managerContract.owns(_vault) == address(this), "not-owner");
|
||||
|
||||
managerContract.give(_vault, nextOwner);
|
||||
|
||||
_eventName = "LogTransfer(uint256,bytes32,address)";
|
||||
_eventParam = abi.encode(_vault, ilk, nextOwner);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Deposit ETH/ERC20_Token Collateral.
|
||||
* @notice Deposit collateral to a MakerDAO vault
|
||||
|
|
Loading…
Reference in New Issue
Block a user