Skip to content

Commit 56eb440

Browse files
author
ilitteri
committed
Update scripts
1 parent e5557d6 commit 56eb440

File tree

2 files changed

+35
-3
lines changed

2 files changed

+35
-3
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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+
}

claim_contracts/script/aligned_token/UpgradeAlignedTokenImplementation.s.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// SPDX-License-Identifier: MIT
22
pragma 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";
66
import "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";
77
import "forge-std/Script.sol";
8-
import {Utils} from "./Utils.sol";
8+
import {Utils} from "../Utils.sol";
99

1010
contract UpgradeAlignedTokenImplementation is Script {
1111
function run(

0 commit comments

Comments
 (0)