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
4fe83770
Commit
4fe83770
authored
Aug 02, 2017
by
SylTi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Transfer event when token is minted to be fully ERC20 compliant &
tests
parent
115e7afe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
MintableToken.sol
contracts/token/MintableToken.sol
+1
-0
MintableToken.js
test/MintableToken.js
+7
-2
No files found.
contracts/token/MintableToken.sol
View file @
4fe83770
...
...
@@ -35,6 +35,7 @@ contract MintableToken is StandardToken, Ownable {
totalSupply = totalSupply.add(_amount);
balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount);
Transfer(0x0, _to, _amount);
return true;
}
...
...
test/MintableToken.js
View file @
4fe83770
...
...
@@ -23,8 +23,13 @@ contract('Mintable', function(accounts) {
});
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
]);
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