Skip to content

Commit

Permalink
fix: CCIPInternal.sol
Browse files Browse the repository at this point in the history
  • Loading branch information
lufaque committed Apr 11, 2024
1 parent f82233c commit bcb025c
Show file tree
Hide file tree
Showing 3 changed files with 2,104 additions and 45 deletions.
4 changes: 2 additions & 2 deletions packages/hardhat/contracts/CCIPInternal.sol
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ contract CCIPInternal is CCIPReceiver, ICCIP {
IRouterClient router = IRouterClient(this.getRouter());
uint256 fees = router.getFee(_destinationChainSelector, evm2AnyMessage);

if (fees > address(s_linkToken).balance) {
revert NotEnoughBalance(address(s_linkToken).balance, fees);
if (fees > IERC20(s_linkToken).balanceOf(address(this))) {
revert NotEnoughBalance(IERC20(s_linkToken).balanceOf(address(this)), fees);
}

IERC20(_token).approve(address(router), _amount);
Expand Down
31 changes: 26 additions & 5 deletions packages/hardhat/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,34 @@ const config: HardhatUserConfig = {
// },
},
etherscan: {
apiKey: `${etherscanApiKey}`,
},
verify: {
etherscan: {
apiKey: `${etherscanApiKey}`,
apiKey: {
polygonMumbai: process.env.MUMBAI_SCAN_API_KEY,
avalancheFuji: "snowtrace",
},
customChains: [
{
network: "polygonMumbai",
chainId: 80001,
urls: {
apiURL: "https://api-testnet.polygonscan.com/api",
browserURL: "https://mumbai.polygonscan.com",
},
},
{
network: "avalancheFuji",
chainId: 43114,
urls: {
apiURL: "https://api.routescan.io/v2/network/mainnet/evm/43114/etherscan",
browserURL: "https://snowtrace.io",
},
},
],
},
// verify: {
// etherscan: {
// apiKey: `${etherscanApiKey}`,
// },
// },
sourcify: {
enabled: false,
},
Expand Down
Loading

0 comments on commit bcb025c

Please sign in to comment.