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
79459625
Commit
79459625
authored
Nov 20, 2016
by
Arseniy Klempner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Inherit Ownable in Migrations and Killable. Fix naming convention.
parent
3caaaaff
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
18 deletions
+9
-18
Killable.sol
contracts/Killable.sol
+2
-2
Migrations.sol
contracts/Migrations.sol
+7
-16
No files found.
contracts/Killable.sol
View file @
79459625
...
@@ -6,7 +6,7 @@ import "./Ownable.sol";
...
@@ -6,7 +6,7 @@ import "./Ownable.sol";
* Base contract that can be killed by owner
* Base contract that can be killed by owner
*/
*/
contract Killable is Ownable {
contract Killable is Ownable {
function kill() {
function kill()
onlyOwner
{
if (msg.sender == owner)
selfdestruct(owner);
selfdestruct(owner);
}
}
}
}
contracts/Migrations.sol
View file @
79459625
pragma solidity ^0.4.4;
pragma solidity ^0.4.4;
contract Migrations {
contract Migrations is Ownable {
address public owner;
uint public lastCompletedMigration;
uint public last_completed_migration;
modifier restricted()
{
function setCompleted(uint completed) onlyOwner
{
if (msg.sender == owner) _
;
lastCompletedMigration = completed
;
}
}
function Migrations() {
function upgrade(address newAddress) onlyOwner {
owner = msg.sender;
Migrations upgraded = Migrations(newAddress);
}
upgraded.setCompleted(lastCompletedMigration);
function setCompleted(uint completed) restricted {
last_completed_migration = completed;
}
function upgrade(address new_address) restricted {
Migrations upgraded = Migrations(new_address);
upgraded.setCompleted(last_completed_migration);
}
}
}
}
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