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

Sonic Deploy 002 - Oracle Router #2354

Closed
wants to merge 2 commits into from

Conversation

naddison36
Copy link
Collaborator

@naddison36 naddison36 commented Jan 16, 2025

Dependencies

Deployment

Deploy scripts

  • contracts/deploy/sonic/002_oracle_router.js

Contracts

The OSonicOracleRouter contract is a deployment of the OETHFixedOracle contract. Locally in the repo it's the OSonicOracleRouter contract but is verified as OETHFixedOracle on SonicScan.

Contract Address
OSonicOracleRouter 0x4f5239bcCbd266Bdbc7233dAE9159e279fa447D1

Governance

The following governance actions need to go through the Timelock contract via the Admin 5/8 multisig

  1. Approve Sonic Staking Strategy on the Vault

Schedule Batch in Timelock

{
  "version": "1.0",
  "chainId": "146",
  "createdAt": 1736995350,
  "meta": {
    "name": "Transaction Batch",
    "description": "",
    "txBuilderVersion": "1.16.1",
    "createdFromSafeAddress": "0xbe2AB3d3d8F6a32b96414ebbd865dBD276d3d899",
    "createdFromOwnerAddress": ""
  },
  "transactions": [
    {
      "to": "0x31a91336414d3B955E494E7d485a6B06b55FC8fB",
      "value": "0",
      "data": null,
      "contractMethod": {
        "inputs": [
          {
            "type": "address[]",
            "name": "targets"
          },
          {
            "type": "uint256[]",
            "name": "values"
          },
          {
            "type": "bytes[]",
            "name": "payloads"
          },
          {
            "type": "bytes32",
            "name": "predecessor"
          },
          {
            "type": "bytes32",
            "name": "salt"
          },
          {
            "type": "uint256",
            "name": "delay"
          }
        ],
        "name": "scheduleBatch",
        "payable": false
      },
      "contractInputsValues": {
        "targets": "[\"0xa3c0eCA00D2B76b4d1F170b0AB3FdeA16C180186\"]",
        "values": "[\"0\"]",
        "payloads": "[\"0x372aa2240000000000000000000000004f5239bccbd266bdbc7233dae9159e279fa447d1\"]",
        "predecessor": "0x0000000000000000000000000000000000000000000000000000000000000000",
        "salt": "0xaddcfc3568702888db295f1ee5ad9d18c63fef2448245eb16c15668b7431c070",
        "delay": "60"
      }
    }
  ]
}

Execute Batch in Timelock

{
  "version": "1.0",
  "chainId": "146",
  "createdAt": 1736995350,
  "meta": {
    "name": "Transaction Batch",
    "description": "",
    "txBuilderVersion": "1.16.1",
    "createdFromSafeAddress": "0xbe2AB3d3d8F6a32b96414ebbd865dBD276d3d899",
    "createdFromOwnerAddress": ""
  },
  "transactions": [
    {
      "to": "0x31a91336414d3B955E494E7d485a6B06b55FC8fB",
      "value": "0",
      "data": null,
      "contractMethod": {
        "inputs": [
          {
            "type": "address[]",
            "name": "targets"
          },
          {
            "type": "uint256[]",
            "name": "values"
          },
          {
            "type": "bytes[]",
            "name": "payloads"
          },
          {
            "type": "bytes32",
            "name": "predecessor"
          },
          {
            "type": "bytes32",
            "name": "salt"
          }
        ],
        "name": "executeBatch",
        "payable": true
      },
      "contractInputsValues": {
        "targets": "[\"0xa3c0eCA00D2B76b4d1F170b0AB3FdeA16C180186\"]",
        "values": "[\"0\"]",
        "payloads": "[\"0x372aa2240000000000000000000000004f5239bccbd266bdbc7233dae9159e279fa447d1\"]",
        "predecessor": "0x0000000000000000000000000000000000000000000000000000000000000000",
        "salt": "0xaddcfc3568702888db295f1ee5ad9d18c63fef2448245eb16c15668b7431c070"
      }
    }
  ]
}

Deploy checklist

Two reviewers complete the following checklist:

- [ ] All deployed contracts are listed in the deploy PR's description
- [ ] Deployed contract's verified code (and all dependencies) match the code in master
- [ ] Contract constructors have correct arguments
- [ ] The transactions that interacted with the newly deployed contract match the deploy script.
- [ ] Governance proposal matches the deploy script
- [ ] Smoke tests pass after fork test execution of the governance proposal

Copy link

codecov bot commented Jan 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 52.72%. Comparing base (fe9f5d8) to head (27b4e82).
Report is 3 commits behind head on nicka/sonic.

Additional details and impacted files
@@               Coverage Diff               @@
##           nicka/sonic    #2354      +/-   ##
===============================================
- Coverage        54.25%   52.72%   -1.53%     
===============================================
  Files               89       89              
  Lines             4396     4396              
  Branches          1158     1158              
===============================================
- Hits              2385     2318      -67     
- Misses            2008     2075      +67     
  Partials             3        3              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@clement-ux clement-ux left a comment

Choose a reason for hiding this comment

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

  • All deployed contracts are listed in the deploy PR's description
    • OSonicOracleRouter
  • Deployed contract's verified code (and all dependencies) match the code in master
    • Small difference in the OETHFixedOracle.sol.
  • Contract constructors have correct arguments
    • Address(0)
  • The transactions that interacted with the newly deployed contract match the deploy script.
    • No interaction.
  • Governance proposal matches the deploy script
    • Call function 0x372aa224(setPriceProvider(address) selector) on 0xa3c0eCA00D2B76b4d1F170b0AB3FdeA16C180186 (VaultProxy) with args 0x4f5239bccbd266bdbc7233dae9159e279fa447d1 (deployed oracle router).
  • Smoke tests pass after fork test execution of the governance proposal

Diff

sol2uml diff 0x4f5239bcCbd266Bdbc7233dAE9159e279fa447D1 .,node_modules -n sonic
(node:3021) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)

Changed contracts/oracle/OETHFixedOracle.sol
   contract OSonicOracleRouter is OETHFixedOracle {
       constructor() OETHFixedOracle(0x0000000000000000000000000000000000000000) {}
   }
   

Compared the "OETHFixedOracle" contract with address 0x4f5239bcCbd266Bdbc7233dAE9159e279fa447D1 on sonic
to local files under folders ".,node_modules"

match   @openzeppelin/contracts/utils/math/SafeCast.sol
match   @openzeppelin/contracts/utils/math/SafeMath.sol
match   contracts/interfaces/chainlink/AggregatorV3Interface.sol
match   contracts/interfaces/IBasicToken.sol
match   contracts/interfaces/IOracle.sol
match   contracts/oracle/AbstractOracleRouter.sol
changed contracts/oracle/OETHFixedOracle.sol
match   contracts/oracle/OETHOracleRouter.sol
match   contracts/utils/Helpers.sol
match   contracts/utils/StableMath.sol

@sparrowDom
Copy link
Member

I propose we use this deploy, that corrects the Oracle Router contract name: #2355

@clement-ux
Copy link
Contributor

I propose we use this deploy, that corrects the Oracle Router contract name: #2355

I'm in favor too, sol2uml doesn't show any this differences in this new deploy.

@sparrowDom
Copy link
Member

Closing in favour of #2355

@sparrowDom sparrowDom closed this Jan 16, 2025
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