feat: add connector to give back position to EOA

This commit is contained in:
Samarendra Gouda 2024-05-20 23:05:05 +05:30
parent 1a62787a04
commit c68a1f51f7
2 changed files with 17 additions and 2 deletions

View File

@ -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);
}

View File

@ -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 {