mirror of
https://github.com/Instadapp/dsa-connectors-2.0.git
synced 2024-07-29 21:57:39 +00:00
feat: add connector to give back position to EOA
This commit is contained in:
parent
1a62787a04
commit
c68a1f51f7
|
@ -3,4 +3,5 @@ pragma solidity ^0.8.19;
|
|||
|
||||
contract Events {
|
||||
event LogTransferToFluid(uint256 indexed vault, bytes32 indexed ilk, address indexed fluidAddress);
|
||||
event LogTransferToEOA(uint256 indexed vault, bytes32 indexed ilk, address indexed owner);
|
||||
}
|
|
@ -11,14 +11,28 @@ contract MakerImport is Helpers, Events {
|
|||
uint256 _vault = getVault(vaultId);
|
||||
(bytes32 ilk,) = getVaultData(_vault);
|
||||
|
||||
require(managerContract.owns(_vault) == address(this), "not-owner");
|
||||
require(managerContract.owns(_vault) == msg.sender, "not-owner");
|
||||
|
||||
address fluidAddress = fluidWalletFactory.computeWallet(msg.sender);
|
||||
managerContract.give(_vault, fluidAddress);
|
||||
|
||||
_eventName = "LogTransferToAvo(uint256,bytes32,address)";
|
||||
_eventName = "LogTransferToFluid(uint256,bytes32,address)";
|
||||
_eventParam = abi.encode(_vault, ilk, fluidAddress);
|
||||
}
|
||||
|
||||
function transferMakerToEOA(
|
||||
uint256 vaultId
|
||||
) public payable returns (string memory _eventName, bytes memory _eventParam) {
|
||||
uint256 _vault = getVault(vaultId);
|
||||
(bytes32 ilk,) = getVaultData(_vault);
|
||||
|
||||
require(managerContract.owns(_vault) == address(this), "not-owner");
|
||||
|
||||
managerContract.give(_vault, msg.sender);
|
||||
|
||||
_eventName = "LogTransferToEOA(uint256,bytes32,address)";
|
||||
_eventParam = abi.encode(_vault, ilk, msg.sender);
|
||||
}
|
||||
}
|
||||
|
||||
contract ConnectV2FluidMakerImport is MakerImport {
|
||||
|
|
Loading…
Reference in New Issue
Block a user