...
import {ASDUSDC} from "./asdUSDC.sol";
+import {console} from "hardhat/console.sol";
...
    function _swapOFTForNote(address _oftAddress, uint _amount, uint _minAmountNote) internal returns (uint, bool) {
         ...
+        console.log("balance:", ASDUSDC(asdUSDC).balanceOf(address(this)));
+        console.log("allowance:", ASDUSDC(asdUSDC).allowance(address(this), crocSwapAddress));
        // swap is good to make, use call just in case revert occurs
        (bool successSwap, bytes memory data) = crocSwapAddress.call(abi.encodeWithSelector(ICrocSwapDex.swap.selector, baseToken, quoteToken, ambientPoolIdx, !isNoteBase, !isNoteBase, amountConverted, 0, 0, uintMinAmount, 0));
...
      ASDRouter
         lzCompose: invalid payload
         lzCompose: invalid payload with gas
         lzCompose: not whitelisted
         lzCompose: not whitelisted with gas
         lzCompose: bad swap
         lzCompose: bad swap with gas
    balance: 100000000000000000000
    allowance: 0
         lzCompose: insufficient send fee
    balance: 100000000000000000000
    allowance: 0
         lzCompose: insufficient send fee with gas
    balance: 100000000000000000000
    allowance: 0
         lzCompose: successful deposit and send on canto

      ASDUSDC
         should set whitelist for correct contract addresses
         should deposit whitelisted usdc versions for asdUSDC
         should withdraw whitelisted usdc versions for asdUSDC
         should recover USDC tokens sent to the contract
...
    networks: {
+       hardhat: {
+           forking: {
+             url: "https://canto-rpc.ansybl.io/",
+             blockNumber: 8977374,
+           },
+           chainId: 7700,
+       },
...
const { expect } = require("chai");
const { ethers } = require("hardhat");
const hre = require("hardhat");

describe("Dex", function () {
    const dexAddress = "0x9290C893ce949FE13EF3355660d07dE0FB793618";
    const usdcAddress = "0x80b5a32E4F032B2a058b4F29EC95EEfEEB87aDcd";
    const cNoteAddress = "0xEe602429Ef7eCe0a13e4FfE8dBC16e101049504C";
    const usdcWhaleAddress = "0xfAc5EBD2b1b830806189FCcD0255DC9B174decbc";
    let dex;
    let usdc;
    let cNote;
    this.beforeEach(async () => {
        dex  = await hre.ethers.getContractAt("ICrocSwapDex", dexAddress);
        usdc = await hre.ethers.getContractAt("IERC20", usdcAddress);
        cNote = await hre.ethers.getContractAt("CErc20Interface", cNoteAddress);
    });

    it("User can only call DEX.swap() for cNote after call USDC.approve(dex)", async () => {
        await hre.network.provider.request({
            method: "hardhat_impersonateAccount",
            params: [usdcWhaleAddress],
        });
        whale = await ethers.getSigner(usdcWhaleAddress);
        let usdcBalanceBeforeSwap = await usdc.balanceOf(usdcWhaleAddress);
        await usdc.connect(whale).approve(dexAddress, 0);
        expect(await usdc.allowance(usdcWhaleAddress,dexAddress)).to.be.equal(0);
        //@audit-info swap failed due to zero allowance
        expect(dex.connect(whale).swap(
            usdcAddress,
            cNoteAddress,
            36000,
            true,
            true,
            2000000,
            0, 
            0,
            0, 
            0 
        )).to.be.reverted;
        //@audit-info user set the allowance for dex to 2000000
        await usdc.connect(whale).approve(dexAddress, 2000000);
        expect(await usdc.allowance(usdcWhaleAddress,dexAddress)).to.be.equal(2000000);
        swapTx = await dex.connect(whale).swap(
            usdcAddress, 
            cNoteAddress,
            36000,
            true,
            true, 
            2000000,
            0,
            ethers.parseEther("10000000000"),
            0,
            0
        );
        await swapTx.wait();
        let usdcBalanceAfterSwap = await usdc.balanceOf(usdcWhaleAddress);
        let usedUSDC = usdcBalanceBeforeSwap - usdcBalanceAfterSwap;
        //@audit-info swap succeeded and 2000000 of USDC was tranferred from user
        expect(usedUSDC).to.be.equal(2000000);
    });
});
    constructor(address _noteAddress, uint32 _cantoLzEID, address _crocSwapAddress, address _crocImpactAddress, address _asdUSDCAddress) {
        noteAddress = _noteAddress;
        cantoLzEID = _cantoLzEID;
        crocSwapAddress = _crocSwapAddress;
        crocImpactAddress = _crocImpactAddress;
        asdUSDC = _asdUSDCAddress;
+       ASDUSDC(asdUSDC).approve(crocSwapAddress, type(uint).max);
    }
