Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Horizon): added missing parameter for TAPCollector deployment #1061

Closed
wants to merge 2 commits into from
Closed
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
2 changes: 1 addition & 1 deletion packages/horizon/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ We use Hardhat Ignition to deploy the contracts. To build and deploy the contrac
yarn install
yarn build
npx hardhat ignition deploy ./ignition/modules/horizon.ts \
--parameters ./ignition/configs/graph.hardhat.json \
--parameters ./ignition/configs/horizon.hardhat.json \
--network hardhat
```

Expand Down
3 changes: 2 additions & 1 deletion packages/horizon/ignition/configs/horizon.hardhat.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
},
"TAPCollector": {
"eip712Name": "TAPCollector",
"eip712Version": "1"
"eip712Version": "1",
"revokeSignerThawingPeriod": 10000
}
}
3 changes: 2 additions & 1 deletion packages/horizon/ignition/modules/core/TAPCollector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ export default buildModule('TAPCollector', (m) => {

const name = m.getParameter('eip712Name')
const version = m.getParameter('eip712Version')
const revokeSignerThawingPeriod = m.getParameter('revokeSignerThawingPeriod')

const TAPCollector = m.contract('TAPCollector', TAPCollectorArtifact, [name, version, Controller], { after: [PeripheryRegistered, HorizonRegistered] })
const TAPCollector = m.contract('TAPCollector', TAPCollectorArtifact, [name, version, Controller, revokeSignerThawingPeriod], { after: [PeripheryRegistered, HorizonRegistered] })

return { TAPCollector }
})
2 changes: 1 addition & 1 deletion packages/horizon/scripts/deploy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ignition } from 'hardhat'

import Parameters from '../ignition/graph.hardhat.json'
import Parameters from '../ignition/configs/horizon.hardhat.json'
import PeripheryModule from '../ignition/modules/periphery'

async function main() {
Expand Down
1 change: 1 addition & 0 deletions packages/subgraph-service/contracts/SubgraphService.sol
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ contract SubgraphService is
* on the DisputeManager. We use the {ProvisionManager} overrideable getters to get the ranges.
* @param minimumProvisionTokens The minimum amount of provisioned tokens required to create an allocation
* @param maximumDelegationRatio The maximum delegation ratio allowed for an allocation
* @param stakeToFeesRatio The ratio of stake to fees to lock when collecting query fees
*/
function initialize(
uint256 minimumProvisionTokens,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
},
"SubgraphService": {
"minimumProvisionTokens": "100000000000000000000000n",
"maximumDelegationRatio": 16
"maximumDelegationRatio": 16,
"stakeToFeesRatio": 2
}
}
2 changes: 2 additions & 0 deletions packages/subgraph-service/ignition/modules/SubgraphService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default buildModule('SubgraphService', (m) => {
// Parameters - config file
const minimumProvisionTokens = m.getParameter('minimumProvisionTokens')
const maximumDelegationRatio = m.getParameter('maximumDelegationRatio')
const stakeToFeesRatio = m.getParameter('stakeToFeesRatio', 2)

// Deploy implementation
const SubgraphServiceImplementation = m.contract('SubgraphService', [controllerAddress, disputeManagerAddress, tapCollectorAddress, curationAddress])
Expand All @@ -25,6 +26,7 @@ export default buildModule('SubgraphService', (m) => {
const encodedCall = m.encodeFunctionCall(SubgraphServiceImplementation, 'initialize', [
minimumProvisionTokens,
maximumDelegationRatio,
stakeToFeesRatio,
])
m.call(SubgraphServiceProxyAdmin, 'upgradeAndCall', [subgraphServiceProxyAddress, SubgraphServiceImplementation, encodedCall])

Expand Down
Loading