Skip to content

Commit

Permalink
PM Base (#184)
Browse files Browse the repository at this point in the history
* PositionManagerAndromedaUSDC

* PositionManagerAndromedaStataUSDC

* Fix failing PM tests.

* fix failing tests values.

* adjust stata usdc rate in tests.

* Fix base usdc withdraw test.

* fix withdraw usdc test.

---------

Co-authored-by: peiman3 <peiman@cc.snxdao.io>
  • Loading branch information
noisekit and peiman3 authored Feb 20, 2025
1 parent dce1848 commit 68be464
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe(__filename, () => {
forkUrl:
Cypress.env('RPC_BASE_MAINNET') ??
`https://base-mainnet.infura.io/v3/${Cypress.env('INFURA_KEY')}`,
block: '25229684',
block: '26590448',
}).then(() => cy.log('Anvil started'));
cy.pythBypass();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe(__filename, () => {
forkUrl:
Cypress.env('RPC_BASE_MAINNET') ??
`https://base-mainnet.infura.io/v3/${Cypress.env('INFURA_KEY')}`,
block: '25229684',
block: '26590448',
}).then(() => cy.log('Anvil started'));
cy.pythBypass();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe(__filename, () => {
forkUrl:
Cypress.env('RPC_BASE_MAINNET') ??
`https://base-mainnet.infura.io/v3/${Cypress.env('INFURA_KEY')}`,
block: '25229684',
block: '26590448',
}).then(() => cy.log('Anvil started'));
cy.pythBypass();
cy.on('window:before:load', (win) => {
Expand Down Expand Up @@ -44,7 +44,7 @@ describe(__filename, () => {
cy.get('[data-cy="withdraw form"]').should('exist');
cy.get('[data-cy="withdraw amount"]', { timeout: 180_000 })
.should('exist')
.and('include.text', 'Unlocked: 150 USDC');
.and('include.text', 'Unlocked: 150.000000096 USDC');

cy.get('[data-cy="stats collateral"] [data-cy="change stats current"]')
.should('exist')
Expand All @@ -59,7 +59,7 @@ describe(__filename, () => {
cy.get('[data-cy="withdraw dialog"]')
.should('exist')
.and('include.text', 'Withdrawing USDC')
.and('include.text', 'Withdrawing 150 USDC');
.and('include.text', 'Withdrawing 150.000000096 USDC');

cy.contains('[data-status="success"]', 'Withdrawal was successful', {
timeout: 180_000,
Expand All @@ -69,7 +69,7 @@ describe(__filename, () => {
cy.get('[data-cy="withdraw dialog"]')
.should('exist')
.and('include.text', 'Withdrawing USDC')
.and('include.text', 'Withdrew 150 USDC');
.and('include.text', 'Withdrew 150.000000096 USDC');

cy.contains('[data-cy="withdraw dialog"] button', 'Done').click();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe(__filename, () => {
forkUrl:
Cypress.env('RPC_BASE_MAINNET') ??
`https://base-mainnet.infura.io/v3/${Cypress.env('INFURA_KEY')}`,
block: '25229684',
block: '26590448',
}).then(() => cy.log('Anvil started'));
cy.pythBypass();

Expand Down Expand Up @@ -45,7 +45,7 @@ describe(__filename, () => {

cy.get('[data-cy="stats collateral"] [data-cy="change stats current"]')
.should('exist')
.and('include.text', '465.62 Static aUSDC');
.and('include.text', '463.17 Static aUSDC');

cy.get('[data-cy="stats collateral"] [data-cy="change stats new"]').should('not.exist');

Expand All @@ -54,7 +54,7 @@ describe(__filename, () => {

cy.get('[data-cy="stats collateral"] [data-cy="change stats new"]')
.should('exist')
.and('include.text', '651.87 Static aUSDC'); // Adjusted per stata rate
.and('include.text', '648.44 Static aUSDC'); // Adjusted per stata rate

cy.get('[data-cy="deposit submit"]').should('be.enabled');
cy.get('[data-cy="deposit submit"]').click();
Expand All @@ -79,7 +79,7 @@ describe(__filename, () => {

cy.get('[data-cy="stats collateral"] [data-cy="change stats current"]', {
timeout: 60_000,
}).and('include.text', '651.87 Static aUSDC');
}).and('include.text', '648.44 Static aUSDC');
cy.get('[data-cy="deposit submit"]').should('be.disabled');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe(__filename, () => {
forkUrl:
Cypress.env('RPC_BASE_MAINNET') ??
`https://base-mainnet.infura.io/v3/${Cypress.env('INFURA_KEY')}`,
block: '25229684',
block: '26590448',
}).then(() => cy.log('Anvil started'));
cy.pythBypass();

Expand Down Expand Up @@ -52,7 +52,7 @@ describe(__filename, () => {

cy.get('[data-cy="stats collateral"] [data-cy="change stats new"]')
.should('exist')
.and('include.text', '465.62 Static aUSDC');
.and('include.text', '463.17 Static aUSDC');

cy.get('[data-cy="deposit submit"]').should('be.enabled');
cy.get('[data-cy="deposit submit"]').click();
Expand All @@ -77,7 +77,7 @@ describe(__filename, () => {

cy.get('[data-cy="stats collateral"] [data-cy="change stats current"]', {
timeout: 60_000,
}).and('include.text', '465.62 Static aUSDC');
}).and('include.text', '463.17 Static aUSDC');
cy.get('[data-cy="deposit submit"]').should('be.disabled');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe(__filename, () => {
forkUrl:
Cypress.env('RPC_BASE_MAINNET') ??
`https://base-mainnet.infura.io/v3/${Cypress.env('INFURA_KEY')}`,
block: '25229684',
block: '26590448',
}).then(() => cy.log('Anvil started'));
cy.pythBypass();

Expand Down Expand Up @@ -49,7 +49,7 @@ describe(__filename, () => {

cy.get('[data-cy="stats collateral"] [data-cy="change stats current"]')
.should('exist')
.and('include.text', '372.5 Static aUSDC');
.and('include.text', '370.54 Static aUSDC');

cy.get('[data-cy="stats collateral"] [data-cy="change stats new"]').should('not.exist');

Expand Down Expand Up @@ -82,7 +82,7 @@ describe(__filename, () => {

cy.get('[data-cy="stats collateral"] [data-cy="change stats current"]').and(
'include.text',
'372.5 Static aUSDC'
'370.54 Static aUSDC'
);
cy.get('[data-cy="withdraw submit"]').should('be.disabled');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ export async function importPositionManagerAndromedaStataUSDC(
const deployment = `${Number(chainId).toFixed(0)}-${preset}`;
switch (deployment) {
case '8453-andromeda': {
// https://basescan.org/address/0x2d86be18716814a7d9c955149967748eab41254b#code
return { address: '0x2d86be18716814a7d9c955149967748eab41254b', abi };
// https://basescan.org/address/0x60de47cd0083cdc59fe8860e2be0d90e441484d3#code
return { address: '0x60de47cd0083cdc59fe8860e2be0d90e441484d3', abi };
}
case '84532-andromeda': {
// https://sepolia.basescan.org/address/0x289a99810ec2e60ee1b0d89344b6c5c00e8a76a6#code
return { address: '0x289a99810ec2e60ee1b0d89344b6c5c00e8a76a6', abi };
// https://sepolia.basescan.org/address/0xe4a23fe04128c54f0efcdbbdda6dbb61bc4bae67#code
return { address: '0xe4a23fe04128c54f0efcdbbdda6dbb61bc4bae67', abi };
}
default: {
throw new Error(`Unsupported deployment ${deployment} for PositionManagerAndromedaStataUSDC`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ export async function importPositionManagerAndromedaUSDC(
const deployment = `${Number(chainId).toFixed(0)}-${preset}`;
switch (deployment) {
case '8453-andromeda': {
// https://basescan.org/address/0xae3fbedc18675fb30d59ee85080deeec485d17b2#code
return { address: '0xae3fbedc18675fb30d59ee85080deeec485d17b2', abi };
// https://basescan.org/address/0x2b67227533714adbab620bb1a493c7fdfaeb6cc9#code
return { address: '0x2b67227533714adbab620bb1a493c7fdfaeb6cc9', abi };
}
case '84532-andromeda': {
// https://sepolia.basescan.org/address/0x83a3f789d3ea78bbad9389e2f574f11b11b09c07#code
return { address: '0x83a3f789d3ea78bbad9389e2f574f11b11b09c07', abi };
// https://sepolia.basescan.org/address/0x6f043ce2d90eb8ee4f25ddd1fba50cb5012cb9a2#code
return { address: '0x6f043ce2d90eb8ee4f25ddd1fba50cb5012cb9a2', abi };
}
default: {
throw new Error(`Unsupported deployment ${deployment} for PositionManagerAndromedaStataUSDC`);
Expand Down

0 comments on commit 68be464

Please sign in to comment.