Skip to content

Commit 7596581

Browse files
committed
fix: add GNS and Staking to callhook allowlist
1 parent fa60dbf commit 7596581

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

packages/contracts/cli/commands/protocol/configure-bridge.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export const configureL1Bridge = async (cli: CLIEnvironment, cliArgs: CLIArgs):
4949
const l2GNSCounterpart = l2AddressBook.getEntry('L2GNS')
5050
logger.info('L2 GNS address: ' + l2GNSCounterpart.address)
5151
await sendTransaction(cli.wallet, gns, 'setCounterpartGNSAddress', [l2GNSCounterpart.address])
52+
await sendTransaction(cli.wallet, gateway, 'addToCallhookAllowlist', [gns.address])
5253

5354
// Staking
5455
const staking = cli.contracts.L1Staking
@@ -57,6 +58,7 @@ export const configureL1Bridge = async (cli: CLIEnvironment, cliArgs: CLIArgs):
5758
await sendTransaction(cli.wallet, staking, 'setCounterpartStakingAddress', [
5859
l2StakingCounterpart.address,
5960
])
61+
await sendTransaction(cli.wallet, gateway, 'addToCallhookAllowlist', [staking.address])
6062
}
6163

6264
export const configureL2Bridge = async (cli: CLIEnvironment, cliArgs: CLIArgs): Promise<void> => {

packages/contracts/e2e/deployment/config/l1/l1GNS.test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { isGraphL2ChainId } from '@graphprotocol/sdk'
55

66
describe('[L1] GNS', () => {
77
const graph = hre.graph()
8-
const { L1GNS } = graph.contracts
8+
const { L1GNS, L1GraphTokenGateway } = graph.contracts
99

1010
let unauthorized: SignerWithAddress
1111

@@ -19,5 +19,10 @@ describe('[L1] GNS', () => {
1919
const l2GNS = await L1GNS.counterpartGNSAddress()
2020
expect(l2GNS).eq(graph.l2.contracts.L2GNS.address)
2121
})
22+
23+
it('should be added to callhookAllowlist', async () => {
24+
const isAllowed = await L1GraphTokenGateway.callhookAllowlist(L1GNS.address)
25+
expect(isAllowed).true
26+
})
2227
})
2328
})

packages/contracts/e2e/deployment/config/l1/l1Staking.test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { isGraphL2ChainId } from '@graphprotocol/sdk'
55

66
describe('[L1] Staking', () => {
77
const graph = hre.graph()
8-
const { L1Staking } = graph.contracts
8+
const { L1Staking, L1GraphTokenGateway } = graph.contracts
99

1010
let unauthorized: SignerWithAddress
1111

@@ -21,5 +21,10 @@ describe('[L1] Staking', () => {
2121
const l2Staking = hre.ethers.utils.defaultAbiCoder.decode(['address'], l2StakingData)[0]
2222
expect(l2Staking).eq(graph.l2.contracts.L2Staking.address)
2323
})
24+
25+
it('should be added to callhookAllowlist', async () => {
26+
const isAllowed = await L1GraphTokenGateway.callhookAllowlist(L1Staking.address)
27+
expect(isAllowed).true
28+
})
2429
})
2530
})

0 commit comments

Comments
 (0)