diff --git a/script/DeployContracts.s.sol b/script/DeployContracts.s.sol index 91b7bf2..4bb41cb 100644 --- a/script/DeployContracts.s.sol +++ b/script/DeployContracts.s.sol @@ -182,6 +182,13 @@ contract DeployContracts is Script { utilityToken.grantRole(utilityToken.BURNER_ROLE(), address(votingPowerExchange)); // give defender the exchanger role votingPowerExchange.grantRole(votingPowerExchange.EXCHANGER_ROLE(), defender); + + // give exchanger some utility token + utilityToken.mint(exchanger, 10_000 * 1e18); + // exchanger should approve the votingPowerExchange to spend the utility token + // here exchanger is deployer so we do this directly + // change this method when exchanger is not deployer + utilityToken.approve(address(votingPowerExchange), 10_000 * 1e18); vm.stopBroadcast(); return DeploymentResult({ diff --git a/test/fuzz/FuzzVotingPowerExchange.t.sol b/test/fuzz/FuzzVotingPowerExchange.t.sol index c51f81b..712aa43 100644 --- a/test/fuzz/FuzzVotingPowerExchange.t.sol +++ b/test/fuzz/FuzzVotingPowerExchange.t.sol @@ -123,7 +123,6 @@ contract VotingPwoerExchangeTest is Test { } function testExchangeWithAnyAmountWhichIsInRangeWillSucceed(uint256 amount) public { - // mint 75240 utility token to the exchanger vm.startPrank(minter); utilityToken.mint(exchanger, 75240 * 1e18); diff --git a/test/integration/VotingPowerExchange.t.sol b/test/integration/VotingPowerExchange.t.sol index 73fd2d9..212267e 100644 --- a/test/integration/VotingPowerExchange.t.sol +++ b/test/integration/VotingPowerExchange.t.sol @@ -491,7 +491,7 @@ contract VotingPowerExchangeTest is Test { vm.prank(minter); // exchanger has already got 10_000 utility token utilityToken.mint(exchanger, 65_300 * 1e18); - // approve + // approve vm.startPrank(exchanger); utilityToken.approve(address(votingPowerExchange), 75_300 * 1e18);