From 9bbff39cf002d50d2e923135cf35d4c2e5c26c94 Mon Sep 17 00:00:00 2001 From: alexcos20 Date: Wed, 30 Sep 2020 23:10:03 -0700 Subject: [PATCH 1/5] bump contracts to 0.5.0 --- package-lock.json | 6 +++--- package.json | 2 +- src/exchange/FixedRateExchange.ts | 14 ++++++++++---- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8f576c57..28c73dbe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -939,9 +939,9 @@ } }, "@oceanprotocol/contracts": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/@oceanprotocol/contracts/-/contracts-0.4.4.tgz", - "integrity": "sha512-0+Tp6UdoDTBJZp4yX3kkSrV+CcOS/hJ3SJ4HuWiL5FE5Nlj3JCeV86iuWPkFuXzIdgri00DaGvQhP58knzJ2Uw==" + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@oceanprotocol/contracts/-/contracts-0.5.0.tgz", + "integrity": "sha512-6HQVP/Dvbh5b+wdu0rBR78pDwH4I+KeVaK80U5q47R/CvuSin5VpGSii3ZiCLY+O6JRxzjAMzCYo9ugL1cXvbg==" }, "@octokit/auth-token": { "version": "2.4.2", diff --git a/package.json b/package.json index 3602056d..d3e2f5b8 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ }, "dependencies": { "@ethereum-navigator/navigator": "^0.5.0", - "@oceanprotocol/contracts": "^0.4.4", + "@oceanprotocol/contracts": "^0.5.0", "decimal.js": "^10.2.0", "fs": "0.0.1-security", "lzma": "^2.3.2", diff --git a/src/exchange/FixedRateExchange.ts b/src/exchange/FixedRateExchange.ts index 0bb5b6eb..f90c08ca 100644 --- a/src/exchange/FixedRateExchange.ts +++ b/src/exchange/FixedRateExchange.ts @@ -205,10 +205,13 @@ export class OceanFixedRateExchange { exchangeId: string, address: string ): Promise { + const exchange = await this.getExchange(exchangeId) + if (!exchange) return null + if (exchange.active === true) return null let estGas try { estGas = await this.contract.methods - .activate(exchangeId) + .toggleExchangeState(exchangeId) .estimateGas(function (err, estGas) { if (err) { // console.log('FixedPriceExchange: ' + err) @@ -219,7 +222,7 @@ export class OceanFixedRateExchange { } catch (e) { estGas = DEFAULT_GAS_LIMIT } - const trxReceipt = await this.contract.methods.activate(exchangeId).send({ + const trxReceipt = await this.contract.methods.toggleExchangeState(exchangeId).send({ from: address, gas: estGas + 1 }) @@ -236,10 +239,13 @@ export class OceanFixedRateExchange { exchangeId: string, address: string ): Promise { + const exchange = await this.getExchange(exchangeId) + if (!exchange) return null + if (exchange.active === false) return null let estGas try { estGas = await this.contract.methods - .deactivate(exchangeId) + .toggleExchangeState(exchangeId) .estimateGas(function (err, estGas) { if (err) { // console.log('FixedPriceExchange: ' + err) @@ -250,7 +256,7 @@ export class OceanFixedRateExchange { } catch (e) { estGas = DEFAULT_GAS_LIMIT } - const trxReceipt = await this.contract.methods.deactivate(exchangeId).send({ + const trxReceipt = await this.contract.methods.toggleExchangeState(exchangeId).send({ from: address, gas: estGas + 1 }) From fa2a1f8944b5a158a142929bf89e09e21c169b8f Mon Sep 17 00:00:00 2001 From: alexcos20 Date: Wed, 30 Sep 2020 23:10:53 -0700 Subject: [PATCH 2/5] remove need of an account for some calls --- src/balancer/OceanPool.ts | 46 +++++---------- src/balancer/Pool.ts | 86 +++++++---------------------- src/datatokens/Datatokens.ts | 28 +++------- test/unit/Datatokens.test.ts | 4 +- test/unit/balancer/Balancer.test.ts | 32 +++++------ 5 files changed, 60 insertions(+), 136 deletions(-) diff --git a/src/balancer/OceanPool.ts b/src/balancer/OceanPool.ts index 0a7ac1f6..db10fdfd 100644 --- a/src/balancer/OceanPool.ts +++ b/src/balancer/OceanPool.ts @@ -118,27 +118,25 @@ export class OceanPool extends Pool { /** * Get Ocean Token balance of a pool - * @param {String} account * @param {String} poolAddress * @return {String} */ - public async getOceanReserve(account: string, poolAddress: string): Promise { + public async getOceanReserve(poolAddress: string): Promise { if (this.oceanAddress == null) { console.error('oceanAddress is not defined') return null } - return super.getReserve(account, poolAddress, this.oceanAddress) + return super.getReserve(poolAddress, this.oceanAddress) } /** * Get Data Token balance of a pool - * @param {String} account * @param {String} poolAddress * @return {String} */ - public async getDTReserve(account: string, poolAddress: string): Promise { + public async getDTReserve(poolAddress: string): Promise { await this.getDTAddress(poolAddress) - return super.getReserve(account, poolAddress, this.dtAddress) + return super.getReserve(poolAddress, this.dtAddress) } /** @@ -332,12 +330,12 @@ export class OceanPool extends Pool { * @param {String} poolAddress * @return {String} */ - public async getDTPrice(account: string, poolAddress: string): Promise { + public async getDTPrice(poolAddress: string): Promise { if (this.oceanAddress == null) { console.error('oceanAddress is not defined') return null } - return this.getOceanNeeded(account, poolAddress, '1') + return this.getOceanNeeded(poolAddress, '1') } /** @@ -346,11 +344,9 @@ export class OceanPool extends Pool { * @param {String} dtAddress * @return {String[]} */ - public async searchPoolforDT(account: string, dtAddress: string): Promise { + public async searchPoolforDT(dtAddress: string): Promise { const result: string[] = [] - const factory = new this.web3.eth.Contract(this.factoryABI, this.factoryAddress, { - from: account - }) + const factory = new this.web3.eth.Contract(this.factoryABI, this.factoryAddress) const events = await factory.getPastEvents('BPoolRegistered', { filter: {}, fromBlock: 0, @@ -363,25 +359,13 @@ export class OceanPool extends Pool { return result } - public async getOceanNeeded( - account: string, - poolAddress: string, - dtRequired: string - ): Promise { + public async getOceanNeeded(poolAddress: string, dtRequired: string): Promise { await this.getDTAddress(poolAddress) - const tokenBalanceIn = await this.getReserve(account, poolAddress, this.oceanAddress) - const tokenWeightIn = await this.getDenormalizedWeight( - account, - poolAddress, - this.oceanAddress - ) - const tokenBalanceOut = await this.getReserve(account, poolAddress, this.dtAddress) - const tokenWeightOut = await this.getDenormalizedWeight( - account, - poolAddress, - this.dtAddress - ) - const swapFee = await this.getSwapFee(account, poolAddress) + const tokenBalanceIn = await this.getReserve(poolAddress, this.oceanAddress) + const tokenWeightIn = await this.getDenormalizedWeight(poolAddress, this.oceanAddress) + const tokenBalanceOut = await this.getReserve(poolAddress, this.dtAddress) + const tokenWeightOut = await this.getDenormalizedWeight(poolAddress, this.dtAddress) + const swapFee = await this.getSwapFee(poolAddress) return super.calcInGivenOut( tokenBalanceIn, tokenWeightIn, @@ -428,7 +412,7 @@ export class OceanPool extends Pool { /** * Get all actions from a pool (join,exit,swap) * @param {String} poolAddress Pool address - * @param {String} account + * @param {String} account Optional, filter for this address * @return {PoolTransaction[]} */ public async getPoolLogs( diff --git a/src/balancer/Pool.ts b/src/balancer/Pool.ts index cb930518..3df7309e 100644 --- a/src/balancer/Pool.ts +++ b/src/balancer/Pool.ts @@ -256,14 +256,11 @@ export class Pool extends PoolFactory { /** * Get number of tokens composing this pool - * @param {String} account * @param {String} poolAddress * @return {String} */ - async getNumTokens(account: string, poolAddress: string): Promise { - const pool = new this.web3.eth.Contract(this.poolABI, poolAddress, { - from: account - }) + async getNumTokens(poolAddress: string): Promise { + const pool = new this.web3.eth.Contract(this.poolABI, poolAddress) let result = null try { result = await pool.methods.getNumTokens().call() @@ -307,14 +304,11 @@ export class Pool extends PoolFactory { /** * Get controller address of this pool - * @param {String} account * @param {String} poolAddress * @return {String} */ - async getController(account: string, poolAddress: string): Promise { - const pool = new this.web3.eth.Contract(this.poolABI, poolAddress, { - from: account - }) + async getController(poolAddress: string): Promise { + const pool = new this.web3.eth.Contract(this.poolABI, poolAddress) let result = null try { result = await pool.methods.getController().call() @@ -352,15 +346,12 @@ export class Pool extends PoolFactory { /** * Get if a token is bounded to a pool - * @param {String} account * @param {String} poolAddress * @param {String} token Address of the token * @return {Boolean} */ - async isBound(account: string, poolAddress: string, token: string): Promise { - const pool = new this.web3.eth.Contract(this.poolABI, poolAddress, { - from: account - }) + async isBound(poolAddress: string, token: string): Promise { + const pool = new this.web3.eth.Contract(this.poolABI, poolAddress) let result = null try { result = await pool.methods.isBound(token).call() @@ -372,15 +363,12 @@ export class Pool extends PoolFactory { /** * Get how many tokens are in the pool - * @param {String} account * @param {String} poolAddress * @param {String} token Address of the token * @return {String} */ - async getReserve(account: string, poolAddress: string, token: string): Promise { - const pool = new this.web3.eth.Contract(this.poolABI, poolAddress, { - from: account - }) + async getReserve(poolAddress: string, token: string): Promise { + const pool = new this.web3.eth.Contract(this.poolABI, poolAddress) let amount = null try { const result = await pool.methods.getBalance(token).call() @@ -393,14 +381,11 @@ export class Pool extends PoolFactory { /** * Get if a pool is finalized - * @param {String} account * @param {String} poolAddress * @return {Boolean} */ - async isFinalized(account: string, poolAddress: string): Promise { - const pool = new this.web3.eth.Contract(this.poolABI, poolAddress, { - from: account - }) + async isFinalized(poolAddress: string): Promise { + const pool = new this.web3.eth.Contract(this.poolABI, poolAddress) let result = null try { result = await pool.methods.isFinalized().call() @@ -412,14 +397,11 @@ export class Pool extends PoolFactory { /** * Get pool fee - * @param {String} account * @param {String} poolAddress * @return {String} Swap fee in wei */ - async getSwapFee(account: string, poolAddress: string): Promise { - const pool = new this.web3.eth.Contract(this.poolABI, poolAddress, { - from: account - }) + async getSwapFee(poolAddress: string): Promise { + const pool = new this.web3.eth.Contract(this.poolABI, poolAddress) let fee = null try { const result = await pool.methods.getSwapFee().call() @@ -432,19 +414,12 @@ export class Pool extends PoolFactory { /** * The normalized weight of a token. The combined normalized weights of all tokens will sum up to 1. (Note: the actual sum may be 1 plus or minus a few wei due to division precision loss) - * @param {String} account * @param {String} poolAddress * @param {String} token * @return {String} */ - async getNormalizedWeight( - account: string, - poolAddress: string, - token: string - ): Promise { - const pool = new this.web3.eth.Contract(this.poolABI, poolAddress, { - from: account - }) + async getNormalizedWeight(poolAddress: string, token: string): Promise { + const pool = new this.web3.eth.Contract(this.poolABI, poolAddress) let weight = null try { const result = await pool.methods.getNormalizedWeight(token).call() @@ -457,19 +432,12 @@ export class Pool extends PoolFactory { /** * getDenormalizedWeight of a token in pool - * @param {String} account * @param {String} poolAddress * @param {String} token * @return {String} */ - async getDenormalizedWeight( - account: string, - poolAddress: string, - token: string - ): Promise { - const pool = new this.web3.eth.Contract(this.poolABI, poolAddress, { - from: account - }) + async getDenormalizedWeight(poolAddress: string, token: string): Promise { + const pool = new this.web3.eth.Contract(this.poolABI, poolAddress) let weight = null try { const result = await pool.methods.getDenormalizedWeight(token).call() @@ -482,17 +450,11 @@ export class Pool extends PoolFactory { /** * getTotalDenormalizedWeight in pool - * @param {String} account * @param {String} poolAddress * @return {String} */ - async getTotalDenormalizedWeight( - account: string, - poolAddress: string - ): Promise { - const pool = new this.web3.eth.Contract(this.poolABI, poolAddress, { - from: account - }) + async getTotalDenormalizedWeight(poolAddress: string): Promise { + const pool = new this.web3.eth.Contract(this.poolABI, poolAddress) let weight = null try { const result = await pool.methods.getTotalDenormalizedWeight().call() @@ -792,21 +754,17 @@ export class Pool extends PoolFactory { /** * Get Spot Price of swaping tokenIn to tokenOut - * @param {String} account * @param {String} poolAddress * @param {String} tokenIn * @param {String} tokenOut * @return {String} */ async getSpotPrice( - account: string, poolAddress: string, tokenIn: string, tokenOut: string ): Promise { - const pool = new this.web3.eth.Contract(this.poolABI, poolAddress, { - from: account - }) + const pool = new this.web3.eth.Contract(this.poolABI, poolAddress) let price = null try { const result = await pool.methods.getSpotPrice(tokenIn, tokenOut).call() @@ -819,21 +777,17 @@ export class Pool extends PoolFactory { /** * Get Spot Price of swaping tokenIn to tokenOut without fees - * @param {String} account * @param {String} poolAddress * @param {String} tokenIn * @param {String} tokenOut * @return {String} */ async getSpotPriceSansFee( - account: string, poolAddress: string, tokenIn: string, tokenOut: string ): Promise { - const pool = new this.web3.eth.Contract(this.poolABI, poolAddress, { - from: account - }) + const pool = new this.web3.eth.Contract(this.poolABI, poolAddress) let price = null try { const result = await pool.methods.getSpotPriceSansFee(tokenIn, tokenOut).call() diff --git a/src/datatokens/Datatokens.ts b/src/datatokens/Datatokens.ts index cde50a1c..c66ed354 100644 --- a/src/datatokens/Datatokens.ts +++ b/src/datatokens/Datatokens.ts @@ -287,52 +287,40 @@ export class DataTokens { /** Get Blob * @param {String} dataTokenAddress - * @param {String} address * @return {Promise} string */ - public async getBlob(dataTokenAddress: string, address: string): Promise { - const datatoken = new this.web3.eth.Contract(this.datatokensABI, dataTokenAddress, { - from: address - }) + public async getBlob(dataTokenAddress: string): Promise { + const datatoken = new this.web3.eth.Contract(this.datatokensABI, dataTokenAddress) const trxReceipt = await datatoken.methods.blob().call() return trxReceipt } /** Get Name * @param {String} dataTokenAddress - * @param {String} address * @return {Promise} string */ - public async getName(dataTokenAddress: string, address: string): Promise { - const datatoken = new this.web3.eth.Contract(this.datatokensABI, dataTokenAddress, { - from: address - }) + public async getName(dataTokenAddress: string): Promise { + const datatoken = new this.web3.eth.Contract(this.datatokensABI, dataTokenAddress) const trxReceipt = await datatoken.methods.name().call() return trxReceipt } /** Get Symbol * @param {String} dataTokenAddress - * @param {String} address * @return {Promise} string */ - public async getSymbol(dataTokenAddress: string, address: string): Promise { - const datatoken = new this.web3.eth.Contract(this.datatokensABI, dataTokenAddress, { - from: address - }) + public async getSymbol(dataTokenAddress: string): Promise { + const datatoken = new this.web3.eth.Contract(this.datatokensABI, dataTokenAddress) const trxReceipt = await datatoken.methods.symbol().call() return trxReceipt } /** Get Cap * @param {String} dataTokenAddress - * @param {String} address * @return {Promise} string */ - public async getCap(dataTokenAddress: string, address: string): Promise { - const datatoken = new this.web3.eth.Contract(this.datatokensABI, dataTokenAddress, { - from: address - }) + public async getCap(dataTokenAddress: string): Promise { + const datatoken = new this.web3.eth.Contract(this.datatokensABI, dataTokenAddress) const trxReceipt = await datatoken.methods.cap().call() return this.web3.utils.fromWei(trxReceipt) } diff --git a/test/unit/Datatokens.test.ts b/test/unit/Datatokens.test.ts index 177aa5e5..f760f04c 100644 --- a/test/unit/Datatokens.test.ts +++ b/test/unit/Datatokens.test.ts @@ -52,8 +52,8 @@ describe('DataTokens', () => { tokenAddress = await datatoken.create(blob, minter) assert(tokenAddress !== null) - const tokenName = await datatoken.getName(tokenAddress, minter) - const tokenSymbol = await datatoken.getSymbol(tokenAddress, minter) + const tokenName = await datatoken.getName(tokenAddress) + const tokenSymbol = await datatoken.getSymbol(tokenAddress) assert(tokenName !== null || tokenName !== '') assert(tokenSymbol !== null || tokenSymbol !== '') }) diff --git a/test/unit/balancer/Balancer.test.ts b/test/unit/balancer/Balancer.test.ts index 063c56b7..e166088b 100644 --- a/test/unit/balancer/Balancer.test.ts +++ b/test/unit/balancer/Balancer.test.ts @@ -118,7 +118,7 @@ describe('Balancer flow', () => { alicePoolAddress = await Pool.createDTPool(alice, tokenAddress, '45', '9', '0.02') const s = await Pool.totalSupply(alicePoolAddress) assert(String(s) === '100', 'totalSupply does not match: ' + s) - const n = await Pool.getNumTokens(alice, alicePoolAddress) + const n = await Pool.getNumTokens(alicePoolAddress) assert(String(n) === '2', 'unexpected num tokens: ' + n) }) it('Get pool information', async () => { @@ -129,13 +129,12 @@ describe('Balancer flow', () => { }) it('Get pool swap fee', async () => { - const currentSwapFee = await Pool.getSwapFee(alice, alicePoolAddress) + const currentSwapFee = await Pool.getSwapFee(alicePoolAddress) assert(currentSwapFee === '0.02') }) it('Get spot price for swapping', async () => { const spotPrice = await Pool.getSpotPrice( - alice, alicePoolAddress, tokenAddress, oceanTokenAddress @@ -145,7 +144,6 @@ describe('Balancer flow', () => { it('Get spot price for swapping without fees', async () => { const spotPrice = await Pool.getSpotPriceSansFee( - alice, alicePoolAddress, tokenAddress, oceanTokenAddress @@ -154,15 +152,15 @@ describe('Balancer flow', () => { }) it('Get dtPrice from the pool ', async () => { - currentDtPrice = await Pool.getDTPrice(alice, alicePoolAddress) + currentDtPrice = await Pool.getDTPrice(alicePoolAddress) assert(Number(currentDtPrice) > 0) }) it('Get dtToken pool reserve ', async () => { - const currentDtReserve = await Pool.getDTReserve(alice, alicePoolAddress) + const currentDtReserve = await Pool.getDTReserve(alicePoolAddress) assert(Number(currentDtReserve) > 0) }) it('Get Ocean pool reserve ', async () => { - const currentOceanReserve = await Pool.getOceanReserve(alice, alicePoolAddress) + const currentOceanReserve = await Pool.getOceanReserve(alicePoolAddress) assert(Number(currentOceanReserve) > 0) }) it('Get total supply of pool tokens', async () => { @@ -170,12 +168,12 @@ describe('Balancer flow', () => { assert(Number(totalSupply) > 0) }) it('Get amount of Ocean needed to buy 1 dtToken', async () => { - const requiredOcean = await Pool.getOceanNeeded(alice, alicePoolAddress, '1') + const requiredOcean = await Pool.getOceanNeeded(alicePoolAddress, '1') assert(Number(requiredOcean) > 0) }) it('Bob should search for pools with this DT', async () => { - const pools = await Pool.searchPoolforDT(bob, tokenAddress) + const pools = await Pool.searchPoolforDT(tokenAddress) assert(pools.length > 0) greatPool = pools[0] }) @@ -188,7 +186,7 @@ describe('Balancer flow', () => { assert(Number(bobOceanBalance) > 0) }) it('Bob should add DT liquidity to pool ', async () => { - const currentDtReserve = await Pool.getDTReserve(bob, greatPool) + const currentDtReserve = await Pool.getDTReserve(greatPool) if (consoleDebug) console.log('currentDtReserve:' + currentDtReserve) const bobDtBalance = await datatoken.balance(tokenAddress, bob) if (consoleDebug) console.log('BOB DT Balance:' + bobDtBalance) @@ -196,7 +194,7 @@ describe('Balancer flow', () => { const newbobDtBalance = await datatoken.balance(tokenAddress, bob) - const newDtReserve = await Pool.getDTReserve(bob, greatPool) + const newDtReserve = await Pool.getDTReserve(greatPool) const sharesBalance = await Pool.sharesBalance(bob, greatPool) if (consoleDebug) console.log('newDtReserve:' + newDtReserve) @@ -208,7 +206,7 @@ describe('Balancer flow', () => { }) it('Bob should remove DT liquidity from pool ', async () => { - const currentDtReserve = await Pool.getDTReserve(bob, greatPool) + const currentDtReserve = await Pool.getDTReserve(greatPool) if (consoleDebug) console.log('currentDtReserve:' + currentDtReserve) const bobDtBalance = await datatoken.balance(tokenAddress, bob) if (consoleDebug) console.log('bobDtBalance:' + bobDtBalance) @@ -216,7 +214,7 @@ describe('Balancer flow', () => { if (consoleDebug) console.log('poolShares:' + poolShares) await Pool.removeDTLiquidity(bob, greatPool, '0.75', poolShares) - const newDtReserve = await Pool.getDTReserve(bob, greatPool) + const newDtReserve = await Pool.getDTReserve(greatPool) if (consoleDebug) console.log('newDtReserve:' + newDtReserve) const newbobDtBalance = await datatoken.balance(tokenAddress, bob) if (consoleDebug) console.log('newbobDtBalance:' + newbobDtBalance) @@ -228,7 +226,7 @@ describe('Balancer flow', () => { }) it('Bob should add Ocean liquidity to pool ', async () => { - const currentDtReserve = await Pool.getOceanReserve(bob, greatPool) + const currentDtReserve = await Pool.getOceanReserve(greatPool) const bobDtBalance = await datatoken.balance(oceanTokenAddress, bob) if (consoleDebug) console.log('currentDtReserve:' + currentDtReserve) if (consoleDebug) console.log('bobDtBalance:' + bobDtBalance) @@ -237,7 +235,7 @@ describe('Balancer flow', () => { const newbobDtBalance = await datatoken.balance(oceanTokenAddress, bob) - const newDtReserve = await Pool.getOceanReserve(bob, greatPool) + const newDtReserve = await Pool.getOceanReserve(greatPool) const sharesBalance = await Pool.sharesBalance(bob, greatPool) if (consoleDebug) console.log('newDtReserve:' + newDtReserve) @@ -249,7 +247,7 @@ describe('Balancer flow', () => { }) it('Bob should remove Ocean liquidity from pool ', async () => { - const currentDtReserve = await Pool.getOceanReserve(bob, greatPool) + const currentDtReserve = await Pool.getOceanReserve(greatPool) const bobDtBalance = await datatoken.balance(oceanTokenAddress, bob) const poolShares = await Pool.sharesBalance(bob, greatPool) @@ -259,7 +257,7 @@ describe('Balancer flow', () => { await Pool.removeOceanLiquidity(bob, greatPool, '0.75', poolShares) - const newDtReserve = await Pool.getOceanReserve(bob, greatPool) + const newDtReserve = await Pool.getOceanReserve(greatPool) const newbobDtBalance = await datatoken.balance(oceanTokenAddress, bob) const newpoolShares = await Pool.sharesBalance(bob, greatPool) From 0ce9e18c6bddd198bba29c4f22925e529a1187d9 Mon Sep 17 00:00:00 2001 From: alexcos20 Date: Wed, 30 Sep 2020 23:23:51 -0700 Subject: [PATCH 3/5] temporary set correct version of contracts in barge --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 91efc2c1..b38f2a0a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,6 +23,7 @@ before_script: - export ADDRESS_FILE="${HOME}/.ocean/ocean-contracts/artifacts/address.json" - export AQUARIUS_URI="http://172.15.0.5:5000" - export DEPLOY_CONTRACTS=true + - export CONTRACTS_VERSION=v0.5.0 - bash -x start_ocean.sh --no-dashboard 2>&1 > start_ocean.log & - cd .. - ./scripts/waitforcontracts.sh From 1c92c555866fc6edd185801065b326e8ed1ab843 Mon Sep 17 00:00:00 2001 From: alexcos20 Date: Wed, 30 Sep 2020 23:42:35 -0700 Subject: [PATCH 4/5] update Rinkeby addresses for 0.5.0 --- src/utils/ConfigHelper.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils/ConfigHelper.ts b/src/utils/ConfigHelper.ts index 1b2735db..c69d060c 100644 --- a/src/utils/ConfigHelper.ts +++ b/src/utils/ConfigHelper.ts @@ -32,13 +32,13 @@ const configs: ConfigHelperConfig[] = [ chainId: 4, network: 'rinkeby', nodeUri: 'https://rinkeby.infura.io/v3', - factoryAddress: '0x732cad3502e2A543118C8047D6bb20D5DB9c3242', + factoryAddress: '0xA7a711A09396DF82D9be46A26B48BafdB9BB4fA6', oceanTokenAddress: '0x8967BCF84170c91B0d24D4302C2376283b0B3a07', metadataStoreUri: 'https://aquarius.rinkeby.v3.dev-ocean.com', providerUri: 'https://provider.rinkeby.v3.dev-ocean.com', - poolFactoryAddress: '0x1735C3A59EcedC617bB570b79A71A6FC7C0380E8', - fixedRateExchangeAddress: '0x2B8da1F6DE33EfCDEc254ebE57d1D854a314b81b', - metadataContractAddress: '0x01906293EAd697f6038b0E3E1f0591F56ABf8EC0' + poolFactoryAddress: '0x4658cD157B57E9D0053Bb2d5CbC7B2Aad06dA5E6', + fixedRateExchangeAddress: '0x09285F0290D74f01D3287ED9B45d2456956758B4', + metadataContractAddress: '0x1da8E04D2ae9b7c32C24e4DB94899b93d8E4751A' }, { chainId: 1, From 2817fa60a1a0d84f2ba520b8349f22cf6d8fa632 Mon Sep 17 00:00:00 2001 From: alexcos20 Date: Thu, 1 Oct 2020 00:34:14 -0700 Subject: [PATCH 5/5] update function docs --- src/balancer/OceanPool.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/balancer/OceanPool.ts b/src/balancer/OceanPool.ts index db10fdfd..5900c499 100644 --- a/src/balancer/OceanPool.ts +++ b/src/balancer/OceanPool.ts @@ -326,7 +326,6 @@ export class OceanPool extends Pool { /** * Get Data Token price from pool - * @param {String} account * @param {String} poolAddress * @return {String} */ @@ -340,7 +339,6 @@ export class OceanPool extends Pool { /** * Search all pools that have Data Token in their composition - * @param {String} account * @param {String} dtAddress * @return {String[]} */