Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b87e80b
chore: add Greenkeeper config file
greenkeeper[bot] Nov 5, 2018
46e7260
chore(package): update dependencies
greenkeeper[bot] Nov 5, 2018
109a150
chore(package): update dependencies
greenkeeper[bot] Nov 5, 2018
5ba3c1b
docs(readme): add Greenkeeper badge
greenkeeper[bot] Nov 5, 2018
a60e346
chore(package): update lockfile CLI/yarn.lock
greenkeeper[bot] Nov 5, 2018
fbf9399
chore(package): update lockfile yarn.lock
greenkeeper[bot] Nov 5, 2018
f33e12a
greenkeeper-fix
maxsam4 Nov 5, 2018
3c6d474
Changed BigNumber version
maxsam4 Nov 5, 2018
bcc1722
sim test fix
maxsam4 Nov 5, 2018
647d2c8
another fix
maxsam4 Nov 5, 2018
c2f505a
changed Kovan PolyToken address
pabloruiz55 Nov 5, 2018
d0cef81
Merge branch 'master' into greenkeeper/initial
maxsam4 Nov 5, 2018
3cc0884
updated ST and STR version to 2.0.0
pabloruiz55 Nov 5, 2018
29e91ef
Update README.md
pabloruiz55 Nov 5, 2018
df1fa5c
rolled back hdwallet upgrade
maxsam4 Nov 5, 2018
105f9bc
Merge branch 'greenkeeper/initial' of https://github.com/PolymathNetw…
maxsam4 Nov 5, 2018
f9ca551
Merge branch 'master' into greenkeeper/initial
maxsam4 Nov 5, 2018
ec1d5af
fixed tests related to change of versioning
pabloruiz55 Nov 5, 2018
2cba4b3
fixed truffle script
pabloruiz55 Nov 5, 2018
12fec38
Merge branch 'master' into greenkeeper/initial
maxsam4 Nov 6, 2018
501e030
fixed deployment on Kovan
pabloruiz55 Nov 6, 2018
d6eeb65
Merge branch 'master' into greenkeeper/initial
maxsam4 Nov 8, 2018
6a9aef4
Merge pull request #393 from PolymathNetwork/greenkeeper/initial
pabloruiz55 Nov 8, 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
2 changes: 1 addition & 1 deletion CLI/commands/helpers/contract_addresses.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function getPolymathRegistryAddress(networkId) {
result = JSON.parse(require('fs').readFileSync('./build/contracts/PolymathRegistry.json').toString()).networks[networkId].address;
break;
case 42: // KOVAN
result = "0xad09dc7939f09601674c69a07132bc642abeeb10";
result = "0x5b215a7d39ee305ad28da29bf2f0425c6c2a00b3";
break;
}

Expand Down
2 changes: 1 addition & 1 deletion CLI/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
"readline-sync": "^1.4.9",
"request": "^2.88.0",
"request-promise": "^4.2.2",
"web3": "^1.0.0-beta.35"
"web3": "1.0.0-beta.34"
}
}
464 changes: 176 additions & 288 deletions CLI/yarn.lock

Large diffs are not rendered by default.

35 changes: 19 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![Build Status](https://travis-ci.org/PolymathNetwork/polymath-core.svg?branch=master)](https://travis-ci.org/PolymathNetwork/polymath-core)
[![Coverage Status](https://coveralls.io/repos/github/PolymathNetwork/polymath-core/badge.svg?branch=master)](https://coveralls.io/github/PolymathNetwork/polymath-core?branch=master)
[![Gitter](https://img.shields.io/badge/chat-gitter-green.svg)](https://gitter.im/PolymathNetwork/Lobby)
[![Telegram](https://img.shields.io/badge/50k+-telegram-blue.svg)](https://gitter.im/PolymathNetwork/Lobby)
[![Telegram](https://img.shields.io/badge/50k+-telegram-blue.svg)](https://gitter.im/PolymathNetwork/Lobby) [![Greenkeeper badge](https://badges.greenkeeper.io/PolymathNetwork/polymath-core.svg)](https://greenkeeper.io/)

![Polymath logo](Polymath.png)

Expand Down Expand Up @@ -172,32 +172,35 @@ node CLI/polymath-cli dividends_manager

### v2.0.0 KOVAN

New Kovan PolyTokenFaucet: 0xb347b9f5b56b431b2cf4e1d90a5995f7519ca792

----------------------- Polymath Network Smart Contracts: -----------------------
PolymathRegistry: 0xad09dc7939f09601674c69a07132bc642abeeb10
SecurityTokenRegistry (Proxy): 0xef600e4904fe0a2f4587ae94bcbed4c9e9aeb37a
ModuleRegistry (Proxy): 0xe8e30fd7d65a5e3b1134ce29d3afb49cc27b7086
FeatureRegistry: 0x35a8f211763be879541656d692f057d108eec9aa
PolymathRegistry: 0x5b215a7d39ee305ad28da29bf2f0425c6c2a00b3
SecurityTokenRegistry (Proxy): 0x91110c2f67e2881a8540417be9eadf5bc9f2f248
ModuleRegistry (Proxy): 0xde6d19d7a68d453244227b6ccc5d8e6c2314627a
FeatureRegistry: 0x8967a7cfc4b455398be2356cd05cd43b7a39697e

ETHOracle: 0xCE5551FC9d43E9D2CC255139169FC889352405C8
POLYOracle: 0x461d98EF2A0c7Ac1416EF065840fF5d4C946206C

STFactory: 0x1f08b1473fbb5bfc2bbaea99520291b6120be529
GeneralTransferManagerFactory: 0xc100ec8f8e397b426a52a5c7acc02892e1d92a53
GeneralPermissionManagerFactory: 0x96d7d693edd4a2ae773e4dd9739d997f0c38738f
STFactory: 0x22f56100c6f18b656dbf1b156334206326fc672a
GeneralTransferManagerFactory: 0x650e9507e983077d6f822472a7dcc37626d55c7f
GeneralPermissionManagerFactory: 0xbf0bd6305b523ce055baa6dfaa9676d6b9e6090b

CappedSTOFactory: 0xfde869904bbc1e881601b2ebde4a77ba3808dfad
USDTieredSTOFactory: 0x01c17f387224148931ce03788e61836e7fe5d753
USDTieredSTOProxyFactory: 0x63d0371a3dfa419a50670770b55618f6b5269057
CappedSTOFactory: 0xa4a24780b93a378eb25ec4bfbf93bc8e79d7eeeb
USDTieredSTOFactory: 0x9106d7fbbd2996ef787913876341d0070cbdfc95
USDTieredSTOProxyFactory: 0xb004ff6893b95dc8a19b9e09b2920a44a609bae3

CountTransferManagerFactory: 0x6691d4e4f8e48c7a3df04c25088169cb101b2882
PercentageTransferManagerFactory: 0x62dd693e8864874d3d806286983e9da41cd5a035
ManualApprovalTransferManagerFactory: 0x20ba9fd6907ff42f033df5cfdbaced6426b5e682
EtherDividendCheckpointFactory: 0xceba16202ce878d1c01a1f5bf3f219b58d712d5f
ERC20DividendCheckpointFactory: 0x5c0051ffdc9655ae7b87a8a79542178be2e973e4
CountTransferManagerFactory: 0xc7cf0c1ddc85c18672951f9bfeb7163ecc8f0e2f
PercentageTransferManagerFactory: 0xfea5fcb254bcb4ada0f86903ff822d6372325cb1
ManualApprovalTransferManagerFactory: 0x8e96e7199b9ba096d666033f058ebb0050786baf
EtherDividendCheckpointFactory: 0x18ae137fc6581e121f3d37ed85c423dbc3c9b964
ERC20DividendCheckpointFactory: 0x8c724a1504643e02bb02b23cdd414da637872c80
---------------------------------------------------------------------------------




## Mainnet

### v1.3.0 (TORO Release)
Expand Down
2 changes: 1 addition & 1 deletion contracts/SecurityTokenRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ contract SecurityTokenRegistry is ISecurityTokenRegistry, EternalStorage {
set(PAUSED, false);
set(OWNER, _owner);
set(POLYMATHREGISTRY, _polymathRegistry);
_setProtocolVersion(_STFactory, uint8(0), uint8(0), uint8(2));
_setProtocolVersion(_STFactory, uint8(2), uint8(0), uint8(0));
set(INITIALIZE, true);
}

Expand Down
2 changes: 1 addition & 1 deletion contracts/tokens/SecurityToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ contract SecurityToken is StandardToken, DetailedERC20, ReentrancyGuard, Registr
updateFromRegistry();
tokenDetails = _tokenDetails;
granularity = _granularity;
securityTokenVersion = SemanticVersion(0,0,2);
securityTokenVersion = SemanticVersion(2,0,0);
}

/**
Expand Down
10 changes: 10 additions & 0 deletions greenkeeper.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"groups": {
"default": {
"packages": [
"CLI/package.json",
"package.json"
]
}
}
}
9 changes: 6 additions & 3 deletions migrations/2_deploy_contracts.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const STFactory = artifacts.require('./tokens/STFactory.sol')
const DevPolyToken = artifacts.require('./helpers/PolyTokenFaucet.sol')
const MockOracle = artifacts.require('./MockOracle.sol')
const TokenLib = artifacts.require('./TokenLib.sol');
const SecurityToken = artifacts.require('./tokens/SecurityToken.sol')

let BigNumber = require('bignumber.js');
const cappedSTOSetupCost = new BigNumber(20000).times(new BigNumber(10).pow(18)); // 20K POLY fee
Expand Down Expand Up @@ -59,7 +60,7 @@ module.exports = function (deployer, network, accounts) {
} else if (network === 'kovan') {
web3 = new Web3(new Web3.providers.HttpProvider('https://kovan.infura.io/g5xfoQ0jFSE9S5LwM1Ei'))
PolymathAccount = accounts[0]
PolyToken = '0xb06d72a24df50d4e2cac133b320c5e7de3ef94cb' // PolyToken Kovan Faucet Address
PolyToken = '0xb347b9f5b56b431b2cf4e1d90a5995f7519ca792' // PolyToken Kovan Faucet Address
POLYOracle = '0x461d98EF2A0c7Ac1416EF065840fF5d4C946206C' // Poly Oracle Kovan Address
ETHOracle = '0xCE5551FC9d43E9D2CC255139169FC889352405C8' // ETH Oracle Kovan Address
} else if (network === 'mainnet') {
Expand Down Expand Up @@ -132,8 +133,8 @@ module.exports = function (deployer, network, accounts) {
return deployer.deploy(TokenLib, {from: PolymathAccount});
}).then(() => {
// Link libraries
return deployer.link(TokenLib, STFactory);
}).then(() => {
deployer.link(TokenLib, SecurityToken);
deployer.link(TokenLib, STFactory);
// A) Deploy the ModuleRegistry Contract (It contains the list of verified ModuleFactory)
return deployer.deploy(ModuleRegistry, {from: PolymathAccount});
}).then(() => {
Expand Down Expand Up @@ -290,6 +291,8 @@ module.exports = function (deployer, network, accounts) {
return polymathRegistry.changeAddress("PolyUsdOracle", POLYOracle, {from: PolymathAccount});
}).then(() => {
return polymathRegistry.changeAddress("EthUsdOracle", ETHOracle, {from: PolymathAccount});
}).then(() => {
return deployer.deploy(SecurityToken, 'a', 'a', 18, 1, 'a', polymathRegistry.address, {from: PolymathAccount});
}).then(() => {
console.log('\n');
console.log(`
Expand Down
25 changes: 14 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,30 +60,30 @@
"babel-preset-stage-2": "6.24.1",
"babel-preset-stage-3": "6.24.1",
"babel-register": "6.26.0",
"bignumber.js": "^5.0.0",
"bignumber.js": "5.0.0",
"chalk": "^2.4.1",
"coveralls": "^3.0.1",
"ethereumjs-testrpc": "^6.0.3",
"ethers": "^3.0.15",
"fs": "0.0.1-security",
"ethers": "^4.0.7",
"fs": "0.0.2",
"openzeppelin-solidity": "1.10.0",
"readline-sync": "^1.4.9",
"request": "^2.88.0",
"request-promise": "^4.2.2",
"shelljs": "^0.8.2",
"solc": "^0.4.24",
"truffle-contract": "^3.0.4",
"truffle-hdwallet-provider-privkey": "^0.1.0",
"truffle-hdwallet-provider-privkey": "0.2.0",
"web3": "1.0.0-beta.34"
},
"devDependencies": {
"@soldoc/soldoc": "^0.4.3",
"eslint": "^4.19.1",
"eslint-config-standard": "^11.0.0",
"eslint": "^5.8.0",
"eslint-config-standard": "^12.0.0",
"eslint-plugin-import": "^2.10.0",
"eslint-plugin-node": "^6.0.1",
"eslint-plugin-promise": "^3.7.0",
"eslint-plugin-standard": "^3.0.1",
"eslint-plugin-node": "^8.0.0",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-standard": "^4.0.0",
"ethereum-bridge": "^0.6.1",
"ethereumjs-abi": "^0.6.5",
"fast-csv": "^2.4.1",
Expand All @@ -93,12 +93,15 @@
"solidity-coverage": "^0.5.11",
"solidity-docgen": "^0.1.0",
"solium": "^1.1.6",
"truffle": "^4.1.13",
"truffle": "4.1.14",
"truffle-wallet-provider": "0.0.5"
},
"greenkeeper": {
"ignore": [
"openzeppelin-solidity"
"openzeppelin-solidity",
"web3",
"bignumber.js",
"truffle-hdwallet-provider-privkey"
]
}
}
2 changes: 1 addition & 1 deletion test/b_capped_sto.js
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ contract("CappedSTO", accounts => {
it("Should fundRaised value equal to the raised value in the funds receiver wallet", async () => {
const newBalance = await web3.eth.getBalance(account_fundsReceiver);
//console.log("WWWW",newBalance,await I_CappedSTO.fundsRaised.call(),balanceOfReceiver);
let op = BigNumber(newBalance)
let op = new BigNumber(newBalance)
.minus(balanceOfReceiver)
.toNumber();
assert.equal(
Expand Down
34 changes: 17 additions & 17 deletions test/c_checkpoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,10 @@ contract("Checkpoints", accounts => {
let cps = [];
let ts = [];
for (let j = 0; j < 10; j++) {
let balance1 = BigNumber(await I_SecurityToken.balanceOf(account_investor1));
let balance2 = BigNumber(await I_SecurityToken.balanceOf(account_investor2));
let balance3 = BigNumber(await I_SecurityToken.balanceOf(account_investor3));
let totalSupply = BigNumber(await I_SecurityToken.totalSupply());
let balance1 = new BigNumber(await I_SecurityToken.balanceOf(account_investor1));
let balance2 = new BigNumber(await I_SecurityToken.balanceOf(account_investor2));
let balance3 = new BigNumber(await I_SecurityToken.balanceOf(account_investor3));
let totalSupply = new BigNumber(await I_SecurityToken.totalSupply());
cps.push([balance1, balance2, balance3]);
ts.push(totalSupply);
console.log(
Expand Down Expand Up @@ -265,18 +265,18 @@ contract("Checkpoints", accounts => {
receiver = account_investor3;
}
let m = Math.random();
let amount = BigNumber(await I_SecurityToken.balanceOf(sender))
let amount = new BigNumber(await I_SecurityToken.balanceOf(sender))
.mul(Math.random().toFixed(10))
.toFixed(0);
if (m > 0.8) {
console.log("Sending full balance");
amount = BigNumber(await I_SecurityToken.balanceOf(sender));
amount = new BigNumber(await I_SecurityToken.balanceOf(sender));
}
console.log("Sender: " + sender + " Receiver: " + receiver + " Amount: " + JSON.stringify(amount));
await I_SecurityToken.transfer(receiver, amount, { from: sender });
}
if (Math.random() > 0.5) {
let n = BigNumber(Math.random().toFixed(10))
let n = new BigNumber(Math.random().toFixed(10))
.mul(10 ** 17)
.toFixed(0);
let p = Math.random() * 3;
Expand All @@ -293,7 +293,7 @@ contract("Checkpoints", accounts => {
await I_SecurityToken.mint(minter, n, { from: token_owner });
}
if (Math.random() > 0.5) {
let n = BigNumber(Math.random().toFixed(10)).mul(10 ** 17);
let n = new BigNumber(Math.random().toFixed(10)).mul(10 ** 17);
let p = Math.random() * 3;
let r = Math.random() * 3;
let burner;
Expand All @@ -304,7 +304,7 @@ contract("Checkpoints", accounts => {
} else {
burner = account_investor3;
}
let burnerBalance = BigNumber(await I_SecurityToken.balanceOf(burner));
let burnerBalance = new BigNumber(await I_SecurityToken.balanceOf(burner));
if (n.gt(burnerBalance.div(2))) {
n = burnerBalance.div(2);
}
Expand All @@ -314,10 +314,10 @@ contract("Checkpoints", accounts => {
}
console.log("Checking Interim...");
for (let k = 0; k < cps.length; k++) {
let balance1 = BigNumber(await I_SecurityToken.balanceOfAt(account_investor1, k + 1));
let balance2 = BigNumber(await I_SecurityToken.balanceOfAt(account_investor2, k + 1));
let balance3 = BigNumber(await I_SecurityToken.balanceOfAt(account_investor3, k + 1));
let totalSupply = BigNumber(await I_SecurityToken.totalSupplyAt(k + 1));
let balance1 = new BigNumber(await I_SecurityToken.balanceOfAt(account_investor1, k + 1));
let balance2 = new BigNumber(await I_SecurityToken.balanceOfAt(account_investor2, k + 1));
let balance3 = new BigNumber(await I_SecurityToken.balanceOfAt(account_investor3, k + 1));
let totalSupply = new BigNumber(await I_SecurityToken.totalSupplyAt(k + 1));
let balances = [balance1, balance2, balance3];
console.log("Checking TotalSupply: " + totalSupply + " is " + ts[k] + " at checkpoint: " + (k + 1));
assert.isTrue(totalSupply.eq(ts[k]));
Expand All @@ -330,10 +330,10 @@ contract("Checkpoints", accounts => {
}
console.log("Checking...");
for (let k = 0; k < cps.length; k++) {
let balance1 = BigNumber(await I_SecurityToken.balanceOfAt(account_investor1, k + 1));
let balance2 = BigNumber(await I_SecurityToken.balanceOfAt(account_investor2, k + 1));
let balance3 = BigNumber(await I_SecurityToken.balanceOfAt(account_investor3, k + 1));
let totalSupply = BigNumber(await I_SecurityToken.totalSupplyAt(k + 1));
let balance1 = new BigNumber(await I_SecurityToken.balanceOfAt(account_investor1, k + 1));
let balance2 = new BigNumber(await I_SecurityToken.balanceOfAt(account_investor2, k + 1));
let balance3 = new BigNumber(await I_SecurityToken.balanceOfAt(account_investor3, k + 1));
let totalSupply = new BigNumber(await I_SecurityToken.totalSupplyAt(k + 1));
let balances = [balance1, balance2, balance3];
console.log("Checking TotalSupply: " + totalSupply + " is " + ts[k] + " at checkpoint: " + (k + 1));
assert.isTrue(totalSupply.eq(ts[k]));
Expand Down
Loading