Skip to content

Commit 124311b

Browse files
satyamakgecadamdossa
authored andcommitted
Move contracts to the respective folders (#510)
* move storage contracts to storage folder and migrate vesting to experimental * BTM migrate to experimental * move Lockup to experimental * Small re-shuffling * remove _ prefix from public functions
1 parent 962dc89 commit 124311b

20 files changed

+49
-54
lines changed

contracts/libraries/VolumeRestrictionLib.sol

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,12 @@ pragma solidity ^0.4.24;
33
import "./BokkyPooBahsDateTimeLibrary.sol";
44
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
55
import "../interfaces/ISecurityToken.sol";
6+
import "../storage/VolumeRestrictionTMStorage.sol";
67

78
library VolumeRestrictionLib {
89

910
using SafeMath for uint256;
1011

11-
enum TypeOfPeriod { MultipleDays, OneDay, Both }
12-
13-
struct RestrictedHolder {
14-
// 1 represent true & 0 for false
15-
uint8 seen;
16-
// Type of period will be enum index of TypeOfPeriod enum
17-
uint8 typeOfPeriod;
18-
// Index of the array where the holder address lives
19-
uint128 index;
20-
}
21-
22-
struct RestrictedData {
23-
mapping(address => RestrictedHolder) restrictedHolders;
24-
address[] restrictedAddresses;
25-
}
26-
2712
function _checkLengthOfArray(
2813
address[] _holders,
2914
uint256[] _allowedTokens,
@@ -45,14 +30,14 @@ library VolumeRestrictionLib {
4530
);
4631
}
4732

48-
function _deleteHolderFromList(RestrictedData storage data, address _holder, uint8 _typeOfPeriod) public {
33+
function deleteHolderFromList(VolumeRestrictionTMStorage.RestrictedData storage data, address _holder, uint8 _typeOfPeriod) public {
4934
// Deleting the holder if holder's type of Period is `Both` type otherwise
5035
// it will assign the given type `_typeOfPeriod` to the _holder typeOfPeriod
5136
// `_typeOfPeriod` it always be contrary to the removing restriction
5237
// if removing restriction is individual then typeOfPeriod is TypeOfPeriod.OneDay
5338
// in uint8 its value is 1. if removing restriction is daily individual then typeOfPeriod
5439
// is TypeOfPeriod.MultipleDays in uint8 its value is 0.
55-
if (data.restrictedHolders[_holder].typeOfPeriod != uint8(TypeOfPeriod.Both)) {
40+
if (data.restrictedHolders[_holder].typeOfPeriod != uint8(VolumeRestrictionTMStorage.TypeOfPeriod.Both)) {
5641
uint128 index = data.restrictedHolders[_holder].index;
5742
uint256 _len = data.restrictedAddresses.length;
5843
if (index != _len) {
@@ -66,22 +51,22 @@ library VolumeRestrictionLib {
6651
}
6752
}
6853

69-
function _addRestrictionData(RestrictedData storage data, address _holder, uint8 _callFrom, uint256 _endTime) public {
54+
function addRestrictionData(VolumeRestrictionTMStorage.RestrictedData storage data, address _holder, uint8 _callFrom, uint256 _endTime) public {
7055
uint128 index = data.restrictedHolders[_holder].index;
7156
if (data.restrictedHolders[_holder].seen == 0) {
7257
data.restrictedAddresses.push(_holder);
7358
index = uint128(data.restrictedAddresses.length);
7459
}
7560
uint8 _type = _getTypeOfPeriod(data.restrictedHolders[_holder].typeOfPeriod, _callFrom, _endTime);
76-
data.restrictedHolders[_holder] = RestrictedHolder(uint8(1), _type, index);
61+
data.restrictedHolders[_holder] = VolumeRestrictionTMStorage.RestrictedHolder(uint8(1), _type, index);
7762
}
7863

7964
function _getTypeOfPeriod(uint8 _currentTypeOfPeriod, uint8 _callFrom, uint256 _endTime) internal pure returns(uint8) {
8065
if (_currentTypeOfPeriod != _callFrom && _endTime != uint256(0))
81-
return uint8(TypeOfPeriod.Both);
66+
return uint8(VolumeRestrictionTMStorage.TypeOfPeriod.Both);
8267
else
8368
return _callFrom;
8469
}
85-
8670

87-
}
71+
72+
}

contracts/modules/TransferManager/BlacklistTransferManager.sol renamed to contracts/modules/Experimental/TransferManager/BlacklistTransferManager.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
pragma solidity ^0.4.24;
22

3-
import "./ITransferManager.sol";
3+
import "../../TransferManager/ITransferManager.sol";
44
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
55

66
/**

contracts/modules/TransferManager/BlacklistTransferManagerFactory.sol renamed to contracts/modules/Experimental/TransferManager/BlacklistTransferManagerFactory.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
pragma solidity ^0.4.24;
22

33
import "./BlacklistTransferManager.sol";
4-
import "../ModuleFactory.sol";
5-
import "../../libraries/Util.sol";
4+
import "../../ModuleFactory.sol";
5+
import "../../../libraries/Util.sol";
66

77
/**
88
* @title Factory for deploying BlacklistManager module

contracts/modules/TransferManager/LockUpTransferManager.sol renamed to contracts/modules/Experimental/TransferManager/LockUpTransferManager.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
pragma solidity ^0.4.24;
22

3-
import "./ITransferManager.sol";
3+
import "../../TransferManager/ITransferManager.sol";
44
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
55

66
contract LockUpTransferManager is ITransferManager {

contracts/modules/TransferManager/LockUpTransferManagerFactory.sol renamed to contracts/modules/Experimental/TransferManager/LockUpTransferManagerFactory.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
pragma solidity ^0.4.24;
22

3-
import "../ModuleFactory.sol";
3+
import "../../ModuleFactory.sol";
44
import "./LockUpTransferManager.sol";
55

66
/**

contracts/modules/Wallet/IWallet.sol renamed to contracts/modules/Experimental/Wallet/IWallet.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
pragma solidity ^0.4.24;
22

3-
import "../../Pausable.sol";
4-
import "../Module.sol";
3+
import "../../../Pausable.sol";
4+
import "../../Module.sol";
55

66
/**
77
* @title Interface to be implemented by all Wallet modules

contracts/modules/Wallet/VestingEscrowWallet.sol renamed to contracts/modules/Experimental/Wallet/VestingEscrowWallet.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
pragma solidity ^0.4.24;
22

33
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
4-
import "./VestingEscrowWalletStorage.sol";
4+
import "../../../storage/VestingEscrowWalletStorage.sol";
55
import "./IWallet.sol";
66

77
/**

contracts/modules/Wallet/VestingEscrowWalletFactory.sol renamed to contracts/modules/Experimental/Wallet/VestingEscrowWalletFactory.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
pragma solidity ^0.4.24;
22

3-
import "../../proxy/VestingEscrowWalletProxy.sol";
4-
import "../../interfaces/IBoot.sol";
5-
import "../ModuleFactory.sol";
6-
import "../../libraries/Util.sol";
3+
import "../../../proxy/VestingEscrowWalletProxy.sol";
4+
import "../../../interfaces/IBoot.sol";
5+
import "../../ModuleFactory.sol";
6+
import "../../../libraries/Util.sol";
77

88
/**
99
* @title Factory for deploying VestingEscrowWallet module

contracts/modules/STO/USDTieredSTO.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import "../../RegistryUpdater.sol";
77
import "../../libraries/DecimalMath.sol";
88
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
99
import "openzeppelin-solidity/contracts/ReentrancyGuard.sol";
10-
import "./USDTieredSTOStorage.sol";
10+
import "../../storage/USDTieredSTOStorage.sol";
1111

1212
/**
1313
* @title STO module for standard capped crowdsale

contracts/modules/TransferManager/GeneralTransferManager.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
pragma solidity ^0.4.24;
22

33
import "./ITransferManager.sol";
4-
import "./GeneralTransferManagerStorage.sol";
4+
import "../../storage/GeneralTransferManagerStorage.sol";
55
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
66

77
/**

0 commit comments

Comments
 (0)