Skip to content

Commit

Permalink
Fixes to Beta (#1328)
Browse files Browse the repository at this point in the history
* Scripts enhancements (#1321)

* Added checks to validate target deployment address matches mainnet

* Added storing of commit hashes upon deployment to track deployed code

* Created script to populate the latest deploy commits

* Renamed deploy commits script for clarity

* Updated module declarations

* Removed script to populate hashes

* prompt language update

---------

Co-authored-by: Don Mosites <[email protected]>

* Bump micromatch from 4.0.5 to 4.0.8 (#1323)

Bumps [micromatch](https://github.com/micromatch/micromatch) from 4.0.5 to 4.0.8.
- [Release notes](https://github.com/micromatch/micromatch/releases)
- [Changelog](https://github.com/micromatch/micromatch/blob/master/CHANGELOG.md)
- [Commits](micromatch/micromatch@4.0.5...4.0.8)

---
updated-dependencies:
- dependency-name: micromatch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump axios from 1.6.7 to 1.7.7 (#1324)

Bumps [axios](https://github.com/axios/axios) from 1.6.7 to 1.7.7.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](axios/axios@v1.6.7...v1.7.7)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Increased Delegate test coverage to 100% (#1325)

* Fix/audit fixes (#1327)

* Increased Delegate test coverage to 100%

* Implemented audit fixes

* Removed unused import

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Smartcontrart <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Sep 10, 2024
1 parent b8243ac commit 76f125e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 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 @@ -152,8 +151,11 @@ contract Delegate is IDelegate, Ownable {
_senderAmount
);

// Approve the SwapERC20 contract to transfer the sender token
ERC20(_senderToken).approve(address(swapERC20), _senderAmount);
SafeTransferLib.safeApprove(
_senderToken,
address(swapERC20),
_senderAmount
);

// Execute the swap
swapERC20.swapLight(
Expand Down
4 changes: 2 additions & 2 deletions source/delegate/contracts/interfaces/IDelegate.sol
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ interface IDelegate {

function unsetRule(
address sender,
address signerToken,
address senderToken
address senderToken,
address signerToken
) external;
}
2 changes: 1 addition & 1 deletion source/delegate/test/Delegate.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ describe('Delegate Unit', () => {
it('the swapERC20Contract address cannot be address(0)', async () => {
await expect(
delegate.setSwapERC20Contract(ADDRESS_ZERO)
).to.be.revertedWith('InvalidAddress')
).to.be.revertedWith('AddressInvalid')
})

it('only the owner can set the swapERC20Contract address', async () => {
Expand Down

0 comments on commit 76f125e

Please sign in to comment.