File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -182,6 +182,13 @@ contract DeployContracts is Script {
182182 utilityToken.grantRole (utilityToken.BURNER_ROLE (), address (votingPowerExchange));
183183 // give defender the exchanger role
184184 votingPowerExchange.grantRole (votingPowerExchange.EXCHANGER_ROLE (), defender);
185+
186+ // give exchanger some utility token
187+ utilityToken.mint (exchanger, 10_000 * 1e18 );
188+ // exchanger should approve the votingPowerExchange to spend the utility token
189+ // here exchanger is deployer so we do this directly
190+ // change this method when exchanger is not deployer
191+ utilityToken.approve (address (votingPowerExchange), 10_000 * 1e18 );
185192 vm.stopBroadcast ();
186193
187194 return DeploymentResult ({
Original file line number Diff line number Diff line change @@ -123,7 +123,6 @@ contract VotingPwoerExchangeTest is Test {
123123 }
124124
125125 function testExchangeWithAnyAmountWhichIsInRangeWillSucceed (uint256 amount ) public {
126-
127126 // mint 75240 utility token to the exchanger
128127 vm.startPrank (minter);
129128 utilityToken.mint (exchanger, 75240 * 1e18 );
Original file line number Diff line number Diff line change @@ -491,7 +491,7 @@ contract VotingPowerExchangeTest is Test {
491491 vm.prank (minter);
492492 // exchanger has already got 10_000 utility token
493493 utilityToken.mint (exchanger, 65_300 * 1e18 );
494- // approve
494+ // approve
495495 vm.startPrank (exchanger);
496496 utilityToken.approve (address (votingPowerExchange), 75_300 * 1e18 );
497497
You can’t perform that action at this time.
0 commit comments