Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
23f5f98
Optimisations
adamdossa Sep 28, 2018
e94e025
WIP
adamdossa Sep 30, 2018
cd952c3
Updates
adamdossa Sep 30, 2018
e425691
Add assertion
adamdossa Sep 30, 2018
7ad0c19
Update interface
adamdossa Sep 30, 2018
6ca6b19
Merge branch 'development-1.5.0' into optimise_str_size
adamdossa Sep 30, 2018
c92ed87
minor fixes to reduce the size
SatyamSB Oct 1, 2018
0ea44ab
Revert changes to setProtocol
adamdossa Oct 1, 2018
04fb3a1
Only allow STs to be added if there is a valid ticker registration first
adamdossa Oct 1, 2018
6621d9e
Change logic to allow tickers to be registered directly when modifyin…
adamdossa Oct 1, 2018
6deb8e2
CLI: STR getters for fees and expiry limit
VictorVicente Oct 1, 2018
7eddf7d
CLI typo
VictorVicente Oct 1, 2018
27e13cb
minor fixes
SatyamSB Oct 1, 2018
c7ddbe5
Merge branch 'optimise_str_size' of https://github.com/PolymathNetwor…
SatyamSB Oct 1, 2018
d56957f
Minor change
adamdossa Oct 1, 2018
1420bce
CLI: Owner getter on STR
VictorVicente Oct 1, 2018
02d9426
Fix
adamdossa Oct 1, 2018
3f6f9c5
Merge branch 'development-1.5.0' into optimise_str_size
adamdossa Oct 1, 2018
1c7ed17
Fix modifyTicker
adamdossa Oct 1, 2018
37b0b96
Add more test cases
adamdossa Oct 1, 2018
0f98a41
Merge branch 'development-1.5.0' into optimise_str_size
VictorVicente Oct 2, 2018
9373adc
Merge branch 'development-1.5.0' into optimise_str_size
adamdossa Oct 2, 2018
b666431
Small fix
adamdossa Oct 2, 2018
e9e31ac
Merge branch 'development-1.5.0' into optimise_str_size
adamdossa Oct 2, 2018
6f0f44e
Fix bad merge
adamdossa Oct 2, 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
6 changes: 2 additions & 4 deletions CLI/commands/ST20Generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ const MODULES_TYPES = {
DIVIDENDS: 4
}

const REG_FEE_KEY = 'tickerRegFee';
const LAUNCH_FEE_KEY = 'stLaunchFee';
const cappedSTOFee = 20000;
const usdTieredSTOFee = 100000;
const tokenDetails = "";
Expand Down Expand Up @@ -103,8 +101,8 @@ async function step_ticker_reg(){
console.log('\n\x1b[34m%s\x1b[0m',"Token Creation - Symbol Registration");

let available = false;
let regFee = web3.utils.fromWei(await securityTokenRegistry.methods.getTickerRegistrationFee().call());
let isDeployed;
let regFee = web3.utils.fromWei(await securityTokenRegistry.methods.getUintValues(web3.utils.soliditySha3(REG_FEE_KEY)).call());

while (!available) {
console.log(chalk.green(`\nRegistering the new token symbol requires ${regFee} POLY & deducted from '${Issuer.address}', Current balance is ${(await currentBalance(Issuer.address))} POLY\n`));
Expand Down Expand Up @@ -156,7 +154,7 @@ async function step_token_deploy(){
} else {
console.log('\n\x1b[34m%s\x1b[0m',"Token Creation - Token Deployment");

let launchFee = web3.utils.fromWei(await securityTokenRegistry.methods.getUintValues(web3.utils.soliditySha3(LAUNCH_FEE_KEY)).call());
let launchFee = web3.utils.fromWei(await securityTokenRegistry.methods.getSecurityTokenLaunchFee().call());
console.log(chalk.green(`\nToken deployment requires ${launchFee} POLY & deducted from '${Issuer.address}', Current balance is ${(await currentBalance(Issuer.address))} POLY\n`));

if (typeof _tokenConfig !== 'undefined' && _tokenConfig.hasOwnProperty('name')) {
Expand Down
4 changes: 1 addition & 3 deletions CLI/commands/TickerRollForward.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ var abis = require('./helpers/contract_abis');
let remoteNetwork = process.argv.slice(2)[0]; //batch size

///////////////////////// GLOBAL VARS /////////////////////////
const REG_FEE_KEY = 'tickerRegFee';

let ticker_data = [];
let registered_tickers = [];
let failed_tickers = [];
Expand Down Expand Up @@ -80,7 +78,7 @@ async function readFile() {
async function registerTickers() {
// Poly approval for registration fees
let polyBalance = BigNumber(await polyToken.methods.balanceOf(Issuer.address).call());
let fee = web3.utils.fromWei(await securityTokenRegistry.methods.getUintValues(web3.utils.soliditySha3(REG_FEE_KEY)).call());
let fee = web3.utils.fromWei(await securityTokenRegistry.methods.getTickerRegistrationFee().call());
let totalFee = BigNumber(ticker_data.length).mul(fee);

if (totalFee.gt(polyBalance)) {
Expand Down
15 changes: 5 additions & 10 deletions CLI/commands/contract_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ var global = require('./common/global');
var contracts = require('./helpers/contract_addresses');
var abis = require('./helpers/contract_abis');

const OWNER_KEY = 'owner';
const REG_FEE_KEY = 'tickerRegFee';
const LAUNCH_FEE_KEY = 'stLaunchFee';
const EXPIRY_LIMIT_KEY = 'expiryLimit';

// App flow
let currentContract = null;

Expand Down Expand Up @@ -79,7 +74,7 @@ async function selectContract() {

async function strActions() {
console.log('\n\x1b[34m%s\x1b[0m',"Security Token Registry - Main menu");
let contractOwner = await currentContract.methods.getAddressValues(web3.utils.soliditySha3(OWNER_KEY)).call();
let contractOwner = await currentContract.methods.owner().call();

if (contractOwner != Issuer.address) {
console.log(chalk.red(`You are not the owner of this contract. Current owner is ${contractOwner}`));
Expand Down Expand Up @@ -117,7 +112,7 @@ async function strActions() {
console.log(chalk.green(`Ticker has been updated successfuly`));
break;
case 'Remove Ticker':
let tickerToRemove = readlineSync.question('Enter the token symbol that you want to add or modify: ');
let tickerToRemove = readlineSync.question('Enter the token symbol that you want to remove: ');
let tickerToRemoveDetails = await currentContract.methods.getTickerDetails(tickerToRemove).call();
if (tickerToRemoveDetails[1] == 0) {
console.log(chalk.yellow(`${ticker} does not exist.`));
Expand Down Expand Up @@ -168,7 +163,7 @@ async function strActions() {
console.log(chalk.green(`Security Token has been updated successfuly`));
break;
case 'Change Expiry Limit':
let currentExpiryLimit = await currentContract.methods.getUintValues(web3.utils.soliditySha3(EXPIRY_LIMIT_KEY)).call();
let currentExpiryLimit = await currentContract.methods.getExpiryLimit().call();
console.log(chalk.yellow(`Current expiry limit is ${Math.floor(parseInt(currentExpiryLimit)/60/60/24)} days`));
let newExpiryLimit = duration.days(readlineSync.questionInt('Enter a new value in days for expiry limit: '));
let changeExpiryLimitAction = currentContract.methods.changeExpiryLimit(newExpiryLimit);
Expand All @@ -177,7 +172,7 @@ async function strActions() {
console.log(chalk.green(`Expiry limit was changed successfuly. 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.getUintValues(web3.utils.soliditySha3(REG_FEE_KEY)).call());
let currentRegFee = web3.utils.fromWei(await currentContract.methods.getTickerRegistrationFee().call());
console.log(chalk.yellow(`\nCurrent ticker registration fee is ${currentRegFee} POLY`));
let newRegFee = web3.utils.toWei(readlineSync.questionInt('Enter a new value in POLY for ticker registration fee: ').toString());
let changeRegFeeAction = currentContract.methods.changeTickerRegistrationFee(newRegFee);
Expand All @@ -186,7 +181,7 @@ async function strActions() {
console.log(chalk.green(`Fee was changed successfuly. New fee is ${web3.utils.fromWei(changeRegFeeEvent._newFee)} POLY\n`));
break;
case 'Change ST launch fee':
let currentLaunchFee = web3.utils.fromWei(await currentContract.methods.getUintValues(web3.utils.soliditySha3(LAUNCH_FEE_KEY)).call());
let currentLaunchFee = web3.utils.fromWei(await currentContract.methods.getSecurityTokenLaunchFee().call());
console.log(chalk.yellow(`\nCurrent ST launch fee is ${currentLaunchFee} POLY`));
let newLaunchFee = web3.utils.toWei(readlineSync.questionInt('Enter a new value in POLY for ST launch fee: ').toString());
let changeLaunchFeeAction = currentContract.methods.changeSecurityLaunchFee(newLaunchFee);
Expand Down
Loading