From cad6368fde0ff514c63f5f654278e61479c0dae8 Mon Sep 17 00:00:00 2001 From: Mitch Oz Date: Wed, 12 Jun 2024 15:29:19 -0600 Subject: [PATCH] add op super delegates --- README.md | 4 +-- add-organisation.js | 6 ++-- ...728227711495-AddOptimism Super Delegate.js | 29 +++++++++++++++++++ org-config.json | 13 +++++++++ 4 files changed, 47 insertions(+), 5 deletions(-) create mode 100644 db/migrations/1728227711495-AddOptimism Super Delegate.js create mode 100644 org-config.json diff --git a/README.md b/README.md index feea365..bfb3b89 100644 --- a/README.md +++ b/README.md @@ -11,10 +11,10 @@ Devouch is a decentralized application that allows users to attest to projects c ```bash # 0. Copy the org-config.template.json to org-config.json -cp org-config.template.json org-config.json +cp org-config.template.jsonc org-config.json # 1. Fill the config with your organisation data # 2. Run the script to add your organisation data to migrations -npm run add-organisation +npm run add-organization ``` Then create a PR to the main branch to be reviewed and merged. \ No newline at end of file diff --git a/add-organisation.js b/add-organisation.js index 3eaa0ad..91a3cc7 100644 --- a/add-organisation.js +++ b/add-organisation.js @@ -1,11 +1,11 @@ const createOrganisationAddMigration = require("./db/create-organisation-add-migration").default; -const ORGANISATION_NAME = "Giveth Verifier"; // Replace with your own organisation name +const ORGANISATION_NAME = "Optimism Super Delegate"; // Replace with your own organisation name const SCHEMA_ID = - "0xf63f2a7159ee674aa6fce42196a8bb0605eafcf20c19e91a7eafba8d39fa0404"; // Replace with your own schema id + "0xe4a196f8ea37d5f9699b095594e44b465b2703eff0615cf9766060786eef517b"; // Replace with your own schema id const AUTHORIZED_ATTESTOR = "0x93E79499b00a2fdAAC38e6005B0ad8E88b177346"; -const COLOR = "#8668fc"; +const COLOR = "#ff0420"; // staging: eth-sepolia // production: optimism-mainnet const network = "optimism-mainnet"; diff --git a/db/migrations/1728227711495-AddOptimism Super Delegate.js b/db/migrations/1728227711495-AddOptimism Super Delegate.js new file mode 100644 index 0000000..72001d6 --- /dev/null +++ b/db/migrations/1728227711495-AddOptimism Super Delegate.js @@ -0,0 +1,29 @@ +module.exports = class AddOptimismSuperDelegate1728227711495 { + name = "AddOptimismSuperDelegate1728227711495"; + + async up(db) { + const SQUID_NETWORK = process.env.SQUID_NETWORK || "eth-sepolia"; + if (SQUID_NETWORK !== "optimism-mainnet") return; + // add organisation with name "Optimism Super Delegate" and schema id "0xe4a196f8ea37d5f9699b095594e44b465b2703eff0615cf9766060786eef517b" + await db.query( + `INSERT INTO "organisation" ("id", "name", "issuer", "color", "start_block") + VALUES ( + '0xe4a196f8ea37d5f9699b095594e44b465b2703eff0615cf9766060786eef517b', + 'Optimism Super Delegate', + '0x93e79499b00a2fdaac38e6005b0ad8e88b177346', + '#ff0420', + null + )` + ); + } + + async down(db) { + const SQUID_NETWORK = process.env.SQUID_NETWORK || "eth-sepolia"; + if (SQUID_NETWORK !== "optimism-mainnet") return; + // remove organisation with name "Optimism Super Delegate" and schema id "0xe4a196f8ea37d5f9699b095594e44b465b2703eff0615cf9766060786eef517b" + await db.query( + `DELETE FROM "organisation" WHERE "id" = '0xe4a196f8ea37d5f9699b095594e44b465b2703eff0615cf9766060786eef517b'` + ); + } +}; + \ No newline at end of file diff --git a/org-config.json b/org-config.json new file mode 100644 index 0000000..f6f88d6 --- /dev/null +++ b/org-config.json @@ -0,0 +1,13 @@ +{ + "$schema": "./org-config.schema.json", + + "name": "Optimism Super Delegate", + "schemaId": "0xe4a196f8ea37d5f9699b095594e44b465b2703eff0615cf9766060786eef517b", + "authorizedAttestor": "0x93E79499b00a2fdAAC38e6005B0ad8E88b177346", + + "network": "optimism-mainnet", + + "color": "#ff0420", + "startBlock": + 121313963 +}