Skip to content

Commit 131b61d

Browse files
authored
Merge pull request #23 from fei-protocol/POZ-Move-Incentives-After-Tx
Move Incentives to After Transfer
2 parents 7ea1712 + 6bfaec7 commit 131b61d

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

contracts/token/Fei.sol

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,9 @@ contract Fei is IFei, ERC20, ERC20Burnable, CoreRef {
5656
emit Burning(account, msg.sender, amount);
5757
}
5858

59-
function _beforeTokenTransfer(address from, address to, uint amount) internal override {
60-
// If not minting or burning
61-
if (from != address(0) && to != address(0)) {
62-
_checkAndApplyIncentives(from, to, amount);
63-
}
59+
function _transfer(address sender, address recipient, uint256 amount) internal override {
60+
super._transfer(sender, recipient, amount);
61+
_checkAndApplyIncentives(sender, recipient, amount);
6462
}
6563

6664
function _checkAndApplyIncentives(address sender, address recipient, uint amount) internal {

test/token/UniswapIncentive.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ describe('UniswapIncentive', function () {
270270
describe('Sell', function() {
271271
describe('not allowed seller', function() {
272272
it('reverts', async function() {
273+
await this.fei.mint(secondUserAddress, 1000000, {from: minterAddress});
273274
await expectRevert(this.fei.transfer(this.pair.address, 500000, {from: secondUserAddress}), "UniswapIncentive: Blocked Fei sender or operator");
274275
});
275276
});

0 commit comments

Comments
 (0)