Skip to content

Commit

Permalink
Fix audittens I07 (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
StanislavBreadless authored Nov 29, 2024
1 parent f54121e commit 5c11f85
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions l1-contracts/contracts/bridge/L1ERC20Bridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,7 @@ contract L1ERC20Bridge is IL1ERC20Bridge, ReentrancyGuard {
function _approveFundsToAssetRouter(address _from, IERC20 _token, uint256 _amount) internal returns (uint256) {
uint256 balanceBefore = _token.balanceOf(address(this));
_token.safeTransferFrom(_from, address(this), _amount);
bool success = _token.approve(address(L1_ASSET_ROUTER), _amount);
if (!success) {
revert ApprovalFailed();
}
_token.forceApprove(address(L1_ASSET_ROUTER), _amount);
uint256 balanceAfter = _token.balanceOf(address(this));

return balanceAfter - balanceBefore;
Expand Down

0 comments on commit 5c11f85

Please sign in to comment.