mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
raw function added
This commit is contained in:
parent
3af67589e8
commit
88c8a689c2
|
@ -3,7 +3,6 @@ pragma solidity ^0.7.0;
|
|||
contract Events {
|
||||
event LogDeposit(
|
||||
address indexed token,
|
||||
string tokenId,
|
||||
address cToken,
|
||||
uint256 tokenAmt,
|
||||
uint256 getId,
|
||||
|
|
|
@ -15,15 +15,15 @@ abstract contract CompoundResolver is Events, Helpers {
|
|||
* @param getId Get token amount at this ID from `InstaMemory` Contract.
|
||||
* @param setId Set token amount at this ID in `InstaMemory` Contract.
|
||||
*/
|
||||
function deposit(
|
||||
string calldata tokenId,
|
||||
function depositRaw(
|
||||
address token,
|
||||
address cToken,
|
||||
uint256 amt,
|
||||
uint256 getId,
|
||||
uint256 setId
|
||||
) external payable returns (string memory _eventName, bytes memory _eventParam) {
|
||||
) public payable returns (string memory _eventName, bytes memory _eventParam) {
|
||||
uint _amt = getUint(getId, amt);
|
||||
|
||||
(address token, address cToken) = compMapping.getMapping(tokenId);
|
||||
require(token != address(0) && cToken != address(0), "ctoken mapping not found");
|
||||
|
||||
enterMarket(cToken);
|
||||
|
@ -38,8 +38,18 @@ abstract contract CompoundResolver is Events, Helpers {
|
|||
}
|
||||
setUint(setId, _amt);
|
||||
|
||||
_eventName = "LogDeposit(address,string,address,uint256,uint256,uint256)";
|
||||
_eventParam = abi.encode(token, tokenId, cToken, _amt, getId, setId);
|
||||
_eventName = "LogDeposit(address,address,uint256,uint256,uint256)";
|
||||
_eventParam = abi.encode(token, cToken, _amt, getId, setId);
|
||||
}
|
||||
|
||||
function deposit(
|
||||
string calldata tokenId,
|
||||
uint256 amt,
|
||||
uint256 getId,
|
||||
uint256 setId
|
||||
) external payable returns (string memory _eventName, bytes memory _eventParam) {
|
||||
(address token, address cToken) = compMapping.getMapping(tokenId);
|
||||
(_eventName, _eventParam) = depositRaw(token, cToken, amt, getId, setId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue
Block a user