Skip to content

Commit

Permalink
integration
Browse files Browse the repository at this point in the history
  • Loading branch information
anajuliabit committed Aug 20, 2024
1 parent fb3c863 commit eeaea83
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions script/Constants.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ address constant CONTRACT_OWNER = 0x36bD3044ab68f600f6d3e081056F34f2a58432c4; //
uint256 constant MIN_STAKE = 50_000e18;
uint256 constant REWARD_RATE = 0.1333333333e18;
uint256 constant LOCK_PERIOD = 182 days;
uint256 constant INITIAL_MINT = 10_000e18;
12 changes: 9 additions & 3 deletions script/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ contract Deploy is Script {
)
);

IERC20Metadata(STAKING_TOKEN).approve(
address(stakingProxy),
INITIAL_MINT
);

stakingProxy.initialize(
CONTRACT_OWNER,
STAKING_TOKEN,
Expand All @@ -43,8 +48,6 @@ contract Deploy is Script {
MIN_STAKE
);

IERC20Metadata(STAKING_TOKEN).approve(address(stakingProxy), 1000e18);

DelegateStaking delegate = new DelegateStaking();
delegateProxy = DelegateStaking(
address(
Expand All @@ -56,7 +59,10 @@ contract Deploy is Script {
)
);

IERC20Metadata(STAKING_TOKEN).approve(address(delegateProxy), 1000e18);
IERC20Metadata(STAKING_TOKEN).approve(
address(delegateProxy),
INITIAL_MINT
);

delegateProxy.initialize(
CONTRACT_OWNER,
Expand Down
3 changes: 3 additions & 0 deletions test/Staking.integration.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ contract StakingIntegrationTest is Test {
function setUp() public {
vm.label(STAKING_TOKEN, "SHU");
vm.createSelectFork(vm.rpcUrl("mainnet"), 20254999);
(, address sender, ) = vm.readCallers();
console.log("sender", sender);
deal(STAKING_TOKEN, sender, INITIAL_MINT * 2);

Deploy deployScript = new Deploy();
(staking, rewardsDistributor, ) = deployScript.run();
Expand Down

0 comments on commit eeaea83

Please sign in to comment.