Skip to content
Permalink
Browse files

Apply Solium style fixes

  • Loading branch information...
maryokhin committed Nov 28, 2017
1 parent 5de3b87 commit c74a90187c1a2c1651e185e6abf14f32e4332b6d
@@ -0,0 +1 @@
node_modules
@@ -0,0 +1,20 @@
{
"extends": "solium:all",
"plugins": [
"security"
],
"rules": {
"quotes": [
"error",
"double"
],
"indentation": [
"error",
4
],
"arg-overflow": [
"warning",
3
]
}
}
@@ -15,11 +15,11 @@ import "./lib/Arithmetic.sol";
contract RocketDepositToken is ERC20, Ownable {

/**** Properties ***********/
string public constant SYMBOL = "RPD"; // Token symbol
string public constant NAME = "Rocket Pool Deposit"; // Token name
uint8 public constant DECIMALS = 18; // Decimal places

address private rocketHubAddress; // Address of the main RocketHub contract
string public constant symbol = "RPD"; // Token symbol
string public constant name = "Rocket Pool Deposit"; // Token name
uint8 public constant decimals = 18; // Decimal places
uint256 public totalSupply = 0; // Total supply
mapping(address => uint256) private balances; // Balances for each account
mapping(address => mapping (address => uint256)) private allowed; // Owner of account approves the transfer of an amount to another account
@@ -163,7 +163,7 @@ contract RocketDepositToken is ERC20, Ownable {
balances[_to] = balances[_to].add(_amount);
return true;
} else {
return false;
return false;
}
}

@@ -177,15 +177,14 @@ contract RocketDepositToken is ERC20, Ownable {
function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success) {
// Verify ok
if (balances[_from] >= _amount && allowed[_from][msg.sender] >= _amount && _amount > 0) {
balances[_from] = balances[_from].sub(_amount);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount);
balances[_to] = balances[_to].add(_amount);
return true;
} else {
return false;
}
balances[_from] = balances[_from].sub(_amount);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount);
balances[_to] = balances[_to].add(_amount);
return true;
} else {
return false;
}

}

/**
* @dev Allow _spender to withdraw from your account, multiple times, up to the _value amount. If this function is called again it overwrites the current allowance with _value.
@@ -12,6 +12,7 @@ import "./interface/RocketStorageInterface.sol";
/// @title Where we build the rockets! New contracts created by Rocket Pool are done here so they can be tracked.
/// @author David Rugendyke


contract RocketFactory is Ownable {

/**** Properties ***********/
@@ -55,7 +56,6 @@ contract RocketFactory is Ownable {
rocketStorage = RocketStorageInterface(_rocketStorageAddress);
}


/// @dev Create a new RocketPoolMini contract, deploy to the etherverse and return the address to the caller
/// @dev Note that the validation and logic for creation should be done in the calling contract
/// @param _miniPoolStakingDuration The staking duration for the mini pool
@@ -10,6 +10,7 @@ import "./interface/RocketPoolInterface.sol";
/// @title The Rocket Smart Node contract - more methods for nodes will be moved from RocketPool to here when metropolis is released
/// @author David Rugendyke


contract RocketNode is Ownable {

/**** Properties ***********/
@@ -88,7 +89,6 @@ contract RocketNode is Ownable {
nodeMinWei = 5 ether;
}


/*** Getters *************/

/// @dev Returns the amount of registered rocket nodes
@@ -132,7 +132,6 @@ contract RocketNode is Ownable {
}
}


/*** Setters *************/

/// @dev Set the min eth required for a node to be registered
@@ -159,7 +158,6 @@ contract RocketNode is Ownable {
rocketStorage.setBool(keccak256("node.active", _nodeAddress), _activeStatus);
}


/*** Methods ************/

/// @dev Register a new node address if it doesn't exist, only the contract creator can do this
@@ -195,8 +193,6 @@ contract RocketNode is Ownable {
return true;
}



/// @dev Remove a node from the Rocket Pool network
/// @param _nodeAddress Address of the node
function nodeRemove(address _nodeAddress) public onlyRegisteredNode(_nodeAddress) onlyOwner {
@@ -229,7 +225,6 @@ contract RocketNode is Ownable {
NodeRemoved(_nodeAddress, now);
}


/// @dev Nodes will checkin with Rocket Pool at a set interval (15 mins) to do things like report on average node server load, set nodes to inactive that have not checked in an unusally long amount of time etc. Only registered nodes can call this.
/// @param _currentLoadAverage The average server load for the node over the last 15 mins
function nodeCheckin(uint256 _currentLoadAverage) public onlyRegisteredNode(msg.sender) {
@@ -267,5 +262,4 @@ contract RocketNode is Ownable {
}
}
}

}
@@ -90,7 +90,6 @@ contract RocketPartnerAPI is Ownable {
_;
}


/*** Constructor *************/

/// @dev rocketNode constructor
@@ -101,7 +100,6 @@ contract RocketPartnerAPI is Ownable {
version = 1;
}


/*** Getters *************/

/// @dev Returns the amount of registered rocket nodes
@@ -114,14 +112,12 @@ contract RocketPartnerAPI is Ownable {
return rocketStorage.getUint(keccak256("partner.index", _partnerAddress));
}


/// @dev Get the address to deposit to with Rocket Pool
function getAPIdepositAddress() public view returns(address) {
// The partner address being supplied must also match the sender address
return this;
}


/*** Setters *************/

/// @notice Send `msg.value ether` Eth from the account of `message.caller.address()`, to an account accessible only by Rocket Pool at `to.address()` with partner address `partnerAddress`.
@@ -156,8 +152,6 @@ contract RocketPartnerAPI is Ownable {
}
}



/*** Owner Only Partner Methods *************/

/// @dev Disable a partners ability to add users deposits
@@ -203,7 +197,6 @@ contract RocketPartnerAPI is Ownable {
PartnerRegistered(_newPartnerAddress, now);
}


/// @dev Remove a partner from the Rocket Pool network, note that a partner should first have its user deposits disabled so that their users can withdraw
/// @param _partnerAddress The address of the partner
function partnerRemove(address _partnerAddress) public onlyRegisteredPartner(_partnerAddress) onlyOwner {

0 comments on commit c74a901

Please sign in to comment.
You can’t perform that action at this time.