From 18f653bd90786c7d8114a90defb4e48dddbbd295 Mon Sep 17 00:00:00 2001 From: Gerald Iakobinyi-Pich1 Date: Fri, 12 Jul 2024 17:35:58 +0200 Subject: [PATCH 1/5] feat: adding shape-sepolia + have deployed the Verifier & Attester already to shape-sepolia --- .env-example | 2 + .openzeppelin/unknown-11011.json | 281 +++++++++++++++++++++++++++ deployments/abi/GitcoinAttester.json | 29 +++ deployments/abi/GitcoinVerifier.json | 28 +++ deployments/onchainInfo.json | 35 ++++ hardhat.config.ts | 17 ++ 6 files changed, 392 insertions(+) create mode 100644 .openzeppelin/unknown-11011.json diff --git a/.env-example b/.env-example index bf09d25..bffc27f 100644 --- a/.env-example +++ b/.env-example @@ -26,3 +26,5 @@ ETHERSCAN_API_KEY=000 OP_SEPOLIA_ETHERSCAN_API_KEY=000 SCROLL_ETHERSCAN_API_KEY=000 SCROLL_SEPOLIA_ETHERSCAN_API_KEY=000 + +SHAPE_SEPOLIA_PROVIDER_URL=https://... diff --git a/.openzeppelin/unknown-11011.json b/.openzeppelin/unknown-11011.json new file mode 100644 index 0000000..baf1a0e --- /dev/null +++ b/.openzeppelin/unknown-11011.json @@ -0,0 +1,281 @@ +{ + "manifestVersion": "3.2", + "proxies": [ + { + "address": "0xCc90105D4A2aa067ee768120AdA19886021dF422", + "txHash": "0x7054c817ff80ec6c69931b4f19384b26d26ed49c56ce4397bdeea5a03f06082e", + "kind": "uups" + }, + { + "address": "0x16db23c4b99bbC9A6Bf55dF7a787C9AEFD261185", + "txHash": "0xd7b321489c02ecf7508bee16eb69800ba1382f126a165825f26f9089cc0dfab6", + "kind": "uups" + } + ], + "impls": { + "38802172d292593a826b81783e72f2e20dc7c1aa4d04aea697a8cc739bcd5da7": { + "address": "0x5aeC6db5FC9490120f209a313EbB8d15C91b1604", + "txHash": "0x59cd31ea7183640cd9432df8a151734d74e497c08af84527276fab4ed3b3238b", + "layout": { + "solcVersion": "0.8.20", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94" + }, + { + "label": "_paused", + "offset": 0, + "slot": "101", + "type": "t_bool", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:29" + }, + { + "label": "__gap", + "offset": 0, + "slot": "102", + "type": "t_array(t_uint256)49_storage", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:116" + }, + { + "label": "verifiers", + "offset": 0, + "slot": "151", + "type": "t_mapping(t_address,t_bool)", + "contract": "GitcoinAttester", + "src": "contracts/GitcoinAttester.sol:17" + }, + { + "label": "eas", + "offset": 0, + "slot": "152", + "type": "t_contract(IEAS)368", + "contract": "GitcoinAttester", + "src": "contracts/GitcoinAttester.sol:20" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_contract(IEAS)368": { + "label": "contract IEAS", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)", + "numberOfBytes": "32" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } + }, + "0ef2af0b0f4788d85266f5a44d062f688d6c3e400e794b81992bf18717fee332": { + "address": "0xf58Bb56E6e6EA7834478b470615e037df825C442", + "txHash": "0xaca98a5442c5117074090de20c9380b267f4fa5ee62ae40c97c4dadbfb7443c1", + "layout": { + "solcVersion": "0.8.19", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94" + }, + { + "label": "_paused", + "offset": 0, + "slot": "101", + "type": "t_bool", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:29" + }, + { + "label": "__gap", + "offset": 0, + "slot": "102", + "type": "t_array(t_uint256)49_storage", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:116" + }, + { + "label": "attester", + "offset": 0, + "slot": "151", + "type": "t_contract(GitcoinAttester)6912", + "contract": "GitcoinVerifier", + "src": "contracts/GitcoinVerifier.sol:25" + }, + { + "label": "issuer", + "offset": 0, + "slot": "152", + "type": "t_address", + "contract": "GitcoinVerifier", + "src": "contracts/GitcoinVerifier.sol:28" + }, + { + "label": "DOMAIN_SEPARATOR", + "offset": 0, + "slot": "153", + "type": "t_bytes32", + "contract": "GitcoinVerifier", + "src": "contracts/GitcoinVerifier.sol:31" + }, + { + "label": "name", + "offset": 0, + "slot": "154", + "type": "t_string_storage", + "contract": "GitcoinVerifier", + "src": "contracts/GitcoinVerifier.sol:34" + }, + { + "label": "recipientNonces", + "offset": 0, + "slot": "155", + "type": "t_mapping(t_address,t_uint256)", + "contract": "GitcoinVerifier", + "src": "contracts/GitcoinVerifier.sol:37" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(GitcoinAttester)6912": { + "label": "contract GitcoinAttester", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_uint256)": { + "label": "mapping(address => uint256)", + "numberOfBytes": "32" + }, + "t_string_storage": { + "label": "string", + "numberOfBytes": "32" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } + } + } +} diff --git a/deployments/abi/GitcoinAttester.json b/deployments/abi/GitcoinAttester.json index 97b7a91..5be747c 100644 --- a/deployments/abi/GitcoinAttester.json +++ b/deployments/abi/GitcoinAttester.json @@ -340,5 +340,34 @@ "function upgradeTo(address newImplementation)", "function upgradeToAndCall(address newImplementation, bytes data) payable", "function verifiers(address) view returns (bool)" + ], + "0x2b03": [ + "event AdminChanged(address previousAdmin, address newAdmin)", + "event BeaconUpgraded(address indexed beacon)", + "event EASSet(address eas)", + "event Initialized(uint8 version)", + "event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)", + "event Paused(address account)", + "event Unpaused(address account)", + "event Upgraded(address indexed implementation)", + "event VerifierAdded(address verifier)", + "event VerifierRemoved(address verifier)", + "function addVerifier(address _verifier)", + "function eas() view returns (address)", + "function initialize()", + "function owner() view returns (address)", + "function pause()", + "function paused() view returns (bool)", + "function proxiableUUID() view returns (bytes32)", + "function removeVerifier(address _verifier)", + "function renounceOwnership()", + "function revokeAttestations((bytes32 schema, (bytes32 uid, uint256 value)[] data)[] multiRevocationRequest) payable", + "function setEASAddress(address _easContractAddress)", + "function submitAttestations((bytes32 schema, (address recipient, uint64 expirationTime, bool revocable, bytes32 refUID, bytes data, uint256 value)[] data)[] multiAttestationRequest) payable returns (bytes32[])", + "function transferOwnership(address newOwner)", + "function unpause()", + "function upgradeTo(address newImplementation)", + "function upgradeToAndCall(address newImplementation, bytes data) payable", + "function verifiers(address) view returns (bool)" ] } \ No newline at end of file diff --git a/deployments/abi/GitcoinVerifier.json b/deployments/abi/GitcoinVerifier.json index 24e669c..b119da5 100644 --- a/deployments/abi/GitcoinVerifier.json +++ b/deployments/abi/GitcoinVerifier.json @@ -340,5 +340,33 @@ "function upgradeToAndCall(address newImplementation, bytes data) payable", "function verifyAndAttest(((bytes32 schema, (address recipient, uint64 expirationTime, bool revocable, bytes32 refUID, bytes data, uint256 value)[] data)[] multiAttestationRequest, uint256 nonce, uint256 fee) attestationRequest, uint8 v, bytes32 r, bytes32 s) payable returns (bytes32[])", "function withdrawFees(uint256 _amount)" + ], + "0x2b03": [ + "error InsufficientFee()", + "error InvalidNonce()", + "error InvalidSignature()", + "event AdminChanged(address previousAdmin, address newAdmin)", + "event BeaconUpgraded(address indexed beacon)", + "event Initialized(uint8 version)", + "event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)", + "event Paused(address account)", + "event Unpaused(address account)", + "event Upgraded(address indexed implementation)", + "function attester() view returns (address)", + "function initialize(address _issuer, address _attester)", + "function issuer() view returns (address)", + "function name() view returns (string)", + "function owner() view returns (address)", + "function pause()", + "function paused() view returns (bool)", + "function proxiableUUID() view returns (bytes32)", + "function recipientNonces(address) view returns (uint256)", + "function renounceOwnership()", + "function transferOwnership(address newOwner)", + "function unpause()", + "function upgradeTo(address newImplementation)", + "function upgradeToAndCall(address newImplementation, bytes data) payable", + "function verifyAndAttest(((bytes32 schema, (address recipient, uint64 expirationTime, bool revocable, bytes32 refUID, bytes data, uint256 value)[] data)[] multiAttestationRequest, uint256 nonce, uint256 fee) attestationRequest, uint8 v, bytes32 r, bytes32 s) payable returns (bytes32[])", + "function withdrawFees(uint256 _amount)" ] } \ No newline at end of file diff --git a/deployments/onchainInfo.json b/deployments/onchainInfo.json index a66424e..c36e71b 100644 --- a/deployments/onchainInfo.json +++ b/deployments/onchainInfo.json @@ -412,5 +412,40 @@ "uid": "0x24620f482734b3806102678e4b8bb68baafb1adc1ec29e524bcd69c85f15b915" } } + }, + "0x2b03": { + "description": "Shape Sepolia", + "issuer": { + "address": "0x5f603Ed913738d9105bAf3BD981AA4750016B167" + }, + "EAS": { + "address": "0x4200000000000000000000000000000000000021" + }, + "EASSchemaRegistry": { + "address": "0x4200000000000000000000000000000000000020" + }, + "GitcoinAttester": { + "address": "0xCc90105D4A2aa067ee768120AdA19886021dF422" + }, + "GitcoinVerifier": { + "address": "0x16db23c4b99bbC9A6Bf55dF7a787C9AEFD261185" + }, + "GitcoinResolver": { + "address": "" + }, + "GitcoinPassportDecoder": { + "address": "" + }, + "easSchemas": { + "namingSchema": { + "uid": "" + }, + "passport": { + "uid": "" + }, + "score": { + "uid": "" + } + } } } \ No newline at end of file diff --git a/hardhat.config.ts b/hardhat.config.ts index 0faa296..b2b583d 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -139,6 +139,14 @@ let config: HardhatUserConfig = { apiURL: "https://api-sepolia.scrollscan.com/api", browserURL: "https://sepolia.scrollscan.com/" } + }, + { + network: "shape-sepolia", + chainId: 11011, + urls: { + apiURL: "https://shape-sepolia-explorer.alchemy.com/api", + browserURL: "https://shape-sepolia-explorer.alchemy.com/" + } } ] }, @@ -301,6 +309,15 @@ if (process.env.DEPLOYER_PRIVATE_KEY && process.env.DEPLOYER_ADDRESS) { from: process.env.DEPLOYER_ADDRESS as string }; } + if (process.env.SHAPE_SEPOLIA_PROVIDER_URL) { + config.networks["shape-sepolia"] = { + url: process.env.SHAPE_SEPOLIA_PROVIDER_URL as string, + accounts: [process.env.DEPLOYER_PRIVATE_KEY as string], + chainId: 11011, + from: process.env.DEPLOYER_ADDRESS as string, + gasPrice: 9068663 + }; + } } } From 33a98548ecd8186d7a775ace4280b35d46d9e81b Mon Sep 17 00:00:00 2001 From: Gerald Iakobinyi-Pich1 Date: Sat, 13 Jul 2024 09:54:15 +0200 Subject: [PATCH 2/5] feat: have deployed the resolver contract --- .openzeppelin/unknown-11011.json | 205 +++++++++++++++++++++++++++ deployments/abi/GitcoinResolver.json | 42 ++++++ deployments/onchainInfo.json | 2 +- 3 files changed, 248 insertions(+), 1 deletion(-) diff --git a/.openzeppelin/unknown-11011.json b/.openzeppelin/unknown-11011.json index baf1a0e..67c2b90 100644 --- a/.openzeppelin/unknown-11011.json +++ b/.openzeppelin/unknown-11011.json @@ -10,6 +10,11 @@ "address": "0x16db23c4b99bbC9A6Bf55dF7a787C9AEFD261185", "txHash": "0xd7b321489c02ecf7508bee16eb69800ba1382f126a165825f26f9089cc0dfab6", "kind": "uups" + }, + { + "address": "0x90E2C4472Df225e8D31f44725B75FFaA244d5D33", + "txHash": "0xa72780a7a495da8cc31213c993d005edb4acf8a542bc978dc28ac9d832245ae8", + "kind": "uups" } ], "impls": { @@ -276,6 +281,206 @@ } } } + }, + "99324d8a4c0405f84990c4f269299dd73f34f7a1ce7c3d6df818d577be86491c": { + "address": "0x2999eF5C943B1F7085c299EFD30556DaF48879dC", + "txHash": "0xbdfc10200a35d9ac012eb3213ef1eecfda52c05f5c5c39b97f605dff847916c6", + "layout": { + "solcVersion": "0.8.19", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94" + }, + { + "label": "_paused", + "offset": 0, + "slot": "101", + "type": "t_bool", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:29" + }, + { + "label": "__gap", + "offset": 0, + "slot": "102", + "type": "t_array(t_uint256)49_storage", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:116" + }, + { + "label": "userAttestations", + "offset": 0, + "slot": "151", + "type": "t_mapping(t_address,t_mapping(t_bytes32,t_bytes32))", + "contract": "GitcoinResolver", + "src": "contracts/GitcoinResolver.sol:37" + }, + { + "label": "_eas", + "offset": 0, + "slot": "152", + "type": "t_contract(IEAS)2310", + "contract": "GitcoinResolver", + "src": "contracts/GitcoinResolver.sol:40" + }, + { + "label": "_gitcoinAttester", + "offset": 0, + "slot": "153", + "type": "t_contract(GitcoinAttester)6912", + "contract": "GitcoinResolver", + "src": "contracts/GitcoinResolver.sol:43" + }, + { + "label": "allowlist", + "offset": 0, + "slot": "154", + "type": "t_mapping(t_address,t_bool)", + "contract": "GitcoinResolver", + "src": "contracts/GitcoinResolver.sol:46" + }, + { + "label": "scores", + "offset": 0, + "slot": "155", + "type": "t_mapping(t_address,t_struct(CachedScore)8657_storage)", + "contract": "GitcoinResolver", + "src": "contracts/GitcoinResolver.sol:49" + }, + { + "label": "scoreSchema", + "offset": 0, + "slot": "156", + "type": "t_bytes32", + "contract": "GitcoinResolver", + "src": "contracts/GitcoinResolver.sol:52" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(GitcoinAttester)6912": { + "label": "contract GitcoinAttester", + "numberOfBytes": "20" + }, + "t_contract(IEAS)2310": { + "label": "contract IEAS", + "numberOfBytes": "20" + }, + "t_mapping(t_address,t_bool)": { + "label": "mapping(address => bool)", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_mapping(t_bytes32,t_bytes32))": { + "label": "mapping(address => mapping(bytes32 => bytes32))", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_struct(CachedScore)8657_storage)": { + "label": "mapping(address => struct IGitcoinResolver.CachedScore)", + "numberOfBytes": "32" + }, + "t_mapping(t_bytes32,t_bytes32)": { + "label": "mapping(bytes32 => bytes32)", + "numberOfBytes": "32" + }, + "t_struct(CachedScore)8657_storage": { + "label": "struct IGitcoinResolver.CachedScore", + "members": [ + { + "label": "score", + "type": "t_uint32", + "offset": 0, + "slot": "0" + }, + { + "label": "time", + "type": "t_uint64", + "offset": 4, + "slot": "0" + }, + { + "label": "expirationTime", + "type": "t_uint64", + "offset": 12, + "slot": "0" + } + ], + "numberOfBytes": "32" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint32": { + "label": "uint32", + "numberOfBytes": "4" + }, + "t_uint64": { + "label": "uint64", + "numberOfBytes": "8" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } } } } diff --git a/deployments/abi/GitcoinResolver.json b/deployments/abi/GitcoinResolver.json index c94ac46..f14076b 100644 --- a/deployments/abi/GitcoinResolver.json +++ b/deployments/abi/GitcoinResolver.json @@ -487,5 +487,47 @@ "function upgradeTo(address newImplementation)", "function upgradeToAndCall(address newImplementation, bytes data) payable", "function userAttestations(address, bytes32) view returns (bytes32)" + ], + "0x2b03": [ + "error AccessDenied()", + "error InsufficientValue()", + "error InvalidAttester()", + "error InvalidEAS()", + "error NotAllowlisted()", + "error NotPayable()", + "event AdminChanged(address previousAdmin, address newAdmin)", + "event BeaconUpgraded(address indexed beacon)", + "event Initialized(uint8 version)", + "event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)", + "event Paused(address account)", + "event ScoreSchemaSet(bytes32 schema)", + "event Unpaused(address account)", + "event Upgraded(address indexed implementation)", + "function _eas() view returns (address)", + "function _gitcoinAttester() view returns (address)", + "function addToAllowlist(address addr)", + "function allowlist(address) view returns (bool)", + "function attest((bytes32 uid, bytes32 schema, uint64 time, uint64 expirationTime, uint64 revocationTime, bytes32 refUID, address recipient, address attester, bool revocable, bytes data) attestation) payable returns (bool)", + "function getCachedScore(address user) view returns ((uint32 score, uint64 time, uint64 expirationTime))", + "function getUserAttestation(address user, bytes32 schema) view returns (bytes32)", + "function initialize(address eas, address gitcoinAttester)", + "function isPayable() pure returns (bool)", + "function multiAttest((bytes32 uid, bytes32 schema, uint64 time, uint64 expirationTime, uint64 revocationTime, bytes32 refUID, address recipient, address attester, bool revocable, bytes data)[] attestations, uint256[]) payable returns (bool)", + "function multiRevoke((bytes32 uid, bytes32 schema, uint64 time, uint64 expirationTime, uint64 revocationTime, bytes32 refUID, address recipient, address attester, bool revocable, bytes data)[] attestations, uint256[]) payable returns (bool)", + "function owner() view returns (address)", + "function pause()", + "function paused() view returns (bool)", + "function proxiableUUID() view returns (bytes32)", + "function removeFromAllowlist(address addr)", + "function renounceOwnership()", + "function revoke((bytes32 uid, bytes32 schema, uint64 time, uint64 expirationTime, uint64 revocationTime, bytes32 refUID, address recipient, address attester, bool revocable, bytes data) attestation) payable returns (bool)", + "function scoreSchema() view returns (bytes32)", + "function scores(address) view returns (uint32 score, uint64 time, uint64 expirationTime)", + "function setScoreSchema(bytes32 _schema)", + "function transferOwnership(address newOwner)", + "function unpause()", + "function upgradeTo(address newImplementation)", + "function upgradeToAndCall(address newImplementation, bytes data) payable", + "function userAttestations(address, bytes32) view returns (bytes32)" ] } \ No newline at end of file diff --git a/deployments/onchainInfo.json b/deployments/onchainInfo.json index c36e71b..c0db01f 100644 --- a/deployments/onchainInfo.json +++ b/deployments/onchainInfo.json @@ -431,7 +431,7 @@ "address": "0x16db23c4b99bbC9A6Bf55dF7a787C9AEFD261185" }, "GitcoinResolver": { - "address": "" + "address": "0x90E2C4472Df225e8D31f44725B75FFaA244d5D33" }, "GitcoinPassportDecoder": { "address": "" From faeab908f9ba901e9ec02ddc572d3834338eacee Mon Sep 17 00:00:00 2001 From: Gerald Iakobinyi-Pich1 Date: Sat, 13 Jul 2024 13:13:20 +0200 Subject: [PATCH 3/5] feat: deployed to shape-sepolia EAS schemas, GitcoinPassportDecoder --- .openzeppelin/unknown-11011.json | 213 ++++++++++++++++++++ deployments/abi/GitcoinPassportDecoder.json | 56 +++++ deployments/onchainInfo.json | 6 +- 3 files changed, 272 insertions(+), 3 deletions(-) diff --git a/.openzeppelin/unknown-11011.json b/.openzeppelin/unknown-11011.json index 67c2b90..b0e21ff 100644 --- a/.openzeppelin/unknown-11011.json +++ b/.openzeppelin/unknown-11011.json @@ -15,6 +15,11 @@ "address": "0x90E2C4472Df225e8D31f44725B75FFaA244d5D33", "txHash": "0xa72780a7a495da8cc31213c993d005edb4acf8a542bc978dc28ac9d832245ae8", "kind": "uups" + }, + { + "address": "0x2050256A91cbABD7C42465aA0d5325115C1dEB43", + "txHash": "0xd835b0e5a44c0fc7f0b9413cf2703a8d007591d70f7937e66010724efc2d7c98", + "kind": "uups" } ], "impls": { @@ -481,6 +486,214 @@ } } } + }, + "90e2b67209504512d49f2eb6948e6ef0c65273140fc40cc7becbf0856ad14e33": { + "address": "0x2443D22Db6d25D141A1138D80724e3Eee54FD4C2", + "txHash": "0x800de87f9b5583a5db73a50c5699af619a4adf54a09370b5060ce5d5e81f7458", + "layout": { + "solcVersion": "0.8.20", + "storage": [ + { + "label": "_initialized", + "offset": 0, + "slot": "0", + "type": "t_uint8", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63", + "retypedFrom": "bool" + }, + { + "label": "_initializing", + "offset": 1, + "slot": "0", + "type": "t_bool", + "contract": "Initializable", + "src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68" + }, + { + "label": "__gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage", + "contract": "ContextUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:36" + }, + { + "label": "_owner", + "offset": 0, + "slot": "51", + "type": "t_address", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22" + }, + { + "label": "__gap", + "offset": 0, + "slot": "52", + "type": "t_array(t_uint256)49_storage", + "contract": "OwnableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94" + }, + { + "label": "_paused", + "offset": 0, + "slot": "101", + "type": "t_bool", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:29" + }, + { + "label": "__gap", + "offset": 0, + "slot": "102", + "type": "t_array(t_uint256)49_storage", + "contract": "PausableUpgradeable", + "src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:116" + }, + { + "label": "eas", + "offset": 0, + "slot": "151", + "type": "t_contract(IEAS)368", + "contract": "GitcoinPassportDecoder", + "src": "contracts/GitcoinPassportDecoder.sol:25" + }, + { + "label": "providerVersions", + "offset": 0, + "slot": "152", + "type": "t_mapping(t_uint32,t_array(t_string_storage)dyn_storage)", + "contract": "GitcoinPassportDecoder", + "src": "contracts/GitcoinPassportDecoder.sol:28" + }, + { + "label": "reversedMappingVersions", + "offset": 0, + "slot": "153", + "type": "t_mapping(t_uint32,t_mapping(t_string_memory_ptr,t_uint8))", + "contract": "GitcoinPassportDecoder", + "src": "contracts/GitcoinPassportDecoder.sol:31" + }, + { + "label": "currentVersion", + "offset": 0, + "slot": "154", + "type": "t_uint32", + "contract": "GitcoinPassportDecoder", + "src": "contracts/GitcoinPassportDecoder.sol:34" + }, + { + "label": "gitcoinResolver", + "offset": 4, + "slot": "154", + "type": "t_contract(IGitcoinResolver)6523", + "contract": "GitcoinPassportDecoder", + "src": "contracts/GitcoinPassportDecoder.sol:37" + }, + { + "label": "passportSchemaUID", + "offset": 0, + "slot": "155", + "type": "t_bytes32", + "contract": "GitcoinPassportDecoder", + "src": "contracts/GitcoinPassportDecoder.sol:40" + }, + { + "label": "scoreSchemaUID", + "offset": 0, + "slot": "156", + "type": "t_bytes32", + "contract": "GitcoinPassportDecoder", + "src": "contracts/GitcoinPassportDecoder.sol:43" + }, + { + "label": "maxScoreAge", + "offset": 0, + "slot": "157", + "type": "t_uint64", + "contract": "GitcoinPassportDecoder", + "src": "contracts/GitcoinPassportDecoder.sol:46" + }, + { + "label": "threshold", + "offset": 0, + "slot": "158", + "type": "t_uint256", + "contract": "GitcoinPassportDecoder", + "src": "contracts/GitcoinPassportDecoder.sol:49" + } + ], + "types": { + "t_address": { + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_string_storage)dyn_storage": { + "label": "string[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)49_storage": { + "label": "uint256[49]", + "numberOfBytes": "1568" + }, + "t_array(t_uint256)50_storage": { + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_contract(IEAS)368": { + "label": "contract IEAS", + "numberOfBytes": "20" + }, + "t_contract(IGitcoinResolver)6523": { + "label": "contract IGitcoinResolver", + "numberOfBytes": "20" + }, + "t_mapping(t_string_memory_ptr,t_uint8)": { + "label": "mapping(string => uint8)", + "numberOfBytes": "32" + }, + "t_mapping(t_uint32,t_array(t_string_storage)dyn_storage)": { + "label": "mapping(uint32 => string[])", + "numberOfBytes": "32" + }, + "t_mapping(t_uint32,t_mapping(t_string_memory_ptr,t_uint8))": { + "label": "mapping(uint32 => mapping(string => uint8))", + "numberOfBytes": "32" + }, + "t_string_memory_ptr": { + "label": "string", + "numberOfBytes": "32" + }, + "t_string_storage": { + "label": "string", + "numberOfBytes": "32" + }, + "t_uint256": { + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint32": { + "label": "uint32", + "numberOfBytes": "4" + }, + "t_uint64": { + "label": "uint64", + "numberOfBytes": "8" + }, + "t_uint8": { + "label": "uint8", + "numberOfBytes": "1" + } + } + } } } } diff --git a/deployments/abi/GitcoinPassportDecoder.json b/deployments/abi/GitcoinPassportDecoder.json index f731903..6d06e17 100644 --- a/deployments/abi/GitcoinPassportDecoder.json +++ b/deployments/abi/GitcoinPassportDecoder.json @@ -592,5 +592,61 @@ "function unpause()", "function upgradeTo(address newImplementation)", "function upgradeToAndCall(address newImplementation, bytes data) payable" + ], + "0x2b03": [ + "error AttestationExpired(uint64 expirationTime)", + "error AttestationNotFound()", + "error EmptyProvider()", + "error ProviderAlreadyExists(string provider)", + "error ScoreDoesNotMeetThreshold(uint256 score)", + "error ZeroMaxScoreAge()", + "error ZeroThreshold()", + "error ZeroValue()", + "event AdminChanged(address previousAdmin, address newAdmin)", + "event BeaconUpgraded(address indexed beacon)", + "event EASSet(address easAddress)", + "event Initialized(uint8 version)", + "event MaxScoreAgeSet(uint256 maxScoreAge)", + "event NewVersionCreated()", + "event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)", + "event Paused(address account)", + "event ProvidersAdded(string[] providers)", + "event ResolverSet(address resolverAddress)", + "event SchemaSet(bytes32 schemaUID)", + "event ThresholdSet(uint256 threshold)", + "event Unpaused(address account)", + "event Upgraded(address indexed implementation)", + "function addProviders(string[] providers)", + "function createNewVersion(string[] providers)", + "function currentVersion() view returns (uint32)", + "function eas() view returns (address)", + "function getAttestation(bytes32 attestationUID) view returns ((bytes32 uid, bytes32 schema, uint64 time, uint64 expirationTime, uint64 revocationTime, bytes32 refUID, address recipient, address attester, bool revocable, bytes data))", + "function getPassport(address user) view returns ((string provider, bytes32 hash, uint64 time, uint64 expirationTime)[])", + "function getProviders(uint32 version) view returns (string[])", + "function getScore(address user) view returns (uint256)", + "function gitcoinResolver() view returns (address)", + "function initialize()", + "function isHuman(address user) view returns (bool)", + "function maxScoreAge() view returns (uint64)", + "function owner() view returns (address)", + "function passportSchemaUID() view returns (bytes32)", + "function pause()", + "function paused() view returns (bool)", + "function providerVersions(uint32, uint256) view returns (string)", + "function proxiableUUID() view returns (bytes32)", + "function renounceOwnership()", + "function reversedMappingVersions(uint32, string) view returns (uint8)", + "function scoreSchemaUID() view returns (bytes32)", + "function setEASAddress(address _easContractAddress)", + "function setGitcoinResolver(address _gitcoinResolver)", + "function setMaxScoreAge(uint64 _maxScoreAge)", + "function setPassportSchemaUID(bytes32 _schemaUID)", + "function setScoreSchemaUID(bytes32 _schemaUID)", + "function setThreshold(uint256 _threshold)", + "function threshold() view returns (uint256)", + "function transferOwnership(address newOwner)", + "function unpause()", + "function upgradeTo(address newImplementation)", + "function upgradeToAndCall(address newImplementation, bytes data) payable" ] } \ No newline at end of file diff --git a/deployments/onchainInfo.json b/deployments/onchainInfo.json index c0db01f..e1fc5f4 100644 --- a/deployments/onchainInfo.json +++ b/deployments/onchainInfo.json @@ -434,17 +434,17 @@ "address": "0x90E2C4472Df225e8D31f44725B75FFaA244d5D33" }, "GitcoinPassportDecoder": { - "address": "" + "address": "0x2050256A91cbABD7C42465aA0d5325115C1dEB43" }, "easSchemas": { "namingSchema": { "uid": "" }, "passport": { - "uid": "" + "uid": "0x8ae6ee946bf1c936584cacc969bf7e9d0b274631c818df7e45c246051b364341" }, "score": { - "uid": "" + "uid": "0x24620f482734b3806102678e4b8bb68baafb1adc1ec29e524bcd69c85f15b915" } } } From e705c253d2b1a88b14211c071280cfbcd7c2d270 Mon Sep 17 00:00:00 2001 From: Gerald Iakobinyi-Pich1 Date: Sat, 13 Jul 2024 13:13:52 +0200 Subject: [PATCH 4/5] feat: have updated providerBitmapInfo.json --- deployments/providerBitMapInfo.json | 271 ++++++++++++++-------------- 1 file changed, 136 insertions(+), 135 deletions(-) diff --git a/deployments/providerBitMapInfo.json b/deployments/providerBitMapInfo.json index 1b45f79..6f96238 100644 --- a/deployments/providerBitMapInfo.json +++ b/deployments/providerBitMapInfo.json @@ -1,136 +1,137 @@ [ - { "bit": 0, "index": 0, "name": "SelfStakingBronze" }, - { "bit": 1, "index": 0, "name": "SelfStakingSilver" }, - { "bit": 2, "index": 0, "name": "SelfStakingGold" }, - { "bit": 3, "index": 0, "name": "CommunityStakingBronze" }, - { "bit": 4, "index": 0, "name": "CommunityStakingSilver" }, - { "bit": 5, "index": 0, "name": "CommunityStakingGold" }, - { - "bit": 6, - "index": 0, - "name": "GitcoinContributorStatistics#numGrantsContributeToGte#1" - }, - { - "bit": 7, - "index": 0, - "name": "GitcoinContributorStatistics#numGrantsContributeToGte#10" - }, - { - "bit": 8, - "index": 0, - "name": "GitcoinContributorStatistics#numGrantsContributeToGte#25" - }, - { - "bit": 9, - "index": 0, - "name": "GitcoinContributorStatistics#numGrantsContributeToGte#100" - }, - { - "bit": 10, - "index": 0, - "name": "GitcoinContributorStatistics#totalContributionAmountGte#10" - }, - { - "bit": 11, - "index": 0, - "name": "GitcoinContributorStatistics#totalContributionAmountGte#100" - }, - { - "bit": 12, - "index": 0, - "name": "GitcoinContributorStatistics#totalContributionAmountGte#1000" - }, - { - "bit": 13, - "index": 0, - "name": "GitcoinContributorStatistics#numGr14ContributionsGte#1" - }, - { - "bit": 14, - "index": 0, - "name": "GitcoinContributorStatistics#numRoundsContributedToGte#1" - }, - { "bit": 15, "index": 0, "name": "twitterAccountAgeGte#180" }, - { "bit": 16, "index": 0, "name": "twitterAccountAgeGte#365" }, - { "bit": 17, "index": 0, "name": "twitterAccountAgeGte#730" }, - { "bit": 18, "index": 0, "name": "Discord" }, - { "bit": 19, "index": 0, "name": "Google" }, - { "bit": 20, "index": 0, "name": "githubAccountCreationGte#90" }, - { "bit": 21, "index": 0, "name": "githubAccountCreationGte#180" }, - { "bit": 22, "index": 0, "name": "githubAccountCreationGte#365" }, - { "bit": 23, "index": 0, "name": "githubContributionActivityGte#30" }, - { "bit": 24, "index": 0, "name": "githubContributionActivityGte#60" }, - { "bit": 25, "index": 0, "name": "githubContributionActivityGte#120" }, - { "bit": 26, "index": 0, "name": "Facebook" }, - { "bit": 27, "index": 0, "name": "FacebookProfilePicture" }, - { "bit": 28, "index": 0, "name": "Linkedin" }, - { "bit": 29, "index": 0, "name": "Ens" }, - { "bit": 30, "index": 0, "name": "Brightid" }, - { "bit": 31, "index": 0, "name": "Poh" }, - { "bit": 32, "index": 0, "name": "ethPossessionsGte#1" }, - { "bit": 33, "index": 0, "name": "ethPossessionsGte#10" }, - { "bit": 34, "index": 0, "name": "ethPossessionsGte#32" }, - { "bit": 35, "index": 0, "name": "FirstEthTxnProvider" }, - { "bit": 36, "index": 0, "name": "EthGTEOneTxnProvider" }, - { "bit": 37, "index": 0, "name": "EthGasProvider" }, - { "bit": 38, "index": 0, "name": "SnapshotVotesProvider" }, - { "bit": 39, "index": 0, "name": "SnapshotProposalsProvider" }, - { "bit": 40, "index": 0, "name": "NFT" }, - { "bit": 41, "index": 0, "name": "ZkSync" }, - { "bit": 42, "index": 0, "name": "ZkSyncEra" }, - { "bit": 43, "index": 0, "name": "Lens" }, - { "bit": 44, "index": 0, "name": "GnosisSafe" }, - { "bit": 45, "index": 0, "name": "Coinbase" }, - { "bit": 46, "index": 0, "name": "GuildMember" }, - { "bit": 47, "index": 0, "name": "GuildAdmin" }, - { "bit": 48, "index": 0, "name": "GuildPassportMember" }, - { "bit": 49, "index": 0, "name": "Hypercerts" }, - { "bit": 50, "index": 0, "name": "PHIActivitySilver" }, - { "bit": 51, "index": 0, "name": "PHIActivityGold" }, - { "bit": 52, "index": 0, "name": "HolonymGovIdProvider" }, - { "bit": 53, "index": 0, "name": "IdenaState#Newbie" }, - { "bit": 54, "index": 0, "name": "IdenaState#Verified" }, - { "bit": 55, "index": 0, "name": "IdenaState#Human" }, - { "bit": 56, "index": 0, "name": "IdenaStake#1k" }, - { "bit": 57, "index": 0, "name": "IdenaStake#10k" }, - { "bit": 58, "index": 0, "name": "IdenaStake#100k" }, - { "bit": 59, "index": 0, "name": "IdenaAge#5" }, - { "bit": 60, "index": 0, "name": "IdenaAge#10" }, - { "bit": 61, "index": 0, "name": "CivicCaptchaPass" }, - { "bit": 62, "index": 0, "name": "CivicUniquenessPass" }, - { "bit": 63, "index": 0, "name": "CivicLivenessPass" }, - { "bit": 64, "index": 0, "name": "CyberProfilePremium" }, - { "bit": 65, "index": 0, "name": "CyberProfilePaid" }, - { "bit": 66, "index": 0, "name": "CyberProfileOrgMember" }, - { "bit": 67, "index": 0, "name": "GrantsStack3Projects" }, - { "bit": 68, "index": 0, "name": "GrantsStack5Projects" }, - { "bit": 69, "index": 0, "name": "GrantsStack7Projects" }, - { "bit": 70, "index": 0, "name": "GrantsStack2Programs" }, - { "bit": 71, "index": 0, "name": "GrantsStack4Programs" }, - { "bit": 72, "index": 0, "name": "GrantsStack6Programs" }, - { "bit": 73, "index": 0, "name": "TrustaLabs" }, - { "bit": 74, "index": 0, "name": "BeginnerCommunityStaker" }, - { "bit": 75, "index": 0, "name": "ExperiencedCommunityStaker" }, - { "bit": 76, "index": 0, "name": "TrustedCitizen" }, - { "bit": 77, "index": 0, "name": "CoinbaseDualVerification" }, - { "bit": 78, "index": 0, "name": "ETHEnthusiast" }, - { "bit": 79, "index": 0, "name": "ETHAdvocate" }, - { "bit": 80, "index": 0, "name": "ETHPioneer" }, - { "bit": 81, "index": 0, "name": "ETHMaxi" }, - { "bit": 82, "index": 0, "name": "ETHScore#50" }, - { "bit": 83, "index": 0, "name": "ETHScore#75" }, - { "bit": 84, "index": 0, "name": "ETHScore#90" }, - { "bit": 85, "index": 0, "name": "ETHGasSpent#0.25" }, - { "bit": 86, "index": 0, "name": "ETHnumTransactions#100" }, - { "bit": 87, "index": 0, "name": "ETHDaysActive#50" }, - { "bit": 88, "index": 0, "name": "DigitalCollector" }, - { "bit": 89, "index": 0, "name": "ArtAficionado" }, - { "bit": 90, "index": 0, "name": "NftVisionary" }, - { "bit": 91, "index": 0, "name": "zkSyncScore#5" }, - { "bit": 92, "index": 0, "name": "zkSyncScore#20" }, - { "bit": 93, "index": 0, "name": "zkSyncScore#50" }, - { "bit": 94, "index": 0, "name": "NFTScore#50" }, - { "bit": 95, "index": 0, "name": "NFTScore#75" }, - { "bit": 96, "index": 0, "name": "NFTScore#90" } - ] - \ No newline at end of file + { "bit": 0, "index": 0, "name": "SelfStakingBronze" }, + { "bit": 1, "index": 0, "name": "SelfStakingSilver" }, + { "bit": 2, "index": 0, "name": "SelfStakingGold" }, + { "bit": 3, "index": 0, "name": "CommunityStakingBronze" }, + { "bit": 4, "index": 0, "name": "CommunityStakingSilver" }, + { "bit": 5, "index": 0, "name": "CommunityStakingGold" }, + { + "bit": 6, + "index": 0, + "name": "GitcoinContributorStatistics#numGrantsContributeToGte#1" + }, + { + "bit": 7, + "index": 0, + "name": "GitcoinContributorStatistics#numGrantsContributeToGte#10" + }, + { + "bit": 8, + "index": 0, + "name": "GitcoinContributorStatistics#numGrantsContributeToGte#25" + }, + { + "bit": 9, + "index": 0, + "name": "GitcoinContributorStatistics#numGrantsContributeToGte#100" + }, + { + "bit": 10, + "index": 0, + "name": "GitcoinContributorStatistics#totalContributionAmountGte#10" + }, + { + "bit": 11, + "index": 0, + "name": "GitcoinContributorStatistics#totalContributionAmountGte#100" + }, + { + "bit": 12, + "index": 0, + "name": "GitcoinContributorStatistics#totalContributionAmountGte#1000" + }, + { + "bit": 13, + "index": 0, + "name": "GitcoinContributorStatistics#numGr14ContributionsGte#1" + }, + { + "bit": 14, + "index": 0, + "name": "GitcoinContributorStatistics#numRoundsContributedToGte#1" + }, + { "bit": 15, "index": 0, "name": "twitterAccountAgeGte#180" }, + { "bit": 16, "index": 0, "name": "twitterAccountAgeGte#365" }, + { "bit": 17, "index": 0, "name": "twitterAccountAgeGte#730" }, + { "bit": 18, "index": 0, "name": "Discord" }, + { "bit": 19, "index": 0, "name": "Google" }, + { "bit": 20, "index": 0, "name": "githubAccountCreationGte#90" }, + { "bit": 21, "index": 0, "name": "githubAccountCreationGte#180" }, + { "bit": 22, "index": 0, "name": "githubAccountCreationGte#365" }, + { "bit": 23, "index": 0, "name": "githubContributionActivityGte#30" }, + { "bit": 24, "index": 0, "name": "githubContributionActivityGte#60" }, + { "bit": 25, "index": 0, "name": "githubContributionActivityGte#120" }, + { "bit": 26, "index": 0, "name": "Facebook" }, + { "bit": 27, "index": 0, "name": "FacebookProfilePicture" }, + { "bit": 28, "index": 0, "name": "Linkedin" }, + { "bit": 29, "index": 0, "name": "Ens" }, + { "bit": 30, "index": 0, "name": "Brightid" }, + { "bit": 31, "index": 0, "name": "Poh" }, + { "bit": 32, "index": 0, "name": "ethPossessionsGte#1" }, + { "bit": 33, "index": 0, "name": "ethPossessionsGte#10" }, + { "bit": 34, "index": 0, "name": "ethPossessionsGte#32" }, + { "bit": 35, "index": 0, "name": "FirstEthTxnProvider" }, + { "bit": 36, "index": 0, "name": "EthGTEOneTxnProvider" }, + { "bit": 37, "index": 0, "name": "EthGasProvider" }, + { "bit": 38, "index": 0, "name": "SnapshotVotesProvider" }, + { "bit": 39, "index": 0, "name": "SnapshotProposalsProvider" }, + { "bit": 40, "index": 0, "name": "NFT" }, + { "bit": 41, "index": 0, "name": "ZkSync" }, + { "bit": 42, "index": 0, "name": "ZkSyncEra" }, + { "bit": 43, "index": 0, "name": "Lens" }, + { "bit": 44, "index": 0, "name": "GnosisSafe" }, + { "bit": 45, "index": 0, "name": "Coinbase" }, + { "bit": 46, "index": 0, "name": "GuildMember" }, + { "bit": 47, "index": 0, "name": "GuildAdmin" }, + { "bit": 48, "index": 0, "name": "GuildPassportMember" }, + { "bit": 49, "index": 0, "name": "Hypercerts" }, + { "bit": 50, "index": 0, "name": "PHIActivitySilver" }, + { "bit": 51, "index": 0, "name": "PHIActivityGold" }, + { "bit": 52, "index": 0, "name": "HolonymGovIdProvider" }, + { "bit": 53, "index": 0, "name": "IdenaState#Newbie" }, + { "bit": 54, "index": 0, "name": "IdenaState#Verified" }, + { "bit": 55, "index": 0, "name": "IdenaState#Human" }, + { "bit": 56, "index": 0, "name": "IdenaStake#1k" }, + { "bit": 57, "index": 0, "name": "IdenaStake#10k" }, + { "bit": 58, "index": 0, "name": "IdenaStake#100k" }, + { "bit": 59, "index": 0, "name": "IdenaAge#5" }, + { "bit": 60, "index": 0, "name": "IdenaAge#10" }, + { "bit": 61, "index": 0, "name": "CivicCaptchaPass" }, + { "bit": 62, "index": 0, "name": "CivicUniquenessPass" }, + { "bit": 63, "index": 0, "name": "CivicLivenessPass" }, + { "bit": 64, "index": 0, "name": "CyberProfilePremium" }, + { "bit": 65, "index": 0, "name": "CyberProfilePaid" }, + { "bit": 66, "index": 0, "name": "CyberProfileOrgMember" }, + { "bit": 67, "index": 0, "name": "GrantsStack3Projects" }, + { "bit": 68, "index": 0, "name": "GrantsStack5Projects" }, + { "bit": 69, "index": 0, "name": "GrantsStack7Projects" }, + { "bit": 70, "index": 0, "name": "GrantsStack2Programs" }, + { "bit": 71, "index": 0, "name": "GrantsStack4Programs" }, + { "bit": 72, "index": 0, "name": "GrantsStack6Programs" }, + { "bit": 73, "index": 0, "name": "TrustaLabs" }, + { "bit": 74, "index": 0, "name": "BeginnerCommunityStaker" }, + { "bit": 75, "index": 0, "name": "ExperiencedCommunityStaker" }, + { "bit": 76, "index": 0, "name": "TrustedCitizen" }, + { "bit": 77, "index": 0, "name": "CoinbaseDualVerification" }, + { "bit": 78, "index": 0, "name": "ETHEnthusiast" }, + { "bit": 79, "index": 0, "name": "ETHAdvocate" }, + { "bit": 80, "index": 0, "name": "ETHPioneer" }, + { "bit": 81, "index": 0, "name": "ETHMaxi" }, + { "bit": 82, "index": 0, "name": "ETHScore#50" }, + { "bit": 83, "index": 0, "name": "ETHScore#75" }, + { "bit": 84, "index": 0, "name": "ETHScore#90" }, + { "bit": 85, "index": 0, "name": "ETHGasSpent#0.25" }, + { "bit": 86, "index": 0, "name": "ETHnumTransactions#100" }, + { "bit": 87, "index": 0, "name": "ETHDaysActive#50" }, + { "bit": 88, "index": 0, "name": "DigitalCollector" }, + { "bit": 89, "index": 0, "name": "ArtAficionado" }, + { "bit": 90, "index": 0, "name": "NftVisionary" }, + { "bit": 91, "index": 0, "name": "zkSyncScore#5" }, + { "bit": 92, "index": 0, "name": "zkSyncScore#20" }, + { "bit": 93, "index": 0, "name": "zkSyncScore#50" }, + { "bit": 94, "index": 0, "name": "NFTScore#50" }, + { "bit": 95, "index": 0, "name": "NFTScore#75" }, + { "bit": 96, "index": 0, "name": "NFTScore#90" }, + { "bit": 97, "index": 0, "name": "BinanceBABT" }, + { "bit": 98, "index": 0, "name": "Outdid" } +] From 9b42ed55042bade4cfdfa367a0af209e6439d90c Mon Sep 17 00:00:00 2001 From: Gerald Iakobinyi-Pich1 Date: Sat, 13 Jul 2024 15:42:11 +0200 Subject: [PATCH 5/5] feat: new script to prepare transaction for adding new providers --- scripts/lib/utils.ts | 7 ++++ scripts/prepareAddProviders.ts | 75 ++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 scripts/prepareAddProviders.ts diff --git a/scripts/lib/utils.ts b/scripts/lib/utils.ts index 7f0475e..093dccb 100644 --- a/scripts/lib/utils.ts +++ b/scripts/lib/utils.ts @@ -184,6 +184,13 @@ export function getVerifierAddress() { return verifierAddress; } +export function getDecoderAddress() { + const decoderAddress = getThisChainInfo().GitcoinPassportDecoder?.address; + if (!decoderAddress) + throw new Error("GitcoinPassportDecoder address not found in onchainInfo"); + return decoderAddress; +} + export function getEASAddress() { const easAddress = getThisChainInfo().EAS?.address; if (!easAddress) throw new Error("EAS address not found in onchainInfo"); diff --git a/scripts/prepareAddProviders.ts b/scripts/prepareAddProviders.ts new file mode 100644 index 0000000..93d47da --- /dev/null +++ b/scripts/prepareAddProviders.ts @@ -0,0 +1,75 @@ +import hre, { ethers } from "hardhat"; +import { + confirmContinue, + assertEnvironment, + getDecoderAddress +} from "./lib/utils"; +import providerBitMapInfo from "../deployments/providerBitMapInfo.json"; + +assertEnvironment(); + +export async function main() { + const decoderAddress = getDecoderAddress(); + const GitcoinDecoder = await ethers.getContractFactory( + "GitcoinPassportDecoder" + ); + const gitcoinDecoder = GitcoinDecoder.attach(decoderAddress); + + const currentVersion = await gitcoinDecoder.currentVersion(); + console.log("currentVersion (mapping): ", currentVersion); + const existingProviders = await gitcoinDecoder.getProviders(currentVersion); + console.log("existing providers: ", existingProviders); + + const providers = new Array(256).fill(""); + let maxProviderIndex = 0; + console.log(`🚀 Adding providers...`); + providerBitMapInfo.forEach(async (provider) => { + providers[provider.bit] = provider.name; + if (provider.bit > maxProviderIndex) { + maxProviderIndex = provider.bit; + } + }); + + // Drop the empty elemnts at the end + providers.splice(maxProviderIndex + 1); + console.log(`🚀 new complete providers list: `, providers); + + // The new providers list must be greater than the existing one + if (providers.length <= existingProviders.length) { + console.log("❌ There are no new providers to be added"); + return; + } + + // The new providers list must contain the existing providers list, at the same indexes + if ( + !providers + .slice(0, existingProviders.length) + .every((p, idx) => p === existingProviders[idx]) + ) { + console.log( + "❌ Mismatch in existing providers and computed / configured providers" + ); + return; + } + + const providersToAdd = providers.slice(existingProviders.length); + + await confirmContinue({ + contract: "GitcoinDecoder", + network: hre.network.name, + chainId: hre.network.config.chainId, + providersToAdd: JSON.stringify(providersToAdd) + }); + + const addProvidersData = gitcoinDecoder.interface.encodeFunctionData( + "addProviders", + [providersToAdd] + ); + + console.log({ addProvidersData }); +} + +main().catch((error) => { + console.error(error); + process.exitCode = 1; +});