Skip to content

Commit

Permalink
Merge pull request #3 from indexed-finance/v1.0.2
Browse files Browse the repository at this point in the history
V1.0.2
  • Loading branch information
d1ll0n committed Oct 31, 2020
2 parents 48e9526 + ea7c0f2 commit 8c44f88
Show file tree
Hide file tree
Showing 23 changed files with 1,652 additions and 272 deletions.
12 changes: 10 additions & 2 deletions README.md
Expand Up @@ -4,6 +4,14 @@
[![Coverage Status](https://coveralls.io/repos/github/indexed-finance/uniswap-v2-oracle/badge.svg?branch=master)](https://coveralls.io/github/indexed-finance/uniswap-v2-oracle?branch=master)
[![npm version](https://badge.fury.io/js/%40indexed-finance%2Funiswap-v2-oracle.svg)](https://badge.fury.io/js/%40indexed-finance%2Funiswap-v2-oracle)

While this contract was developed for use in the Indexed protocol, the name comes from the fact that it indexes keys to track timestamps that the oracle has observed prices for.
### [Documentation (incomplete)](https://docs.indexed.finance/indexed-finance-docs/smart-contracts/indexeduniswapv2oracle)

## TODO - README
## Tests

**Run all tests**

`npx buidler test`

**Run test coverage**

`npm run coverage`
35 changes: 29 additions & 6 deletions buidler.config.js
Expand Up @@ -5,11 +5,23 @@ const Logger = require('./lib/logger');
const Deployer = require('./lib/deployer');
const { toBN, toHex, oneToken } = require('./lib/bn');

// usePlugin("@nomiclabs/buidler-waffle");
require('dotenv').config();

const { InfuraProvider } = require('@ethersproject/providers');
const { fromPrivateKey } = require('ethereumjs-wallet');
const { randomBytes } = require('crypto');

usePlugin("buidler-ethers-v5");
usePlugin("buidler-deploy");
// usePlugin("@nomiclabs/buidler-web3");
usePlugin("solidity-coverage");
usePlugin("@nomiclabs/buidler-etherscan");

const keys = {
rinkeby: fromPrivateKey(
process.env.RINKEBY_PVT_KEY
? Buffer.from(process.env.RINKEBY_PVT_KEY.slice(2), 'hex')
: randomBytes(32)).getPrivateKeyString()
};

internalTask('deploy-test-token-and-market', 'Deploy a test token and Uniswap market pair for it and WETH')
.setAction(async ({ logger, name, symbol }) => {
Expand Down Expand Up @@ -174,9 +186,6 @@ internalTask('update-prices', 'Update the prices for a list of tokens')
priceTable.push(['HourlyTWAP', receiptHourly.cumulativeGasUsed.toString()]);
priceTable.push(['WeeklyTWAP', receiptWeekly.cumulativeGasUsed.toString()]);
priceTable.push(['Indexed', receiptIndexed.cumulativeGasUsed.toString()]);

// console.log(priceTable.toString());

});

internalTask('getTimestamp', () => {
Expand All @@ -191,25 +200,39 @@ internalTask('increaseTime', 'Increases the node timestamp')
});

module.exports = {
etherscan: {
// url: "https://api.etherscan.io/api",
apiKey: process.env.ETHERSCAN_API_KEY,
},
external: {
artifacts: [
"node_modules/@uniswap/v2-core/build",
"node_modules/@uniswap/v2-periphery/build"
],
deployments: {
rinkeby: [
"node_modules/@indexed-finance/uniswap-deployments/rinkeby"
]
}
},
namedAccounts: {
deployer: {
default: 0
},
},
networks: {
rinkeby: {
url: new InfuraProvider("rinkeby", process.env.INFURA_PROJECT_ID).connection.url,
accounts: [keys.rinkeby],
chainId: 4
},
coverage: {
url: url.format({
protocol: "http:",
port: 8555,
hostname: "localhost",
}),
},
}
},
solc: {
version: "0.6.8",
Expand Down

0 comments on commit 8c44f88

Please sign in to comment.