Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
29ed76d
intialise
SatyamSB Nov 16, 2018
8adb72d
function declaration
SatyamSB Nov 16, 2018
055d2ac
initial draft of VRTM
SatyamSB Nov 20, 2018
6aee799
remove BokkyPooBahsDateTimeLibrary from coverage
SatyamSB Nov 20, 2018
f805ad6
test file addition
SatyamSB Nov 20, 2018
c3de389
allow read using verifyTransfer()
SatyamSB Nov 21, 2018
eddd5a5
refactoring bucket function
SatyamSB Nov 22, 2018
3455d94
global + individual check added
SatyamSB Nov 23, 2018
9f1970d
finalised the logic of sc
SatyamSB Nov 25, 2018
18b429f
Merge branch 'dev-2.1.0' into volTM-module
SatyamSB Nov 25, 2018
6126201
minor fixes
SatyamSB Nov 25, 2018
b069122
reduce the error strings to lower the sixe of the contract
SatyamSB Nov 25, 2018
f44d053
minor fixes
SatyamSB Nov 26, 2018
96bf749
add more test cases
SatyamSB Nov 26, 2018
6597961
Merge branch 'dev-2.1.0' into volTM-module
SatyamSB Nov 26, 2018
8e44d1b
remove the reason strings
SatyamSB Nov 26, 2018
56d0a57
minor fixes in the contract
SatyamSB Nov 27, 2018
c9b90bc
Merge branch 'dev-2.1.0' into volTM-module
SatyamSB Nov 27, 2018
2d96fc2
merge dev-2.1.0 and add new test case
SatyamSB Nov 27, 2018
c33afd4
Merge branch 'dev-2.1.0' into volTM-module
satyamakgec Nov 27, 2018
9802d8a
test cases fixed
SatyamSB Nov 27, 2018
2031c8e
Merge branch 'volTM-module' of https://github.com/PolymathNetwork/pol…
SatyamSB Nov 27, 2018
ed94068
minor test fix because of gtm
SatyamSB Nov 27, 2018
c0878e8
update the permission doc
SatyamSB Nov 27, 2018
0afae26
VRTM moved from experimental to usable TM list
SatyamSB Nov 28, 2018
e29027b
remove the STVRTM
SatyamSB Nov 28, 2018
2e22001
contract changes
SatyamSB Nov 30, 2018
3617971
simplification in the code
SatyamSB Dec 2, 2018
ee059b0
change business logic of verify transfer
SatyamSB Dec 4, 2018
c161fc9
logic fix
SatyamSB Dec 4, 2018
69a648f
modification in the _restrictionCheck
SatyamSB Dec 5, 2018
d0b2aa2
improvements in the update storage
SatyamSB Dec 5, 2018
1734fa9
Merge branch 'dev-2.1.0' into volTM-module
maxsam4 Dec 6, 2018
e3a2a59
resolve conflicts
SatyamSB Dec 6, 2018
3f256b8
changes in the business logic
SatyamSB Dec 6, 2018
6bbe51d
add functions for the individual daily restrictions
SatyamSB Dec 6, 2018
e9a4636
VRTM smart contract completion
SatyamSB Dec 7, 2018
f309d61
resolve conflicts in the changelog
SatyamSB Dec 7, 2018
aa6e8a1
reinvent test cases
SatyamSB Dec 7, 2018
40eac85
contract fully tested with different scenarios of selling of tokens
SatyamSB Dec 8, 2018
0c6cdc1
Merge branch 'dev-2.1.0' into volTM-module
satyamakgec Dec 8, 2018
97fe1cf
more test cases and fix bug in algo
SatyamSB Dec 9, 2018
5b83dbf
empty merge
SatyamSB Dec 9, 2018
7447fb6
CLI & CountTransferManager changes readded
SatyamSB Dec 9, 2018
57bde3a
minor fix in test case
SatyamSB Dec 10, 2018
74c3c4f
Increase Travis test timeout to 25 minutes
maxsam4 Dec 10, 2018
e44af3d
Update .travis.yml
maxsam4 Dec 10, 2018
e579947
minor fix in the naming convention
SatyamSB Dec 10, 2018
dc9a172
Merge branch 'dev-2.1.0' into volTM-module
maxsam4 Dec 10, 2018
c637c2c
resolve conflicts
SatyamSB Dec 10, 2018
5f094d4
Merge branch 'dev-2.1.0' into volTM-module
VictorVicente Dec 11, 2018
216d320
Added code comments
maxsam4 Dec 12, 2018
a0700ea
Removed uninitialized pointer
maxsam4 Dec 12, 2018
34efb95
trying by adding some buffer in time travel
SatyamSB Dec 12, 2018
bc0b62e
modify function changes
SatyamSB Dec 13, 2018
62d4bb5
CLI - WIP VolumeRestrictionTM support
VictorVicente Dec 12, 2018
70f6cac
CLI - Removed STVR TM from CLI
VictorVicente Dec 12, 2018
125c1b8
CLI - Operations in batch for VRTM
VictorVicente Dec 13, 2018
67d3429
CLI - Explore account
VictorVicente Dec 17, 2018
3386072
wip - issue with test not finishing
comeonbuddy Dec 20, 2018
43cc95a
WIP-multiple transaction within 1 day with Individual and daily Restr…
comeonbuddy Dec 20, 2018
4e1e37b
fixed bug with the initial test
comeonbuddy Dec 21, 2018
2de1bb8
added scenario 2 and 3
comeonbuddy Dec 21, 2018
40343b9
fix input random number issue
comeonbuddy Dec 21, 2018
2148636
finished test case 4
comeonbuddy Dec 31, 2018
7b7f3ab
WIP
comeonbuddy Jan 2, 2019
40cfa3d
WIP
comeonbuddy Jan 3, 2019
b13e08c
reinvent the test case
SatyamSB Jan 3, 2019
1299ca3
Merge conflicts
VictorVicente Jan 3, 2019
b7d6df0
Merge branch 'dev-2.1.0' into volTM-module
VictorVicente Jan 3, 2019
6354748
Merge branch 'dev-2.1.0' into volTM-module
VictorVicente Jan 3, 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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
include:
- stage: test
before_script: truffle version
script: npm run test
script: travis_wait 120 sleep infinity & npm run test
notifications:
slack:
secure: W4FZSabLrzF74f317hutolEHnlq2GBlQxU6b85L5XymrjgLEhlgE16c5Qz7Emoyt6le6PXL+sfG2ujJc3XYys/6hppgrHSAasuJnKCdQNpmMZ9BNyMs6WGkmB3enIf3K/FLXb26AQdwpQdIXuOeJUTf879u+YoiZV0eZH8d3+fsIOyovq9N6X5pKOpDM9iT8gGB4t7fie7xf51s+iUaHxyO9G7jDginZ4rBXHcU7mxCub9z+Z1H8+kCTnPWaF+KKVEXx4Z0nI3+urboD7E4OIP02LwrThQls2CppA3X0EoesTcdvj/HLErY/JvsXIFiFEEHZzB1Wi+k2TiOeLcYwEuHIVij+HPxxlJNX/j8uy01Uk8s4rd+0EhvfdKHJqUKqxH4YN2npcKfHEss7bU3y7dUinXQfYShW5ZewHdvc7pnnxBTfhvmdi64HdNrXAPq+s1rhciH7MmnU+tsm4lhrpr+FBuHzUMA9fOCr7b0SQytZEgWpiUls88gdbh3yG8TjyZxmZJGx09cwEP0q7VoH0UwFh7mIu5XmYdd5tWUhavTiO7YV8cUPn7MvwMsTltB3YBpF/fB26L7ka8zBhCsjm9prW6SVYU/dyO3m91VeZtO/zJFHRDA6Q58JGVW2rgzO39z193qC1EGRXqTie96VwAAtNg8+hRb+bI/CWDVzSPc=
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ All notable changes to this project will be documented in this file.
* Changed the version of `ERC20DividendCheckpointFactory` & `EtherDividendCheckpointFactory` from `1.0.0` to `2.1.0`.
* Applied proxy pattern to Dividends modules

## Experimental modules
* Remove the `SingleTradeVolumeRestrictionTMFactory.sol` and its corresponding module `SingleTradeVolumeRestrictionTM.sol`.

## Added
* Add new module called `VolumeRestrictionTM.sol` under the TransferManager modules list. It will be used to restrict the token
volume traded in a given rolling period.

## Changed
* `getAllModulesAndPermsFromTypes()` does not take securityToken address as a parameter anymore.

Expand Down
5 changes: 5 additions & 0 deletions CLI/commands/helpers/contract_abis.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ let generalTransferManagerABI;
let manualApprovalTransferManagerABI;
let countTransferManagerABI;
let percentageTransferManagerABI;
let volumeRestrictionTMABI;
let generalPermissionManagerABI;
let polyTokenABI;
let cappedSTOFactoryABI;
Expand All @@ -36,6 +37,7 @@ try {
manualApprovalTransferManagerABI = JSON.parse(require('fs').readFileSync(`${__dirname}/../../../build/contracts/ManualApprovalTransferManager.json`).toString()).abi;
countTransferManagerABI = JSON.parse(require('fs').readFileSync(`${__dirname}/../../../build/contracts/CountTransferManager.json`).toString()).abi;
percentageTransferManagerABI = JSON.parse(require('fs').readFileSync(`${__dirname}/../../../build/contracts/PercentageTransferManager.json`).toString()).abi;
volumeRestrictionTMABI = JSON.parse(require('fs').readFileSync(`${__dirname}/../../../build/contracts/VolumeRestrictionTM.json`).toString()).abi;
generalPermissionManagerABI = JSON.parse(require('fs').readFileSync(`${__dirname}/../../../build/contracts/GeneralPermissionManager.json`).toString()).abi;
polyTokenABI = JSON.parse(require('fs').readFileSync(`${__dirname}/../../../build/contracts/PolyTokenFaucet.json`).toString()).abi;
cappedSTOFactoryABI = JSON.parse(require('fs').readFileSync(`${__dirname}/../../../build/contracts/CappedSTOFactory.json`).toString()).abi;
Expand Down Expand Up @@ -90,6 +92,9 @@ module.exports = {
percentageTransferManager: function () {
return percentageTransferManagerABI;
},
volumeRestrictionTM: function () {
return volumeRestrictionTMABI;
},
generalPermissionManager: function () {
return generalPermissionManagerABI;
},
Expand Down
842 changes: 617 additions & 225 deletions CLI/commands/transfer_manager.js

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions CLI/data/Transfer/VRTM/add_daily_restriction_data.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
0xee7ae74d964f2be7d72c1b187b38e2ed3615d4d1,1000,1/8/2019,10/10/2019,"Fixed"
0x2f0fd672bf222413cc69dc1f4f1d7e93ad1763a1,2000,1/8/2019,10/10/2019,"Fixed"
0xac297053173b02b02a737d47f7b4a718e5b170ef,500,1/8/2019,10/10/2019,"Fixed"
0x49fc0b78238dab644698a90fa351b4c749e123d2,0.15,1/8/2019,10/10/2019,"Percentage"
0x10223927009b8add0960359dd90d1449415b7ca9,0.25,1/8/2019,10/10/2019,"Percentage"
0x3c65cfe3de848cf38e9d76e9c3e57a2f1140b399,0.1,1/8/2019,10/10/2019,"Percentage"
0xabf60de3265b3017db7a1be66fc8b364ec1dbb98,1234,1/8/2019,10/10/2019,"Fixed"
0xb841fe5a89da1bbef2d0805fbd7ffcbbb2fca5e3,5678,1/8/2019,10/10/2019,"Fixed"
8 changes: 8 additions & 0 deletions CLI/data/Transfer/VRTM/add_restriction_data.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
0xee7ae74d964f2be7d72c1b187b38e2ed3615d4d1,1000,1/8/2019,90,10/10/2019,"Fixed"
0x2f0fd672bf222413cc69dc1f4f1d7e93ad1763a1,2000,1/8/2019,30,10/10/2019,"Fixed"
0xac297053173b02b02a737d47f7b4a718e5b170ef,500,1/8/2019,15,10/10/2019,"Fixed"
0x49fc0b78238dab644698a90fa351b4c749e123d2,0.15,1/8/2019,90,10/10/2019,"Percentage"
0x10223927009b8add0960359dd90d1449415b7ca9,0.25,1/8/2019,30,10/10/2019,"Percentage"
0x3c65cfe3de848cf38e9d76e9c3e57a2f1140b399,0.1,1/8/2019,15,10/10/2019,"Percentage"
0xabf60de3265b3017db7a1be66fc8b364ec1dbb98,1234,1/8/2019,10,10/10/2019,"Fixed"
0xb841fe5a89da1bbef2d0805fbd7ffcbbb2fca5e3,5678,1/8/2019,2,10/10/2019,"Fixed"
5 changes: 5 additions & 0 deletions CLI/data/Transfer/VRTM/modify_daily_restriction_data.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
0xee7ae74d964f2be7d72c1b187b38e2ed3615d4d1,2000,1/8/2019,10/10/2019,"Fixed"
0x2f0fd672bf222413cc69dc1f4f1d7e93ad1763a1,2000,2/8/2019,10/10/2019,"Fixed"
0xac297053173b02b02a737d47f7b4a718e5b170ef,500,1/8/2019,10/10/2019,"Fixed"
0x49fc0b78238dab644698a90fa351b4c749e123d2,0.15,1/8/2019,20/10/2019,"Percentage"
0x10223927009b8add0960359dd90d1449415b7ca9,25,1/8/2019,10/10/2019,"Fixed"
5 changes: 5 additions & 0 deletions CLI/data/Transfer/VRTM/modify_restriction_data.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
0xee7ae74d964f2be7d72c1b187b38e2ed3615d4d1,2000,1/8/2019,90,10/10/2019,"Fixed"
0x2f0fd672bf222413cc69dc1f4f1d7e93ad1763a1,2000,2/8/2019,30,10/10/2019,"Fixed"
0xac297053173b02b02a737d47f7b4a718e5b170ef,500,1/8/2019,20,10/10/2019,"Fixed"
0x49fc0b78238dab644698a90fa351b4c749e123d2,0.15,1/8/2019,90,20/10/2019,"Percentage"
0x10223927009b8add0960359dd90d1449415b7ca9,25,1/8/2019,30,10/10/2019,"Fixed"
6 changes: 6 additions & 0 deletions CLI/data/Transfer/VRTM/remove_daily_restriction_data.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
0xee7ae74d964f2be7d72c1b187b38e2ed3615d4d1
0x2f0fd672bf222413cc69dc1f4f1d7e93ad1763a1
0xac297053173b02b02a737d47f7b4a718e5b170ef
0x49fc0b78238dab644698a90fa351b4c749e123d2
0x10223927009b8add0960359dd90d1449415b7ca9
0x3c65cfe3de848cf38e9d76e9c3e57a2f1140b399
2 changes: 2 additions & 0 deletions CLI/data/Transfer/VRTM/remove_restriction_data.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
0xabf60de3265b3017db7a1be66fc8b364ec1dbb98
0xb841fe5a89da1bbef2d0805fbd7ffcbbb2fca5e3
37 changes: 18 additions & 19 deletions CLI/polymath-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ const transfer_manager = require('./commands/transfer_manager');
const contract_manager = require('./commands/contract_manager');
const strMigrator = require('./commands/strMigrator');
const permission_manager = require('./commands/permission_manager');
const time = require('./commands/helpers/time')
const time = require('./commands/helpers/time');
const gbl = require('./commands/common/global');
const program = require('commander');
const program = require('commander');
const moment = require('moment');
const yaml = require('js-yaml');
const fs = require('fs');
Expand Down Expand Up @@ -162,24 +162,23 @@ program
await permission_manager.executeApp();
});

program
.command('time_travel')
.alias('tt')
.option('-p, --period <seconds>', 'Period of time in seconds to increase')
.option('-d, --toDate <date>', 'Human readable date ("MM/DD/YY [HH:mm:ss]") to travel to')
.option('-e, --toEpochTime <epochTime>', 'Unix Epoch time to travel to')
.description('Increases time on EVM according to given value.')
.action(async function (cmd) {
await gbl.initialize(program.remoteNode);
if (cmd.period) {
await time.increaseTimeByDuration(parseInt(cmd.period));
} else if (cmd.toDate) {
await time.increaseTimeToDate(cmd.toDate);
} else if (cmd.toEpochTime) {
await time.increaseTimeToEpochDate(cmd.toEpochTime);
}
program
.command('time_travel')
.alias('tt')
.option('-p, --period <seconds>', 'Period of time in seconds to increase')
.option('-d, --toDate <date>', 'Human readable date ("MM/DD/YY [HH:mm:ss]") to travel to')
.option('-e, --toEpochTime <epochTime>', 'Unix Epoch time to travel to')
.description('Increases time on EVM according to given value.')
.action(async function (cmd) {
await gbl.initialize(program.remoteNode);
if (cmd.period) {
await time.increaseTimeByDuration(parseInt(cmd.period));
} else if (cmd.toDate) {
await time.increaseTimeToDate(cmd.toDate);
} else if (cmd.toEpochTime) {
await time.increaseTimeToEpochDate(cmd.toEpochTime);
}
});

program.parse(process.argv);

if (typeof program.commands.length == 0) {
Expand Down
Loading