Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,7 @@ tx-builder-*.json
**/horizon-localNetwork/
**/subgraph-service-localNetwork/
!**/ignition/**/artifacts/

# Tenderly
.tenderly-artifacts/

1 change: 1 addition & 0 deletions packages/horizon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"@openzeppelin/contracts": "^5.0.2",
"@openzeppelin/contracts-upgradeable": "^5.0.2",
"@openzeppelin/foundry-upgrades": "0.4.0",
"@tenderly/hardhat-tenderly": "^1.11.0",
"@typechain/ethers-v6": "^0.5.0",
"@typechain/hardhat": "^9.0.0",
"@types/chai": "^4.2.0",
Expand Down
35 changes: 35 additions & 0 deletions packages/horizon/tasks/tenderly.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { task } from 'hardhat/config'

Check failure on line 1 in packages/horizon/tasks/tenderly.ts

View workflow job for this annotation

GitHub Actions / Lint Files

Run autofix to sort these imports!
import { HardhatRuntimeEnvironment } from 'hardhat/types'
import { runTenderlyUpload } from '@graphprotocol/toolshed/hardhat'
import addresses from '../addresses.json'
import path from 'path'

task('tenderly:upload', 'Upload and verify contracts on Tenderly')
.addFlag('noVerify', 'Skip contract verification')
.addFlag('skipAdd', 'Skip adding contracts (only verify)')
.setAction(async (taskArgs: { noVerify: boolean; skipAdd: boolean }, hre: HardhatRuntimeEnvironment) => {
// Dynamically import tenderly plugin only when this task runs
// This avoids triggering provider initialization for other hardhat commands
// eslint-disable-next-line @typescript-eslint/no-require-imports
const { Tenderly } = require('@tenderly/hardhat-integration')
// eslint-disable-next-line @typescript-eslint/no-require-imports
const { lazyObject } = require('hardhat/plugins')
// eslint-disable-next-line @typescript-eslint/no-require-imports
const { configExists, getAccessToken } = require('@tenderly/api-client/utils/config')

// Manually attach tenderly to hre since extendEnvironment already ran
if (!(hre as any).tenderly) {
;(hre as any).tenderly = lazyObject(() => new Tenderly(hre))
}

if (!configExists()) {
throw new Error(
'Tenderly config not found. Run `tenderly login` to authenticate, or create ~/.tenderly/config.yaml manually.',
)
}

const accessToken = getAccessToken()
const packageDir = path.join(__dirname, '..')

await runTenderlyUpload(hre, packageDir, addresses, accessToken, taskArgs)
})
24 changes: 24 additions & 0 deletions packages/horizon/tenderly.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"username": "graphprotocol",
"networks": {
"421614": {
"project": "horizon-arbitrum-sepolia"
},
"42161": {
"project": "horizon-arbitrum-one"
}
},
"externalArtifacts": {
"source": "../contracts/artifacts",
"buildInfo": "../contracts/artifacts/build-info"
},
"verifyList": [
"HorizonStaking",
"GraphPayments",
"PaymentsEscrow",
"GraphTallyCollector",
"L2Curation",
"RewardsManager"
],
"tag": "Horizon"
}
1 change: 1 addition & 0 deletions packages/subgraph-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"@openzeppelin/contracts": "^5.0.2",
"@openzeppelin/contracts-upgradeable": "^5.0.2",
"@openzeppelin/foundry-upgrades": "0.4.0",
"@tenderly/hardhat-tenderly": "^1.11.0",
"@typechain/ethers-v6": "^0.5.0",
"@typechain/hardhat": "^9.0.0",
"@types/chai": "^4.2.0",
Expand Down
35 changes: 35 additions & 0 deletions packages/subgraph-service/tasks/tenderly.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { task } from 'hardhat/config'

Check failure on line 1 in packages/subgraph-service/tasks/tenderly.ts

View workflow job for this annotation

GitHub Actions / Lint Files

Run autofix to sort these imports!
import { HardhatRuntimeEnvironment } from 'hardhat/types'
import { runTenderlyUpload } from '@graphprotocol/toolshed/hardhat'
import addresses from '../addresses.json'
import path from 'path'

task('tenderly:upload', 'Upload and verify contracts on Tenderly')
.addFlag('noVerify', 'Skip contract verification')
.addFlag('skipAdd', 'Skip adding contracts (only verify)')
.setAction(async (taskArgs: { noVerify: boolean; skipAdd: boolean }, hre: HardhatRuntimeEnvironment) => {
// Dynamically import tenderly plugin only when this task runs
// This avoids triggering provider initialization for other hardhat commands
// eslint-disable-next-line @typescript-eslint/no-require-imports
const { Tenderly } = require('@tenderly/hardhat-integration')
// eslint-disable-next-line @typescript-eslint/no-require-imports
const { lazyObject } = require('hardhat/plugins')
// eslint-disable-next-line @typescript-eslint/no-require-imports
const { configExists, getAccessToken } = require('@tenderly/api-client/utils/config')

// Manually attach tenderly to hre since extendEnvironment already ran
if (!(hre as any).tenderly) {
;(hre as any).tenderly = lazyObject(() => new Tenderly(hre))
}

if (!configExists()) {
throw new Error(
'Tenderly config not found. Run `tenderly login` to authenticate, or create ~/.tenderly/config.yaml manually.',
)
}

const accessToken = getAccessToken()
const packageDir = path.join(__dirname, '..')

await runTenderlyUpload(hre, packageDir, addresses, accessToken, taskArgs)
})
21 changes: 21 additions & 0 deletions packages/subgraph-service/tenderly.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"username": "graphprotocol",
"networks": {
"421614": {
"project": "horizon-arbitrum-sepolia"
},
"42161": {
"project": "horizon-arbitrum-one"
}
},
"verifyList": [
"SubgraphService",
"DisputeManager"
],
"excludeList": [
"L2Curation",
"L2GNS",
"SubgraphNFT"
],
"tag": "Subgraph Service"
}
13 changes: 13 additions & 0 deletions packages/toolshed/src/hardhat/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
export { isProjectBuilt, loadTasks } from './config'

Check failure on line 1 in packages/toolshed/src/hardhat/index.ts

View workflow job for this annotation

GitHub Actions / Lint Files

Run autofix to sort these exports!
export { setERC20Balance, setGRTBalance } from './erc20'
export { getEventData } from './event'
export { hardhatBaseConfig } from './hardhat.base.config'
export { loadConfig, patchConfig, saveToAddressBook } from './ignition'
export { requireLocalNetwork } from './local'
export {
loadTenderlyConfig,
copyExternalArtifacts,
classifyContracts,
addContractToTenderly,
tagContractsOnTenderly,
verifyLocalContract,
verifyExternalContract,
runTenderlyUpload,
type TenderlyConfig,
type ContractInfo,
type BuildInfo,
} from './tenderly'
Loading
Loading