Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
openzeppelin-contracts-upgradeable
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
俞永鹏
openzeppelin-contracts-upgradeable
Commits
b972f435
Commit
b972f435
authored
Aug 11, 2017
by
Francisco Giordano
Committed by
GitHub
Aug 11, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #345 from SylTi/master
Add Transfer event when token is minted
parents
30d02b1c
4fe83770
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletions
+7
-1
MintableToken.sol
contracts/token/MintableToken.sol
+1
-0
MintableToken.js
test/MintableToken.js
+6
-1
No files found.
contracts/token/MintableToken.sol
View file @
b972f435
...
@@ -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;
}
}
...
...
test/MintableToken.js
View file @
b972f435
...
@@ -23,7 +23,12 @@ contract('Mintable', function(accounts) {
...
@@ -23,7 +23,12 @@ 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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment