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
41fdd5d4
Commit
41fdd5d4
authored
Dec 15, 2016
by
qdeswaef
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes gh-109: resolve conflict between Ownable and ERC20 token.
parent
e859d53b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
Ownable.sol
contracts/Ownable.sol
+2
-2
Ownable.js
test/Ownable.js
+4
-4
No files found.
contracts/Ownable.sol
View file @
41fdd5d4
...
@@ -14,12 +14,12 @@ contract Ownable {
...
@@ -14,12 +14,12 @@ contract Ownable {
owner = msg.sender;
owner = msg.sender;
}
}
modifier onlyOwner() {
modifier onlyOwner() {
if (msg.sender == owner)
if (msg.sender == owner)
_;
_;
}
}
function transfer(address newOwner) onlyOwner {
function transfer
Ownership
(address newOwner) onlyOwner {
if (newOwner != address(0)) owner = newOwner;
if (newOwner != address(0)) owner = newOwner;
}
}
...
...
test/Ownable.js
View file @
41fdd5d4
...
@@ -12,7 +12,7 @@ contract('Ownable', function(accounts) {
...
@@ -12,7 +12,7 @@ contract('Ownable', function(accounts) {
it
(
"changes owner after transfer"
,
async
function
()
{
it
(
"changes owner after transfer"
,
async
function
()
{
let
other
=
accounts
[
1
];
let
other
=
accounts
[
1
];
let
transfer
=
await
ownable
.
transfer
(
other
);
let
transfer
=
await
ownable
.
transfer
Ownership
(
other
);
let
owner
=
await
ownable
.
owner
();
let
owner
=
await
ownable
.
owner
();
assert
.
isTrue
(
owner
===
other
);
assert
.
isTrue
(
owner
===
other
);
...
@@ -20,7 +20,7 @@ contract('Ownable', function(accounts) {
...
@@ -20,7 +20,7 @@ contract('Ownable', function(accounts) {
it
(
"should prevent non-owners from transfering"
,
async
function
()
{
it
(
"should prevent non-owners from transfering"
,
async
function
()
{
let
other
=
accounts
[
2
];
let
other
=
accounts
[
2
];
let
transfer
=
await
ownable
.
transfer
(
other
,
{
from
:
accounts
[
2
]});
let
transfer
=
await
ownable
.
transfer
Ownership
(
other
,
{
from
:
accounts
[
2
]});
let
owner
=
await
ownable
.
owner
();
let
owner
=
await
ownable
.
owner
();
assert
.
isFalse
(
owner
===
other
);
assert
.
isFalse
(
owner
===
other
);
...
@@ -29,9 +29,9 @@ contract('Ownable', function(accounts) {
...
@@ -29,9 +29,9 @@ contract('Ownable', function(accounts) {
it
(
"should guard ownership against stuck state"
,
async
function
()
{
it
(
"should guard ownership against stuck state"
,
async
function
()
{
let
ownable
=
Ownable
.
deployed
();
let
ownable
=
Ownable
.
deployed
();
let
originalOwner
=
await
ownable
.
owner
();
let
originalOwner
=
await
ownable
.
owner
();
let
transfer
=
await
ownable
.
transfer
(
null
,
{
from
:
originalOwner
});
let
transfer
=
await
ownable
.
transfer
Ownership
(
null
,
{
from
:
originalOwner
});
let
newOwner
=
await
ownable
.
owner
();
let
newOwner
=
await
ownable
.
owner
();
assert
.
equal
(
originalOwner
,
newOwner
);
assert
.
equal
(
originalOwner
,
newOwner
);
});
});
...
...
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