Skip to content
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
d7abab2
revamp the lockup
SatyamSB Nov 13, 2018
21bd05a
test suite addition
SatyamSB Nov 14, 2018
b847f54
minor fixes
SatyamSB Nov 16, 2018
d28ef32
change to external
SatyamSB Nov 16, 2018
d4d35e5
stack too deep erro fix
SatyamSB Nov 16, 2018
1f4e9c1
remove some require statements
SatyamSB Nov 22, 2018
9852a9d
Merge branch 'dev-2.1.0' into reinvent-lockup
SatyamSB Nov 22, 2018
8199aa2
Merge branch 'dev-2.1.0' into reinvent-lockup
adamdossa Nov 26, 2018
0c61008
Merge branch 'dev-2.1.0' into reinvent-lockup
VictorVicente Nov 29, 2018
4eb3a5a
redesign the lockup module
SatyamSB Nov 29, 2018
3469a7d
test case improvement
SatyamSB Nov 30, 2018
c2449c9
Merge branch 'reinvent-lockup' of https://github.com/PolymathNetwork/…
SatyamSB Nov 30, 2018
64c85d4
Merge branch 'dev-2.1.0' into reinvent-lockup
satyamakgec Nov 30, 2018
f91bbc4
Merge branch 'dev-2.1.0' into reinvent-lockup
satyamakgec Nov 30, 2018
ae08093
minor fixes
SatyamSB Nov 30, 2018
57c24be
allow the lockup start could be 0
SatyamSB Nov 30, 2018
35d73d5
Merge branch 'dev-2.1.0' into reinvent-lockup
VictorVicente Dec 4, 2018
3fd2a34
resolve conflicts and add Lockup module in migrations
SatyamSB Dec 5, 2018
f1c82d6
Merge branch 'dev-2.1.0' into reinvent-lockup
VictorVicente Dec 10, 2018
4162766
CLI - LockupTM support
VictorVicente Dec 11, 2018
4ae3a21
recommended fixes
SatyamSB Dec 12, 2018
d1598e5
CLI - Fixes for new contract changes
VictorVicente Dec 12, 2018
4ebc150
Merge branch 'dev-2.1.0' into reinvent-lockup
VictorVicente Dec 13, 2018
18a0426
Merge branch 'dev-2.1.0' into reinvent-lockup
VictorVicente Jan 8, 2019
23e7d51
Fixed test file
maxsam4 Jan 8, 2019
887860e
Trigger TravisCI
VictorVicente Jan 9, 2019
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

This file was deleted.

646 changes: 646 additions & 0 deletions contracts/modules/TransferManager/LockUpTransferManager.sol

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
pragma solidity ^0.4.24;

import "./../../ModuleFactory.sol";
import "./LockupVolumeRestrictionTM.sol";
import "../ModuleFactory.sol";
import "./LockUpTransferManager.sol";

/**
* @title Factory for deploying ManualApprovalTransferManager module
* @title Factory for deploying LockUpTransferManager module
*/
contract LockupVolumeRestrictionTMFactory is ModuleFactory {
contract LockUpTransferManagerFactory is ModuleFactory {

/**
* @notice Constructor
Expand All @@ -19,8 +19,8 @@ contract LockupVolumeRestrictionTMFactory is ModuleFactory {
ModuleFactory(_polyAddress, _setupCost, _usageCost, _subscriptionCost)
{
version = "1.0.0";
name = "LockupVolumeRestrictionTM";
title = "Lockup Volume Restriction Transfer Manager";
name = "LockUpTransferManager";
title = "LockUp Transfer Manager";
description = "Manage transfers using lock ups over time";
compatibleSTVersionRange["lowerBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0));
compatibleSTVersionRange["upperBound"] = VersionUtils.pack(uint8(0), uint8(0), uint8(0));
Expand All @@ -33,10 +33,10 @@ contract LockupVolumeRestrictionTMFactory is ModuleFactory {
function deploy(bytes /* _data */) external returns(address) {
if (setupCost > 0)
require(polyToken.transferFrom(msg.sender, owner, setupCost), "Failed transferFrom because of sufficent Allowance is not provided");
LockupVolumeRestrictionTM lockupVolumeRestrictionTransferManager = new LockupVolumeRestrictionTM(msg.sender, address(polyToken));
LockUpTransferManager lockUpTransferManager = new LockUpTransferManager(msg.sender, address(polyToken));
/*solium-disable-next-line security/no-block-members*/
emit GenerateModuleFromFactory(address(lockupVolumeRestrictionTransferManager), getName(), address(this), msg.sender, now);
return address(lockupVolumeRestrictionTransferManager);
emit GenerateModuleFromFactory(address(lockUpTransferManager), getName(), address(this), msg.sender, now);
return address(lockUpTransferManager);
}

/**
Expand All @@ -61,7 +61,7 @@ contract LockupVolumeRestrictionTMFactory is ModuleFactory {
*/
function getTags() external view returns(bytes32[]) {
bytes32[] memory availableTags = new bytes32[](2);
availableTags[0] = "Volume";
availableTags[0] = "LockUp";
availableTags[1] = "Transfer Restriction";
return availableTags;
}
Expand Down
15 changes: 15 additions & 0 deletions migrations/2_deploy_contracts.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const EtherDividendCheckpointLogic = artifacts.require('./EtherDividendCheckpoin
const ERC20DividendCheckpointLogic = artifacts.require('./ERC20DividendCheckpoint.sol')
const EtherDividendCheckpointFactory = artifacts.require('./EtherDividendCheckpointFactory.sol')
const ERC20DividendCheckpointFactory = artifacts.require('./ERC20DividendCheckpointFactory.sol')
const LockUpTransferManagerFactory = artifacts.require('./LockUpTransferManagerFactory.sol')
const ModuleRegistry = artifacts.require('./ModuleRegistry.sol');
const ModuleRegistryProxy = artifacts.require('./ModuleRegistryProxy.sol');
const ManualApprovalTransferManagerFactory = artifacts.require('./ManualApprovalTransferManagerFactory.sol')
Expand Down Expand Up @@ -164,6 +165,10 @@ module.exports = function (deployer, network, accounts) {
// B) Deploy the GeneralTransferManagerFactory Contract (Factory used to generate the GeneralTransferManager contract and this
// manager attach with the securityToken contract at the time of deployment)
return deployer.deploy(GeneralTransferManagerFactory, PolyToken, 0, 0, 0, GeneralTransferManagerLogic.address, {from: PolymathAccount});
}).then(() => {
// C) Deploy the LockUpTransferManagerFactory Contract (Factory used to generate the LockUpTransferManager contract and
// this manager attach with the securityToken contract at the time of deployment)
return deployer.deploy(LockUpTransferManagerFactory, PolyToken, 0, 0, 0, {from: PolymathAccount});
}).then(() => {
// C) Deploy the GeneralPermissionManagerFactory Contract (Factory used to generate the GeneralPermissionManager contract and
// this manager attach with the securityToken contract at the time of deployment)
Expand Down Expand Up @@ -211,6 +216,10 @@ module.exports = function (deployer, network, accounts) {
}).then(() => {
// Update all addresses into the registry contract by calling the function updateFromregistry
return moduleRegistry.updateFromRegistry({from: PolymathAccount});
}).then(() => {
// D) Register the LockUpTransferManagerFactory in the ModuleRegistry to make the factory available at the protocol level.
// So any securityToken can use that factory to generate the LockUpTransferManager contract.
return moduleRegistry.registerModule(LockUpTransferManagerFactory.address, {from: PolymathAccount});
}).then(() => {
// D) Register the PercentageTransferManagerFactory in the ModuleRegistry to make the factory available at the protocol level.
// So any securityToken can use that factory to generate the PercentageTransferManager contract.
Expand Down Expand Up @@ -249,6 +258,11 @@ module.exports = function (deployer, network, accounts) {
// contract, Factory should comes under the verified list of factories or those factories deployed by the securityToken issuers only.
// Here it gets verified because it is deployed by the third party account (Polymath Account) not with the issuer accounts.
return moduleRegistry.verifyModule(CountTransferManagerFactory.address, true, {from: PolymathAccount});
}).then(() => {
// F) Once the LockUpTransferManagerFactory registered with the ModuleRegistry contract then for making them accessble to the securityToken
// contract, Factory should comes under the verified list of factories or those factories deployed by the securityToken issuers only.
// Here it gets verified because it is deployed by the third party account (Polymath Account) not with the issuer accounts.
return moduleRegistry.verifyModule(LockUpTransferManagerFactory.address, true, {from: PolymathAccount});
}).then(() => {
// G) Once the PercentageTransferManagerFactory registered with the ModuleRegistry contract then for making them accessble to the securityToken
// contract, Factory should comes under the verified list of factories or those factories deployed by the securityToken issuers only.
Expand Down Expand Up @@ -333,6 +347,7 @@ module.exports = function (deployer, network, accounts) {
ERC20DividendCheckpointLogic: ${ERC20DividendCheckpointLogic.address}
EtherDividendCheckpointFactory: ${EtherDividendCheckpointFactory.address}
ERC20DividendCheckpointFactory: ${ERC20DividendCheckpointFactory.address}
LockUpTransferManagerFactory: ${LockUpTransferManagerFactory.address}
---------------------------------------------------------------------------------
`);
console.log('\n');
Expand Down
6 changes: 3 additions & 3 deletions test/helpers/createInstances.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const GeneralTransferManager = artifacts.require("./GeneralTransferManager.sol")
const GeneralTransferManagerFactory = artifacts.require("./GeneralTransferManagerFactory.sol");
const GeneralPermissionManagerFactory = artifacts.require("./GeneralPermissionManagerFactory.sol");
const CountTransferManagerFactory = artifacts.require("./CountTransferManagerFactory.sol");
const VolumeRestrictionTransferManagerFactory = artifacts.require("./LockupVolumeRestrictionTMFactory");
const LockUpTransferManagerFactory = artifacts.require("./LockUpTransferManagerFactory");
const PreSaleSTOFactory = artifacts.require("./PreSaleSTOFactory.sol");
const PolyToken = artifacts.require("./PolyToken.sol");
const PolyTokenFaucet = artifacts.require("./PolyTokenFaucet.sol");
Expand Down Expand Up @@ -262,11 +262,11 @@ export async function deployPercentageTMAndVerified(accountPolymath, MRProxyInst
}

export async function deployLockupVolumeRTMAndVerified(accountPolymath, MRProxyInstance, polyToken, setupCost) {
I_VolumeRestrictionTransferManagerFactory = await VolumeRestrictionTransferManagerFactory.new(polyToken, setupCost, 0, 0, { from: accountPolymath });
I_VolumeRestrictionTransferManagerFactory = await LockUpTransferManagerFactory.new(polyToken, setupCost, 0, 0, { from: accountPolymath });
assert.notEqual(
I_VolumeRestrictionTransferManagerFactory.address.valueOf(),
"0x0000000000000000000000000000000000000000",
"VolumeRestrictionTransferManagerFactory contract was not deployed"
"LockUpTransferManagerFactory contract was not deployed"
);

await registerAndVerifyByMR(I_VolumeRestrictionTransferManagerFactory.address, accountPolymath, MRProxyInstance);
Expand Down
Loading