Skip to content

Commit

Permalink
resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
SatyamSB committed Jun 13, 2019
2 parents 6a5ae2f + 6d61c1c commit 7b6c088
Show file tree
Hide file tree
Showing 171 changed files with 908 additions and 403 deletions.
4 changes: 1 addition & 3 deletions contracts/FeatureRegistry.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity 0.5.8;

import "./ReclaimTokens.sol";
import "./interfaces/IFeatureRegistry.sol";
Expand All @@ -9,8 +9,6 @@ import "./interfaces/IFeatureRegistry.sol";
contract FeatureRegistry is IFeatureRegistry, ReclaimTokens {
mapping(bytes32 => bool) public featureStatus;

event ChangeFeatureStatus(string _nameKey, bool _newStatus);

/**
* @notice Get the status of a feature
* @param _nameKey is the key for the feature status mapping
Expand Down
2 changes: 1 addition & 1 deletion contracts/Migrations.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity 0.5.8;

contract Migrations {
address public owner;
Expand Down
25 changes: 2 additions & 23 deletions contracts/ModuleRegistry.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity 0.5.8;

import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
import "./interfaces/IModuleRegistry.sol";
Expand Down Expand Up @@ -43,28 +43,7 @@ contract ModuleRegistry is IModuleRegistry, EternalStorage {
bytes32 constant POLYMATHREGISTRY = 0x90eeab7c36075577c7cc5ff366e389fefa8a18289b949bab3529ab4471139d4d; //keccak256("polymathRegistry")
bytes32 constant FEATURE_REGISTRY = 0xed9ca06607835ad25ecacbcb97f2bc414d4a51ecf391b5ae42f15991227ab146; //keccak256("featureRegistry")
bytes32 constant SECURITY_TOKEN_REGISTRY = 0x12ada4f7ee6c2b7b933330be61fefa007a1f497dc8df1b349b48071a958d7a81; //keccak256("securityTokenRegistry")

///////////
// Events
//////////

// Emit when network becomes paused
event Pause(address account);
// Emit when network becomes unpaused
event Unpause(address account);
// Emit when Module is used by the SecurityToken
event ModuleUsed(address indexed _moduleFactory, address indexed _securityToken);
// Emit when the Module Factory gets registered on the ModuleRegistry contract
event ModuleRegistered(address indexed _moduleFactory, address indexed _owner);
// Emit when the module gets verified by Polymath
event ModuleVerified(address indexed _moduleFactory);
// Emit when the module gets unverified by Polymath or the factory owner
event ModuleUnverified(address indexed _moduleFactory);
// Emit when a ModuleFactory is removed by Polymath
event ModuleRemoved(address indexed _moduleFactory, address indexed _decisionMaker);
// Emit when ownership gets transferred
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);


///////////////
//// Modifiers
///////////////
Expand Down
2 changes: 1 addition & 1 deletion contracts/Pausable.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity 0.5.8;

/**
* @title Utility contract to allow pausing and unpausing of certain functions
Expand Down
7 changes: 3 additions & 4 deletions contracts/PolymathRegistry.sol
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
pragma solidity ^0.5.0;
pragma solidity 0.5.8;

import "./ReclaimTokens.sol";
import "./interfaces/IPolymathRegistry.sol";

/**
* @title Core functionality for registry upgradability
*/
contract PolymathRegistry is ReclaimTokens {
contract PolymathRegistry is ReclaimTokens, IPolymathRegistry {
mapping(bytes32 => address) public storedAddresses;

event ChangeAddress(string _nameKey, address indexed _oldAddress, address indexed _newAddress);

/**
* @notice Gets the contract address
* @param _nameKey is the key for the contract address mapping
Expand Down
2 changes: 1 addition & 1 deletion contracts/ReclaimTokens.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity 0.5.8;

import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/STRGetter.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity 0.5.8;

import "./storage/EternalStorage.sol";
import "./interfaces/ISecurityToken.sol";
Expand Down
15 changes: 11 additions & 4 deletions contracts/SecurityTokenRegistry.sol
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
/**
//
IMPORTANT: Developer should update the ISecurityTokenRegistry.sol (Interface) if there is any change in
function signature or addition/removal of the functions from SecurityTokenRegistry & STRGetter contract.
//
*/

pragma solidity ^0.5.0;

import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
import "./interfaces/IOwnable.sol";
import "./interfaces/ISTFactory.sol";
import "./interfaces/ISecurityTokenRegistry.sol";
import "./interfaces/ISecurityToken.sol";
import "./interfaces/IPolymathRegistry.sol";
import "./interfaces/IOracle.sol";
Expand Down Expand Up @@ -333,7 +340,7 @@ contract SecurityTokenRegistry is EternalStorage, Proxy {
// Attempt to charge the reg fee if it is > 0 USD
(uint256 usdFee, uint256 polyFee) = _takeFee(TICKERREGFEE);
string memory ticker = Util.upper(_ticker);
require(_tickerAvailable(ticker), "Ticker reserved");
require(tickerAvailable(ticker), "Ticker reserved");
// Check whether ticker was previously registered (and expired)
address previousOwner = _tickerOwner(ticker);
if (previousOwner != address(0)) {
Expand Down Expand Up @@ -462,11 +469,11 @@ contract SecurityTokenRegistry is EternalStorage, Proxy {
}

/**
* @notice Internal - Checks if the entered ticker is registered and has not expired
* @notice Checks if the entered ticker is registered and has not expired
* @param _ticker is the token ticker
* @return bool
*/
function _tickerAvailable(string memory _ticker) internal view returns(bool) {
function tickerAvailable(string memory _ticker) public view returns(bool) {
if (_tickerOwner(_ticker) != address(0)) {
/*solium-disable-next-line security/no-block-members*/
if ((now > getUintValue(Encoder.getKey("registeredTickers_expiryDate", _ticker))) && !_tickerStatus(_ticker)) {
Expand Down
2 changes: 1 addition & 1 deletion contracts/datastore/DataStore.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity 0.5.8;

import "../interfaces/ISecurityToken.sol";
import "../interfaces/IOwnable.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/datastore/DataStoreFactory.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity 0.5.8;

import "./DataStoreProxy.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/datastore/DataStoreProxy.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity 0.5.8;

import "../proxy/Proxy.sol";
import "./DataStoreStorage.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/datastore/DataStoreStorage.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity 0.5.8;

import "../interfaces/ISecurityToken.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/external/IMedianizer.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* solium-disable */
pragma solidity ^0.5.0;
pragma solidity 0.5.8;

/**
* @title Interface to MakerDAO Medianizer contract
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/ICheckPermission.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity 0.5.8;

interface ICheckPermission {
/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IDataStore.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity 0.5.8;

interface IDataStore {
/**
Expand Down
13 changes: 12 additions & 1 deletion contracts/interfaces/IFeatureRegistry.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
pragma solidity ^0.5.0;
pragma solidity 0.5.8;

/**
* @title Interface for managing polymath feature switches
*/
interface IFeatureRegistry {

event ChangeFeatureStatus(string _nameKey, bool _newStatus);

/**
* @notice change a feature status
* @dev feature status is set to false by default
* @param _nameKey is the key for the feature status mapping
* @param _newStatus is the new feature status
*/
function setFeatureStatus(string calldata _nameKey, bool _newStatus) external;

/**
* @notice Get the status of a feature
* @param _nameKey is the key for the feature status mapping
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IModule.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity 0.5.8;

/**
* @title Interface that every module contract should implement
Expand Down
26 changes: 25 additions & 1 deletion contracts/interfaces/IModuleFactory.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity 0.5.8;

/**
* @title Interface that every module factory contract should implement
Expand Down Expand Up @@ -91,4 +91,28 @@ interface IModuleFactory {
*/
function upperSTVersionBounds() external view returns(uint8[] memory upperBounds);

/**
* @notice Updates the tags of the ModuleFactory
* @param _tagsData New list of tags
*/
function changeTags(bytes32[] calldata _tagsData) external;

/**
* @notice Updates the name of the ModuleFactory
* @param _name New name that will replace the old one.
*/
function changeName(bytes32 _name) external;

/**
* @notice Updates the description of the ModuleFactory
* @param _description New description that will replace the old one.
*/
function changeDescription(string calldata _description) external;

/**
* @notice Updates the title of the ModuleFactory
* @param _title New Title that will replace the old one.
*/
function changeTitle(string calldata _title) external;

}
49 changes: 47 additions & 2 deletions contracts/interfaces/IModuleRegistry.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,32 @@
pragma solidity ^0.5.0;
pragma solidity 0.5.8;

/**
* @title Interface for the Polymath Module Registry contract
*/
interface IModuleRegistry {

///////////
// Events
//////////

// Emit when network becomes paused
event Pause(address account);
// Emit when network becomes unpaused
event Unpause(address account);
// Emit when Module is used by the SecurityToken
event ModuleUsed(address indexed _moduleFactory, address indexed _securityToken);
// Emit when the Module Factory gets registered on the ModuleRegistry contract
event ModuleRegistered(address indexed _moduleFactory, address indexed _owner);
// Emit when the module gets verified by Polymath
event ModuleVerified(address indexed _moduleFactory);
// Emit when the module gets unverified by Polymath or the factory owner
event ModuleUnverified(address indexed _moduleFactory);
// Emit when a ModuleFactory is removed by Polymath
event ModuleRemoved(address indexed _moduleFactory, address indexed _decisionMaker);
// Emit when ownership gets transferred
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);


/**
* @notice Called by a security token to notify the registry it is using a module
* @param _moduleFactory is the address of the relevant module factory
Expand Down Expand Up @@ -78,7 +101,7 @@ interface IModuleRegistry {
* @param _moduleType Type of Module
* @return address array that contains the list of addresses of module factory contracts.
*/
function getAllModulesByType(uint8 _moduleType) external view returns(address[] memory);
function getAllModulesByType(uint8 _moduleType) external view returns(address[] memory factories);
/**
* @notice Returns the list of addresses of Module Factory of a particular type
* @param _moduleType Type of Module
Expand Down Expand Up @@ -111,4 +134,26 @@ interface IModuleRegistry {
*/
function isPaused() external view returns(bool paused);

/**
* @notice Reclaims all ERC20Basic compatible tokens
* @param _tokenContract The address of the token contract
*/
function reclaimERC20(address _tokenContract) external;

/**
* @notice Called by the owner to pause, triggers stopped state
*/
function pause() external;

/**
* @notice Called by the owner to unpause, returns to normal state
*/
function unpause() external;

/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) external;

}
2 changes: 1 addition & 1 deletion contracts/interfaces/IOracle.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity 0.5.8;

interface IOracle {
/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IOwnable.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity 0.5.8;

/**
* @title Ownable
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IPoly.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.5.0;
pragma solidity 0.5.8;

/**
* @title ERC20 interface
Expand Down
12 changes: 11 additions & 1 deletion contracts/interfaces/IPolymathRegistry.sol
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
pragma solidity ^0.5.0;
pragma solidity 0.5.8;

interface IPolymathRegistry {

event ChangeAddress(string _nameKey, address indexed _oldAddress, address indexed _newAddress);

/**
* @notice Returns the contract address
* @param _nameKey is the key for the contract address mapping
* @return address
*/
function getAddress(string calldata _nameKey) external view returns(address registryAddress);

/**
* @notice Changes the contract address
* @param _nameKey is the key for the contract address mapping
* @param _newAddress is the new contract address
*/
function changeAddress(string calldata _nameKey, address _newAddress) external;

}
Loading

0 comments on commit 7b6c088

Please sign in to comment.