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
475cb5dc
Commit
475cb5dc
authored
Nov 19, 2016
by
AugustoL
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed DelayedClaimable function and modifier
parent
85a4013f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
16 deletions
+16
-16
DelayedClaimable.sol
contracts/DelayedClaimable.sol
+8
-8
DelayedClaimble.js
test/DelayedClaimble.js
+8
-8
No files found.
contracts/DelayedClaimable.sol
View file @
475cb5dc
...
...
@@ -4,25 +4,25 @@ import './Claimable.sol';
/*
* DelayedClaimable
* Extension for the Claimable contract, where the ownership needs to be claimed before certain
time
* Extension for the Claimable contract, where the ownership needs to be claimed before certain
block number
*/
contract DelayedClaimable is Ownable, Claimable {
uint public claimBefore;
uint public claimBefore
Block
;
modifier
onTime() {
if (block.number < claimBefore)
modifier
claimBefore() {
if (block.number < claimBefore
Block
)
_;
}
function set
Delay(uint _claimBefore
) onlyOwner {
claimBefore
= _claimBefore
;
function set
ClaimBefore(uint _claimBeforeBlock
) onlyOwner {
claimBefore
Block = _claimBeforeBlock
;
}
function claimOwnership() onlyPendingOwner
onTim
e {
function claimOwnership() onlyPendingOwner
claimBefor
e {
owner = pendingOwner;
pendingOwner = 0x0;
claimBefore = 0;
claimBefore
Block
= 0;
}
}
test/DelayedClaimble.js
View file @
475cb5dc
...
...
@@ -11,13 +11,13 @@ contract('DelayedClaimable', function(accounts) {
var
newOwner
=
accounts
[
2
];
return
delayedClaimable
.
transfer
(
newOwner
)
.
then
(
function
(){
return
delayedClaimable
.
set
Delay
(
1000
)
return
delayedClaimable
.
set
ClaimBefore
(
1000
)
})
.
then
(
function
(){
return
delayedClaimable
.
claimBefore
();
return
delayedClaimable
.
claimBefore
Block
();
})
.
then
(
function
(
claimBefore
)
{
assert
.
isTrue
(
claimBefore
==
1000
);
.
then
(
function
(
claimBefore
Block
)
{
assert
.
isTrue
(
claimBefore
Block
==
1000
);
return
delayedClaimable
.
pendingOwner
();
})
.
then
(
function
(
pendingOwner
)
{
...
...
@@ -37,13 +37,13 @@ contract('DelayedClaimable', function(accounts) {
var
newOwner
=
accounts
[
1
];
return
delayedClaimable
.
transfer
(
newOwner
)
.
then
(
function
(){
return
delayedClaimable
.
set
Delay
(
1
)
return
delayedClaimable
.
set
ClaimBefore
(
1
)
})
.
then
(
function
(){
return
delayedClaimable
.
claimBefore
();
return
delayedClaimable
.
claimBefore
Block
();
})
.
then
(
function
(
claimBefore
)
{
assert
.
isTrue
(
claimBefore
==
1
);
.
then
(
function
(
claimBefore
Block
)
{
assert
.
isTrue
(
claimBefore
Block
==
1
);
return
delayedClaimable
.
pendingOwner
();
})
.
then
(
function
(
pendingOwner
)
{
...
...
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