Skip to content

Conversation

gzliudan
Copy link
Contributor

In PriceOracle, when base asset equals quote asset, we can return 10**18 directly, no need to run other rules.

    function getPrice(address _assetOne, address _assetTwo) external view returns (uint256) {
        require(
            controller.isSystemContract(msg.sender),
            "PriceOracle.getPrice: Caller must be system contract."
        );

        if (_assetOne == _assetTwo) {
            return 10**18;
        }

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.

1 participant