Skip to content

Commit

Permalink
Merge pull request #181 from desci-labs/contract-fixes
Browse files Browse the repository at this point in the history
smart contract fixes
  • Loading branch information
hubsmoke authored Mar 19, 2024
2 parents d839128 + 17f998a commit 8e519b0
Show file tree
Hide file tree
Showing 105 changed files with 16,905 additions and 70 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ DISCORD_NOTIFICATIONS_WEBHOOK_URL=
# must match value in nodes-media/.env
MEDIA_SECRET_KEY=supersecret

ORCID_API_DOMAIN=https://api.sandbox.orcid.org
ORCID_API_DOMAIN=sandbox.orcid.org
ORCID_CLIENT_ID=
ORCID_CLIENT_SECRET=

Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/contracts-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# build.yml
on:
# pull_request:
# paths:
# - .github/workflows/**
# - desci-models/**
push:
paths:
- .github/workflows/**
- desci-contracts/**

name: Test desci-contracts

jobs:
build-and-test:
runs-on: ubuntu-latest
# container:
# image: ubuntu:latest
# options: --user 1001

steps:
- name: Check out repository
uses: actions/checkout@v2

- name: Set up the environment
# Replace this line with the appropriate setup for your project
# Examples:
uses: actions/setup-node@v2
with:
node-version: 18

- name: Install dependencies
run: cd desci-contracts && npm i -g yarn && yarn && yarn build

- name: Run tests
run: |
cd desci-contracts && npx hardhat clean && yarn test
17 changes: 9 additions & 8 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"recommendations": [
"bradlc.vscode-tailwindcss",
"juanblanco.solidity",
"esbenp.prettier-vscode",
"prisma.prisma",
"rbbit.typescript-hero"
]
}
"recommendations": [
"bradlc.vscode-tailwindcss",
"juanblanco.solidity",
"esbenp.prettier-vscode",
"prisma.prisma",
"eamodio.gitlens",
"ms-vscode.makefile-tools"
]
}
23 changes: 20 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
{
"explorer.compactFolders": false,
"files.exclude": {
"**/node_modules/**": false
"**/node_modules/**": true
},
"editor.formatOnSave": true, // Tell VSCode to format files on save
"editor.defaultFormatter": "esbenp.prettier-vscode",
"typescript.format.enable": false,
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}
},
"yaml.schemas": {
"https://gitpod.io/schemas/gitpod-schema.json": "file:///workspace/desci-nodes/.gitpod.yml"
Expand All @@ -19,8 +29,15 @@
"tw\\.[^`]+`([^`]*)`", // tw.xxx<xxx>`...`
"tw\\(.*?\\).*?`([^`]*)" // tw(Component)<xxx>`...`
],
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"solidity.packageDefaultDependenciesContractsDirectory": "./desci-contracts/node_modules",
"solidity.remappingsUnix": [
"@openzeppelin/=./desci-contracts/node_modules/@openzeppelin/",
"hardhat/=./desci-contracts/node_modules/hardhat/"
],
"[solidity]": {
"editor.defaultFormatter": "JuanBlanco.solidity",
"editor.formatOnSave": true
},
"[prisma]": {
"editor.defaultFormatter": "Prisma.prisma"
},
Expand Down
1 change: 1 addition & 0 deletions desci-contracts/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ frontend/*
subgraph/subgraph.yaml
build
.openzeppelin/unknown-*.json
.openzeppelin/migration-complete.json
*.dbg.json
flat.sol
167 changes: 167 additions & 0 deletions desci-contracts/.openzeppelin/old/sepoliaDev-dpid.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
{
"manifestVersion": "3.2",
"admin": {
"address": "0x6FAD4bF532EbaA56Ecf5CFd0E59617F5Fe173aa2",
"txHash": "0x5b1e70832abbcd6f11d19f027119d0da3deb062f82deff25b63d100dd1990056"
},
"proxies": [
{
"address": "0xb9F1b29d9435Ff4772F57067C927367B337B0456",
"txHash": "0xcbf8a479adaab2755220d93e8cddcf61e7ec0d9eb6e024e4f064851a8a7ef3a8",
"kind": "transparent"
}
],
"impls": {
"7d36eb1fb5509724c9c86e5567a213c3dc9d83c3cbe4f6b633ad300b6ccc8728": {
"address": "0xC9bd4f323E037f5560Bb96f90c4Dc170bdD6E550",
"txHash": "0xd1081c86a9500a81fa498e3838ae05691b6185686e09c3de7133a83f262c704b",
"layout": {
"storage": [
{
"label": "_initialized",
"offset": 0,
"slot": "0",
"type": "t_uint8",
"contract": "Initializable",
"src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:62",
"retypedFrom": "bool"
},
{
"label": "_initializing",
"offset": 1,
"slot": "0",
"type": "t_bool",
"contract": "Initializable",
"src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:67"
},
{
"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": "organizations",
"offset": 0,
"slot": "101",
"type": "t_mapping(t_bytes32,t_struct(Organization)4485_storage)",
"contract": "DpidRegistry",
"src": "contracts/DpidRegistry.sol:36"
},
{
"label": "_fee",
"offset": 0,
"slot": "102",
"type": "t_uint256",
"contract": "DpidRegistry",
"src": "contracts/DpidRegistry.sol:39"
},
{
"label": "_orgFee",
"offset": 0,
"slot": "103",
"type": "t_uint256",
"contract": "DpidRegistry",
"src": "contracts/DpidRegistry.sol:42"
}
],
"types": {
"t_address": {
"label": "address",
"numberOfBytes": "20"
},
"t_array(t_address)dyn_storage": {
"label": "address[]",
"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_mapping(t_bytes32,t_struct(Organization)4485_storage)": {
"label": "mapping(bytes32 => struct DpidRegistry.Organization)",
"numberOfBytes": "32"
},
"t_mapping(t_uint256,t_uint256)": {
"label": "mapping(uint256 => uint256)",
"numberOfBytes": "32"
},
"t_struct(Organization)4485_storage": {
"label": "struct DpidRegistry.Organization",
"members": [
{
"label": "prefix",
"type": "t_bytes32",
"offset": 0,
"slot": "0"
},
{
"label": "registrant",
"type": "t_address",
"offset": 0,
"slot": "1"
},
{
"label": "tokenGate",
"type": "t_array(t_address)dyn_storage",
"offset": 0,
"slot": "2"
},
{
"label": "entries",
"type": "t_mapping(t_uint256,t_uint256)",
"offset": 0,
"slot": "3"
},
{
"label": "count",
"type": "t_uint256",
"offset": 0,
"slot": "4"
}
],
"numberOfBytes": "160"
},
"t_uint256": {
"label": "uint256",
"numberOfBytes": "32"
},
"t_uint8": {
"label": "uint8",
"numberOfBytes": "1"
}
}
}
}
}
}
Loading

0 comments on commit 8e519b0

Please sign in to comment.