changed owned to controlled

This commit is contained in:
Ricardo Guilherme Schmidt
2017-05-19 21:12:11 -03:00
parent 3d70349e19
commit 9fefe9cdf7
10 changed files with 30 additions and 31 deletions
+2 -2
View File
@@ -1,8 +1,8 @@
import "Owned.sol";
import "Controlled.sol";
pragma solidity ^0.4.11;
contract BountyBank is Owned {
contract BountyBank is Controlled {
enum State {CLOSED, OPEN, CLAIMED}
+17
View File
@@ -0,0 +1,17 @@
pragma solidity ^0.4.11;
contract Controlled {
/// @notice The address of the controller is the only address that can call
/// a function with this modifier
modifier onlyController { if (msg.sender != controller) throw; _; }
address public controller;
function Controlled() { controller = msg.sender;}
/// @notice Changes the controller of the contract
/// @param _newController The new controller of the contract
function changeController(address _newController) onlyController {
controller = _newController;
}
}
+2 -2
View File
@@ -3,13 +3,13 @@
* Abstract Logic for GitHubOracle Registries.
* Ricardo Guilherme Schmidt <3esmit@gmail.com>
*/
import "Owned.sol";
import "Controlled.sol";
import "oraclizeAPI_0.4.sol";
import "strings.sol";
pragma solidity ^0.4.11;
contract GitHubAPIReg is Owned, usingOraclize {
contract GitHubAPIReg is Controlled, usingOraclize {
using strings for string;
using strings for strings.slice;
+2 -2
View File
@@ -14,14 +14,14 @@
*/
import "oraclizeAPI_0.4.sol";
import "Owned.sol";
import "Controlled.sol";
import "./GitHubUserReg.sol";
import "./GitHubRepositoryReg.sol";
import "./GitHubPoints.sol";
pragma solidity ^0.4.11;
contract GitHubOracle is Owned, DGitI {
contract GitHubOracle is Controlled, DGitI {
GitHubUserReg public userReg;
GitHubRepositoryReg public repositoryReg;
+2 -2
View File
@@ -1,5 +1,5 @@
import "oraclizeAPI_0.4.sol";
import "Owned.sol";
import "Controlled.sol";
import "strings.sol";
pragma solidity ^0.4.11;
@@ -13,7 +13,7 @@ contract DGitI {
function __setIssuePoints(uint256 projectId, uint256 issueId, uint256 userId, uint256 points);
}
contract GitHubPoints is Owned, usingOraclize{
contract GitHubPoints is Controlled, usingOraclize{
using strings for string;
using strings for strings.slice;
+2 -2
View File
@@ -14,13 +14,13 @@
*/
import "CollaborationBank.sol";
import "Owned.sol";
import "Controlled.sol";
import "./BountyBank.sol";
import "./GitRepositoryToken.sol";
pragma solidity ^0.4.11;
contract GitRepositoryI is Owned{
contract GitRepositoryI is Controlled{
function claim(address _user, uint _total) returns (bool) ;
function setBounty(uint256 _issueId, bool _state, uint256 _closedAt);
function setBountyPoints(uint256 _issueId, address _claimer, uint256 _points);
+1 -1
View File
@@ -14,7 +14,7 @@
*/
import "LockerToken.sol";
import "Owned.sol";
import "Controlled.sol";
pragma solidity ^0.4.11;
-2
View File
@@ -1,5 +1,3 @@
import "./Owned.sol";
pragma solidity ^0.4.11;
contract Lockable {
+2 -1
View File
@@ -7,10 +7,11 @@
import "./AbstractToken.sol";
import "Lockable.sol";
import "Controlled.sol";
pragma solidity ^0.4.11;
contract LockerToken is AbstractToken, Lockable, Owned {
contract LockerToken is AbstractToken, Lockable, Controlled {
Lockable public locker = this;
function unlinkLocker() only_owner {
-17
View File
@@ -1,17 +0,0 @@
pragma solidity ^0.4.11;
contract Owned {
address public owner= msg.sender;
event NewOwner(address owner);
modifier only_owner {
if (msg.sender != owner) throw;
_;
}
function setOwner(address _owner)
only_owner {
owner = _owner;
NewOwner(_owner);
}
}