File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ // SPDX-License-Identifier: MIT
2+ pragma solidity 0.8.26 ;
3+
4+ import {Script, console} from "forge-std/Script.sol " ;
5+ import {DevOpsTools} from "lib/foundry-devops/src/DevOpsTools.sol " ;
6+ import {IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol " ;
7+ import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol " ;
8+
9+ contract AddLinkTokenToSepoliaSender is Script {
10+ using SafeERC20 for IERC20 ;
11+
12+ uint256 constant AMOUNT = 3e18 ; // 3 LINK
13+ address constant SEPOLIA_LINK_ADDRESS =
14+ 0x779877A7B0D9E8603169DdbD7836e478b4624789 ;
15+
16+ function addLinkTokenToSepoliaSender (address mostRecentlyDeployed ) public {
17+ vm.startBroadcast ();
18+ IERC20 (SEPOLIA_LINK_ADDRESS).approve (mostRecentlyDeployed, AMOUNT);
19+ IERC20 (SEPOLIA_LINK_ADDRESS).safeTransfer (mostRecentlyDeployed, AMOUNT);
20+ vm.stopBroadcast ();
21+
22+ console.log ("Link token added to SepoliaSender. " );
23+ }
24+
25+ function run () public {
26+ address mostRecentlyDeployed = DevOpsTools.get_most_recent_deployment (
27+ "SepoliaSender " ,
28+ block .chainid
29+ );
30+ console.log ("Most recently deployed address: " , mostRecentlyDeployed);
31+
32+ addLinkTokenToSepoliaSender (mostRecentlyDeployed);
33+ }
34+ }
You can’t perform that action at this time.
0 commit comments