Skip to content

Commit

Permalink
Fix after review
Browse files Browse the repository at this point in the history
  • Loading branch information
viatrix committed Dec 16, 2024
1 parent 04072c3 commit 823576a
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
JSON_RPC_PROVIDER=
USDC_OWNER_ADDRESS=
FORK_RPC_PROVIDER=https://eth-mainnet.g.alchemy.com/v2/demo
USDC_OWNER_ADDRESS=0x7713974908Be4BEd47172370115e8b1219F4A5f0
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ node_modules
ignition/deployments/chain-31337

.openzeppelin

.vscode
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
}
}
4 changes: 2 additions & 2 deletions contracts/SwapAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ contract SwapAdapter is AccessControl {

IWETH(_weth).withdraw(IERC20(_weth).balanceOf(address(this)));
vars.ERC20HandlerAddress = _bridge._resourceIDToHandlerAddress(vars.resourceID);
IERC20(token).approve(address(vars.ERC20HandlerAddress), amountOut);
IERC20(token).forceApprove(address(vars.ERC20HandlerAddress), amountOut);
_bridge.deposit{value: vars.fee}(destinationDomainID, vars.resourceID, vars.depositData, "");

// Return unspent native currency to msg.sender
Expand Down Expand Up @@ -398,7 +398,7 @@ contract SwapAdapter is AccessControl {
IWETH(_weth).withdraw(IERC20(_weth).balanceOf(address(this)));

vars.ERC20HandlerAddress = _bridge._resourceIDToHandlerAddress(vars.resourceID);
IERC20(token).approve(address(vars.ERC20HandlerAddress), amountOut);
IERC20(token).forceApprove(address(vars.ERC20HandlerAddress), amountOut);
_bridge.deposit{value: vars.fee}(destinationDomainID, vars.resourceID, vars.depositData, "");

// Return unspent native currency to msg.sender
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IPermit2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ interface IPermit2 {
/// @dev The packed allowance also holds a nonce, which will stay unchanged in approve
/// @dev Setting amount to type(uint160).max sets an unlimited approval
function approve(address token, address spender, uint160 amount, uint48 expiration) external;
}
}
2 changes: 1 addition & 1 deletion contracts/interfaces/IUniversalRouter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ interface IUniversalRouter {
/// @param inputs An array of byte strings containing abi encoded inputs for each command
/// @param deadline The deadline by which the transaction must be executed
function execute(bytes calldata commands, bytes[] calldata inputs, uint256 deadline) external payable;
}
}
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ export default [...compat.extends("eslint:recommended"), {
quotes: ["error", "double"],
semi: "off",
},
}];
}];
2 changes: 1 addition & 1 deletion hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import dotenv from "dotenv";
dotenv.config();

const mainnetFork = {
url: `${process.env.JSON_RPC_PROVIDER}`,
url: `${process.env.FORK_RPC_PROVIDER}`,
};

const config: HardhatUserConfig = {
Expand Down

0 comments on commit 823576a

Please sign in to comment.