diff --git a/app/components/AddFunder.jsx b/app/components/AddFunder.jsx index 87d3fc5..8135464 100644 --- a/app/components/AddFunder.jsx +++ b/app/components/AddFunder.jsx @@ -1,6 +1,6 @@ import React from 'react' import { Formik } from 'formik' -import LiquidPledgingMock from 'Embark/contracts/LiquidPledgingMock' +import LiquidPledging from 'Embark/contracts/LiquidPledging' import Button from '@material-ui/core/Button' import MenuItem from '@material-ui/core/MenuItem' import TextField from '@material-ui/core/TextField' @@ -8,7 +8,7 @@ import Snackbar from '@material-ui/core/Snackbar' import web3 from 'Embark/web3' import { MySnackbarContentWrapper } from './base/SnackBars' -const { addGiver, addDelegate, addProject } = LiquidPledgingMock.methods +const { addGiver, addDelegate, addProject } = LiquidPledging.methods const FUNDER = 'FUNDER' const DELEGATE = 'DELEGATE' const PROJECT = 'PROJECT' diff --git a/app/components/CreateFunding.jsx b/app/components/CreateFunding.jsx index f3f2535..35fa024 100644 --- a/app/components/CreateFunding.jsx +++ b/app/components/CreateFunding.jsx @@ -2,7 +2,7 @@ import React from 'react'; import { Formik } from 'formik'; import EmbarkJS from 'Embark/EmbarkJS'; import LPVault from 'Embark/contracts/LPVault'; -import LiquidPledgingMock from 'Embark/contracts/LiquidPledgingMock'; +import LiquidPledging from 'Embark/contracts/LiquidPledging'; import Button from '@material-ui/core/Button'; import TextField from '@material-ui/core/TextField'; import Snackbar from '@material-ui/core/Snackbar'; @@ -11,7 +11,7 @@ import web3 from 'Embark/web3'; import { MySnackbarContentWrapper } from './base/SnackBars'; import { currencies, TOKEN_ICON_API, getTokenLabel } from '../utils/currencies' -const { donate } = LiquidPledgingMock.methods +const { donate } = LiquidPledging.methods const hoursToSeconds = hours => hours * 60 * 60 const addFunderSucessMsg = response => { const { events: { GiverAdded: { returnValues: { idGiver } } } } = response diff --git a/app/components/FunderProfilesTable.jsx b/app/components/FunderProfilesTable.jsx index 8f2afd0..6a06a50 100644 --- a/app/components/FunderProfilesTable.jsx +++ b/app/components/FunderProfilesTable.jsx @@ -1,9 +1,9 @@ import React, { Fragment, memo } from 'react' import MaterialTable from 'material-table' -import LiquidPledgingMock from 'Embark/contracts/LiquidPledgingMock' +import LiquidPledging from 'Embark/contracts/LiquidPledging' import { FundingContext } from '../context' -const { cancelProject } = LiquidPledgingMock.methods +const { cancelProject } = LiquidPledging.methods const convertToHours = seconds => seconds / 60 / 60 const cancelText = canceled => canceled ? 'Yes' : 'No' diff --git a/app/components/SetMockedTime.jsx b/app/components/SetMockedTime.jsx index 9e7e94b..5eceec8 100644 --- a/app/components/SetMockedTime.jsx +++ b/app/components/SetMockedTime.jsx @@ -1,9 +1,9 @@ import React from 'react' import { Formik } from 'formik' -import LiquidPledgingMock from 'Embark/contracts/LiquidPledgingMock' +import LiquidPledging from 'Embark/contracts/LiquidPledging' import TextField from '@material-ui/core/TextField' -const { setMockedTime } = LiquidPledgingMock.methods +const { setMockedTime } = LiquidPledging.methods const SetMockedTime = () => ( ( { return formattedEvents } -const { getPledgeAdmin } = LiquidPledgingMock.methods +const { getPledgeAdmin } = LiquidPledging.methods export const formatFundProfileEvent = async event => { const lookup = lookups[event.event] const { returnValues: { url, idProject } } = event @@ -62,7 +62,7 @@ export const formatFundProfileEvent = async event => { } const getPastEvents = async (event, raw = false) => { - const events = await LiquidPledgingMock.getPastEvents(event, { + const events = await LiquidPledging.getPastEvents(event, { addr: await web3.eth.getCoinbase(), fromBlock: 0, toBlock: 'latest' @@ -76,7 +76,7 @@ const getPastEvents = async (event, raw = false) => { export const lpEventsSubscription = async () => { //todo add on event handlers - const events = await LiquidPledgingMock.events.allEvents({ + const events = await LiquidPledging.events.allEvents({ fromBlock: 0, toBlock: 'latest' }) diff --git a/app/utils/initialize.js b/app/utils/initialize.js index d60a7e5..60da1cc 100644 --- a/app/utils/initialize.js +++ b/app/utils/initialize.js @@ -1,5 +1,5 @@ import LPVault from 'Embark/contracts/LPVault' -import LiquidPledgingMock from 'Embark/contracts/LiquidPledgingMock' +import LiquidPledging from 'Embark/contracts/LiquidPledging' import StandardToken from 'Embark/contracts/StandardToken' import web3 from 'Embark/web3' @@ -8,26 +8,26 @@ export const initVaultAndLP = async () => { let toSend; - toSend = LiquidPledgingMock.methods.initialize(LPVault._address); + toSend = LiquidPledging.methods.initialize(LPVault._address); estimateGas = await toSend.estimateGas(); const lpInit = await toSend.send({gas: estimateGas + 1000}) console.log(lpInit) - toSend = LPVault.methods.initialize(LiquidPledgingMock._address); + toSend = LPVault.methods.initialize(LiquidPledging._address); estimateGas = await toSend.estimateGas(); const vaultInit = await toSend.send({gas: estimateGas + 1000}) console.log(vaultInit) } export const vaultPledgingNeedsInit = async () => { - const needsInit = !!Number(await LiquidPledgingMock.methods.getInitializationBlock().call()) + const needsInit = !!Number(await LiquidPledging.methods.getInitializationBlock().call()) && !!Number(await LPVault.methods.getInitializationBlock().call()) return needsInit } export const standardTokenApproval = async () => { const { approve } = StandardToken.methods - const spender = LiquidPledgingMock._address + const spender = LiquidPledging._address return await approve( spender, web3.utils.toWei('10000000', 'tether') @@ -37,7 +37,7 @@ export const standardTokenApproval = async () => { export const getLpAllowance = async () => { const { allowance } = StandardToken.methods const account = await web3.eth.getCoinbase() - const spender = LiquidPledgingMock._address + const spender = LiquidPledging._address const allowanceAmt = Number(await allowance(account, spender).call()) return allowanceAmt } diff --git a/app/utils/pledges.js b/app/utils/pledges.js index d83ecf7..e3d4dd4 100644 --- a/app/utils/pledges.js +++ b/app/utils/pledges.js @@ -1,6 +1,6 @@ -import LiquidPledgingMock from 'Embark/contracts/LiquidPledgingMock' +import LiquidPledging from 'Embark/contracts/LiquidPledging' -const { getPledgeAdmin, numberOfPledges, getPledge } = LiquidPledgingMock.methods +const { getPledgeAdmin, numberOfPledges, getPledge } = LiquidPledging.methods export const formatPledge = async (pledgePromise, idx) => { const pledge = await pledgePromise return { @@ -10,7 +10,7 @@ export const formatPledge = async (pledgePromise, idx) => { } export const getAllPledges = async (start = 1) => { - const numPledges = await LiquidPledgingMock.methods.numberOfPledges().call() + const numPledges = await LiquidPledging.methods.numberOfPledges().call() const pledges = [] for (let i = start; i <= numPledges; i++) { pledges.push(getPledge(i).call()) diff --git a/config/contracts.js b/config/contracts.js index c5ba951..df50245 100644 --- a/config/contracts.js +++ b/config/contracts.js @@ -56,16 +56,16 @@ module.exports = { strategy: 'explicit', contracts: { LPVault: {}, - LiquidPledgingMock: {}, + LiquidPledging: { + instanceOf: 'LiquidPledgingMock' + }, RecoveryVault: {}, LPFactory: { - args: ['$LPVault', '$LiquidPledgingMock'] - // args: { - // _vaultBase: '$LPVault', - // _lpBase: '$LiquidPledgingMock', - // }, + args: { + _vaultBase: '$LPVault', + _lpBase: '$LiquidPledging', + }, }, - // contracts for testing StandardToken: {}, Kernel: {