Skip to content

Commit

Permalink
add from param in DegenDeposit event
Browse files Browse the repository at this point in the history
  • Loading branch information
JoscelynFarr committed Mar 29, 2024
1 parent 4da616e commit 04548cf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/DegenDealer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ contract DegenDealer is Ownable {

using SafeERC20 for IERC20;

event DegenDeposit(address account, uint256 amount);
event DegenDeposit(address from, address to, uint256 amount);
event DegenTransferOut(address account, uint256 amount, uint256 id);
event DegenWithdraw(address account, uint256 amount, uint256 id);
event PositionFinalizeLog(
Expand All @@ -36,9 +36,9 @@ contract DegenDealer is Ownable {
jojoDealer = _jojoDealer;
}

function deposit(address account, uint256 amount) external {
function deposit(address from, address to, uint256 amount) external {
IERC20(primaryAsset).safeTransferFrom(msg.sender, address(this), amount);
emit DegenDeposit(account, amount);
emit DegenDeposit(from, to, amount);
}

function withdraw(address to, uint256 amount, uint256 id, bool isInternal) external onlyOwner {
Expand Down
5 changes: 2 additions & 3 deletions src/DegenDepositHelper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,10 @@ contract DegenDepositHelper is Ownable {
emit UpdateAdmin(admin, isValid);
}

function depositToDegenDealer(address from, address to) external onlyAdminWhiteList {
function depositToDegenDealer(address to) external onlyAdminWhiteList {
uint256 usdcBalance = IERC20(usdc).balanceOf(address(this));
require(usdcBalance > 0, "need to transfer usdc first");
IERC20(usdc).approve(degenDealer, usdcBalance);
DegenDealer(degenDealer).deposit(to, usdcBalance);
emit PerpDepositToDegen(from, to, usdcBalance);
DegenDealer(degenDealer).deposit(msg.sender, to, usdcBalance);
}
}

0 comments on commit 04548cf

Please sign in to comment.