Skip to content

Commit

Permalink
Merge branch 'master' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosQ96 committed Feb 6, 2024
2 parents 0f5cd26 + f1c1fd1 commit 2c4a95d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion migration/1706820821887-addmpEthToDatabaseTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const mpEthTokens = [
name: 'mpETH',
symbol: 'mpETH',
address: '0x819845b60a192167ed1139040b4f8eca31834f27',
mainnetAddress: '0x48afbbd342f64ef8a9ab1c143719b63c2ad81710',
decimals: 18,
isGivbackEligible: true,
networkId: NETWORK_IDS.OPTIMISTIC,
Expand All @@ -29,6 +28,17 @@ export class addmpEthToDatabaseTokens1706820821887
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
const exists = await queryRunner.query(`
SELECT * FROM token
WHERE
("address" = '0x48afbbd342f64ef8a9ab1c143719b63c2ad81710' AND "networkId" = ${NETWORK_IDS.MAIN_NET}) OR
("address" = '0x819845b60a192167ed1139040b4f8eca31834f27' AND "networkId" = ${NETWORK_IDS.OPTIMISTIC})
`);

if (exists && exists.length === 2) {
return;
}

await queryRunner.manager.save(Token, mpEthTokens);

const tokens = await queryRunner.query(`
Expand Down

0 comments on commit 2c4a95d

Please sign in to comment.