Skip to content

Commit

Permalink
Autid create fix (#118)
Browse files Browse the repository at this point in the history
* fixed role data type mismatch issue when creating autids

* added sample to test with ethers provider to ensure that requests same as they would be in the frontend

---------

Co-authored-by: mrtmeeseeks <[email protected]>
  • Loading branch information
mrtmeeseeks and mrtmeeseeks authored Sep 26, 2024
1 parent 3378dba commit c9d7b50
Show file tree
Hide file tree
Showing 9 changed files with 378 additions and 401 deletions.
13 changes: 13 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

echo "Running forge build..."
if ! forge build; then
echo "Forge build failed. Please fix the errors before committing."
exit 1
fi

echo "Running forge test for AutTests..."
if ! forge test; then
echo "Forge tests failed on AutTests. Please fix the errors before committing."
exit 1
fi
4 changes: 2 additions & 2 deletions contracts/membership/Membership.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ contract Membership is Initializable, PeriodUtils, AccessUtils {
EnumerableSet.AddressSet private _members;

struct MemberDetail {
uint128 role;
uint256 role;
uint8 commitment;
}
mapping(address who => mapping(uint32 periodId => MemberDetail)) public memberDetails;
Expand Down Expand Up @@ -120,7 +120,7 @@ contract Membership is Initializable, PeriodUtils, AccessUtils {
// MUTATIVE
// -----------------------------------------------------------

function join(address who, uint128 role, uint8 commitment) public virtual {
function join(address who, uint256 role, uint8 commitment) public virtual {
_revertIfNotHub();

currentRole[who] = role;
Expand Down
411 changes: 29 additions & 382 deletions deployments.txt

Large diffs are not rendered by default.

113 changes: 112 additions & 1 deletion subgraphs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion subgraphs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
},
"dependencies": {
"@graphprotocol/graph-cli": "^0.81.0",
"@graphprotocol/graph-ts": "^0.35.1"
"@graphprotocol/graph-ts": "^0.35.1",
"dotenv": "^16.4.5",
"ethers": "^6.13.2"
},
"devDependencies": {
"matchstick-as": "^0.6.0"
Expand Down
20 changes: 10 additions & 10 deletions subgraphs/subgraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ dataSources:
name: AutID
network: polygon-amoy
source:
address: "0x1CC5566beEE06bFC8ADecE5D1FC762998ed74A3E"
startBlock: 12131793
address: "0x5Eb0d591aAdffe9012d73fd3c32931E97A97Bfec"
startBlock: 12236817
abi: AutID
mapping:
kind: ethereum/events
Expand All @@ -32,9 +32,9 @@ dataSources:
name: HubRegistry
network: polygon-amoy
source:
address: "0x98F716B5836d963d986E648d43aaA43c57D8E259"
address: "0xd0510466b9575c53013216Dc48c299C3B82ACcE6"
abi: HubRegistry
startBlock: 12131793
startBlock: 12236817
mapping:
kind: ethereum/events
apiVersion: 0.0.8
Expand All @@ -53,7 +53,7 @@ dataSources:
network: polygon-amoy
source:
abi: Hub
startBlock: 12131793
startBlock: 12236817
mapping:
kind: ethereum/events
apiVersion: 0.0.8
Expand All @@ -76,8 +76,8 @@ dataSources:
network: polygon-amoy
source:
abi: HubDomainsRegistry
address: "0xFd62B048D87bD002927B7867a9B3958f5b7481B7"
startBlock: 12131793
address: "0x3A4490F8b60F131c9f352e20056649131c2FEfc7"
startBlock: 12236817
mapping:
kind: ethereum/events
apiVersion: 0.0.8
Expand All @@ -97,7 +97,7 @@ dataSources:
network: polygon-amoy
source:
abi: TaskFactory
startBlock: 12131793
startBlock: 12236817
mapping:
kind: ethereum/events
apiVersion: 0.0.8
Expand All @@ -116,8 +116,8 @@ dataSources:
network: polygon-amoy
source:
abi: TaskRegistry
address: "0xf14D863E4C3af3d62950B7d01688C4E9941Da67b"
startBlock: 12131793
address: "0xb510b6B6f7f74F15f808c0b610F5BF7466675970"
startBlock: 12236817
mapping:
kind: ethereum/events
apiVersion: 0.0.8
Expand Down
55 changes: 55 additions & 0 deletions subgraphs/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
# yarn lockfile v1


"@adraffy/[email protected]":
version "1.10.1"
resolved "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.10.1.tgz"
integrity sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw==

"@babel/code-frame@^7.0.0":
version "7.24.7"
resolved "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz"
Expand Down Expand Up @@ -301,6 +306,18 @@
"@jridgewell/resolve-uri" "^3.0.3"
"@jridgewell/sourcemap-codec" "^1.4.10"

"@noble/[email protected]":
version "1.2.0"
resolved "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz"
integrity sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==
dependencies:
"@noble/hashes" "1.3.2"

"@noble/[email protected]":
version "1.3.2"
resolved "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz"
integrity sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==

"@nodelib/[email protected]":
version "2.1.5"
resolved "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz"
Expand Down Expand Up @@ -581,6 +598,11 @@
resolved "https://registry.npmjs.org/@types/node/-/node-8.10.66.tgz"
integrity sha512-tktOkFUA4kXx2hhhrB8bIFb5TbwzS4uOhKEmwiD+NoiL0qtP2OQ9mFldbgD4dV1djrlBYP6eBuQZiWjuHUpqFw==

"@types/[email protected]":
version "18.15.13"
resolved "https://registry.npmjs.org/@types/node/-/node-18.15.13.tgz"
integrity sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==

"@types/parse-json@^4.0.0":
version "4.0.2"
resolved "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.2.tgz"
Expand Down Expand Up @@ -656,6 +678,11 @@ acorn@^8.4.1:
resolved "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz"
integrity sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==

[email protected]:
version "4.0.0-beta.5"
resolved "https://registry.npmjs.org/aes-js/-/aes-js-4.0.0-beta.5.tgz"
integrity sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==

ansi-colors@^4.1.1:
version "4.1.3"
resolved "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz"
Expand Down Expand Up @@ -1311,6 +1338,11 @@ [email protected]:
docker-modem "^1.0.8"
tar-fs "~1.16.3"

dotenv@^16.4.5:
version "16.4.5"
resolved "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz"
integrity sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==

ejs@^3.1.8:
version "3.1.9"
resolved "https://registry.npmjs.org/ejs/-/ejs-3.1.9.tgz"
Expand Down Expand Up @@ -1449,6 +1481,19 @@ ethereumjs-util@^7.1.0:
ethereum-cryptography "^0.1.3"
rlp "^2.2.4"

ethers@^6.13.2:
version "6.13.2"
resolved "https://registry.npmjs.org/ethers/-/ethers-6.13.2.tgz"
integrity sha512-9VkriTTed+/27BGuY1s0hf441kqwHJ1wtN2edksEtiRvXx+soxRX3iSXTfFqq2+YwrOqbDoTHjIhQnjJRlzKmg==
dependencies:
"@adraffy/ens-normalize" "1.10.1"
"@noble/curves" "1.2.0"
"@noble/hashes" "1.3.2"
"@types/node" "18.15.13"
aes-js "4.0.0-beta.5"
tslib "2.4.0"
ws "8.17.1"

[email protected]:
version "0.1.6"
resolved "https://registry.npmjs.org/ethjs-unit/-/ethjs-unit-0.1.6.tgz"
Expand Down Expand Up @@ -3233,6 +3278,11 @@ tslib@^2.0.0, tslib@^2.3.1, tslib@^2.4.0, tslib@^2.5.0, tslib@^2.6.1, tslib@^2.6
resolved "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz"
integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==

[email protected]:
version "2.4.0"
resolved "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz"
integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==

type-fest@^0.21.3:
version "0.21.3"
resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz"
Expand Down Expand Up @@ -3393,6 +3443,11 @@ ws@*, ws@^7.4.5:
resolved "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz"
integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==

[email protected]:
version "8.17.1"
resolved "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz"
integrity sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==

xtend@^4.0.0:
version "4.0.2"
resolved "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz"
Expand Down
Loading

0 comments on commit c9d7b50

Please sign in to comment.