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

Market oracle #228

Merged
merged 7 commits into from
Mar 1, 2022
Merged

Market oracle #228

merged 7 commits into from
Mar 1, 2022

Conversation

nms-7
Copy link
Contributor

@nms-7 nms-7 commented Feb 23, 2022

Migrates MedianOracle contract to this repository, also migrating the testing from truffle/js to hardhat/ts.

Open questions:

  • Deployment - no migration file in the market-oracle repo, uncertainty around plans to actually deploy new oracle with any updated params or feature improvements
  • There's a TODO left in the gas testing to fail if gas utilization changes – however it does change for some iterations
  • Any new features to be discussed

@aalavandhan aalavandhan self-requested a review February 24, 2022 19:10
Copy link
Member

@brandoniles brandoniles left a comment

Choose a reason for hiding this comment

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

LGTM, but please what for @ahnaguib or @aalavandhan 's approval before merging.

@@ -0,0 +1,49 @@
// TODO(naguib): Fail tests if gas utilization changes
import { ethers } from 'hardhat'
import { BigNumber, Contract, ContractFactory, Signer } from 'ethers'
Copy link
Member

Choose a reason for hiding this comment

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

I think we can just get rid of this. We wrote this when there wasn't a lot of tooling for solidity development.

We now have a hardhat plugin built in which does this out of the box ,,
https://www.npmjs.com/package/hardhat-gas-reporter

@@ -0,0 +1,223 @@
pragma solidity 0.4.24;

import "openzeppelin-solidity/contracts/math/SafeMath.sol";
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@nms-7 nms-7 Feb 25, 2022

Choose a reason for hiding this comment

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

so I tried a few things here. I could yarn add from the github path as you had, in the case "https://github.com/OpenZeppelin/openzeppelin-solidity.git#2.0.0" actually resolves to "https://github.com/OpenZeppelin/openzeppelin-contracts.git#2.0.0", but the package name remains "openzeppelin-solidity" for purposes of importing from the contract code

@@ -0,0 +1,223 @@
pragma solidity 0.4.24;

import "openzeppelin-solidity/contracts/math/SafeMath.sol";
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import {SafeMath} from "openzeppelin-solidity/contracts/math/SafeMath.sol";

pragma solidity 0.4.24;

import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
import "openzeppelin-solidity/contracts/ownership/Ownable.sol";
import {Ownable} from "openzeppelin-solidity/contracts/ownership/Ownable.sol";

@aalavandhan
Copy link
Member

aalavandhan commented Feb 25, 2022

I wonder if we can just use the latest solidity versions (and oz dependencies) for the market oracle contracts you've imported? If we redeploy we'll bump them up anyway.

We could add an issue and get back to it in a later PR, no rush.

@nms-7
Copy link
Contributor Author

nms-7 commented Feb 25, 2022

Open to doing this. Of course, would not match the existing deployed oracle, so maybe better for a separate PR, possibly including any feature update proposals

@nms-7 nms-7 merged commit d49624e into master Mar 1, 2022
@nms-7 nms-7 deleted the market-oracle branch March 1, 2022 17:25
@nms-7 nms-7 mentioned this pull request Jun 9, 2023
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.

3 participants