Skip to content

Commit

Permalink
Merge pull request #84 from Giveth/add-super-delegate
Browse files Browse the repository at this point in the history
add op super delegates
  • Loading branch information
divine-comedian authored Jun 12, 2024
2 parents 36d9e7f + cad6368 commit 8a5cc0f
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
6 changes: 3 additions & 3 deletions add-organisation.js
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
29 changes: 29 additions & 0 deletions db/migrations/1728227711495-AddOptimism Super Delegate.js
Original file line number Diff line number Diff line change
@@ -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'`
);
}
};

13 changes: 13 additions & 0 deletions org-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "./org-config.schema.json",

"name": "Optimism Super Delegate",
"schemaId": "0xe4a196f8ea37d5f9699b095594e44b465b2703eff0615cf9766060786eef517b",
"authorizedAttestor": "0x93E79499b00a2fdAAC38e6005B0ad8E88b177346",

"network": "optimism-mainnet",

"color": "#ff0420",
"startBlock":
121313963
}

0 comments on commit 8a5cc0f

Please sign in to comment.