Skip to content
This repository was archived by the owner on Jul 6, 2022. It is now read-only.

Commit 87835ee

Browse files
author
Sukhveer Sanghera
committed
Add audit reports, and update readme
1 parent f375959 commit 87835ee

8 files changed

+58
-49
lines changed

Diff for: README.md

+9-21
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,22 @@
1-
# Polymath (POLY) Token Distribution
1+
# Polymath (POLY) Token
22

33
<img src="https://travis-ci.org/PolymathNetwork/polymath-token-distribution.svg?branch=master"/> <a href="https://t.me/polymathnetwork" target="_blank"><img src="https://img.shields.io/badge/50k+-telegram-blue.svg"></a>
44

5-
The Ethereum contracts for the [Polymath](https://polymath.network) (POLY) token
6-
distribution. The primary purpose is to allocate tokens to purchasers, advisors,
7-
reserve, community members, and founders.
5+
The Ethereum contracts for the [Polymath](https://polymath.network) token (POLY) and token distribution.
86

97
![Polymath](Polymath.png)
108

11-
POLY tokens are used to align incentives of network participants, and help
12-
ensure compliant security token offerings.
9+
Check out [polymath-core](https://github.com/PolymathNetwork/polymath-core) for details on how POLY is used to power the Polymath Securities Token Platform.
1310

1411
# Live on Ethereum
1512

16-
#### [Testnet (Ropsten)](https://ropsten.etherscan.io/address/0x3f9d29ead6493db97e9756d54171e8844ce87ddd)
13+
The contracts are currently available on Ropsten testnet. We will be announcing the Mainnet contracts next week.
1714

18-
#### mainnet (coming soon)
15+
## Mainnet
16+
Launching on Mainnet on January 31st, 2018.
1917

20-
# Contributing
18+
## Testnet
2119

22-
If you find any issues please open a new issue on github.
20+
Poly Token: [0x75e2b469d92e90aeca511be20384af83c0578646](https://ropsten.etherscan.io/address/0xcceae97b9ee2f89e62367bf95d970678a5c59958)
2321

24-
# Community Airdrop
25-
26-
Please [join our Telegram](https://t.me/polymathnetwork) for details on the
27-
airdrop!
28-
29-
# Performing the airdrop
30-
31-
1. Run `truffle migrate` to deploy the distribution and POLY token contract. Take note of the address of the PolyDistribution contract.
32-
2. Add a csv file named `airdrop_distrib.csv` to the scripts folder. It should contain one valid address per row.
33-
3. Run `node scripts/csv_allocation.js [ADDRESS of POLYDISTRIBUTION]` This will process the airdrop_distrib.csv file and transfer 250 POLY to each address.
34-
4. Run `node scripts/verify_airdrop.js [ADDRESS of POLYDISTRIBUTION] > scripts/data/review.csv` to retrieve the event log of the distribution and output it to a csv file you can use to compare the intended distribution and the results.
22+
Token Distribution: [0x75e2b469d92e90aeca511be20384af83c0578646](https://ropsten.etherscan.io/address/0x75e2b469d92e90aeca511be20384af83c0578646)

Diff for: audits/solidified audit report - polymath token.pdf

152 KB
Binary file not shown.

Diff for: audits/zeppelin solutions audit report.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# [Click here to view the Zeppelin Solutions audit report](https://blog.zeppelin.solutions/be55e9936aba)

Diff for: flat/PolyDistribution.sol

+23-18
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ pragma solidity ^0.4.18;
44
* @title ERC20 interface
55
* @dev see https://github.com/ethereum/EIPs/issues/20
66
*/
7-
contract IERC20 {
8-
function balanceOf(address who) public view returns (uint256);
9-
function allowance(address owner, address spender) public view returns (uint256);
10-
function transfer(address to, uint256 value) public returns (bool);
11-
function transferFrom(address from, address to, uint256 value) public returns (bool);
12-
function approve(address spender, uint256 value) public returns (bool);
7+
interface IERC20 {
8+
function balanceOf(address _owner) public view returns (uint256);
9+
function allowance(address _owner, address _spender) public view returns (uint256);
10+
function transfer(address _to, uint256 _value) public returns (bool);
11+
function transferFrom(address _from, address _to, uint256 _value) public returns (bool);
12+
function approve(address _spender, uint256 _value) public returns (bool);
1313
event Transfer(address indexed from, address indexed to, uint256 value);
1414
event Approval(address indexed owner, address indexed spender, uint256 value);
1515
}
@@ -84,16 +84,21 @@ contract PolyToken is IERC20 {
8484
string public symbol = 'POLY';
8585
uint8 public constant decimals = 18;
8686
uint256 public constant decimalFactor = 10 ** uint256(decimals);
87-
uint256 public totalSupply = 1000000000 * decimalFactor;
87+
uint256 public constant totalSupply = 1000000000 * decimalFactor;
8888
mapping (address => uint256) balances;
8989
mapping (address => mapping (address => uint256)) internal allowed;
9090

91+
event Transfer(address indexed from, address indexed to, uint256 value);
92+
event Approval(address indexed owner, address indexed spender, uint256 value);
93+
9194
/**
9295
* @dev Constructor for Poly creation
9396
* @dev Assigns the totalSupply to the PolyDistribution contract
9497
*/
9598
function PolyToken(address _polyDistributionContractAddress) public {
99+
require(_polyDistributionContractAddress != address(0));
96100
balances[_polyDistributionContractAddress] = totalSupply;
101+
Transfer(address(0), _polyDistributionContractAddress, totalSupply);
97102
}
98103

99104
/**
@@ -280,13 +285,13 @@ contract PolyDistribution is Ownable {
280285
uint256 public constant INITIAL_SUPPLY = 1000000000 * decimalFactor;
281286
uint256 public AVAILABLE_TOTAL_SUPPLY = 1000000000 * decimalFactor;
282287
uint256 public AVAILABLE_PRESALE_SUPPLY = 230000000 * decimalFactor; // 100% Released at Token Distribution (TD)
283-
uint256 public AVAILABLE_FOUNDER_SUPPLY = 150000000 * decimalFactor; // 25% Released at TD +1 year -> 100% at TD +4 years
288+
uint256 public AVAILABLE_FOUNDER_SUPPLY = 150000000 * decimalFactor; // 33% Released at TD +1 year -> 100% at TD +3 years
284289
uint256 public AVAILABLE_AIRDROP_SUPPLY = 10000000 * decimalFactor; // 100% Released at TD
285290
uint256 public AVAILABLE_ADVISOR_SUPPLY = 20000000 * decimalFactor; // 100% Released at TD +7 months
286-
uint256 public AVAILABLE_RESERVE_SUPPLY = 513116658 * decimalFactor; // 12.5% Released at TD +6 months -> 100% at TD +4 years
287-
uint256 public AVAILABLE_BONUS1_SUPPLY = 39053330 * decimalFactor;
288-
uint256 public AVAILABLE_BONUS2_SUPPLY = 9354408 * decimalFactor;
289-
uint256 public AVAILABLE_BONUS3_SUPPLY = 28475604 * decimalFactor;
291+
uint256 public AVAILABLE_RESERVE_SUPPLY = 513116658 * decimalFactor; // 6.8% Released at TD +100 days -> 100% at TD +4 years
292+
uint256 public AVAILABLE_BONUS1_SUPPLY = 39053330 * decimalFactor; // 100% Released at TD +1 year
293+
uint256 public AVAILABLE_BONUS2_SUPPLY = 9354408 * decimalFactor; // 100% Released at TD +2 years
294+
uint256 public AVAILABLE_BONUS3_SUPPLY = 28475604 * decimalFactor; // 100% Released at TD +3 years
290295

291296
uint256 public grandTotalClaimed = 0;
292297
uint256 public startTime;
@@ -341,13 +346,13 @@ contract PolyDistribution is Ownable {
341346
allocations[_recipient] = Allocation(uint8(AllocationType.PRESALE), 0, 0, _totalAllocated, 0);
342347
} else if (_supply == AllocationType.FOUNDER) {
343348
AVAILABLE_FOUNDER_SUPPLY = AVAILABLE_FOUNDER_SUPPLY.sub(_totalAllocated);
344-
allocations[_recipient] = Allocation(uint8(AllocationType.FOUNDER), startTime + 1 years, startTime + 4 years, _totalAllocated, 0);
349+
allocations[_recipient] = Allocation(uint8(AllocationType.FOUNDER), startTime + 1 years, startTime + 3 years, _totalAllocated, 0);
345350
} else if (_supply == AllocationType.ADVISOR) {
346351
AVAILABLE_ADVISOR_SUPPLY = AVAILABLE_ADVISOR_SUPPLY.sub(_totalAllocated);
347-
allocations[_recipient] = Allocation(uint8(AllocationType.ADVISOR), startTime + 212 days, 0, _totalAllocated, 0);
352+
allocations[_recipient] = Allocation(uint8(AllocationType.ADVISOR), startTime + 209 days, 0, _totalAllocated, 0);
348353
} else if (_supply == AllocationType.RESERVE) {
349354
AVAILABLE_RESERVE_SUPPLY = AVAILABLE_RESERVE_SUPPLY.sub(_totalAllocated);
350-
allocations[_recipient] = Allocation(uint8(AllocationType.RESERVE), startTime + 182 days, startTime + 4 years, _totalAllocated, 0);
355+
allocations[_recipient] = Allocation(uint8(AllocationType.RESERVE), startTime + 100 days, startTime + 4 years, _totalAllocated, 0);
351356
} else if (_supply == AllocationType.BONUS1) {
352357
AVAILABLE_BONUS1_SUPPLY = AVAILABLE_BONUS1_SUPPLY.sub(_totalAllocated);
353358
allocations[_recipient] = Allocation(uint8(AllocationType.BONUS1), startTime + 1 years, startTime + 1 years, _totalAllocated, 0);
@@ -376,7 +381,7 @@ contract PolyDistribution is Ownable {
376381
function airdropTokens(address[] _recipient) public onlyOwnerOrAdmin {
377382
require(now >= startTime);
378383
uint airdropped;
379-
for(uint8 i = 0; i< _recipient.length; i++)
384+
for(uint256 i = 0; i< _recipient.length; i++)
380385
{
381386
if (!airdrops[_recipient[i]]) {
382387
airdrops[_recipient[i]] = true;
@@ -407,7 +412,7 @@ contract PolyDistribution is Ownable {
407412
}
408413
uint256 tokensToTransfer = newAmountClaimed.sub(allocations[_recipient].amountClaimed);
409414
allocations[_recipient].amountClaimed = newAmountClaimed;
410-
POLY.transfer(_recipient, tokensToTransfer);
415+
require(POLY.transfer(_recipient, tokensToTransfer));
411416
grandTotalClaimed = grandTotalClaimed.add(tokensToTransfer);
412417
LogPolyClaimed(_recipient, allocations[_recipient].AllocationSupply, tokensToTransfer, newAmountClaimed, grandTotalClaimed);
413418
}
@@ -422,6 +427,6 @@ contract PolyDistribution is Ownable {
422427
require(_token != address(POLY));
423428
IERC20 token = IERC20(_token);
424429
uint256 balance = token.balanceOf(this);
425-
token.transfer(_recipient, balance);
430+
require(token.transfer(_recipient, balance));
426431
}
427432
}

Diff for: flat/PolyToken.sol

+12-7
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ pragma solidity ^0.4.18;
44
* @title ERC20 interface
55
* @dev see https://github.com/ethereum/EIPs/issues/20
66
*/
7-
contract IERC20 {
8-
function balanceOf(address who) public view returns (uint256);
9-
function allowance(address owner, address spender) public view returns (uint256);
10-
function transfer(address to, uint256 value) public returns (bool);
11-
function transferFrom(address from, address to, uint256 value) public returns (bool);
12-
function approve(address spender, uint256 value) public returns (bool);
7+
interface IERC20 {
8+
function balanceOf(address _owner) public view returns (uint256);
9+
function allowance(address _owner, address _spender) public view returns (uint256);
10+
function transfer(address _to, uint256 _value) public returns (bool);
11+
function transferFrom(address _from, address _to, uint256 _value) public returns (bool);
12+
function approve(address _spender, uint256 _value) public returns (bool);
1313
event Transfer(address indexed from, address indexed to, uint256 value);
1414
event Approval(address indexed owner, address indexed spender, uint256 value);
1515
}
@@ -84,16 +84,21 @@ contract PolyToken is IERC20 {
8484
string public symbol = 'POLY';
8585
uint8 public constant decimals = 18;
8686
uint256 public constant decimalFactor = 10 ** uint256(decimals);
87-
uint256 public totalSupply = 1000000000 * decimalFactor;
87+
uint256 public constant totalSupply = 1000000000 * decimalFactor;
8888
mapping (address => uint256) balances;
8989
mapping (address => mapping (address => uint256)) internal allowed;
9090

91+
event Transfer(address indexed from, address indexed to, uint256 value);
92+
event Approval(address indexed owner, address indexed spender, uint256 value);
93+
9194
/**
9295
* @dev Constructor for Poly creation
9396
* @dev Assigns the totalSupply to the PolyDistribution contract
9497
*/
9598
function PolyToken(address _polyDistributionContractAddress) public {
99+
require(_polyDistributionContractAddress != address(0));
96100
balances[_polyDistributionContractAddress] = totalSupply;
101+
Transfer(address(0), _polyDistributionContractAddress, totalSupply);
97102
}
98103

99104
/**

Diff for: migrations/1_deploy_contracts.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ var PolyDistribution = artifacts.require('./PolyDistribution.sol');
33

44
module.exports = async (deployer, network) => {
55
let _now = Date.now();
6-
let _fromNow = 60 * 10 * 1000; // Start distribution in 1 hour
6+
let _fromNow = 60 * 60 * 1000; // Start distribution in 1 hour
77
let _startTime = (_now + _fromNow) / 1000;
88
await deployer.deploy(PolyDistribution, _startTime);
99
console.log(`

Diff for: package.json

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"coverage": "./node_modules/.bin/solidity-coverage",
1313
"migrate-local": "truffle migrate --network=local --reset",
1414
"migrate-ropsten": "truffle migrate --network=ropsten --reset",
15+
"migrate-kovan": "truffle migrate --network=kovan --reset",
1516
"flatten": "sol-merger './contracts/*.sol' ./flat"
1617
},
1718
"repository": {

Diff for: truffle.js

+11-2
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,19 @@ module.exports = {
1818
},
1919
ropsten: {
2020
host: 'localhost',
21+
from: '0x00F13d5bCA2E8A4E58fD8018a7b1e8D286dD135A',
2122
port: 8545,
2223
network_id: '3', // Match any network id
23-
gas: 3500000,
24-
gasPrice: 50000000000
24+
gas: 4500000,
25+
gasPrice: 330000000000
26+
},
27+
kovan: {
28+
host: 'localhost',
29+
from: '0x007d9F7cc97E3D9a3f56f1335517f3648C42c370',
30+
port: 8545,
31+
network_id: '42', // Match any network id
32+
gas: 4500000,
33+
gasPrice: 130000000000
2534
},
2635
local: {
2736
host: 'localhost',

0 commit comments

Comments
 (0)