Skip to content

Commit

Permalink
fix: use deployed gating manager and whitelist address in Task0006
Browse files Browse the repository at this point in the history
  • Loading branch information
lacoop6tu committed Apr 16, 2024
1 parent 9e542b7 commit 0e8eab1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
11 changes: 6 additions & 5 deletions src/contracts/scripts/Task0006.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,26 @@
pragma solidity ^0.8.0;

import {ArbScript} from "scripts/utils/ArbScript.s.sol";
import {GatingManager} from "periphery/GatingManager.sol";
import {IGatingManager} from "periphery/IGatingManager.sol";

// solhint-disable no-empty-blocks, reason-string, state-visibility

contract Task0006 is ArbScript {
uint256 internal currentForkId;
address acc1 = 0x5a6B3E907b83DE2AbD9010509429683CF5ad5984;
address acc3 = 0x7BF50060a0C3EE0ba4073CF33E39a18304A7586E;

function payload0006() public returns (address) {
IGatingManager newManager = IGatingManager(0xaFF08b22E3583b2ad34cb2434DAbc39A754B828C);

function payload0006() public {
ArbScript.initialize();
if (currentForkId == 0) {
currentForkId = vm.createSelectFork("arbitrum");
}

broadcastWith(safe);
GatingManager newManager = new GatingManager(safe, address(kreskian), address(questForKresk), 1);
kresko.setGatingManager(address(newManager));
newManager.whitelist(acc1, true);
newManager.whitelist(acc3, true);

return address(newManager);
}
}
6 changes: 4 additions & 2 deletions src/contracts/test/Task0006.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ contract Task0006Test is Tested, Task0006 {
IGatingManager currentManager = IGatingManager(kresko.getGatingManager());
currentManager.phase().eq(1);
currentManager.isEligible(userNotElegible).eq(false);
currentManager.isEligible(acc1).eq(true);
currentManager.isEligible(acc3).eq(true);

prank(safe);
currentManager.setPhase(2);

currentManager.isEligible(userNotElegible).eq(false);
currentManager.isEligible(acc1).eq(true);
currentManager.isEligible(acc3).eq(true);

payload0006();

_grantRoleAndMintToUser();
Expand All @@ -43,10 +43,12 @@ contract Task0006Test is Tested, Task0006 {
IGatingManager newManager = IGatingManager(kresko.getGatingManager());
newManager.phase().eq(1);
newManager.isEligible(userNotElegible).eq(false);
newManager.isEligible(acc1).eq(true);
newManager.isEligible(acc3).eq(true);

newManager.setPhase(2);
newManager.isEligible(userNotElegible).eq(true);
newManager.isEligible(acc1).eq(true);
newManager.isEligible(acc3).eq(true);
}

Expand Down

0 comments on commit 0e8eab1

Please sign in to comment.