File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,12 @@ import {BeaconProxy} from "@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol"
8
8
// interfaces
9
9
import {IRescueAirdrop} from "@src/interfaces/IRescueAirdrop.sol " ;
10
10
11
+ /**
12
+ * @title Rescue Airdrop Factory
13
+ * @author @apoorvlathey
14
+ *
15
+ * @notice Factory that deploys RescueAirdrop beacon proxies, by iterating the nonces.
16
+ */
11
17
contract RescueAirdropFactory is UpgradeableBeacon {
12
18
uint256 public proxyCount;
13
19
@@ -17,7 +23,13 @@ contract RescueAirdropFactory is UpgradeableBeacon {
17
23
address beaconImplementation
18
24
) UpgradeableBeacon (beaconImplementation) {}
19
25
20
- function deployNewProxy () external onlyOwner {
26
+ function deployNewProxies (uint256 count ) external {
27
+ for (uint256 i; i < count; i++ ) {
28
+ _deployNewProxy ();
29
+ }
30
+ }
31
+
32
+ function _deployNewProxy () internal {
21
33
address proxy = address (new BeaconProxy (address (this ), "" ));
22
34
IRescueAirdrop (proxy).__RescueAirdrop_init ();
23
35
Original file line number Diff line number Diff line change @@ -57,9 +57,7 @@ contract RescueAirdropTests is Test {
57
57
}
58
58
assertEq (address (rescueAidropFactory), NFTX_FACTORY);
59
59
60
- for (uint256 i; i <= factoryNonce; ++ i) {
61
- rescueAidropFactory.deployNewProxy ();
62
- }
60
+ rescueAidropFactory.deployNewProxies (factoryNonce + 1 );
63
61
64
62
uint256 preMFERBalance = IERC20 (MFER_AIRDROP_TOKEN).balanceOf (
65
63
FACTORY_DEPLOYER
You can’t perform that action at this time.
0 commit comments