From eeaea835908784c33ce35086977a3e2a0997958f Mon Sep 17 00:00:00 2001 From: Ana Julia Date: Tue, 20 Aug 2024 15:07:15 -0300 Subject: [PATCH] integration --- script/Constants.sol | 1 + script/Deploy.s.sol | 12 +++++++++--- test/Staking.integration.t.sol | 3 +++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/script/Constants.sol b/script/Constants.sol index 6765024..e718637 100644 --- a/script/Constants.sol +++ b/script/Constants.sol @@ -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; diff --git a/script/Deploy.s.sol b/script/Deploy.s.sol index 8d2191e..cac1e0d 100644 --- a/script/Deploy.s.sol +++ b/script/Deploy.s.sol @@ -35,6 +35,11 @@ contract Deploy is Script { ) ); + IERC20Metadata(STAKING_TOKEN).approve( + address(stakingProxy), + INITIAL_MINT + ); + stakingProxy.initialize( CONTRACT_OWNER, STAKING_TOKEN, @@ -43,8 +48,6 @@ contract Deploy is Script { MIN_STAKE ); - IERC20Metadata(STAKING_TOKEN).approve(address(stakingProxy), 1000e18); - DelegateStaking delegate = new DelegateStaking(); delegateProxy = DelegateStaking( address( @@ -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, diff --git a/test/Staking.integration.t.sol b/test/Staking.integration.t.sol index 9c88166..2998ce9 100644 --- a/test/Staking.integration.t.sol +++ b/test/Staking.integration.t.sol @@ -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();