Skip to content

Commit 7b6c088

Browse files
committed
resolve conflicts
2 parents 6a5ae2f + 6d61c1c commit 7b6c088

File tree

171 files changed

+908
-403
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

171 files changed

+908
-403
lines changed

contracts/FeatureRegistry.sol

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pragma solidity ^0.5.0;
1+
pragma solidity 0.5.8;
22

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

12-
event ChangeFeatureStatus(string _nameKey, bool _newStatus);
13-
1412
/**
1513
* @notice Get the status of a feature
1614
* @param _nameKey is the key for the feature status mapping

contracts/Migrations.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pragma solidity ^0.5.0;
1+
pragma solidity 0.5.8;
22

33
contract Migrations {
44
address public owner;

contracts/ModuleRegistry.sol

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pragma solidity ^0.5.0;
1+
pragma solidity 0.5.8;
22

33
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
44
import "./interfaces/IModuleRegistry.sol";
@@ -43,28 +43,7 @@ contract ModuleRegistry is IModuleRegistry, EternalStorage {
4343
bytes32 constant POLYMATHREGISTRY = 0x90eeab7c36075577c7cc5ff366e389fefa8a18289b949bab3529ab4471139d4d; //keccak256("polymathRegistry")
4444
bytes32 constant FEATURE_REGISTRY = 0xed9ca06607835ad25ecacbcb97f2bc414d4a51ecf391b5ae42f15991227ab146; //keccak256("featureRegistry")
4545
bytes32 constant SECURITY_TOKEN_REGISTRY = 0x12ada4f7ee6c2b7b933330be61fefa007a1f497dc8df1b349b48071a958d7a81; //keccak256("securityTokenRegistry")
46-
47-
///////////
48-
// Events
49-
//////////
50-
51-
// Emit when network becomes paused
52-
event Pause(address account);
53-
// Emit when network becomes unpaused
54-
event Unpause(address account);
55-
// Emit when Module is used by the SecurityToken
56-
event ModuleUsed(address indexed _moduleFactory, address indexed _securityToken);
57-
// Emit when the Module Factory gets registered on the ModuleRegistry contract
58-
event ModuleRegistered(address indexed _moduleFactory, address indexed _owner);
59-
// Emit when the module gets verified by Polymath
60-
event ModuleVerified(address indexed _moduleFactory);
61-
// Emit when the module gets unverified by Polymath or the factory owner
62-
event ModuleUnverified(address indexed _moduleFactory);
63-
// Emit when a ModuleFactory is removed by Polymath
64-
event ModuleRemoved(address indexed _moduleFactory, address indexed _decisionMaker);
65-
// Emit when ownership gets transferred
66-
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
67-
46+
6847
///////////////
6948
//// Modifiers
7049
///////////////

contracts/Pausable.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pragma solidity ^0.5.0;
1+
pragma solidity 0.5.8;
22

33
/**
44
* @title Utility contract to allow pausing and unpausing of certain functions

contracts/PolymathRegistry.sol

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
pragma solidity ^0.5.0;
1+
pragma solidity 0.5.8;
22

33
import "./ReclaimTokens.sol";
4+
import "./interfaces/IPolymathRegistry.sol";
45

56
/**
67
* @title Core functionality for registry upgradability
78
*/
8-
contract PolymathRegistry is ReclaimTokens {
9+
contract PolymathRegistry is ReclaimTokens, IPolymathRegistry {
910
mapping(bytes32 => address) public storedAddresses;
1011

11-
event ChangeAddress(string _nameKey, address indexed _oldAddress, address indexed _newAddress);
12-
1312
/**
1413
* @notice Gets the contract address
1514
* @param _nameKey is the key for the contract address mapping

contracts/ReclaimTokens.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pragma solidity ^0.5.0;
1+
pragma solidity 0.5.8;
22

33
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
44
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";

contracts/STRGetter.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pragma solidity ^0.5.0;
1+
pragma solidity 0.5.8;
22

33
import "./storage/EternalStorage.sol";
44
import "./interfaces/ISecurityToken.sol";

contracts/SecurityTokenRegistry.sol

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1+
/**
2+
//
3+
IMPORTANT: Developer should update the ISecurityTokenRegistry.sol (Interface) if there is any change in
4+
function signature or addition/removal of the functions from SecurityTokenRegistry & STRGetter contract.
5+
//
6+
7+
*/
8+
19
pragma solidity ^0.5.0;
210

311
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
412
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";
513
import "./interfaces/IOwnable.sol";
614
import "./interfaces/ISTFactory.sol";
7-
import "./interfaces/ISecurityTokenRegistry.sol";
815
import "./interfaces/ISecurityToken.sol";
916
import "./interfaces/IPolymathRegistry.sol";
1017
import "./interfaces/IOracle.sol";
@@ -333,7 +340,7 @@ contract SecurityTokenRegistry is EternalStorage, Proxy {
333340
// Attempt to charge the reg fee if it is > 0 USD
334341
(uint256 usdFee, uint256 polyFee) = _takeFee(TICKERREGFEE);
335342
string memory ticker = Util.upper(_ticker);
336-
require(_tickerAvailable(ticker), "Ticker reserved");
343+
require(tickerAvailable(ticker), "Ticker reserved");
337344
// Check whether ticker was previously registered (and expired)
338345
address previousOwner = _tickerOwner(ticker);
339346
if (previousOwner != address(0)) {
@@ -462,11 +469,11 @@ contract SecurityTokenRegistry is EternalStorage, Proxy {
462469
}
463470

464471
/**
465-
* @notice Internal - Checks if the entered ticker is registered and has not expired
472+
* @notice Checks if the entered ticker is registered and has not expired
466473
* @param _ticker is the token ticker
467474
* @return bool
468475
*/
469-
function _tickerAvailable(string memory _ticker) internal view returns(bool) {
476+
function tickerAvailable(string memory _ticker) public view returns(bool) {
470477
if (_tickerOwner(_ticker) != address(0)) {
471478
/*solium-disable-next-line security/no-block-members*/
472479
if ((now > getUintValue(Encoder.getKey("registeredTickers_expiryDate", _ticker))) && !_tickerStatus(_ticker)) {

contracts/datastore/DataStore.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pragma solidity ^0.5.0;
1+
pragma solidity 0.5.8;
22

33
import "../interfaces/ISecurityToken.sol";
44
import "../interfaces/IOwnable.sol";

contracts/datastore/DataStoreFactory.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pragma solidity ^0.5.0;
1+
pragma solidity 0.5.8;
22

33
import "./DataStoreProxy.sol";
44

contracts/datastore/DataStoreProxy.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pragma solidity ^0.5.0;
1+
pragma solidity 0.5.8;
22

33
import "../proxy/Proxy.sol";
44
import "./DataStoreStorage.sol";

contracts/datastore/DataStoreStorage.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pragma solidity ^0.5.0;
1+
pragma solidity 0.5.8;
22

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

contracts/external/IMedianizer.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* solium-disable */
2-
pragma solidity ^0.5.0;
2+
pragma solidity 0.5.8;
33

44
/**
55
* @title Interface to MakerDAO Medianizer contract

contracts/interfaces/ICheckPermission.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pragma solidity ^0.5.0;
1+
pragma solidity 0.5.8;
22

33
interface ICheckPermission {
44
/**

contracts/interfaces/IDataStore.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pragma solidity ^0.5.0;
1+
pragma solidity 0.5.8;
22

33
interface IDataStore {
44
/**

contracts/interfaces/IFeatureRegistry.sol

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
1-
pragma solidity ^0.5.0;
1+
pragma solidity 0.5.8;
22

33
/**
44
* @title Interface for managing polymath feature switches
55
*/
66
interface IFeatureRegistry {
7+
8+
event ChangeFeatureStatus(string _nameKey, bool _newStatus);
9+
10+
/**
11+
* @notice change a feature status
12+
* @dev feature status is set to false by default
13+
* @param _nameKey is the key for the feature status mapping
14+
* @param _newStatus is the new feature status
15+
*/
16+
function setFeatureStatus(string calldata _nameKey, bool _newStatus) external;
17+
718
/**
819
* @notice Get the status of a feature
920
* @param _nameKey is the key for the feature status mapping

contracts/interfaces/IModule.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pragma solidity ^0.5.0;
1+
pragma solidity 0.5.8;
22

33
/**
44
* @title Interface that every module contract should implement

contracts/interfaces/IModuleFactory.sol

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pragma solidity ^0.5.0;
1+
pragma solidity 0.5.8;
22

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

94+
/**
95+
* @notice Updates the tags of the ModuleFactory
96+
* @param _tagsData New list of tags
97+
*/
98+
function changeTags(bytes32[] calldata _tagsData) external;
99+
100+
/**
101+
* @notice Updates the name of the ModuleFactory
102+
* @param _name New name that will replace the old one.
103+
*/
104+
function changeName(bytes32 _name) external;
105+
106+
/**
107+
* @notice Updates the description of the ModuleFactory
108+
* @param _description New description that will replace the old one.
109+
*/
110+
function changeDescription(string calldata _description) external;
111+
112+
/**
113+
* @notice Updates the title of the ModuleFactory
114+
* @param _title New Title that will replace the old one.
115+
*/
116+
function changeTitle(string calldata _title) external;
117+
94118
}

contracts/interfaces/IModuleRegistry.sol

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,32 @@
1-
pragma solidity ^0.5.0;
1+
pragma solidity 0.5.8;
22

33
/**
44
* @title Interface for the Polymath Module Registry contract
55
*/
66
interface IModuleRegistry {
7+
8+
///////////
9+
// Events
10+
//////////
11+
12+
// Emit when network becomes paused
13+
event Pause(address account);
14+
// Emit when network becomes unpaused
15+
event Unpause(address account);
16+
// Emit when Module is used by the SecurityToken
17+
event ModuleUsed(address indexed _moduleFactory, address indexed _securityToken);
18+
// Emit when the Module Factory gets registered on the ModuleRegistry contract
19+
event ModuleRegistered(address indexed _moduleFactory, address indexed _owner);
20+
// Emit when the module gets verified by Polymath
21+
event ModuleVerified(address indexed _moduleFactory);
22+
// Emit when the module gets unverified by Polymath or the factory owner
23+
event ModuleUnverified(address indexed _moduleFactory);
24+
// Emit when a ModuleFactory is removed by Polymath
25+
event ModuleRemoved(address indexed _moduleFactory, address indexed _decisionMaker);
26+
// Emit when ownership gets transferred
27+
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
28+
29+
730
/**
831
* @notice Called by a security token to notify the registry it is using a module
932
* @param _moduleFactory is the address of the relevant module factory
@@ -78,7 +101,7 @@ interface IModuleRegistry {
78101
* @param _moduleType Type of Module
79102
* @return address array that contains the list of addresses of module factory contracts.
80103
*/
81-
function getAllModulesByType(uint8 _moduleType) external view returns(address[] memory);
104+
function getAllModulesByType(uint8 _moduleType) external view returns(address[] memory factories);
82105
/**
83106
* @notice Returns the list of addresses of Module Factory of a particular type
84107
* @param _moduleType Type of Module
@@ -111,4 +134,26 @@ interface IModuleRegistry {
111134
*/
112135
function isPaused() external view returns(bool paused);
113136

137+
/**
138+
* @notice Reclaims all ERC20Basic compatible tokens
139+
* @param _tokenContract The address of the token contract
140+
*/
141+
function reclaimERC20(address _tokenContract) external;
142+
143+
/**
144+
* @notice Called by the owner to pause, triggers stopped state
145+
*/
146+
function pause() external;
147+
148+
/**
149+
* @notice Called by the owner to unpause, returns to normal state
150+
*/
151+
function unpause() external;
152+
153+
/**
154+
* @dev Allows the current owner to transfer control of the contract to a newOwner.
155+
* @param _newOwner The address to transfer ownership to.
156+
*/
157+
function transferOwnership(address _newOwner) external;
158+
114159
}

contracts/interfaces/IOracle.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pragma solidity ^0.5.0;
1+
pragma solidity 0.5.8;
22

33
interface IOracle {
44
/**

contracts/interfaces/IOwnable.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pragma solidity ^0.5.0;
1+
pragma solidity 0.5.8;
22

33
/**
44
* @title Ownable

contracts/interfaces/IPoly.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pragma solidity ^0.5.0;
1+
pragma solidity 0.5.8;
22

33
/**
44
* @title ERC20 interface
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
1-
pragma solidity ^0.5.0;
1+
pragma solidity 0.5.8;
22

33
interface IPolymathRegistry {
4+
5+
event ChangeAddress(string _nameKey, address indexed _oldAddress, address indexed _newAddress);
6+
47
/**
58
* @notice Returns the contract address
69
* @param _nameKey is the key for the contract address mapping
710
* @return address
811
*/
912
function getAddress(string calldata _nameKey) external view returns(address registryAddress);
1013

14+
/**
15+
* @notice Changes the contract address
16+
* @param _nameKey is the key for the contract address mapping
17+
* @param _newAddress is the new contract address
18+
*/
19+
function changeAddress(string calldata _nameKey, address _newAddress) external;
20+
1121
}

0 commit comments

Comments
 (0)