Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
188 commits
Select commit Hold shift + click to select a range
bfda334
Change "addPermission()" to "addDelegate()"
VictorVicente Sep 14, 2018
0a7e17a
Remove "getDelegateDetails()"
VictorVicente Sep 14, 2018
34c8c19
Add requirement to avoid empty details on "addDelegate()"
VictorVicente Sep 14, 2018
3566d16
Change "addPermission()" to "addDelegate()"
VictorVicente Sep 14, 2018
8612b20
Remove "getDelegateDetails()"
VictorVicente Sep 14, 2018
2b28b3e
Add requirement to avoid empty details on "addDelegate()"
VictorVicente Sep 14, 2018
faf1bab
generalPermissionManager changes
comeonbuddy Oct 2, 2018
fc0bace
WIP
adamdossa Oct 2, 2018
a925a8c
Fixes
adamdossa Oct 2, 2018
4838de7
Merge branch 'development-1.5.0' into support_multiple_module_types
adamdossa Oct 2, 2018
59cb476
Size too big...
adamdossa Oct 2, 2018
f774113
Added exception helper
maxsam4 Oct 3, 2018
b197574
Using helper in erc20 dividend tests
maxsam4 Oct 3, 2018
ce06984
WIP
adamdossa Oct 3, 2018
f91dd27
DividendCheckpoint test cases added
maxsam4 Oct 3, 2018
7b09033
ERC20 Dividends test cases added
maxsam4 Oct 3, 2018
3104215
ether dividend test cases added
maxsam4 Oct 3, 2018
ceed74e
WIP
adamdossa Oct 3, 2018
e7caf0d
Go back to in-lined internals
adamdossa Oct 3, 2018
f1c6aa4
Merge branch 'development-1.5.0' into support_multiple_module_types
adamdossa Oct 3, 2018
0a00f95
Remove merge cruft
adamdossa Oct 3, 2018
85a8ba6
More merge cruft
adamdossa Oct 3, 2018
5e57f73
finished permission manager changes
comeonbuddy Oct 3, 2018
c6b04e1
fix branch conflicts
comeonbuddy Oct 3, 2018
98b7a8e
finished permission manager changes
comeonbuddy Oct 3, 2018
f31a001
WIP fixes
adamdossa Oct 3, 2018
a37a776
Still too big
adamdossa Oct 3, 2018
5c5dbd5
Working
adamdossa Oct 3, 2018
80bfbb1
Remove commented lines
adamdossa Oct 3, 2018
5a7657b
Fix test cases
adamdossa Oct 3, 2018
5278696
More fixes
adamdossa Oct 3, 2018
3b0f0be
Remove kludge
adamdossa Oct 3, 2018
b91c14e
Fix some more tests
adamdossa Oct 3, 2018
476e535
STR test cases updated
SatyamSB Oct 4, 2018
b37b605
move investors data and logic into the library
SatyamSB Oct 4, 2018
11f6e60
minor naming fix
SatyamSB Oct 4, 2018
e7a290d
cleanup
SatyamSB Oct 4, 2018
6fe5614
Merge branch 'support_multiple_module_types' into some-changes-adampr
SatyamSB Oct 4, 2018
2b50c16
add some improvements
SatyamSB Oct 4, 2018
d5e0a7f
added a missing semi-colon
maxsam4 Oct 4, 2018
eda91dc
fix testing with extra module attached
comeonbuddy Oct 4, 2018
00948cc
Merge branch 'development-1.5.0' into Permission-Manager-Changes
maxsam4 Oct 4, 2018
00654ea
Removed mocks from coverage
maxsam4 Oct 4, 2018
52f475d
Burn module test case
maxsam4 Oct 4, 2018
16161ae
General permission manager test case
maxsam4 Oct 4, 2018
f4869dd
Fixes based on comments
adamdossa Oct 4, 2018
a810f91
Remove empty module
adamdossa Oct 4, 2018
2952dc4
Add forceBurn to fuzz testing for checkpoints
adamdossa Oct 4, 2018
acbc3f5
resolve conflicts
SatyamSB Oct 4, 2018
7e2859b
minor fix
SatyamSB Oct 4, 2018
6d8bcee
remove investorCount
SatyamSB Oct 4, 2018
e4817d3
Merge pull request #314 from PolymathNetwork/some-changes-adampr
satyamakgec Oct 4, 2018
fe52c2e
helper for PM ecosystem deployment
SatyamSB Oct 4, 2018
a0082ba
Merge branch 'improve-coverage' of https://github.com/PolymathNetwork…
SatyamSB Oct 4, 2018
c056227
fixes done
comeonbuddy Oct 4, 2018
1b4a549
Small update
adamdossa Oct 4, 2018
6ab03f1
Merge pull request #305 from PolymathNetwork/support_multiple_module_…
satyamakgec Oct 4, 2018
35a2cc1
fixed function name in transfer manager test
comeonbuddy Oct 4, 2018
b9247bd
fixed issuerance & security token test files
comeonbuddy Oct 4, 2018
b09148c
WIP catchRevert
maxsam4 Oct 4, 2018
e0e932c
Removed try{ (no space) as well
maxsam4 Oct 4, 2018
205fb70
Merge branch 'development-1.5.0' into Permission-Manager-Changes
SatyamSB Oct 4, 2018
05b79b9
Merge branch 'development-1.5.0' into Permission-Manager-Changes
pabloruiz55 Oct 4, 2018
3b1eb69
re-ordered functions
pabloruiz55 Oct 4, 2018
6629170
app proper spacing and imrovements
SatyamSB Oct 4, 2018
741e790
resolve conflicts
SatyamSB Oct 4, 2018
de69a71
Add additional transfer / mint / burn functions with _data parameter
adamdossa Oct 4, 2018
7992f9d
Merge pull request #315 from PolymathNetwork/off-chain-validation
pabloruiz55 Oct 4, 2018
6a034ee
Merge branch 'development-1.5.0' into Permission-Manager-Changes
pabloruiz55 Oct 4, 2018
1e28f63
cleanup
maxsam4 Oct 5, 2018
4e037d6
added prettier
maxsam4 Oct 5, 2018
87ea437
Revert "added prettier"
maxsam4 Oct 5, 2018
4be9a12
Merge branch 'development-1.5.0' into improve-coverage
maxsam4 Oct 5, 2018
178add4
Capped STO test fix
maxsam4 Oct 5, 2018
0868f88
erc20 dividend test cases fix
maxsam4 Oct 5, 2018
7843f36
Added prettier
maxsam4 Oct 5, 2018
f8ee1cb
Merge branch 'development-1.5.0' into Permission-Manager-Changes
SatyamSB Oct 5, 2018
618c260
general transfer manager test fix
maxsam4 Oct 5, 2018
77e91de
Ignore helpers and oracles in coverage
maxsam4 Oct 5, 2018
b20c415
usd tiered sto test fix
maxsam4 Oct 5, 2018
92bc715
Execute prettier
maxsam4 Oct 5, 2018
abd9477
minor fix in changePermissionMulti
SatyamSB Oct 5, 2018
5ab89fe
Merge branch 'Permission-Manager-Changes' of https://github.com/Polym…
SatyamSB Oct 5, 2018
77f829d
Removed ex.js
maxsam4 Oct 5, 2018
e50e690
Disabled deepSkip to fix coverage
maxsam4 Oct 5, 2018
487624f
Coverage config changed
maxsam4 Oct 5, 2018
5d56a51
remove cruft
SatyamSB Oct 5, 2018
d65432f
resolve conflicts
SatyamSB Oct 5, 2018
903044a
remove repeatitive code
SatyamSB Oct 5, 2018
f6f4526
cleanup GPM
SatyamSB Oct 5, 2018
fff2ddd
Lockup Volume Restrictions (#290)
glitch003 Oct 5, 2018
1f29ca9
Decimals fixed for percentage
maxsam4 Oct 5, 2018
bfbb890
Merge branch 'development-1.5.0' into percentage-fix
maxsam4 Oct 5, 2018
2f8a9ba
Merge branch 'development-1.5.0' into Permission-Manager-Changes
adamdossa Oct 5, 2018
6e9bcc4
more improvement into the createInstances
SatyamSB Oct 5, 2018
3b7be9c
Merge pull request #317 from PolymathNetwork/percentage-fix
satyamakgec Oct 5, 2018
3c2c800
Merge branch 'development-1.5.0' into Permission-Manager-Changes
SatyamSB Oct 5, 2018
951d1b3
Merge branch 'development-1.5.0' into improve-coverage
maxsam4 Oct 5, 2018
813777d
test attempt
SatyamSB Oct 5, 2018
9c5667a
Add the ability to bypass issuance transfers
adamdossa Oct 5, 2018
3851971
Fix test cases
adamdossa Oct 5, 2018
aa274eb
closing the coverage
SatyamSB Oct 5, 2018
3affcd0
Another fix
adamdossa Oct 5, 2018
186b9fd
Update change log
adamdossa Oct 5, 2018
5976c9a
copy files over based on dev 1.5.0
comeonbuddy Oct 5, 2018
a2f50db
Merge pull request #318 from PolymathNetwork/allow_issuance_transfers
pabloruiz55 Oct 5, 2018
58c270e
Merge branch 'development-1.5.0' into Permission-Manager-Changes
pabloruiz55 Oct 5, 2018
7f76322
Merge pull request #313 from PolymathNetwork/Permission-Manager-Changes
pabloruiz55 Oct 5, 2018
bfaa674
Fixed migration
maxsam4 Oct 5, 2018
5ae5be3
Coverage re enabled
maxsam4 Oct 5, 2018
0761d51
Migration fix
maxsam4 Oct 5, 2018
29fa0b5
added mainnet oracle addresses
pabloruiz55 Oct 5, 2018
5b507fd
adjusted mainnet migration gas price
pabloruiz55 Oct 5, 2018
ea909ad
Hacky fix for nonce
maxsam4 Oct 5, 2018
f096c39
Update truffle.js
maxsam4 Oct 5, 2018
08fc007
Merge branch 'development-1.5.0' into migrate-fix
pabloruiz55 Oct 5, 2018
3b5f3a4
remove redundant code
SatyamSB Oct 5, 2018
1d485d4
fixed EternalStorage.sol indentation
pabloruiz55 Oct 5, 2018
1aaef50
fixed linter errors in helpers, proxy, storage contracts
pabloruiz55 Oct 5, 2018
e4a6eee
fixed linter errors in MR and STR
pabloruiz55 Oct 5, 2018
308f992
fixed linter errors and typos in SecurityToken
pabloruiz55 Oct 5, 2018
5bf40c5
fixed linter errors is STO modules
pabloruiz55 Oct 5, 2018
5f33e92
Merge branch 'development-1.5.0' into migrate-fix
pabloruiz55 Oct 5, 2018
6fcc8ef
Merge pull request #319 from PolymathNetwork/migrate-fix
pabloruiz55 Oct 5, 2018
018e81d
remove more cruft
SatyamSB Oct 7, 2018
99bb061
resolve conflicts
SatyamSB Oct 7, 2018
4db2e6b
Merge branch 'improve-coverage' of https://github.com/PolymathNetwork…
SatyamSB Oct 7, 2018
9edfd6d
provide correct path to exclude the contracts
SatyamSB Oct 8, 2018
627a4e3
debugging test
comeonbuddy Oct 8, 2018
865af7a
new test file from scratch
comeonbuddy Oct 8, 2018
e7c04b2
factory debug
comeonbuddy Oct 8, 2018
44d28e7
remove the unnecessary calling of modules
SatyamSB Oct 8, 2018
df02a68
rebased branch on dev 1.5.0 and rewrite a new test
comeonbuddy Oct 8, 2018
f3a1f86
remove the cruft from the securityToken.js
SatyamSB Oct 8, 2018
4ee8119
small changes
SatyamSB Oct 8, 2018
d2248ff
fix the tiered STO
SatyamSB Oct 9, 2018
de03d13
revamp the tests
SatyamSB Oct 9, 2018
1c20dbe
revamp the STVRM -- need to re-write the test cases
SatyamSB Oct 9, 2018
ba3ca77
remove the redundant code
SatyamSB Oct 9, 2018
e0a3302
improve the test code of proxies
SatyamSB Oct 9, 2018
4c32a99
fix in GPM
SatyamSB Oct 9, 2018
d2f048b
finished refacting module / added new function to allow active/deacti…
comeonbuddy Oct 9, 2018
5c0c3ba
update test file name
comeonbuddy Oct 9, 2018
c6d448e
Travis fix (#321)
maxsam4 Oct 9, 2018
d7a427f
Merge branch 'development-1.5.0' into improve-coverage
maxsam4 Oct 9, 2018
bfe65be
Solidity Coverage Fix (#328)
maxsam4 Oct 10, 2018
a9aa7b1
Merge branch 'development-1.5.0' into improve-coverage
maxsam4 Oct 10, 2018
019ad67
Merge branch 'development-1.5.0' into voting-module-oct
adamdossa Oct 10, 2018
dec62a5
Merge pull request #304 from PolymathNetwork/improve-coverage
satyamakgec Oct 10, 2018
3f4f6db
fixed pull comments
comeonbuddy Oct 10, 2018
60d2514
Merge branch 'voting-module-oct' of https://github.com/PolymathNetwor…
comeonbuddy Oct 10, 2018
b94c068
fixed pull request comments
comeonbuddy Oct 10, 2018
22dab87
Merge branch 'development-1.5.0' into voting-module-oct
comeonbuddy Oct 10, 2018
14acb4e
fixed permission manager test causing fail
comeonbuddy Oct 10, 2018
9dc1fc9
Migration script to 2.0.0 (#325)
VictorVicente Oct 10, 2018
43689cc
Cli minor updates (#331)
VictorVicente Oct 10, 2018
5ed3fa4
Improved deploy info (#330)
maxsam4 Oct 10, 2018
fde4d30
Renamed VRTM module
maxsam4 Oct 11, 2018
72fe74a
Merge branch 'development-1.5.0' into voting-module-oct
comeonbuddy Oct 11, 2018
c6cdc38
Merge pull request #329 from PolymathNetwork/voting-module-oct
comeonbuddy Oct 11, 2018
9d09b70
Limited faucet drops
maxsam4 Oct 11, 2018
ede272b
Faucet decimal fixed
maxsam4 Oct 11, 2018
57026c1
Renamed TransferManager to TM
maxsam4 Oct 11, 2018
6b2e7ef
tests fixed
maxsam4 Oct 11, 2018
e327a68
Merge branch 'development-1.5.0' into faucet-fix
maxsam4 Oct 11, 2018
5e5a145
Using decimals
maxsam4 Oct 11, 2018
94b5c7d
Increased initial minting
maxsam4 Oct 11, 2018
49aae2b
Revert "Voting module" (#336)
pabloruiz55 Oct 11, 2018
1dd8191
Merge pull request #332 from PolymathNetwork/rename-vrtm
satyamakgec Oct 11, 2018
d8a6db8
Merge branch 'development-1.5.0' into faucet-fix
maxsam4 Oct 11, 2018
acb36c5
Delete LockupVolumeRestrictionTransferManager.sol
maxsam4 Oct 12, 2018
1bde6b3
Delete LockupVolumeRestrictionTransferManagerFactory.sol
maxsam4 Oct 12, 2018
e940a2d
Merge pull request #333 from PolymathNetwork/faucet-fix
satyamakgec Oct 12, 2018
84c0077
Cli permissions manager (#335)
VictorVicente Oct 12, 2018
06a1916
Migrating to yarn from npm (#340)
maxsam4 Oct 12, 2018
05331d1
linter errors and typos
pabloruiz55 Oct 12, 2018
468b047
minor linter error fixes
pabloruiz55 Oct 14, 2018
df996a1
Increase coverage (#342)
satyamakgec Oct 16, 2018
1a38304
Windows support (#343)
maxsam4 Oct 16, 2018
ac8630c
Dividend delegate (#344)
maxsam4 Oct 17, 2018
37df18c
CLI typos fix
VictorVicente Oct 18, 2018
4ce4666
Fixed withdraw recipient
maxsam4 Oct 18, 2018
299d353
Merge branch 'development-1.5.0' into divident-transfer
maxsam4 Oct 18, 2018
4d1f3e5
Merge pull request #351 from PolymathNetwork/divident-transfer
satyamakgec Oct 18, 2018
fa9c29b
Added function to deleteDelegate
maxsam4 Oct 19, 2018
c9abbd5
Update g_general_permission_manager.js
maxsam4 Oct 19, 2018
aa428ea
Merge branch 'development-1.5.0' into remove-delegate
maxsam4 Oct 19, 2018
771dbe6
Merge pull request #354 from PolymathNetwork/remove-delegate
satyamakgec Oct 19, 2018
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
10 changes: 10 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,14 @@ module.exports = {
"assert": false,
"web3": false
},

"rules": {
"indent": 0,
"camelcase": 0,
"no-unused-vars": 0,
"quotes": 0,
"semi": 0,
"no-undef": 0,
"key-spacing": 0
}
};
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,11 @@ coverage.json
bridge.log
scTopics
coverageEnv
/flat
/flat
/tempPoly
.eslintrc.js
package-lock.json
bridge.log
.node-xml*
.solcover.js.bk
allFiredEvents
3 changes: 2 additions & 1 deletion .solcover.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ module.exports = {
copyPackages: ['openzeppelin-solidity'],
testCommand: 'node ../node_modules/.bin/truffle test `find test/*.js ! -name a_poly_oracle.js -and ! -name s_v130_to_v140_upgrade.js` --network coverage',
deepSkip: true,
skipFiles: ['external', 'flat']
skipFiles: ['external', 'flat', 'helpers', 'mocks', 'oracles', 'libraries/KindMath.sol', 'storage'],
forceParse: ['mocks', 'oracles']
};
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ before_install:
- sudo apt-get -y install solc
before_script:
- truffle version
- wget -O node_modules/solidity-coverage/lib/app.js https://raw.githubusercontent.com/maxsam4/solidity-coverage/relative-path/lib/app.js
script:
- npm run test
- npm run docs
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=
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=
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ All notable changes to this project will be documented in this file.
[__1.5.0__](https://www.npmjs.com/package/polymath-core?activeTab=readme) __15-08-18__

## Added
* Added `deleteDelegate()` to general permission manager. It will disable the delegate but not delete the perms.
* Migrated from `npm` to `yarn`.
* Added `SingleTradeVolumeRestrictionManager` module
* Added flag in `PercentageTransferManager` to allow ignoring of issuance transfers
* Added `transferWithData`, `transferFromWithData`, `mintWithData`, `burnWithData` to allow passing of a `bytes _data` for off-chain validation
* Added ability for modules to have multiple types
* Added `name` field to dividends struct in DividendCheckpoint. #295
* Added `getTagsByType`, `getTagsByTypeAndToken`, `getModulesByType`, `getModulesByTypeAndToken` to MR
* Added `getTokensByOwner` to STR
Expand All @@ -21,11 +27,12 @@ All notable changes to this project will be documented in this file.
* Add `getReputationOfFactory()` & `getModuleListOfType()` functions to get the array type data from the ModuleRegistry contract.
* Add `_setupCost` in `LogGenerateModuleFromFactory` event.
* Add new function `getAllModulesByName()`, To get the list of modules having the same name. #198.
* Add new function `modifyTickerDetails()`, To modify the details of undeployed ticker. #230
* Add new function `modifyTickerDetails()`, To modify the details of undeployed ticker. #230

## Fixed
* Generalize the STO varaible names and added them in `ISTO.sol` to use the common standard in all STOs.
* Generalize the event when any new token get registered with the polymath ecosystem. `LogNewSecurityToken` should emit _ticker, _name, _securityTokenAddress, _owner, _addedAt, _registrant respectively. #230
* Generalize the event when any new token get registered with the polymath ecosystem. `LogNewSecurityToken` should emit _ticker, _name, _securityTokenAddress, _owner, _addedAt, _registrant respectively. #230
* Change the function name of `withdraPoly` to `withdrawERC20` and make the function generalize to extract tokens from the ST contract. parmeters are contract address and the value need to extract from the securityToken.

## Removed
* Remove `swarmHash` from the `registerTicker(), addCustomTicker(), generateSecurityToken(), addCustomSecurityToken()` functions of TickerRegistry.sol and SecurityTokenRegistry.sol. #230
Expand Down
57 changes: 31 additions & 26 deletions CLI/commands/ST20Generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ const MODULES_TYPES = {
PERMISSION: 1,
TRANSFER: 2,
STO: 3,
DIVIDENDS: 4
DIVIDENDS: 4,
BURN: 5
}

const cappedSTOFee = 20000;
Expand All @@ -45,11 +46,14 @@ let _tokenConfig;
let _mintingConfig;
let _stoConfig;

let network;

async function executeApp(tokenConfig, mintingConfig, stoConfig, remoteNetwork) {
_tokenConfig = tokenConfig;
_mintingConfig = mintingConfig;
_stoConfig = stoConfig;

network = remoteNetwork;
await global.initialize(remoteNetwork);

common.logAsciiBull();
Expand Down Expand Up @@ -98,7 +102,7 @@ async function setup(){
}

async function step_ticker_reg(){
console.log('\n\x1b[34m%s\x1b[0m',"Token Creation - Symbol Registration");
console.log('\n\x1b[34m%s\x1b[0m',"Token Symbol Registration");

let available = false;
let regFee = web3.utils.fromWei(await securityTokenRegistry.methods.getTickerRegistrationFee().call());
Expand Down Expand Up @@ -204,7 +208,7 @@ async function step_Wallet_Issuance(){
console.log("\n");
console.log('\x1b[34m%s\x1b[0m',"Token Creation - Token Minting for Issuer");

console.log("Before setting up the STO, you can mint any amount of tokens that will remain under your control or you can trasfer to affiliates");
console.log("Before setting up the STO, you can mint any amount of tokens that will remain under your control or you can transfer to affiliates");

let multimint;
if (typeof _mintingConfig !== 'undefined' && _mintingConfig.hasOwnProperty('multimint')) {
Expand Down Expand Up @@ -257,12 +261,12 @@ async function step_Wallet_Issuance(){

async function multi_mint_tokens() {
//await whitelist.startWhitelisting(tokenSymbol);
shell.exec(`${__dirname}/scripts/script.sh Whitelist ${tokenSymbol} 75`);
shell.exec(`${__dirname}/scripts/script.sh Whitelist ${tokenSymbol} 75 ${network}`);
console.log(chalk.green(`\nCongrats! All the affiliates get succssfully whitelisted, Now its time to Mint the tokens\n`));
console.log(chalk.red(`WARNING: `) + `Please make sure all the addresses that get whitelisted are only eligible to hold or get Security token\n`);

shell.exec(`${__dirname}/scripts//script.sh Multimint ${tokenSymbol} 75`);
console.log(chalk.green(`\nHurray!! Tokens get successfully Minted and transfered to token holders`));
shell.exec(`${__dirname}/scripts//script.sh Multimint ${tokenSymbol} 75 ${network}`);
console.log(chalk.green(`\nHurray!! Tokens get successfully Minted and transferred to token holders`));
}

async function step_STO_launch() {
Expand Down Expand Up @@ -350,7 +354,7 @@ async function cappedSTO_launch() {
process.exit(0);
} else {
let transferAction = polyToken.methods.transfer(securityToken._address, new BigNumber(transferAmount));
let receipt = await common.sendTransaction(Issuer, transferAction, defaultGasPrice, 0, 1.5);
let receipt = await common.sendTransaction(Issuer, transferAction, defaultGasPrice, 0, 2);
let event = common.getEventFromLogs(polyToken._jsonInterface, receipt.logs, 'Transfer');
console.log(`Number of POLY sent: ${web3.utils.fromWei(new web3.utils.BN(event._value))}`)
}
Expand Down Expand Up @@ -518,19 +522,20 @@ function fundingConfigUSDTieredSTO() {
if (typeof _stoConfig !== 'undefined' && _stoConfig.hasOwnProperty('fundingType')) {
selectedFunding = _stoConfig.fundingType;
} else {
selectedFunding = readlineSync.question('Enter' + chalk.green(` P `) + 'for POLY raise,' + chalk.green(` D `) + 'for DAI raise,' + chalk.green(` E `) + 'for Ether raise or' + chalk.green(` A `) + 'for all (A): ').toUpperCase();
selectedFunding = readlineSync.question('Enter' + chalk.green(` P `) + 'for POLY raise,' + chalk.green(` D `) + 'for DAI raise,' + chalk.green(` E `) + 'for Ether raise or any combination of them (i.e.'+ chalk.green(` PED `) + 'for all): ').toUpperCase();
}

if (selectedFunding == 'E') {
funding.raiseType = [FUND_RAISE_TYPES.ETH];
funding.raiseType = [];
if (selectedFunding.includes('E')) {
funding.raiseType.push(FUND_RAISE_TYPES.ETH);
}
else if (selectedFunding == 'P') {
funding.raiseType = [FUND_RAISE_TYPES.POLY];
if (selectedFunding.includes('P')) {
funding.raiseType.push(FUND_RAISE_TYPES.POLY);
}
else if (selectedFunding == 'D') {
funding.raiseType = [FUND_RAISE_TYPES.DAI];
if (selectedFunding.includes('D')) {
funding.raiseType.push(FUND_RAISE_TYPES.DAI);
}
else {
if (funding.raiseType.length == 0) {
funding.raiseType = [FUND_RAISE_TYPES.ETH, FUND_RAISE_TYPES.POLY, FUND_RAISE_TYPES.DAI];
}

Expand Down Expand Up @@ -725,7 +730,7 @@ function limitsConfigUSDTieredSTO() {
if (typeof _stoConfig !== 'undefined' && _stoConfig.hasOwnProperty('nonAccreditedLimitUSD')) {
limits.nonAccreditedLimitUSD = web3.utils.toWei(_stoConfig.nonAccreditedLimitUSD.toString());
} else {
limits.nonAccreditedLimitUSD = web3.utils.toWei(readlineSync.question(`What is the default limit for non accredited insvestors in USD? (${nonAccreditedLimit}): `, {
limits.nonAccreditedLimitUSD = web3.utils.toWei(readlineSync.question(`What is the default limit for non accredited investors in USD? (${nonAccreditedLimit}): `, {
limit: function(input) {
return new BigNumber(web3.utils.toWei(input)).gte(limits.minimumInvestmentUSD);
},
Expand All @@ -744,17 +749,17 @@ async function usdTieredSTO_launch() {
let stoFee = usdTieredSTOFee;
let contractBalance = await polyToken.methods.balanceOf(securityToken._address).call();
let requiredAmount = web3.utils.toWei(stoFee.toString(), "ether");
if (parseInt(contractBalance) < parseInt(requiredAmount)) {
let transferAmount = parseInt(requiredAmount) - parseInt(contractBalance);
let ownerBalance = await polyToken.methods.balanceOf(Issuer.address).call();
if(parseInt(ownerBalance) < transferAmount) {
if (new web3.utils.BN(contractBalance).lt(new web3.utils.BN(requiredAmount))) {
let transferAmount = (new web3.utils.BN(requiredAmount)).sub(new web3.utils.BN(contractBalance));
let ownerBalance = new web3.utils.BN(await polyToken.methods.balanceOf(Issuer.address).call());
if (ownerBalance.lt(transferAmount)) {
console.log(chalk.red(`\n**************************************************************************************************************************************************`));
console.log(chalk.red(`Not enough balance to pay the ${selectedSTO} fee, Requires ${(new BigNumber(transferAmount).dividedBy(new BigNumber(10).pow(18))).toNumber()} POLY but have ${(new BigNumber(ownerBalance).dividedBy(new BigNumber(10).pow(18))).toNumber()} POLY. Access POLY faucet to get the POLY to complete this txn`));
console.log(chalk.red(`Not enough balance to pay the ${selectedSTO} fee, Requires ${web3.utils.fromWei(transferAmount)} POLY but have ${web3.utils.fromWei(ownerBalance)} POLY. Access POLY faucet to get the POLY to complete this txn`));
console.log(chalk.red(`**************************************************************************************************************************************************\n`));
process.exit(0);
} else {
let transferAction = polyToken.methods.transfer(securityToken._address, new BigNumber(transferAmount));
let receipt = await common.sendTransaction(Issuer, transferAction, defaultGasPrice, 0, 1.5);
let transferAction = polyToken.methods.transfer(securityToken._address, transferAmount);
let receipt = await common.sendTransaction(Issuer, transferAction, defaultGasPrice, 0, 2);
let event = common.getEventFromLogs(polyToken._jsonInterface, receipt.logs, 'Transfer');
console.log(`Number of POLY sent: ${web3.utils.fromWei(new web3.utils.BN(event._value))}`)
}
Expand Down Expand Up @@ -997,7 +1002,7 @@ async function usdTieredSTO_configure() {
switch (index) {
case 0:
let reserveWallet = await currentSTO.methods.reserveWallet().call();
let isVerified = await generalTransferManager.methods.verifyTransfer(STO_Address, reserveWallet, 0, false).call();
let isVerified = await generalTransferManager.methods.verifyTransfer(STO_Address, reserveWallet, 0, web3.utils.fromAscii("")).call();
if (isVerified == "2") {
if (readlineSync.keyInYNStrict()) {
let finalizeAction = currentSTO.methods.finalize();
Expand All @@ -1017,7 +1022,7 @@ async function usdTieredSTO_configure() {
await common.sendTransaction(Issuer, changeAccreditedAction, defaultGasPrice);
break;
case 2:
shell.exec(`${__dirname}/scripts/script.sh Accredit ${tokenSymbol} 75`);
shell.exec(`${__dirname}/scripts/script.sh Accredit ${tokenSymbol} 75 ${network}`);
break;
case 3:
let account = readlineSync.question('Enter the address to change non accredited limit: ');
Expand All @@ -1029,7 +1034,7 @@ async function usdTieredSTO_configure() {
await common.sendTransaction(Issuer, changeNonAccreditedLimitAction, defaultGasPrice);
break;
case 4:
shell.exec(`${__dirname}/scripts/script.sh NonAccreditedLimit ${tokenSymbol} 75`);
shell.exec(`${__dirname}/scripts/script.sh NonAccreditedLimit ${tokenSymbol} 75 ${network}`);
break;
case 5:
await modfifyTimes();
Expand Down
1 change: 1 addition & 0 deletions CLI/commands/accredit.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ let badData = new Array();
startScript();

async function startScript() {
if (remoteNetwork == 'undefined') remoteNetwork = undefined;
await global.initialize(remoteNetwork);
try {
let securityTokenRegistryAddress = await contracts.securityTokenRegistry();
Expand Down
1 change: 1 addition & 0 deletions CLI/commands/changeNonAccreditedLimit.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ let badData = new Array();
startScript();

async function startScript() {
if (remoteNetwork == 'undefined') remoteNetwork = undefined;
await global.initialize(remoteNetwork);
try {
let securityTokenRegistryAddress = await contracts.securityTokenRegistry();
Expand Down
12 changes: 6 additions & 6 deletions CLI/commands/contract_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ async function strActions() {
let tickerStatus = readlineSync.keyInYNStrict(`Is the token deployed?`);
let modifyTickerAction = currentContract.methods.modifyTicker(tickerOwner, tickerToModify, tickerSTName, tickerRegistrationDate, tickerExpiryDate, tickerStatus);
await common.sendTransaction(Issuer, modifyTickerAction, defaultGasPrice, 0, 1.5);
console.log(chalk.green(`Ticker has been updated successfuly`));
console.log(chalk.green(`Ticker has been updated successfully`));
break;
case 'Remove Ticker':
let tickerToRemove = readlineSync.question('Enter the token symbol that you want to remove: ');
Expand All @@ -119,7 +119,7 @@ async function strActions() {
} else {
let removeTickerAction = currentContract.methods.removeTicker(tickerToRemove);
await common.sendTransaction(Issuer, removeTickerAction, defaultGasPrice, 0, 3);
console.log(chalk.green(`Ticker has been removed successfuly`));
console.log(chalk.green(`Ticker has been removed successfully`));
}
break;
case 'Modify SecurityToken':
Expand Down Expand Up @@ -160,7 +160,7 @@ async function strActions() {
let deployedAt = readlineSync.questionInt(`Enter the Unix Epoch timestamp at which security token was deployed: `);
let modifySTAction = currentContract.methods.modifySecurityToken(name, ticker, owner, stAddress, tokenDetails, deployedAt);
await common.sendTransaction(Issuer, modifySTAction, defaultGasPrice, 0, 1.5);
console.log(chalk.green(`Security Token has been updated successfuly`));
console.log(chalk.green(`Security Token has been updated successfully`));
break;
case 'Change Expiry Limit':
let currentExpiryLimit = await currentContract.methods.getExpiryLimit().call();
Expand All @@ -169,7 +169,7 @@ async function strActions() {
let changeExpiryLimitAction = currentContract.methods.changeExpiryLimit(newExpiryLimit);
let changeExpiryLimitReceipt = await common.sendTransaction(Issuer, changeExpiryLimitAction, defaultGasPrice);
let changeExpiryLimitEvent = common.getEventFromLogs(currentContract._jsonInterface, changeExpiryLimitReceipt.logs, 'ChangeExpiryLimit');
console.log(chalk.green(`Expiry limit was changed successfuly. New limit is ${Math.floor(parseInt(changeExpiryLimitEvent._newExpiry)/60/60/24)} days\n`));
console.log(chalk.green(`Expiry limit was changed successfully. New limit is ${Math.floor(parseInt(changeExpiryLimitEvent._newExpiry)/60/60/24)} days\n`));
break;
case 'Change registration fee':
let currentRegFee = web3.utils.fromWei(await currentContract.methods.getTickerRegistrationFee().call());
Expand All @@ -178,7 +178,7 @@ async function strActions() {
let changeRegFeeAction = currentContract.methods.changeTickerRegistrationFee(newRegFee);
let changeRegFeeReceipt = await common.sendTransaction(Issuer, changeRegFeeAction, defaultGasPrice);
let changeRegFeeEvent = common.getEventFromLogs(currentContract._jsonInterface, changeRegFeeReceipt.logs, 'ChangeTickerRegistrationFee');
console.log(chalk.green(`Fee was changed successfuly. New fee is ${web3.utils.fromWei(changeRegFeeEvent._newFee)} POLY\n`));
console.log(chalk.green(`Fee was changed successfully. New fee is ${web3.utils.fromWei(changeRegFeeEvent._newFee)} POLY\n`));
break;
case 'Change ST launch fee':
let currentLaunchFee = web3.utils.fromWei(await currentContract.methods.getSecurityTokenLaunchFee().call());
Expand All @@ -187,7 +187,7 @@ async function strActions() {
let changeLaunchFeeAction = currentContract.methods.changeSecurityLaunchFee(newLaunchFee);
let changeLaunchFeeReceipt = await common.sendTransaction(Issuer, changeLaunchFeeAction, defaultGasPrice);
let changeLaunchFeeEvent = common.getEventFromLogs(currentContract._jsonInterface, changeLaunchFeeReceipt.logs, 'ChangeSecurityLaunchFee');
console.log(chalk.green(`Fee was changed successfuly. New fee is ${web3.utils.fromWei(changeLaunchFeeEvent._newFee)} POLY\n`));
console.log(chalk.green(`Fee was changed successfully. New fee is ${web3.utils.fromWei(changeLaunchFeeEvent._newFee)} POLY\n`));
break;
case 'CANCEL':
process.exit(0);
Expand Down
Loading