Skip to content

Commit

Permalink
Fix/audit fixes (#1327)
Browse files Browse the repository at this point in the history
* Increased Delegate test coverage to 100%

* Implemented audit fixes

* Removed unused import
  • Loading branch information
smartcontrart authored Sep 9, 2024
1 parent f12798f commit dc22193
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 5 additions & 2 deletions source/delegate/contracts/Delegate.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ pragma solidity 0.8.23;

import "./interfaces/IDelegate.sol";
import "@airswap/swap-erc20/contracts/interfaces/ISwapERC20.sol";
import { ERC20 } from "solady/src/tokens/ERC20.sol";
import { Ownable } from "solady/src/auth/Ownable.sol";
import { SafeTransferLib } from "solady/src/utils/SafeTransferLib.sol";

Expand Down Expand Up @@ -129,7 +128,11 @@ contract Delegate is IDelegate, Ownable {
_senderAmount
);

ERC20(_senderToken).approve(address(swapERC20), _senderAmount);
SafeTransferLib.safeApprove(
_senderToken,
address(swapERC20),
_senderAmount
);

swapERC20.swapLight(
_nonce,
Expand Down
5 changes: 2 additions & 3 deletions source/delegate/contracts/interfaces/IDelegate.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ interface IDelegate {
error InvalidSignerAmount();
error ManagerInvalid();
error SenderInvalid();
error TransferFromFailed();

event Authorize(address signatory, address signer);
event DelegateSwap(uint256 nonce, address signerWallet);
Expand Down Expand Up @@ -64,7 +63,7 @@ interface IDelegate {

function unsetRule(
address sender,
address signerToken,
address senderToken
address senderToken,
address signerToken
) external;
}

0 comments on commit dc22193

Please sign in to comment.