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

Ubiquity Pool Security Monitor #959

Open
wants to merge 26 commits into
base: development
Choose a base branch
from

Conversation

alexandr-masl
Copy link
Contributor

@alexandr-masl alexandr-masl commented Sep 12, 2024

Resolves #927

Changes

  • Added a new UbiquityPoolSecurityMonitor contract that tracks the pool's liquidity and emits events when liquidity falls below a certain threshold

@ubiquity-os-deployer
Copy link

ubiquity-os-deployer bot commented Sep 12, 2024

@alexandr-masl
Copy link
Contributor Author

Please let me know if the naming conventions or directory structure do not align with the project's standards

@alexandr-masl
Copy link
Contributor Author

Hey @rndquu , I'm currently facing a workflow issue where my code passes all Check For Core Contracts Storage Changes checks successfully when run locally by act pull_request, but it fails when executed in a pull request. This is quite frustrating. Any insights or suggestions on how to resolve this would be greatly appreciated.

[Check For Core Contracts Storage Changes/provide_contracts]   ✅  Success - Main Install Foundry
[Check For Core Contracts Storage Changes/provide_contracts]   ✅  Success - Main Narrow down test matrix scope to changed contracts to limit API requests
[Check For Core Contracts Storage Changes/provide_contracts]   ✅  Success - Main Set contracts matrix
[Check For Core Contracts Storage Changes/provide_contracts]   ✅  Success - Post Install Foundry
[Check For Core Contracts Storage Changes/provide_contracts] 🏁  Job succeeded

@rndquu
Copy link
Member

rndquu commented Sep 19, 2024

Hey @rndquu , I'm currently facing a workflow issue where my code passes all Check For Core Contracts Storage Changes checks successfully when run locally by act pull_request, but it fails when executed in a pull request. This is quite frustrating. Any insights or suggestions on how to resolve this would be greatly appreciated.

[Check For Core Contracts Storage Changes/provide_contracts]   ✅  Success - Main Install Foundry
[Check For Core Contracts Storage Changes/provide_contracts]   ✅  Success - Main Narrow down test matrix scope to changed contracts to limit API requests
[Check For Core Contracts Storage Changes/provide_contracts]   ✅  Success - Main Set contracts matrix
[Check For Core Contracts Storage Changes/provide_contracts]   ✅  Success - Post Install Foundry
[Check For Core Contracts Storage Changes/provide_contracts] 🏁  Job succeeded

Skip it, it'll pass in the development branch. UbiquityPoolSecurityMonitor is a new contract so storage layout can't be broken there.

@alexandr-masl alexandr-masl changed the title feat(pool-monitor): add initial liquidity monitor Ubiquity Pool Security Monitor Sep 20, 2024
@alexandr-masl
Copy link
Contributor Author

Hey @rndquu,

I'm currently testing out OpenZeppelin Defender in the UI, and the only piece of code that needs to be included there is the following:

const { Defender } = require('@openzeppelin/defender-sdk');

exports.handler = async function (credentials) {
  const client = new Defender(credentials);

  const txRes = await client.relaySigner.sendTransaction({
    to: '0xb60ce3bf27B86d3099F48dbcDB52F5538402EF7B',
    speed: 'fast',
    data: '0x9ba8a26c', // Encoded function signature for checkLiquidityVertex() of the UbiquityPoolSecurityMonitor
    gasLimit: '80000',
  });

  return txRes.hash;
};

Everything is covered in the tutorial, and the only parts that have been changed are:

  • to: '0xb60ce3bf27B86d3099F48dbcDB52F5538402EF7B'
  • data: '0x9ba8a26c', which represents the encoded function signature for the checkLiquidityVertex() function in the UbiquityPoolSecurityMonitor.

I have two questions:

  1. Should this code be added to the repository, or is it unnecessary?
  2. Is it necessary to add a README with all the steps for setting up Defender in the UI?

@rndquu
Copy link
Member

rndquu commented Sep 27, 2024

Hey @rndquu,

I'm currently testing out OpenZeppelin Defender in the UI, and the only piece of code that needs to be included there is the following:

const { Defender } = require('@openzeppelin/defender-sdk');

exports.handler = async function (credentials) {
  const client = new Defender(credentials);

  const txRes = await client.relaySigner.sendTransaction({
    to: '0xb60ce3bf27B86d3099F48dbcDB52F5538402EF7B',
    speed: 'fast',
    data: '0x9ba8a26c', // Encoded function signature for checkLiquidityVertex() of the UbiquityPoolSecurityMonitor
    gasLimit: '80000',
  });

  return txRes.hash;
};

Everything is covered in the tutorial, and the only parts that have been changed are:

  • to: '0xb60ce3bf27B86d3099F48dbcDB52F5538402EF7B'
  • data: '0x9ba8a26c', which represents the encoded function signature for the checkLiquidityVertex() function in the UbiquityPoolSecurityMonitor.

I have two questions:

  1. Should this code be added to the repository, or is it unnecessary?
  2. Is it necessary to add a README with all the steps for setting up Defender in the UI?

Is it necessary to add a README with all the steps for setting up Defender in the UI?

Yes, it would be highly appreciated + you may also include that piece of code (from question 1) in the readme file.

@alexandr-masl alexandr-masl marked this pull request as ready for review October 1, 2024 14:57
@alexandr-masl
Copy link
Contributor Author

Hey @rndquu, I'm currently conducting final tests on the off-chain part of the Defender. Looking forward to your review

@rndquu rndquu mentioned this pull request Oct 4, 2024
4 tasks
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.

Security monitoring
2 participants