From 7e1f79b43235acce96130e9b470045b76a5d6e09 Mon Sep 17 00:00:00 2001 From: Reinis Martinsons Date: Tue, 13 Feb 2024 15:13:42 +0000 Subject: [PATCH 1/5] feat: add core mainnet Signed-off-by: Reinis Martinsons --- src/plugins/oSnap/constants.ts | 18 ++++++++++++++++++ src/plugins/safeSnap/constants.ts | 22 +++++++++++++++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/src/plugins/oSnap/constants.ts b/src/plugins/oSnap/constants.ts index 4b5dc1ea5..6dfd37c8a 100644 --- a/src/plugins/oSnap/constants.ts +++ b/src/plugins/oSnap/constants.ts @@ -1417,6 +1417,15 @@ export const contractData = [ 'https://api.thegraph.com/subgraphs/name/umaprotocol/avalanche-optimistic-oracle-v3', deployBlock: 27816737 }, + { + // core + network: '1116', + name: 'OptimisticOracleV3', + address: '0xD84ACa67d683aF7702705141b3C7E57e4e5e7726', + subgraph: + 'https://thegraph.coredao.org/subgraphs/name/umaprotocol/core-optimistic-oracle-v3', + deployBlock: 11341063 + }, { // mainnet network: '1', @@ -1480,6 +1489,15 @@ export const contractData = [ deployBlock: 28050250, subgraph: 'https://api.thegraph.com/subgraphs/name/umaprotocol/avalanche-optimistic-governor' + }, + { + // core + network: '1116', + name: 'OptimisticGovernor', + address: '0x596Fd6A5A185c67aBD1c845b39f593fBA9C233aa', + deployBlock: 11341122, + subgraph: + 'https://thegraph.coredao.org/subgraphs/name/umaprotocol/core-optimistic-governor' } ] as const; diff --git a/src/plugins/safeSnap/constants.ts b/src/plugins/safeSnap/constants.ts index 0b88007ae..a19b226e1 100644 --- a/src/plugins/safeSnap/constants.ts +++ b/src/plugins/safeSnap/constants.ts @@ -18,7 +18,8 @@ export const EIP3770_PREFIXES = { 246: 'ewt', 73799: 'vt', 42161: 'arb1', - 137: 'matic' + 137: 'matic', + 1116: 'core' }; export const EXPLORER_API_URLS = { @@ -348,6 +349,7 @@ export const MULTI_SEND_V1_3_0 = { '288': '0x998739BFdAAdde7C933B942a68053933098f9EDa', '588': '0x998739BFdAAdde7C933B942a68053933098f9EDa', '1088': '0x998739BFdAAdde7C933B942a68053933098f9EDa', + '1116': '0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761', '1285': '0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761', '1287': '0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761', '4002': '0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761', @@ -460,6 +462,15 @@ export const contractData: ContractData[] = [ 'https://api.thegraph.com/subgraphs/name/umaprotocol/avalanche-optimistic-oracle-v3', deployBlock: 27816737 }, + { + // core + network: '43114', + name: 'OptimisticOracleV3', + address: '0xD84ACa67d683aF7702705141b3C7E57e4e5e7726', + subgraph: + 'https://thegraph.coredao.org/subgraphs/name/umaprotocol/core-optimistic-oracle-v3', + deployBlock: 11341063 + }, { // mainnet network: '1', @@ -523,5 +534,14 @@ export const contractData: ContractData[] = [ deployBlock: 28050250, subgraph: 'https://api.thegraph.com/subgraphs/name/umaprotocol/avalanche-optimistic-governor' + }, + { + // core + network: '1116', + name: 'OptimisticGovernor', + address: '0x596Fd6A5A185c67aBD1c845b39f593fBA9C233aa', + deployBlock: 11341122, + subgraph: + 'https://thegraph.coredao.org/subgraphs/name/umaprotocol/core-optimistic-governor' } ]; From e9a7505ae3f5c78d4a7601ced5b68fe71be379a9 Mon Sep 17 00:00:00 2001 From: Reinis Martinsons Date: Tue, 13 Feb 2024 16:33:34 +0000 Subject: [PATCH 2/5] fix: add core coin Signed-off-by: Reinis Martinsons --- src/plugins/oSnap/utils/coins.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/plugins/oSnap/utils/coins.ts b/src/plugins/oSnap/utils/coins.ts index d0066e4cf..0f94c36a1 100644 --- a/src/plugins/oSnap/utils/coins.ts +++ b/src/plugins/oSnap/utils/coins.ts @@ -43,6 +43,14 @@ const BNB_COIN = { logoUri: 'https://safe-transaction-assets.safe.global/chains/56/currency_logo.png' } as const; +const CORE_COIN = { + name: 'Core', + symbol: 'CORE', + address: 'main', + decimals: 18, + logiUri: + 'https://cloudflare-ipfs.com/ipfs/bafkreigjv5yb7uhlrryzib7j2f73nnwqan2tmfnwjdu26vkk365fyesoiu' +} as const; export function getNativeAsset(network: Network) { switch (parseInt(network)) { @@ -55,6 +63,8 @@ export function getNativeAsset(network: Network) { return EWC_COIN; case 56: return BNB_COIN; + case 1116: + return CORE_COIN; } return ETHEREUM_COIN; From b2e614f75f48b6b744ba0ed5b127d004586135e6 Mon Sep 17 00:00:00 2001 From: Reinis Martinsons Date: Tue, 13 Feb 2024 16:41:22 +0000 Subject: [PATCH 3/5] fix: typo Signed-off-by: Reinis Martinsons --- src/plugins/oSnap/utils/coins.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/oSnap/utils/coins.ts b/src/plugins/oSnap/utils/coins.ts index 0f94c36a1..b566df182 100644 --- a/src/plugins/oSnap/utils/coins.ts +++ b/src/plugins/oSnap/utils/coins.ts @@ -48,7 +48,7 @@ const CORE_COIN = { symbol: 'CORE', address: 'main', decimals: 18, - logiUri: + logoUri: 'https://cloudflare-ipfs.com/ipfs/bafkreigjv5yb7uhlrryzib7j2f73nnwqan2tmfnwjdu26vkk365fyesoiu' } as const; From bad0a2ea2ff9ef5baec0280ca968173a75134ed4 Mon Sep 17 00:00:00 2001 From: Reinis Martinsons Date: Tue, 13 Feb 2024 17:23:57 +0000 Subject: [PATCH 4/5] fix: add core coin to safesnap Signed-off-by: Reinis Martinsons --- src/plugins/safeSnap/utils/coins.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/plugins/safeSnap/utils/coins.ts b/src/plugins/safeSnap/utils/coins.ts index 006e83c28..0d2fac313 100644 --- a/src/plugins/safeSnap/utils/coins.ts +++ b/src/plugins/safeSnap/utils/coins.ts @@ -41,6 +41,14 @@ const BNB_COIN: TokenAsset = { logoUri: 'https://safe-transaction-assets.safe.global/chains/56/currency_logo.png' }; +const CORE_COIN: TokenAsset = { + name: 'Core', + symbol: 'CORE', + address: 'main', + decimals: 18, + logoUri: + 'https://cloudflare-ipfs.com/ipfs/bafkreigjv5yb7uhlrryzib7j2f73nnwqan2tmfnwjdu26vkk365fyesoiu' +}; export function getNativeAsset(network: Network) { switch (parseInt(network)) { @@ -53,7 +61,9 @@ export function getNativeAsset(network: Network) { return EWC_COIN; case 56: return BNB_COIN; - } + case 1116: + return CORE_COIN; + } return ETHEREUM_COIN; } From ff3ff3e9971901e91aaf6041c915b45ebd5e249c Mon Sep 17 00:00:00 2001 From: Reinis Martinsons Date: Tue, 20 Feb 2024 20:47:48 +0000 Subject: [PATCH 5/5] fix: custom safe url for core Signed-off-by: Reinis Martinsons --- src/plugins/oSnap/constants.ts | 18 ++++++++++++++++-- src/plugins/oSnap/utils/getters.ts | 3 ++- src/plugins/safeSnap/constants.ts | 6 ++++-- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/plugins/oSnap/constants.ts b/src/plugins/oSnap/constants.ts index 6dfd37c8a..99991cafa 100644 --- a/src/plugins/oSnap/constants.ts +++ b/src/plugins/oSnap/constants.ts @@ -1105,7 +1105,8 @@ export const EXPLORER_API_URLS = { '246': 'https://explorer.energyweb.org/api', '137': 'https://api.polygonscan.com/api', '56': 'https://api.bscscan.com/api', - '42161': 'https://api.arbiscan.io/api' + '42161': 'https://api.arbiscan.io/api', + // '1116': Add 'https://openapi.coredao.org/api' if API key requirement is removed } as const; export const GNOSIS_SAFE_TRANSACTION_API_URLS = { @@ -1116,7 +1117,20 @@ export const GNOSIS_SAFE_TRANSACTION_API_URLS = { '246': 'https://safe-transaction-ewc.safe.global/api', '137': 'https://safe-transaction-polygon.safe.global/api', '56': 'https://safe-transaction-bsc.safe.global/api', - '42161': 'https://safe-transaction-arbitrum.safe.global/api' + '42161': 'https://safe-transaction-arbitrum.safe.global/api', + // '1116': Add when public tx service is available for Core +} as const; + +export const SAFE_APP_URLS = { + '1': 'https://app.safe.global/apps/open', + '5': 'https://app.safe.global/apps/open', + '100': 'https://app.safe.global/apps/open', + '73799': 'https://app.safe.global/apps/open', + '246': 'https://app.safe.global/apps/open', + '137': 'https://app.safe.global/apps/open', + '56': 'https://app.safe.global/apps/open', + '42161': 'https://app.safe.global/apps/open', + '1116': 'https://safe.coredao.org/apps/open' } as const; // ABIs diff --git a/src/plugins/oSnap/utils/getters.ts b/src/plugins/oSnap/utils/getters.ts index b03912c3b..dc4f31db2 100644 --- a/src/plugins/oSnap/utils/getters.ts +++ b/src/plugins/oSnap/utils/getters.ts @@ -14,6 +14,7 @@ import { GNOSIS_SAFE_TRANSACTION_API_URLS, OPTIMISTIC_GOVERNOR_ABI, OPTIMISTIC_ORACLE_V3_ABI, + SAFE_APP_URLS, contractData, safePrefixes, solidityZeroHexString @@ -247,9 +248,9 @@ export function makeConfigureOsnapUrl(params: { network, spaceName, spaceUrl, - baseUrl = 'https://app.safe.global/apps/open', appUrl = 'https://osnap.uma.xyz/' } = params; + const baseUrl = params.baseUrl ?? SAFE_APP_URLS[network] ?? 'https://app.safe.global/apps/open'; const safeAddressPrefix = getSafeNetworkPrefix(network); const appUrlSearchParams = new URLSearchParams(); appUrlSearchParams.set('spaceName', spaceName); diff --git a/src/plugins/safeSnap/constants.ts b/src/plugins/safeSnap/constants.ts index a19b226e1..0f995e8e1 100644 --- a/src/plugins/safeSnap/constants.ts +++ b/src/plugins/safeSnap/constants.ts @@ -30,7 +30,8 @@ export const EXPLORER_API_URLS = { '246': 'https://explorer.energyweb.org/api', '137': 'https://api.polygonscan.com/api', '56': 'https://api.bscscan.com/api', - '42161': 'https://api.arbiscan.io/api' + '42161': 'https://api.arbiscan.io/api', + // '1116': Add 'https://openapi.coredao.org/api' if API key requirement is removed }; export const GNOSIS_SAFE_TRANSACTION_API_URLS = { @@ -41,7 +42,8 @@ export const GNOSIS_SAFE_TRANSACTION_API_URLS = { '246': 'https://safe-transaction-ewc.safe.global/api', '137': 'https://safe-transaction-polygon.safe.global/api', '56': 'https://safe-transaction-bsc.safe.global/api', - '42161': 'https://safe-transaction-arbitrum.safe.global/api' + '42161': 'https://safe-transaction-arbitrum.safe.global/api', + // '1116': // Add when public tx service is available for Core }; // ABIs