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
77e73221
Commit
77e73221
authored
Dec 15, 2016
by
qdeswaef
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Also change claimable to avoid conflicts with ERC20 tokens
parent
41fdd5d4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
Claimable.sol
contracts/Claimable.sol
+3
-3
Claimable.js
test/Claimable.js
+4
-4
No files found.
contracts/Claimable.sol
View file @
77e73221
...
...
@@ -7,8 +7,8 @@ import './Ownable.sol';
/*
* Claimable
*
* Extension for the Ownable contract, where the ownership needs to be claimed. This allows the new owner to accept the transfer.
*
* Extension for the Ownable contract, where the ownership needs to be claimed. This allows the new owner to accept the transfer.
*/
contract Claimable is Ownable {
address public pendingOwner;
...
...
@@ -18,7 +18,7 @@ contract Claimable is Ownable {
_;
}
function transfer(address newOwner) onlyOwner {
function transfer
Ownership
(address newOwner) onlyOwner {
pendingOwner = newOwner;
}
...
...
test/Claimable.js
View file @
77e73221
...
...
@@ -12,7 +12,7 @@ contract('Claimable', function(accounts) {
it
(
"changes pendingOwner after transfer"
,
async
function
()
{
let
newOwner
=
accounts
[
1
];
let
transfer
=
await
claimable
.
transfer
(
newOwner
);
let
transfer
=
await
claimable
.
transfer
Ownership
(
newOwner
);
let
pendingOwner
=
await
claimable
.
pendingOwner
();
assert
.
isTrue
(
pendingOwner
===
newOwner
);
...
...
@@ -21,12 +21,12 @@ contract('Claimable', function(accounts) {
it
(
"should prevent to claimOwnership from no pendingOwner"
,
async
function
()
{
let
claimedOwner
=
await
claimable
.
claimOwnership
({
from
:
accounts
[
2
]});
let
owner
=
await
claimable
.
owner
();
assert
.
isTrue
(
owner
!=
accounts
[
2
]);
});
it
(
"should prevent non-owners from transfering"
,
async
function
()
{
let
transfer
=
await
claimable
.
transfer
(
accounts
[
2
],
{
from
:
accounts
[
2
]});
let
transfer
=
await
claimable
.
transfer
Ownership
(
accounts
[
2
],
{
from
:
accounts
[
2
]});
let
pendingOwner
=
await
claimable
.
pendingOwner
();
assert
.
isFalse
(
pendingOwner
===
accounts
[
2
]);
...
...
@@ -37,7 +37,7 @@ contract('Claimable', function(accounts) {
beforeEach
(
async
function
()
{
newOwner
=
accounts
[
1
];
await
claimable
.
transfer
(
newOwner
);
await
claimable
.
transfer
Ownership
(
newOwner
);
});
it
(
"changes allow pending owner to claim ownership"
,
async
function
()
{
...
...
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