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
78f6b4cc
Commit
78f6b4cc
authored
Nov 21, 2016
by
Manuel Aráoz
Committed by
GitHub
Nov 21, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #79 from adklempner/naming
Inherit Ownable in Migrations and Killable. Fix variable naming.
parents
fb0f9c05
79459625
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 @
78f6b4cc
...
...
@@ -6,7 +6,7 @@ import "./Ownable.sol";
* Base contract that can be killed by owner
*/
contract Killable is Ownable {
function kill() {
if (msg.sender == owner)
selfdestruct(owner);
function kill()
onlyOwner
{
selfdestruct(owner);
}
}
contracts/Migrations.sol
View file @
78f6b4cc
pragma solidity ^0.4.4;
contract Migrations {
address public owner;
uint public last_completed_migration;
contract Migrations is Ownable {
uint public lastCompletedMigration;
modifier restricted()
{
if (msg.sender == owner) _
;
function setCompleted(uint completed) onlyOwner
{
lastCompletedMigration = completed
;
}
function Migrations() {
owner = msg.sender;
}
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);
function upgrade(address newAddress) onlyOwner {
Migrations upgraded = Migrations(newAddress);
upgraded.setCompleted(lastCompletedMigration);
}
}
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