Deposit function lacks whitelisted token check
The deposit function in BridgeTokenFactory does not call _checkWhitelistedToken, allowing any token to be deposited regardless of whitelist status.
Description
The deposit function in the BridgeTokenFactory contract allows users to deposit tokens from the NEAR blockchain to the Ethereum blockchain. However, it has been identified that the function does not include a check to verify if the token being deposited is whitelisted.
Impact
Without a whitelisted token check, the deposit function allows the deposit of any token, regardless of its whitelisting status. This means that potentially malicious, unauthorized, or untrusted tokens can be deposited into the contract, compromising the integrity and security of the bridge ecosystem.
Even though proof is submitted through relayer, it is recommended to have this check on each chain.
Recommendation
Modify the deposit function to include a call to the _checkWhitelistedToken function before allowing the deposit of tokens.
Resolution
Acknowledged.

