-
Notifications
You must be signed in to change notification settings - Fork 154
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
Market oracle #228
Conversation
There was a problem hiding this 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.
test/unit/MedianOracle_gas_cost.ts
Outdated
@@ -0,0 +1,49 @@ | |||
// TODO(naguib): Fail tests if gas utilization changes | |||
import { ethers } from 'hardhat' | |||
import { BigNumber, Contract, ContractFactory, Signer } from 'ethers' |
There was a problem hiding this comment.
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
contracts/MedianOracle.sol
Outdated
@@ -0,0 +1,223 @@ | |||
pragma solidity 0.4.24; | |||
|
|||
import "openzeppelin-solidity/contracts/math/SafeMath.sol"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if you can specify the version explicitly as i've done here ..
There was a problem hiding this comment.
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
contracts/MedianOracle.sol
Outdated
@@ -0,0 +1,223 @@ | |||
pragma solidity 0.4.24; | |||
|
|||
import "openzeppelin-solidity/contracts/math/SafeMath.sol"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import "openzeppelin-solidity/contracts/math/SafeMath.sol"; | |
import {SafeMath} from "openzeppelin-solidity/contracts/math/SafeMath.sol"; |
contracts/MedianOracle.sol
Outdated
pragma solidity 0.4.24; | ||
|
||
import "openzeppelin-solidity/contracts/math/SafeMath.sol"; | ||
import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import "openzeppelin-solidity/contracts/ownership/Ownable.sol"; | |
import {Ownable} from "openzeppelin-solidity/contracts/ownership/Ownable.sol"; |
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. |
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 |
Migrates MedianOracle contract to this repository, also migrating the testing from truffle/js to hardhat/ts.
Open questions: