Skip to content

Commit 781f53f

Browse files
committed
change the way of burning util token
1 parent 6fab322 commit 781f53f

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/VotingPowerExchange.sol

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ contract VotingPowerExchange is AccessControl, EIP712 {
133133
burningTokenAmount = calculateIncrementedBurningAmount(incrementedVotingPower, currentVotingPower);
134134
}
135135

136+
// msg.sender send utilityToken to the sender
137+
// exchange role address need to approve this contract to transfer the utilityToken
138+
utilityToken.transferFrom(msg.sender, sender, burningTokenAmount);
136139
// burn utilityToken from the `sender`
137140
utilityToken.burnByBurner(sender, burningTokenAmount);
138141

test/fuzz/FuzzVotingPowerExchange.t.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ contract VotingPwoerExchangeTest is Test {
6464
utilityToken.mint(user, 1_000 * 1e18);
6565
utilityToken.mint(participant, 100_000 * 1e18);
6666
utilityToken.mint(participant2, 10_000 * 1e18);
67+
utilityToken.mint(exchanger, 10_000 * 1e18);
6768
vm.stopPrank();
6869

6970
// set the voting power cap to 99e18

0 commit comments

Comments
 (0)