Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oracle v1pool #270

Merged
merged 12 commits into from
Jul 13, 2021
Merged

Oracle v1pool #270

merged 12 commits into from
Jul 13, 2021

Conversation

cwsnt
Copy link
Contributor

@cwsnt cwsnt commented Jun 16, 2021

We want to use our v1PoolOracle in our protocol. So we created the v1PoolOraclePriceFeed contract registry which is pointed to v1PoolOracle, so that can be registered in our priceFeed.sol and be used by our protocol
The deployment steps would be:

  1. Need to redeploy the priceFeeds.sol and then re-register all of the assets.
  2. Then can use the deployOracleV1Pool() in contract_interaction.py to register asset and pointed out to oracleV1Pool

@tjcloa tjcloa self-requested a review July 6, 2021 21:14
contracts/feeds/PriceFeedV1PoolOracle.sol Outdated Show resolved Hide resolved
contracts/feeds/PriceFeedV1PoolOracle.sol Show resolved Hide resolved
Comment on lines 49 to 50
require(rBTCAddress != address(0), "rBTC address has not been set");
require(docAddress != address(0), "DOC address has not been set");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls move this to the constructor not to waste gas on every call

contracts/feeds/PriceFeedV1PoolOracle.sol Outdated Show resolved Hide resolved
contracts/feeds/PriceFeedV1PoolOracle.sol Show resolved Hide resolved
Comment on lines +7 to +11
/**
* @dev we had a bug in a loop: "i < endDate" instead of "i <= endDate"
*/
function delegate(address _delegatee) public onlyTokenOwner {
require(_delegatee != address(0), "delegatee address invalid");
Copy link
Contributor

@tjcloa tjcloa Jul 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls check that your formatter settings correspond to those in development branch and prettier is active

@@ -106,3 +106,15 @@ def checkRates():
def readPriceFeedFor(tokenAddress):
feeds = Contract.from_abi("PriceFeeds", address= conf.contracts['PriceFeeds'], abi = PriceFeeds.abi, owner = conf.acct)
print(feeds.pricesFeeds(tokenAddress))

def deployOracleV1Pool():
oraclePoolAsset = "0x28A05da0939853F7Bc9D5A17C9550D2769eE93D3" #SOV/WRBTC -- for SOV asset
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why hardcoded?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one, is the v1 pool asset that's just created by rahne. I will put it in testnet_contracts.json later

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please change it to pulling from the contracts lists as otherwise it is a potential issue

Comment on lines +109 to +111
(
await LockedSOV.new(tokenSOV.address, vestingRegistry.address, cliff, duration, [owner])
).address
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is false positive
shouldn't change with proper formatting switched on

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be because of "Fit code within this line limit" parameters in visual code? what is the correct value should i use?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be
try to switch it off and see the result

Comment on lines 27 to 31
const PriceFeedV1PoolOracleMockup = artifacts.require("PriceFeedV1PoolOracleMockup");
const PriceFeedRSKOracle = artifacts.require("PriceFeedRSKOracle");
const PriceFeedRSKOracleMockup = artifacts.require("PriceFeedRSKOracleMockup");
const PriceFeedV1PoolOracle = artifacts.require("PriceFeedV1PoolOracle");
const LiquidityPoolV1ConverterMockup = artifacts.require("LiquidityPoolV1ConverterMockup");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as an experiment
pls replace the mockup contracts with
waffle mock contracts feature
let's see if it is more convenient

Comment on lines +111 to +113
(
await LockedSOV.new(tokenSOV.address, vestingRegistry.address, cliff, duration, [owner])
).address
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably formatting issue
shouldn't change

@cwsnt cwsnt merged commit b5bd57f into development Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Price Feed Implementation for oracleV1Pool
2 participants