Skip to content

Commit

Permalink
feat: added schema-manager contract details
Browse files Browse the repository at this point in the history
Signed-off-by: tipusinghaw <[email protected]>
  • Loading branch information
tipusinghaw committed Jan 19, 2024
1 parent f80e32d commit 1aa705c
Show file tree
Hide file tree
Showing 7 changed files with 232 additions and 356 deletions.
139 changes: 115 additions & 24 deletions .openzeppelin/polygon-mumbai.json
Original file line number Diff line number Diff line change
@@ -1,71 +1,162 @@
{
"manifestVersion": "3.2",
"admin": {
"address": "0xE3dCB856a7038ede083083c10D9a66Fd401752B8",
"txHash": "0x6b3d93ef383e38acd5bc9167ec31b9a9c44cf01e234ddea50ff9bcdceda24f7a"
},
"proxies": [
{
"address": "0xDc8063aC8b03a09E10b84831e94B218C1192Dd18",
"txHash": "0xfaf9949ebc0fc7ebeec0a56e9eefe35fef85dc3191602a18fe874babcb9eb71b",
"address": "0xCdB4e190d6A5702294A7f825e04257E7ed5480a3",
"txHash": "0x75d31570997138059eb7ed38c367792308d6539e1c0045415ef3b555054d9781",
"kind": "transparent"
},
{
"address": "0xE3F77cb485f0e75Afd75b05b0A74A91568B3174a",
"txHash": "0x654184912f3e47bb737b9c2eb1f980ed7171d2eb408541349a6d3dccdfc155f5",
"address": "0xF5B03bAaACC7dCc5a693B91b8EfD684EF52b8B68",
"txHash": "0x95039b4bcca7c540f1a6be0218037078e0de50739ab6c59957095e31659eafb0",
"kind": "transparent"
},
{
"address": "0x568633430714858702D49c0C3E8482B70752236f",
"txHash": "0x23c42837cf6ff6393fb73a9c2e6d9d19f440baac196f96898ee70b6ce89b6e3b",
"kind": "transparent"
}
],
"impls": {
"f7328d5d2b266c1834536273f7ef19f486b48786bd360fda2ba36d23e140d51e": {
"address": "0x432907312da67C42c9C80cF0f76E665DB7fb7e49",
"txHash": "0x4049ca12a03494a0133d8eae96fbe56f86408ef8c8284aee5277eaa212540e58",
"ac1be2cf50e687736d809a3dbe19cb2fc2ead745f43705f7c57296f823630136": {
"address": "0x84347670881A56ED2B42fab1bC157286223260D0",
"txHash": "0x83fa6cf4a1a900bb316c5c94b7bb7deaea460ce4defa8c607c10f147e5d074ac",
"layout": {
"solcVersion": "0.8.16",
"storage": [
{
"contract": "SchemaRegistry",
"label": "owner",
"offset": 0,
"slot": "0",
"type": "t_address",
"src": "../project:/contracts/schemaManager.sol:9"
"contract": "SchemaRegistry",
"src": "contracts/SchemaRegistry.sol:9"
},
{
"contract": "SchemaRegistry",
"label": "schemas",
"offset": 0,
"slot": "1",
"type": "t_mapping(t_address,t_mapping(t_string_memory_ptr,t_struct(Schema)40_storage))",
"src": "../project:/contracts/schemaManager.sol:15"
"contract": "SchemaRegistry",
"src": "contracts/SchemaRegistry.sol:15"
},
{
"contract": "SchemaRegistry",
"label": "initialized",
"offset": 0,
"slot": "2",
"type": "t_bool",
"src": "../project:/contracts/schemaManager.sol:19"
"contract": "SchemaRegistry",
"src": "contracts/SchemaRegistry.sol:19"
}
],
"types": {
"t_address": {
"label": "address"
"label": "address",
"numberOfBytes": "20"
},
"t_bool": {
"label": "bool",
"numberOfBytes": "1"
},
"t_mapping(t_address,t_mapping(t_string_memory_ptr,t_struct(Schema)40_storage))": {
"label": "mapping(address => mapping(string => struct SchemaRegistry.Schema))"
"label": "mapping(address => mapping(string => struct SchemaRegistry.Schema))",
"numberOfBytes": "32"
},
"t_mapping(t_string_memory_ptr,t_struct(Schema)40_storage)": {
"label": "mapping(string => struct SchemaRegistry.Schema)"
"label": "mapping(string => struct SchemaRegistry.Schema)",
"numberOfBytes": "32"
},
"t_string_memory_ptr": {
"label": "string",
"numberOfBytes": "32"
},
"t_string_storage": {
"label": "string"
"label": "string",
"numberOfBytes": "32"
},
"t_struct(Schema)40_storage": {
"label": "struct SchemaRegistry.Schema",
"members": [
{
"label": "schemaJson",
"type": "t_string_storage"
"type": "t_string_storage",
"offset": 0,
"slot": "0"
}
]
],
"numberOfBytes": "32"
}
},
"namespaces": {}
}
},
"2b89bc9b5130220a32261fccba0ee7dd3aaafb98bb9d4018ecbdb1be7ff48623": {
"address": "0x6b045643F2c29b430427Fa0A6eaef7eE57bbC26e",
"txHash": "0x715b0ee8af2c6c761628d5b4ad7273bb6b68533a935f77566e15fed8f3134a47",
"layout": {
"solcVersion": "0.8.16",
"storage": [
{
"label": "owner",
"offset": 0,
"slot": "0",
"type": "t_address",
"contract": "SchemaRegistry",
"src": "contracts/SchemaRegistry.sol:9"
},
{
"label": "schemas",
"offset": 0,
"slot": "1",
"type": "t_mapping(t_address,t_mapping(t_string_memory_ptr,t_struct(Schema)7_storage))",
"contract": "SchemaRegistry",
"src": "contracts/SchemaRegistry.sol:15"
},
{
"label": "initialized",
"offset": 0,
"slot": "2",
"type": "t_bool",
"contract": "SchemaRegistry",
"src": "contracts/SchemaRegistry.sol:19"
}
],
"types": {
"t_address": {
"label": "address",
"numberOfBytes": "20"
},
"t_bool": {
"label": "bool"
"label": "bool",
"numberOfBytes": "1"
},
"t_mapping(t_address,t_mapping(t_string_memory_ptr,t_struct(Schema)7_storage))": {
"label": "mapping(address => mapping(string => struct SchemaRegistry.Schema))",
"numberOfBytes": "32"
},
"t_mapping(t_string_memory_ptr,t_struct(Schema)7_storage)": {
"label": "mapping(string => struct SchemaRegistry.Schema)",
"numberOfBytes": "32"
},
"t_string_memory_ptr": {
"label": "string",
"numberOfBytes": "32"
},
"t_string_storage": {
"label": "string",
"numberOfBytes": "32"
},
"t_struct(Schema)7_storage": {
"label": "struct SchemaRegistry.Schema",
"members": [
{
"label": "schemaJson",
"type": "t_string_storage",
"offset": 0,
"slot": "0"
}
],
"numberOfBytes": "32"
}
},
"namespaces": {}
Expand Down
8 changes: 4 additions & 4 deletions contracts/SchemaRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
pragma solidity ^0.8.16;

/**
* @title PolygonDidRegistry
* @dev Smart Contract for Polygon DID Method
* @title SchemaRegistry
* @dev Smart Contract for Polygon Schema Methods
*/
contract SchemaRegistry {
address public owner;
address private owner;

struct Schema {
string schemaJson;
}

mapping(address => mapping(string => Schema)) public schemas;
mapping(address => mapping(string => Schema)) private schemas;

event TransferOwnership(address indexed newOwner);
event SchemaCreate(address indexed id, string schemaId, string schemaJson);
Expand Down
6 changes: 6 additions & 0 deletions hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// import 'hardhat';
require('@nomicfoundation/hardhat-ethers')
require('@openzeppelin/hardhat-upgrades')
require("@nomicfoundation/hardhat-verify");

require('dotenv/config')

Expand All @@ -25,4 +26,9 @@ module.exports = {
accounts: [`0x${process.env.SIGNER}`],
},
},
etherscan: {
apiKey: {
polygonMumbai:process.env.VERIFICATION_KEY
}
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"license": "Apache-2.0",
"dependencies": {
"@ayanworks/polygon-did-registry-contract": "2.0.1-alpha.3",
"@nomicfoundation/hardhat-verify": "^2.0.3",
"axios": "^1.6.3",
"ethers": "^6.9.0",
"uuid": "^9.0.1"
Expand Down
Loading

0 comments on commit 1aa705c

Please sign in to comment.