File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
Expand file tree Collapse file tree 1 file changed +36
-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 AddLinkTokenToAmoyTokenTransfer is Script {
10+ using SafeERC20 for IERC20 ;
11+
12+ uint256 constant AMOUNT = 16e18 ; // 16 LINK should be enough for the transfer
13+ address constant AMOY_LINK_ADDRESS =
14+ 0x0Fd9e8d3aF1aaee056EB9e802c3A762a667b1904 ;
15+
16+ function addLinkTokenToAmoyTokenTransfer (
17+ address mostRecentlyDeployed
18+ ) public {
19+ vm.startBroadcast ();
20+ IERC20 (AMOY_LINK_ADDRESS).approve (mostRecentlyDeployed, AMOUNT);
21+ IERC20 (AMOY_LINK_ADDRESS).safeTransfer (mostRecentlyDeployed, AMOUNT);
22+ vm.stopBroadcast ();
23+
24+ console.log ("Link token added to AmoyTokenTransfer. " );
25+ }
26+
27+ function run () public {
28+ address mostRecentlyDeployed = DevOpsTools.get_most_recent_deployment (
29+ "AmoyTokenTransfer " ,
30+ block .chainid
31+ );
32+ console.log ("Most recently deployed address: " , mostRecentlyDeployed);
33+
34+ addLinkTokenToAmoyTokenTransfer (mostRecentlyDeployed);
35+ }
36+ }
You can’t perform that action at this time.
0 commit comments