diff --git a/.gitignore b/.gitignore index 9ea8354ce..43ca2f2c5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ /node_modules /dist +/app/web3/contracts/*.ts .env .nyc_output coverage diff --git a/app/components/commitfunds/CommitUnknownUser.tsx b/app/components/commitfunds/CommitUnknownUser.tsx index cde323c2e..dbf1452c0 100644 --- a/app/components/commitfunds/CommitUnknownUser.tsx +++ b/app/components/commitfunds/CommitUnknownUser.tsx @@ -16,7 +16,7 @@ import { selectMyEtherWallerUrl } from "../../reducers/formSelectors"; import { IAppState } from "../../reducers/index"; import { selectEthNetwork } from "../../reducers/web3State"; import { etherscanUrl } from "../../utils/etherscan"; -import { publicCommitment } from "../../web3/contracts/ContractsRepository"; +import { publicCommitment } from "../../web3/ContractsRepository"; import { LegalAgreementsDownload } from "../LegalAgreementsDownload"; import * as style from "./CommitUnknownUser.scss"; import { CommitUnknownUserDesc } from "./CommitUnknownUserDesc"; @@ -103,7 +103,7 @@ export const CommitUnknownUser = connect( minTicketWei: selectMinTicketWei(state.commitmentState), estimatedReward: selectEstimatedReward(state.commitmentState), loadingEstimatedReward: selectEstimatedRewardLoadingState(state.commitmentState), - transactionPayload: publicCommitment.rawWeb3Contract.commit.getData(), + transactionPayload: publicCommitment.commitTx().getData(), gasPrice: config.contractsDeployed.gasPrice, gasLimit: config.contractsDeployed.gasLimit, myEtherWalletUrl: selectMyEtherWallerUrl(state), diff --git a/app/reducers/formSelectors.ts b/app/reducers/formSelectors.ts index b9f5ccaec..69152a7b8 100644 --- a/app/reducers/formSelectors.ts +++ b/app/reducers/formSelectors.ts @@ -3,7 +3,7 @@ import { formValueSelector } from "redux-form"; import config from "../config"; import { myEtherWalletUrl } from "../utils/myetherwallet"; import { parseStrToNumStrict } from "../utils/utils"; -import { publicCommitment } from "../web3/contracts/ContractsRepository"; +import { publicCommitment } from "../web3/ContractsRepository"; import { IAppState } from "./index"; export const selectMyEtherWallerUrl = (state: IAppState): string => { diff --git a/app/startup.ts b/app/startup.ts index ff01f7d8e..2cc9d2ccc 100644 --- a/app/startup.ts +++ b/app/startup.ts @@ -12,7 +12,7 @@ import reduxThunk from "redux-thunk"; import { setFatalErrorActionCreator } from "./actions/fatalErrorActions"; import reducers, { IAppState } from "./reducers"; import { checkIfSupportedBrowser } from "./utils/utils"; -import { initRepository } from "./web3/contracts/ContractsRepository"; +import { initRepository } from "./web3/ContractsRepository"; import { Web3Service } from "./web3/web3Service"; const persistStorePromised = promisify(persistStore) as any; diff --git a/app/web3/contracts/ContractsRepository.ts b/app/web3/ContractsRepository.ts similarity index 77% rename from app/web3/contracts/ContractsRepository.ts rename to app/web3/ContractsRepository.ts index 0e5d42442..042ee830f 100644 --- a/app/web3/contracts/ContractsRepository.ts +++ b/app/web3/ContractsRepository.ts @@ -1,13 +1,13 @@ import promiseAll = require("promise-all"); -import { AppState } from "../../actions/constants"; -import config from "../../config"; -import { Web3Service } from "../web3Service"; -import EthToken from "./EthToken"; -import EuroToken from "./EuroToken"; -import LockedAccount from "./LockedAccount"; -import Neumark from "./Neumark"; -import PublicCommitment from "./PublicCommitment"; +import { AppState } from "../actions/constants"; +import config from "../config"; +import { EthToken } from "./contracts/EthToken"; +import { EuroToken } from "./contracts/EuroToken"; +import { PublicCommitment } from "./contracts/extensions/PublicCommitment"; +import { LockedAccount } from "./contracts/LockedAccount"; +import { Neumark } from "./contracts/Neumark"; +import { Web3Service } from "./web3Service"; export let publicCommitment: PublicCommitment = null; export let neumark: Neumark = null; diff --git a/app/web3/contracts/EthToken.ts b/app/web3/contracts/EthToken.ts deleted file mode 100644 index 7a0c8720c..000000000 --- a/app/web3/contracts/EthToken.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { BigNumber } from "bignumber.js"; - -import { MissingContractError } from "../../errors"; -import { promisify } from "../utils"; -import * as EthTokenAbiJson from "./EthToken.abi.json"; - -class EthToken { - public static async createAndValidate(web3: any, address: string): Promise { - const contract = new EthToken(web3, address); - if (process.env.NODE_ENV === "production") { - return contract; - } - const code = await promisify(web3.eth.getCode, [address]); - if (code === "0x0") { - throw new MissingContractError("EthToken", address); - } - return contract; - } - - public readonly rawWeb3Contract: any; - - public constructor(web3: any, address: string) { - this.rawWeb3Contract = web3.eth.contract(EthTokenAbiJson).at(address); - } - - public get name(): Promise { - return promisify(this.rawWeb3Contract.name, []); - } - - public get decimals(): Promise { - return promisify(this.rawWeb3Contract.decimals, []); - } - - public balanceOf(owner: BigNumber | string): Promise { - return promisify(this.rawWeb3Contract.balanceOf, [owner]); - } -} - -export default EthToken; diff --git a/app/web3/contracts/EuroToken.ts b/app/web3/contracts/EuroToken.ts deleted file mode 100644 index 4008d1325..000000000 --- a/app/web3/contracts/EuroToken.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { BigNumber } from "bignumber.js"; - -import { MissingContractError } from "../../errors"; -import { promisify } from "../utils"; -import * as EuroTokenAbiJson from "./EuroToken.abi.json"; - -class EuroToken { - public static async createAndValidate(web3: any, address: string): Promise { - const contract = new EuroToken(web3, address); - const code = await promisify(web3.eth.getCode, [address]); - if (process.env.NODE_ENV === "production") { - return contract; - } - if (code === "0x0") { - throw new MissingContractError("EuroToken", address); - } - return contract; - } - - public readonly rawWeb3Contract: any; - - public constructor(web3: any, address: string) { - this.rawWeb3Contract = web3.eth.contract(EuroTokenAbiJson).at(address); - } - - public get name(): Promise { - return promisify(this.rawWeb3Contract.name, []); - } - - public get decimals(): Promise { - return promisify(this.rawWeb3Contract.decimals, []); - } - - public balanceOf(owner: BigNumber | string): Promise { - return promisify(this.rawWeb3Contract.balanceOf, [owner]); - } -} - -export default EuroToken; diff --git a/app/web3/contracts/LockedAccount.ts b/app/web3/contracts/LockedAccount.ts deleted file mode 100644 index 5a74aa60f..000000000 --- a/app/web3/contracts/LockedAccount.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { BigNumber } from "bignumber.js"; - -import { MissingContractError } from "../../errors"; -import { promisify } from "../utils"; -import * as LockedAccountAbiJson from "./LockedAccount.abi.json"; - -class Contract { - public static async createAndValidate(web3: any, address: string): Promise { - const contract = new Contract(web3, address); - if (process.env.NODE_ENV === "production") { - return contract; - } - const code = await promisify(web3.eth.getCode, [address]); - if (code === "0x0") { - throw new MissingContractError("LockedAccount", address); - } - return contract; - } - - public readonly rawWeb3Contract: any; - public readonly address: string; - - public constructor(web3: any, address: string) { - this.address = address; - this.rawWeb3Contract = web3.eth.contract(LockedAccountAbiJson).at(address); - } - - public get assetToken(): Promise { - return promisify(this.rawWeb3Contract.assetToken, []); - } - - public get totalInvestors(): Promise { - return promisify(this.rawWeb3Contract.totalInvestors, []); - } - - public get totalLockedAmount(): Promise { - return promisify(this.rawWeb3Contract.totalLockedAmount, []); - } - - public get lockPeriod(): Promise { - return promisify(this.rawWeb3Contract.lockPeriod, []); - } - - public get penaltyFraction(): Promise { - return promisify(this.rawWeb3Contract.penaltyFraction, []); - } - - public get penaltyDisbursalAddress(): Promise { - return promisify(this.rawWeb3Contract.penaltyDisbursalAddress, []); - } - - public balanceOf(investor: BigNumber | string): Promise<[BigNumber, BigNumber, BigNumber]> { - return promisify(this.rawWeb3Contract.balanceOf, [investor]); - } -} - -export default Contract; diff --git a/app/web3/contracts/Neumark.ts b/app/web3/contracts/Neumark.ts deleted file mode 100644 index 180ecc0e7..000000000 --- a/app/web3/contracts/Neumark.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { BigNumber } from "bignumber.js"; - -import { MissingContractError } from "../../errors"; -import { promisify } from "../utils"; -import * as NeumarkAbiJson from "./Neumark.abi.json"; - -class Contract { - public static async createAndValidate(web3: any, address: string): Promise { - const contract = new Contract(web3, address); - if (process.env.NODE_ENV === "production") { - return contract; - } - const code = await promisify(web3.eth.getCode, [address]); - if (code === "0x0") { - throw new MissingContractError("Neumark", address); - } - return contract; - } - - public readonly rawWeb3Contract: any; - - public constructor(web3: any, address: string) { - this.rawWeb3Contract = web3.eth.contract(NeumarkAbiJson).at(address); - } - - public get totalSupply(): Promise { - return promisify(this.rawWeb3Contract.totalSupply, []); - } - - public get totalEuroUlps(): Promise { - return promisify(this.rawWeb3Contract.totalEuroUlps, []); - } - - public get decimals(): Promise { - return promisify(this.rawWeb3Contract.decimals, []); - } - - public currentAgreement(): Promise<[BigNumber, BigNumber, string, BigNumber]> { - return promisify(this.rawWeb3Contract.currentAgreement, []); - } - - public balanceOf(address: string): Promise { - return promisify(this.rawWeb3Contract.balanceOf, [address]); - } -} - -export default Contract; diff --git a/app/web3/contracts/PublicCommitment.ts b/app/web3/contracts/PublicCommitment.ts deleted file mode 100644 index 6da894175..000000000 --- a/app/web3/contracts/PublicCommitment.ts +++ /dev/null @@ -1,115 +0,0 @@ -import { BigNumber } from "bignumber.js"; -import { Moment } from "moment/moment"; - -import { MissingContractError } from "../../errors"; -import { asMomentDate } from "../utils"; -import * as PublicCommitmentAbiJson from "./PublicCommitment.abi.json"; - -interface IPayableTxParams { - value: string | BigNumber; - from?: string; - gas?: number | string | BigNumber; - gasPrice?: number | string | BigNumber; -} - -// represents same values that are used internally in commitment smartcontract -export enum InternalCommitmentState { - BEFORE = 0, - WHITELIST = 1, - PUBLIC = 2, - FINISHED = 3, -} - -function promisify(func: any, args: any): Promise { - return new Promise((res, rej) => { - func(...args, (err: any, data: any) => { - if (err) { - return rej(err); - } - return res(data); - }); - }); -} - -class Contract { - public static async createAndValidate(web3: any, address: string): Promise { - const contract = new Contract(web3, address); - if (process.env.NODE_ENV === "production") { - return contract; - } - const code = await promisify(web3.eth.getCode, [address]); - if (code === "0x0" || code === "0x") { - throw new MissingContractError("PublicCommitment", address); - } - return contract; - } - - public readonly rawWeb3Contract: any; - - public constructor(public readonly web3: any, public readonly address: string) { - this.rawWeb3Contract = web3.eth.contract(PublicCommitmentAbiJson).at(address); - } - - public get state(): Promise { - return promisify(this.rawWeb3Contract.state, []).then((state: BigNumber) => { - return state.toNumber(); - }); - } - - public get platformOperatorNeumarkRewardShare(): Promise { - return promisify(this.rawWeb3Contract.platformOperatorNeumarkRewardShare, []); - } - - public get maxCapEur(): Promise { - return promisify(this.rawWeb3Contract.maxCapEur, []); - } - - public get minTicketEur(): Promise { - return promisify(this.rawWeb3Contract.minTicketEur, []); - } - - public get ethEurFraction(): Promise { - return promisify(this.rawWeb3Contract.ethEurFraction, []); - } - - public currentAgreement(): Promise<[BigNumber, BigNumber, string, BigNumber]> { - return promisify(this.rawWeb3Contract.currentAgreement, []); - } - - public get neumark(): Promise { - return promisify(this.rawWeb3Contract.neumark, []); - } - - public get etherLock(): Promise { - return promisify(this.rawWeb3Contract.etherLock, []); - } - - public get euroLock(): Promise { - return promisify(this.rawWeb3Contract.euroLock, []); - } - - public estimateNeumarkReward(amountEth: string): Promise { - return promisify(this.rawWeb3Contract.estimateNeumarkReward, [amountEth]); - } - - public async startOf(stateEnum: InternalCommitmentState): Promise { - return asMomentDate(await promisify(this.rawWeb3Contract.startOf, [stateEnum])); - } - - public async whitelistTicket( - investorAddress: BigNumber | string - ): Promise<[BigNumber, BigNumber, BigNumber]> { - return promisify(this.rawWeb3Contract.whitelistTicket, [investorAddress]); - } - - public commitTx(params?: IPayableTxParams, customWeb3?: any): Promise { - if (customWeb3) { - const tmpContract = customWeb3.eth.contract(PublicCommitmentAbiJson).at(this.address); - return promisify(tmpContract.commit.sendTransaction, [params]); - } else { - return promisify(this.rawWeb3Contract.commit.sendTransaction, [params]); - } - } -} - -export default Contract; diff --git a/app/web3/contracts/extensions/PublicCommitment.ts b/app/web3/contracts/extensions/PublicCommitment.ts new file mode 100644 index 000000000..283a24906 --- /dev/null +++ b/app/web3/contracts/extensions/PublicCommitment.ts @@ -0,0 +1,35 @@ +import { BigNumber } from "bignumber.js"; + +import { Moment } from "moment/moment"; +import { asMomentDate } from "../../utils"; +import { PublicCommitment as PublicCommitmentBase } from "../PublicCommitment"; +import { promisify } from "../typechain-runtime"; + +export enum InternalCommitmentState { + BEFORE = 0, + WHITELIST = 1, + PUBLIC = 2, + FINISHED = 3, +} + +export class PublicCommitment extends PublicCommitmentBase { + public static async createAndValidate( + web3: any, + address: string | BigNumber + ): Promise { + const contract = new PublicCommitment(web3, address); + const code = await promisify(web3.eth.getCode, [address]); + if (code === "0x0") { + throw new Error(`Contract at ${address} doesn't exist!`); + } + return contract; + } + + public get internalCommitmentState(): Promise { + return this.state.then(state => state.toNumber()); + } + + public async startOfDate(stateEnum: InternalCommitmentState): Promise { + return asMomentDate(await promisify(this.rawWeb3Contract.startOf, [stateEnum])); + } +} diff --git a/app/web3/estimateNeumarksRewardFromContract.ts b/app/web3/estimateNeumarksRewardFromContract.ts index 1625cdb4e..744620d0e 100644 --- a/app/web3/estimateNeumarksRewardFromContract.ts +++ b/app/web3/estimateNeumarksRewardFromContract.ts @@ -1,5 +1,5 @@ import { BigNumber } from "bignumber.js"; -import { publicCommitment } from "./contracts/ContractsRepository"; +import { publicCommitment } from "./ContractsRepository"; export async function estimateNeumarksRewardFromContract( etherWei: BigNumber, @@ -20,7 +20,7 @@ export async function estimateNeumarksRewardFromContract( } if (curvePart.gt(0)) { - curveNeumarks = await publicCommitment.estimateNeumarkReward(curvePart.toString()); + curveNeumarks = await publicCommitment.estimateNeumarkReward(curvePart); } return neumarkProportionReward.add(curveNeumarks); diff --git a/app/web3/loadAftermathFromContract.ts b/app/web3/loadAftermathFromContract.ts index cc28d3dbc..890ce9b0d 100644 --- a/app/web3/loadAftermathFromContract.ts +++ b/app/web3/loadAftermathFromContract.ts @@ -1,4 +1,4 @@ -import { etherLock, euroLock, neumark } from "./contracts/ContractsRepository"; +import { etherLock, euroLock, neumark } from "./ContractsRepository"; import { asMomentDate } from "./utils"; export async function loadAftermathFromContract(address: string) { diff --git a/app/web3/loadDuringIcoDetailsFromContract.ts b/app/web3/loadDuringIcoDetailsFromContract.ts index c1a2a6715..7e0c04d05 100644 --- a/app/web3/loadDuringIcoDetailsFromContract.ts +++ b/app/web3/loadDuringIcoDetailsFromContract.ts @@ -1,7 +1,7 @@ import { BigNumber } from "bignumber.js"; import promiseAll = require("promise-all"); -import { etherLock, euroLock, neumark, publicCommitment } from "./contracts/ContractsRepository"; +import { etherLock, euroLock, neumark, publicCommitment } from "./ContractsRepository"; import { convertEurToEth } from "./utils"; export async function loadDuringIcoDetailsFromContract( @@ -32,5 +32,5 @@ export async function allInvestors() { export async function issuanceRate(ethDecimals: number): Promise { const eth = new BigNumber(10).pow(ethDecimals); - return await publicCommitment.estimateNeumarkReward(eth.toString()); + return await publicCommitment.estimateNeumarkReward(eth); } diff --git a/app/web3/loadIcoParamsFromContract.ts b/app/web3/loadIcoParamsFromContract.ts index d273ab096..72ec62617 100644 --- a/app/web3/loadIcoParamsFromContract.ts +++ b/app/web3/loadIcoParamsFromContract.ts @@ -3,8 +3,8 @@ import promiseAll = require("promise-all"); import { IcoPhase } from "../actions/constants"; import config, { CommitmentType } from "../config"; -import { etherToken, euroToken, neumark, publicCommitment } from "./contracts/ContractsRepository"; -import { InternalCommitmentState } from "./contracts/PublicCommitment"; +import { InternalCommitmentState } from "./contracts/extensions/PublicCommitment"; +import { etherToken, euroToken, neumark, publicCommitment } from "./ContractsRepository"; import { convertEurToEth } from "./utils"; export function mapCommitmentTypeToStartingInternalContractPhase( @@ -55,8 +55,8 @@ export async function loadIcoParamsFromContract() { neuDecimals, ethEurFraction, } = await promiseAll({ - startingDate: publicCommitment.startOf(startingInternalState), - finishDate: publicCommitment.startOf(finishingInternalState), + startingDate: publicCommitment.startOfDate(startingInternalState), + finishDate: publicCommitment.startOfDate(finishingInternalState), minTicketEur: publicCommitment.minTicketEur, euroDecimals: euroToken.decimals, ethDecimals: etherToken.decimals, diff --git a/app/web3/loadLegalAgreementsFromContract.ts b/app/web3/loadLegalAgreementsFromContract.ts index ab0f3d905..9dcb70220 100644 --- a/app/web3/loadLegalAgreementsFromContract.ts +++ b/app/web3/loadLegalAgreementsFromContract.ts @@ -1,4 +1,4 @@ -import { neumark, publicCommitment } from "./contracts/ContractsRepository"; +import { neumark, publicCommitment } from "./ContractsRepository"; export async function loadLegalAgreementsHashesAndTagsFromWeb3(): Promise<{ reservationAgreementHash: string; diff --git a/app/web3/loadTagsFromContract.ts b/app/web3/loadTagsFromContract.ts index 899ebc292..8980062c5 100644 --- a/app/web3/loadTagsFromContract.ts +++ b/app/web3/loadTagsFromContract.ts @@ -11,7 +11,7 @@ import { euroToken, neumark, publicCommitment, -} from "./contracts/ContractsRepository"; +} from "./ContractsRepository"; import { convertEurToEth } from "./utils"; export async function loadReservationAgreementGeneralTagsFromContract( diff --git a/app/web3/loadUserAccountFromWeb3.ts b/app/web3/loadUserAccountFromWeb3.ts index eefca10e9..ec3c4495a 100644 --- a/app/web3/loadUserAccountFromWeb3.ts +++ b/app/web3/loadUserAccountFromWeb3.ts @@ -1,6 +1,6 @@ import { BigNumber } from "bignumber.js"; -import { publicCommitment } from "./contracts/ContractsRepository"; +import { publicCommitment } from "./ContractsRepository"; import { Web3Service } from "./web3Service"; export async function loadUserAccountFromWeb3(): Promise { diff --git a/app/web3/submitFundsToContract.ts b/app/web3/submitFundsToContract.ts index ea71f9e1c..560faa253 100644 --- a/app/web3/submitFundsToContract.ts +++ b/app/web3/submitFundsToContract.ts @@ -1,7 +1,7 @@ import * as invariant from "invariant"; import config from "../config"; -import { publicCommitment } from "./contracts/ContractsRepository"; +import { publicCommitment } from "./ContractsRepository"; import { asWeiNumber } from "./utils"; import { Web3Service } from "./web3Service"; @@ -14,7 +14,7 @@ export async function submitFundsToContract( invariant(Web3Service.instance.hasPersonalWeb3(), "Can't find personal web3 instance!"); // we use personal web3 to commit tx but we check confirmations using our nodes - return publicCommitment.commitTx( + return publicCommitment.commitTx().send( { from: fromAccount, gas: config.contractsDeployed.gasLimit, diff --git a/package.json b/package.json index 922766654..9c452e3fc 100644 --- a/package.json +++ b/package.json @@ -85,17 +85,18 @@ "tslint-microsoft-contrib": "^5.0.1", "tslint-plugin-prettier": "^1.1.0", "tslint-react": "^3.2.0", + "typechain": "^0.0.9", "typescript": "^2.4.2", "url-loader": "^0.5.9", "url-search-params-polyfill": "^2.0.1", - "web3-typescript-typings": "0.3.0", + "web3-typescript-typings": "^0.7.2", "webpack": "^3.5.4", "webpack-dev-server": "^2.7.1", "yaml-js": "^0.2.0" }, "scripts": { "start": "(cp -n .env.example .env || true) && gulp build && concurrently -r \"gulp watch\" \"webpack-dev-server --https --port 9090\"", - "tslint": "tslint --type-check --project . 'app/*.ts?(x)' 'app/**/*.ts?(x)' 'page/ts/*.ts?(x)' 'test/**/*.ts?(x)' 'test-e2e/*.ts'", + "tslint": "tslint --type-check --project . 'app/*.ts?(x)' 'app/**/*.ts?(x)' 'page/ts/*.ts?(x)' 'test/**/*.ts?(x)' 'test-e2e/*.ts' -e 'app/web3/contracts/*.ts'", "tslint:fix": "tslint --format stylish --fix --type-check --project . 'app/*.ts?(x)' 'app/**/*.ts?(x)' 'page/ts/*.ts?(x)' 'test/**/*.ts?(x)' 'test-e2e/*.ts'", "lint": "yarn tslint && yarn sass-lint", "lint:fix": "yarn tslint:fix && yarn sass-lint", @@ -106,7 +107,9 @@ "test-e2e": "ts-mocha -t 40000 'test-e2e/**/*.spec.ts?(x)'", "test-e2e:dev": "NODE_ENV=development PUPPETEER_DEBUG=true E2E_URL=https://localhost:9090/ yarn test-e2e", "test:coverage": "NODE_ENV=test nyc ts-mocha --require ./setupTests.ts 'test/**/*.spec.ts?(x)'", - "fixyarn": "git checkout origin/master -- yarn.lock && yarn install && git add yarn.lock" + "fixyarn": "git checkout origin/master -- yarn.lock && yarn install && git add yarn.lock", + "typechain:generate": "typechain --force 'app/web3/contracts/*.abi.json'", + "postinstall": "yarn typechain:generate" }, "dependencies": { "@types/chart.js": "^2.6.9", @@ -147,7 +150,7 @@ "semver": "^5.4.1", "sinon": "^3.2.1", "vex-js": "^4.0.0", - "web3": "0.19.0", + "web3": "0.20.2", "web3-provider-engine": "^13.3.2", "zero-fill": "^2.2.3" } diff --git a/test/web3/loadIcoParamsFromContract.spec.ts b/test/web3/loadIcoParamsFromContract.spec.ts index 283baedee..9b32500a2 100644 --- a/test/web3/loadIcoParamsFromContract.spec.ts +++ b/test/web3/loadIcoParamsFromContract.spec.ts @@ -3,7 +3,7 @@ import * as moment from "moment"; import { IcoPhase } from "../../app/actions/constants"; import { CommitmentType } from "../../app/config"; -import { InternalCommitmentState } from "../../app/web3/contracts/PublicCommitment"; +import { InternalCommitmentState } from "../../app/web3/contracts/extensions/PublicCommitment"; import { mapCommitmentTypeToFinishingInternalContractPhase, mapCommitmentTypeToStartingInternalContractPhase, diff --git a/yarn.lock b/yarn.lock index 253c7916f..aa61729c8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -416,6 +416,18 @@ arr-union@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" +array-back@^1.0.3, array-back@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/array-back/-/array-back-1.0.4.tgz#644ba7f095f7ffcf7c43b5f0dc39d3c1f03c063b" + dependencies: + typical "^2.6.0" + +array-back@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/array-back/-/array-back-2.0.0.tgz#6877471d51ecc9c9bfa6136fb6c7d5fe69748022" + dependencies: + typical "^2.6.1" + array-differ@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-1.0.0.tgz#eff52e3758249d33be402b8bb8e564bb2b5d4031" @@ -1064,9 +1076,9 @@ bignumber.js@^4.0.2, bignumber.js@^4.0.4: version "4.0.4" resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-4.0.4.tgz#7c40f5abcd2d6623ab7b99682ee7db81b11889a4" -"bignumber.js@git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2": +"bignumber.js@git+https://github.com/frozeman/bignumber.js-nolookahead.git": version "2.0.7" - resolved "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2" + resolved "git+https://github.com/frozeman/bignumber.js-nolookahead.git#57692b3ecfc98bbdd6b3a516cb2353652ea49934" binary-extensions@^1.0.0: version "1.9.0" @@ -1729,6 +1741,14 @@ combined-stream@^1.0.5, combined-stream@~1.0.5: dependencies: delayed-stream "~1.0.0" +command-line-args@^4.0.7: + version "4.0.7" + resolved "https://registry.yarnpkg.com/command-line-args/-/command-line-args-4.0.7.tgz#f8d1916ecb90e9e121eda6428e41300bfb64cc46" + dependencies: + array-back "^2.0.0" + find-replace "^1.0.3" + typical "^2.6.1" + commander@2.11.x, commander@^2.8.1, commander@~2.11.0: version "2.11.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563" @@ -2147,6 +2167,12 @@ debug@2.6.9, debug@^2.4.1: dependencies: ms "2.0.0" +debug@^3.0.1: + version "3.1.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261" + dependencies: + ms "2.0.0" + decamelize@^1.0.0, decamelize@^1.1.1, decamelize@^1.1.2: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" @@ -3234,6 +3260,13 @@ find-index@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/find-index/-/find-index-0.1.1.tgz#675d358b2ca3892d795a1ab47232f8b6e2e0dde4" +find-replace@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/find-replace/-/find-replace-1.0.3.tgz#b88e7364d2d9c959559f388c66670d6130441fa0" + dependencies: + array-back "^1.0.4" + test-value "^2.1.0" + find-up@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" @@ -3436,6 +3469,14 @@ fs-extra@^3.0.1: jsonfile "^3.0.0" universalify "^0.1.0" +fs-extra@^4.0.2: + version "4.0.3" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94" + dependencies: + graceful-fs "^4.1.2" + jsonfile "^4.0.0" + universalify "^0.1.0" + fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" @@ -3624,15 +3665,7 @@ glob@^5.0.15, glob@~5.0.0: once "^1.3.0" path-is-absolute "^1.0.0" -glob@~3.1.21: - version "3.1.21" - resolved "https://registry.yarnpkg.com/glob/-/glob-3.1.21.tgz#d29e0a055dea5138f4d07ed40e8982e83c2066cd" - dependencies: - graceful-fs "~1.2.0" - inherits "1" - minimatch "~0.2.11" - -glob@~7.1.2: +glob@^7.1.2, glob@~7.1.2: version "7.1.2" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" dependencies: @@ -3643,6 +3676,14 @@ glob@~7.1.2: once "^1.3.0" path-is-absolute "^1.0.0" +glob@~3.1.21: + version "3.1.21" + resolved "https://registry.yarnpkg.com/glob/-/glob-3.1.21.tgz#d29e0a055dea5138f4d07ed40e8982e83c2066cd" + dependencies: + graceful-fs "~1.2.0" + inherits "1" + minimatch "~0.2.11" + global-modules@^0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-0.2.3.tgz#ea5a3bed42c6d6ce995a4f8a1269b5dae223828d" @@ -4840,6 +4881,12 @@ jsonfile@^3.0.0: optionalDependencies: graceful-fs "^4.1.6" +jsonfile@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" + optionalDependencies: + graceful-fs "^4.1.6" + jsonify@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" @@ -8476,6 +8523,13 @@ test-exclude@^4.1.1: read-pkg-up "^1.0.1" require-main-filename "^1.0.1" +test-value@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/test-value/-/test-value-2.1.0.tgz#11da6ff670f3471a73b625ca4f3fdcf7bb748291" + dependencies: + array-back "^1.0.3" + typical "^2.6.0" + text-encoding@0.6.4: version "0.6.4" resolved "https://registry.yarnpkg.com/text-encoding/-/text-encoding-0.6.4.tgz#e399a982257a276dae428bb92845cb71bdc26d19" @@ -8794,6 +8848,16 @@ type-is@~1.6.15: media-typer "0.3.0" mime-types "~2.1.15" +typechain@^0.0.9: + version "0.0.9" + resolved "https://registry.yarnpkg.com/typechain/-/typechain-0.0.9.tgz#14079e8930bb7393ba40cfa9df046d0677d152b8" + dependencies: + chalk "^2.1.0" + command-line-args "^4.0.7" + debug "^3.0.1" + fs-extra "^4.0.2" + glob "^7.1.2" + typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" @@ -8802,6 +8866,10 @@ typescript@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.4.2.tgz#f8395f85d459276067c988aa41837a8f82870844" +typical@^2.6.0, typical@^2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/typical/-/typical-2.6.1.tgz#5c080e5d661cbbe38259d2e70a3c7253e873881d" + u2f-api@^0.0.9: version "0.0.9" resolved "https://registry.yarnpkg.com/u2f-api/-/u2f-api-0.0.9.tgz#bded457ba5a9a9ee9b58b3de291f8c1f8feacb7a" @@ -9178,17 +9246,17 @@ web3-provider-engine@^13.3.2: xhr "^2.2.0" xtend "^4.0.1" -web3-typescript-typings@0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/web3-typescript-typings/-/web3-typescript-typings-0.3.0.tgz#1df583d8d9012059802dee90f72144576e0ab4fe" +web3-typescript-typings@^0.7.2: + version "0.7.2" + resolved "https://registry.yarnpkg.com/web3-typescript-typings/-/web3-typescript-typings-0.7.2.tgz#5312bb786936a9c91381eee7af3d02ac21cf13b3" dependencies: bignumber.js "^4.0.2" -web3@0.19.0: - version "0.19.0" - resolved "https://registry.yarnpkg.com/web3/-/web3-0.19.0.tgz#8b18fba24421a59d2884859bcb9b718c2665524e" +web3@0.20.2: + version "0.20.2" + resolved "https://registry.yarnpkg.com/web3/-/web3-0.20.2.tgz#c54dac5fc0e377399c04c1a6ecbb12e4513278d6" dependencies: - bignumber.js "git+https://github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2" + bignumber.js "git+https://github.com/frozeman/bignumber.js-nolookahead.git" crypto-js "^3.1.4" utf8 "^2.1.1" xhr2 "*"