Commit 4fe83770 by SylTi

Add Transfer event when token is minted to be fully ERC20 compliant &

tests
parent 115e7afe
...@@ -35,6 +35,7 @@ contract MintableToken is StandardToken, Ownable { ...@@ -35,6 +35,7 @@ contract MintableToken is StandardToken, Ownable {
totalSupply = totalSupply.add(_amount); totalSupply = totalSupply.add(_amount);
balances[_to] = balances[_to].add(_amount); balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount); Mint(_to, _amount);
Transfer(0x0, _to, _amount);
return true; return true;
} }
......
...@@ -23,8 +23,13 @@ contract('Mintable', function(accounts) { ...@@ -23,8 +23,13 @@ contract('Mintable', function(accounts) {
}); });
it('should mint a given amount of tokens to a given address', async function() { it('should mint a given amount of tokens to a given address', async function() {
await token.mint(accounts[0], 100); const result = await token.mint(accounts[0], 100);
assert.equal(result.logs[0].event, 'Mint');
assert.equal(result.logs[0].args.to.valueOf(), accounts[0]);
assert.equal(result.logs[0].args.amount.valueOf(), 100);
assert.equal(result.logs[1].event, 'Transfer');
assert.equal(result.logs[1].args.from.valueOf(), 0x0);
let balance0 = await token.balanceOf(accounts[0]); let balance0 = await token.balanceOf(accounts[0]);
assert(balance0, 100); assert(balance0, 100);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment