Skip to content

Commit

Permalink
Add Transfer event to Burnable Token. (OpenZeppelin#735)
Browse files Browse the repository at this point in the history
  • Loading branch information
rstormsf authored and shrugs committed Feb 20, 2018
1 parent 9ea4bae commit 5ef8554
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions contracts/token/ERC20/BurnableToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ contract BurnableToken is BasicToken {
balances[burner] = balances[burner].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
Burn(burner, _value);
Transfer(burner, address(0), _value);
}
}
9 changes: 7 additions & 2 deletions test/token/BurnableToken.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,16 @@ contract('BurnableToken', function ([owner]) {

it('emits a burn event', async function () {
const { logs } = await this.token.burn(amount, { from });

assert.equal(logs.length, 1);
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
assert.equal(logs.length, 2);
assert.equal(logs[0].event, 'Burn');
assert.equal(logs[0].args.burner, owner);
assert.equal(logs[0].args.value, amount);

assert.equal(logs[1].event, 'Transfer');
assert.equal(logs[1].args.from, owner);
assert.equal(logs[1].args.to, ZERO_ADDRESS);
assert.equal(logs[1].args.value, amount);
});
});

Expand Down

0 comments on commit 5ef8554

Please sign in to comment.