Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions contracts/schemes/Auction4Reputation.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ pragma solidity ^0.5.4;

import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "../controller/ControllerInterface.sol";
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "../libs/SafeERC20.sol";

/**
Expand Down Expand Up @@ -64,7 +63,6 @@ contract Auction4Reputation is Ownable {
IERC20 _token,
address _wallet)
external
onlyOwner
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious: What is the use case for removing this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

initialize function can be called one time only .
So no need to set onlyOwner

{
require(avatar == Avatar(0), "can be called only one time");
require(_avatar != Avatar(0), "avatar cannot be zero");
Expand Down Expand Up @@ -116,7 +114,7 @@ contract Auction4Reputation is Ownable {
function bid(uint256 _amount, uint256 _auctionId) public returns(uint256 auctionId) {
require(_amount > 0, "bidding amount should be > 0");
// solhint-disable-next-line not-rely-on-time
require(now <= auctionsEndTime, "bidding should be within the allowed bidding period");
require(now < auctionsEndTime, "bidding should be within the allowed bidding period");
// solhint-disable-next-line not-rely-on-time
require(now >= auctionsStartTime, "bidding is enable only after bidding auctionsStartTime");
address(token).safeTransferFrom(msg.sender, address(this), _amount);
Expand Down
3 changes: 0 additions & 3 deletions contracts/schemes/ExternalLocking4Reputation.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
pragma solidity ^0.5.4;

import "./Locking4Reputation.sol";
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";


/**
* @title A scheme for external locking Tokens for reputation
Expand Down Expand Up @@ -43,7 +41,6 @@ contract ExternalLocking4Reputation is Locking4Reputation, Ownable {
address _externalLockingContract,
string calldata _getBalanceFuncSignature)
external
onlyOwner
{
require(_claimingEndTime > _claimingStartTime, "_claimingEndTime should be greater than _claimingStartTime");
externalLockingContract = _externalLockingContract;
Expand Down
5 changes: 1 addition & 4 deletions contracts/schemes/LockingEth4Reputation.sol
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
pragma solidity ^0.5.4;

import "./Locking4Reputation.sol";
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";


/**
* @title A scheme for locking ETH for reputation
*/

contract LockingEth4Reputation is Locking4Reputation, Ownable {
contract LockingEth4Reputation is Locking4Reputation {

/**
* @dev initialize
Expand All @@ -30,7 +28,6 @@ contract LockingEth4Reputation is Locking4Reputation, Ownable {
uint256 _redeemEnableTime,
uint256 _maxLockingPeriod)
external
onlyOwner
{
super._initialize(
_avatar,
Expand Down
4 changes: 1 addition & 3 deletions contracts/schemes/LockingToken4Reputation.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ pragma solidity ^0.5.4;

import "./Locking4Reputation.sol";
import "./PriceOracleInterface.sol";
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "../libs/SafeERC20.sol";


/**
* @title A scheme for locking ERC20 Tokens for reputation
*/

contract LockingToken4Reputation is Locking4Reputation, Ownable {
contract LockingToken4Reputation is Locking4Reputation {
using SafeERC20 for address;

PriceOracleInterface public priceOracleContract;
Expand Down Expand Up @@ -42,7 +41,6 @@ contract LockingToken4Reputation is Locking4Reputation, Ownable {
uint256 _maxLockingPeriod,
PriceOracleInterface _priceOracleContract)
external
onlyOwner
{
priceOracleContract = _priceOracleContract;
super._initialize(
Expand Down
14 changes: 1 addition & 13 deletions contracts/universalSchemes/UniversalScheme.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,9 @@ pragma solidity ^0.5.4;
import "./UniversalSchemeInterface.sol";
import "../controller/ControllerInterface.sol";
import "../controller/Avatar.sol";
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";


contract UniversalScheme is Ownable, UniversalSchemeInterface {
bytes32 public hashedParameters; // For other parameters.

function updateParameters(
bytes32 _hashedParameters
)
public
onlyOwner
{
hashedParameters = _hashedParameters;
}

contract UniversalScheme is UniversalSchemeInterface {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So all schemes are affected, not just the bootstrapping.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right

/**
* @dev get the parameters for the current scheme from the controller
*/
Expand Down
3 changes: 1 addition & 2 deletions contracts/universalSchemes/UniversalSchemeInterface.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import "../controller/Avatar.sol";

contract UniversalSchemeInterface {

function updateParameters(bytes32 _hashedParameters) public;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this function appears to address #387.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right


function getParametersFromController(Avatar _avatar) internal view returns(bytes32);

}
27 changes: 0 additions & 27 deletions test/auction4reputation.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,33 +110,6 @@ contract('Auction4Reputation', accounts => {
}
});

it("initialize is onlyOwner", async () => {
var auction4Reputation = await Auction4Reputation.new();
try {
await auction4Reputation.initialize(accounts[0],
100,
0,
1000,
1,
1000,
accounts[0],
accounts[0],
{gas :constants.ARC_GAS_LIMIT,from:accounts[1]});
assert(false, "initialize is onlyOwner");
} catch(error) {
helpers.assertVMException(error);
}
await auction4Reputation.initialize(accounts[0],
100,
0,
1000,
1,
1000,
accounts[0],
accounts[0],
{gas :constants.ARC_GAS_LIMIT,from:accounts[0]});
});

it("initialize auctionsEndTime = auctionsStartTime is not allowed", async () => {
var auction4Reputation = await Auction4Reputation.new();
try {
Expand Down
25 changes: 0 additions & 25 deletions test/externallocking4reputation.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,31 +227,6 @@ contract('ExternalLocking4Reputation', accounts => {
}
});

it("initialize is onlyOwner", async () => {
var externalLocking4Reputation = await ExternalLocking4Reputation.new();
try {
await externalLocking4Reputation.initialize(accounts[0],
100,
0,
3000,
3000,
accounts[0],
"lockedTokenBalances(address)",
{from:accounts[1]});
assert(false, "initialize is onlyOwner");
} catch(error) {
helpers.assertVMException(error);
}
await externalLocking4Reputation.initialize(accounts[0],
100,
0,
3000,
3000,
accounts[0],
"lockedTokenBalances(address)",
{from:accounts[0]});
});

it("redeemEnableTime >= lockingEndTime ", async () => {
var externalLocking4Reputation = await ExternalLocking4Reputation.new();
try {
Expand Down
23 changes: 0 additions & 23 deletions test/lockingeth4reputation.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,29 +273,6 @@ contract('LockingEth4Reputation', accounts => {
}
});

it("initialize is onlyOwner", async () => {
var lockingEth4Reputation = await LockingEth4Reputation.new();
try {
await lockingEth4Reputation.initialize(accounts[1],
100,
0,
100,
100,
6000,
{from:accounts[1]});
assert(false, "initialize is onlyOwner");
} catch(error) {
helpers.assertVMException(error);
}
await lockingEth4Reputation.initialize(accounts[1],
100,
0,
100,
100,
6000,
{from:accounts[0]});
});

it("redeemEnableTime >= lockingEndTime", async () => {
var lockingEth4Reputation = await LockingEth4Reputation.new();
try {
Expand Down
25 changes: 0 additions & 25 deletions test/lockingtoken4reputation.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,31 +298,6 @@ contract('LockingToken4Reputation', accounts => {
}
});

it("initialize is onlyOwner", async () => {
var lockingToken4Reputation = await LockingToken4Reputation.new();
try {
await lockingToken4Reputation.initialize(accounts[1],
100,
0,
100,
100,
6000,
accounts[1],
{from:accounts[1]});
assert(false, "initialize is onlyOwner");
} catch(error) {
helpers.assertVMException(error);
}
await lockingToken4Reputation.initialize(accounts[1],
100,
0,
100,
100,
6000,
accounts[1],
{from:accounts[0]});
});

it("redeemEnableTime >= lockingEndTime", async () => {
var lockingToken4Reputation = await LockingToken4Reputation.new();
try {
Expand Down