Skip to content

Conversation

@cwsnt
Copy link
Contributor

@cwsnt cwsnt commented Dec 26, 2025

No description provided.

@tjcloa tjcloa requested review from Copilot and tjcloa December 31, 2025 00:53
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enables BOS token as collateral for borrowing pools across all Sovryn loan tokens (iXUSD, iRBTC, iBPRO, iDOC, iDLLR, iUSDT). The implementation includes deploying a price feed oracle, registering loan parameters for Torque borrowing mode, and providing comprehensive documentation and testing infrastructure.

Key Changes:

  • Deployed PriceFeedV1PoolOracleBOS contract for BOS token price feeds
  • Configured loan parameters with 50% min initial margin and 15% maintenance margin for Torque mode
  • Added comprehensive documentation for collateral onboarding process
  • Removed obsolete scripts and deployment artifacts for deprecated Zero protocol components

Reviewed changes

Copilot reviewed 30 out of 35 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests-onchain/sip0088.test.js New test validating SIP-0088 proposal execution and BOS collateral enablement
hardhat/tasks/sips/args/sipArgs.js Added getArgsSip0088 function with BOS collateral setup parameters
hardhat/tasks/bos.js New Hardhat tasks for BOS price feed deployment on Tenderly and RSK mainnet
hardhat.config.js Added Tenderly virtual network configuration and reorganized imports
contracts/feeds/PriceFeedV1PoolOracleBOS.sol New price feed oracle contract for BOS token
deployment/deploy/2160-deploy-BOSPriceFeedV1PoolOracle.js Deployment script for BOS price feed with automated loan parameter setup
docs/ADDING-NEW-COLLATERAL.md Comprehensive guide for onboarding new collateral assets
scripts/contractInteraction/*.py Removed hardcoded gas price parameters
scripts/contractInteraction/mainnet_contracts.json Removed deprecated Zero protocol contract references
package.json Added Tenderly integration and updated solhint version
Various deployment artifacts Removed deprecated Zero protocol contracts and BOS AMM converter references

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

const protocol = await ethers.getContract("ISovryn");
const priceFeeds = await ethers.getContract("PriceFeeds");
const bosToken = await get("BOS");
const bosPriceFeedV1PoolOracle = await get("BOSPriceFeedV1PoolOracle"); // @todo update the address in the deployment file once deployed to the mainnet
Copy link

Copilot AI Dec 31, 2025

Choose a reason for hiding this comment

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

The TODO comment indicates incomplete work. Either remove this comment after confirming the deployment address is correct, or track this as a separate issue if the deployment is still pending.

Copilot uses AI. Check for mistakes.
abiCoder.encode(["address[]", "bool[]"], [[bosToken.address], [true]]),
],
description:
"SIP-0088 : Enable BOS Token as collateral, Details: https://github.com/DistributedCollective/SIPS/blob/04ad90b/SIP-0088.md, sha256:", // @todo update the description
Copy link

Copilot AI Dec 31, 2025

Choose a reason for hiding this comment

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

The SIP description is incomplete with a trailing 'sha256:' and a TODO comment. The sha256 hash should be added or the comment updated to reflect the final SIP document state.

Suggested change
"SIP-0088 : Enable BOS Token as collateral, Details: https://github.com/DistributedCollective/SIPS/blob/04ad90b/SIP-0088.md, sha256:", // @todo update the description
"SIP-0088 : Enable BOS Token as collateral, Details: https://github.com/DistributedCollective/SIPS/blob/04ad90b/SIP-0088.md",

Copilot uses AI. Check for mistakes.
// Tenderly cheatcode to top up native balance on the VT
// Normalize hex without leading zero nibble (Tenderly examples use 0xde0b6b3a7640000 for 1e18)
const rawHex = typeof fundAmount === "bigint" ? toBeHex(fundAmount) : hexlify(fundAmount);
const balanceHex = "0x" + BigInt(rawHex).toString(16);
Copy link

Copilot AI Dec 31, 2025

Choose a reason for hiding this comment

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

The conversion logic is redundant. Line 19 already produces a hex string (with '0x' prefix from hexlify/toBeHex), then line 20 strips and re-adds the '0x' prefix. Simplify to const balanceHex = rawHex; or use the appropriate method directly.

Suggested change
const balanceHex = "0x" + BigInt(rawHex).toString(16);
const balanceHex = rawHex;

Copilot uses AI. Check for mistakes.
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.

2 participants