File tree Expand file tree Collapse file tree 2 files changed +35
-3
lines changed
Expand file tree Collapse file tree 2 files changed +35
-3
lines changed Original file line number Diff line number Diff line change 1+ // SPDX-License-Identifier: MIT
2+ pragma solidity ^ 0.8.19 ;
3+
4+ import "forge-std/Script.sol " ;
5+ import "@openzeppelin/contracts/token/ERC20/IERC20.sol " ;
6+
7+ contract ApproveERC20 is Script {
8+ function run (
9+ address tokenContractProxy ,
10+ address airdropContractProxy ,
11+ uint256 amounToClaim
12+ ) public {
13+ vm.startBroadcast ();
14+ (bool success , bytes memory data ) = address (tokenContractProxy).call (
15+ abi.encodeCall (
16+ IERC20 .approve,
17+ (address (airdropContractProxy), amounToClaim)
18+ )
19+ );
20+ bool approved;
21+ assembly {
22+ approved := mload (add (data, 0x20 ))
23+ }
24+
25+ if (! success || ! approved) {
26+ revert ("Failed to give approval to airdrop contract " );
27+ }
28+ vm.stopBroadcast ();
29+
30+ console.log ("Succesfully gave approval to airdrop contract " );
31+ }
32+ }
Original file line number Diff line number Diff line change 11// SPDX-License-Identifier: MIT
22pragma solidity ^ 0.8.19 ;
33
4- import "../src/AlignedTokenV1.sol " ;
5- import "../src/AlignedTokenV2Example.sol " ;
4+ import "../../ src/AlignedTokenV1.sol " ;
5+ import "../../ src/AlignedTokenV2Example.sol " ;
66import "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol " ;
77import "forge-std/Script.sol " ;
8- import {Utils} from "./Utils.sol " ;
8+ import {Utils} from ".. /Utils.sol " ;
99
1010contract UpgradeAlignedTokenImplementation is Script {
1111 function run (
You can’t perform that action at this time.
0 commit comments