Skip to content

Commit

Permalink
Made aragon-mainnet work and deployed
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddavo committed May 22, 2024
1 parent 1e1ae79 commit 8bb7f9d
Show file tree
Hide file tree
Showing 12 changed files with 2,397 additions and 1,895 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ node_modules/

# Compilation output
dist/
build/

# Tests
coverage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
startBlock: {{startBlock}}
mapping:
kind: ethereum/events
apiVersion: 0.0.1
apiVersion: 0.0.5
language: wasm/assemblyscript
entities:
- RegistryFactory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
startBlock: {{startBlock}}
mapping:
kind: ethereum/events
apiVersion: 0.0.1
apiVersion: 0.0.5
language: wasm/assemblyscript
entities:
- App
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{{/startBlock}}
mapping:
kind: ethereum/events
apiVersion: 0.0.1
apiVersion: 0.0.5
language: wasm/assemblyscript
entities:
- Organization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{{/startBlock}}
mapping:
kind: ethereum/events
apiVersion: 0.0.1
apiVersion: 0.0.5
language: wasm/assemblyscript
entities:
- Registry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ templates:
abi: ACL
mapping:
kind: ethereum/events
apiVersion: 0.0.1
apiVersion: 0.0.5
language: wasm/assemblyscript
entities:
- Organization
Expand All @@ -51,7 +51,7 @@ templates:
abi: Repo
mapping:
kind: ethereum/events
apiVersion: 0.0.1
apiVersion: 0.0.5
language: wasm/assemblyscript
entities:
- Repo
Expand Down
8 changes: 4 additions & 4 deletions packages/connect-thegraph/subgraph/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "org-subgraph",
"version": "2.0.0",
"repository": "https://github.com/graphprotocol/aragon-network",
"version": "2.0.1",
"repository": "https://github.com/daviddavo/connect",
"license": "AGPL-3.0",
"private": true,
"scripts": {
Expand All @@ -22,8 +22,8 @@
"deploy-xdai": "scripts/deploy.sh 1hive xdai"
},
"devDependencies": {
"@graphprotocol/graph-cli": "^0.19.0",
"@graphprotocol/graph-ts": "^0.19.0",
"@graphprotocol/graph-cli": "^0.71.0",
"@graphprotocol/graph-ts": "^0.35.0",
"graphqlviz": "^3.1.0",
"mustache": "^4.0.1"
},
Expand Down
13 changes: 2 additions & 11 deletions packages/connect-thegraph/subgraph/scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@
USER=$1
NETWORK=$2

# Require $GRAPHKEY to be set
if [[ -z "${GRAPHKEY}" ]]; then
>&2 echo "Please set \$GRAPHKEY to your The Graph access token to run this command."
exit 1
fi

# Build manifest
echo ''
echo '> Building manifest file subgraph.yaml'
Expand All @@ -21,15 +15,12 @@ echo '> Generating types'
graph codegen

# Prepare subgraph name
FULLNAME=$USER/aragon-$NETWORK
FULLNAME=aragon-$NETWORK
if [ "$STAGING" ]; then
FULLNAME=$FULLNAME-staging
fi
echo ''
echo '> Deploying subgraph: '$FULLNAME

# Deploy subgraph
graph deploy $FULLNAME \
--ipfs https://api.thegraph.com/ipfs/ \
--node https://api.thegraph.com/deploy/ \
--access-token $GRAPHKEY
graph deploy --studio $FULLNAME
2 changes: 1 addition & 1 deletion packages/connect-thegraph/subgraph/src/mappings/acl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function handleSetPermission(event: SetPermissionEvent): void {
const acl = AclContract.bind(event.address)
const orgAddress = acl.kernel()
const orgId = orgAddress.toHex()
const org = OrganizationEntity.load(orgId)
const org = OrganizationEntity.load(orgId)!

const appAddress = event.params.app
const roleHash = event.params.role
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Address } from '@graphprotocol/graph-ts'

// Import event types from the contract ABI
import { DeployDAO as DeployDAOEvent } from '../../generated/DaoFactory/DAOFactory'
import { DeployDAO as DeployDAOEvent } from '../../generated/DAOFactory/DAOFactory'

// Import entity types from the schema
import { OrgFactory as FactoryEntity } from '../../generated/schema'
Expand Down
30 changes: 0 additions & 30 deletions packages/connect-thegraph/subgraph/src/mappings/repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,33 +69,3 @@ function loadOrCreateVersion(
return version!
}

function buildVersionId(repoId: string, semanticVersion: string): string {
return repoId.concat('-').concat(semanticVersion)
}

function loadOrCreateVersion(
repo: Address,
semanticVersion: string,
versionContractId: BigInt
): VersionEntity {
const versionId = buildVersionId(repo.toHexString(), semanticVersion)
// create new version
let version = VersionEntity.load(versionId)
if (version === null) {
version = new VersionEntity(versionId)
version.semanticVersion = semanticVersion
version.codeAddress = Bytes.fromHexString(ZERO_ADDR) as Bytes
version.contentUri = ''

const repoContract = RepoContract.bind(repo)
const callVersionResult = repoContract.try_getByVersionId(versionContractId)
if (callVersionResult.reverted) {
log.info('get repo version by id reverted', [])
} else {
const versionData = callVersionResult.value
version.codeAddress = versionData.value1
version.contentUri = versionData.value2.toString()
}
}
return version!
}
Loading

0 comments on commit 8bb7f9d

Please sign in to comment.