diff --git a/packages/networks/src/networks/arbitrum.ts b/packages/networks/src/networks/arbitrum.ts index a7debfd0a8f..05f21982ea8 100644 --- a/packages/networks/src/networks/arbitrum.ts +++ b/packages/networks/src/networks/arbitrum.ts @@ -53,6 +53,11 @@ export const arbitrum: NetworkConfig = { id: HookType.PASSWORD_CAPPED, name: 'Passwords with caps. Multiple passwords can be used per contract', }, + { + address: '0x8e1158A7f9d0905602f90191AC4DFb30DD4Ee04C', + id: HookType.GITCOIN, + name: 'Gitcoin', + }, ], }, id: 42161, diff --git a/packages/networks/src/networks/base-sepolia.ts b/packages/networks/src/networks/base-sepolia.ts index 71d16a602e8..7c59d595fee 100644 --- a/packages/networks/src/networks/base-sepolia.ts +++ b/packages/networks/src/networks/base-sepolia.ts @@ -1,4 +1,4 @@ -import { NetworkConfig } from '@unlock-protocol/types' +import { HookType, NetworkConfig } from '@unlock-protocol/types' export const baseSepolia: NetworkConfig = { blockScan: { @@ -19,7 +19,15 @@ export const baseSepolia: NetworkConfig = { }, featured: false, fullySubsidizedGas: true, - hooks: {}, + hooks: { + onKeyPurchaseHook: [ + { + address: '0x8c5D54B2CAA4C2D08B0DDF82a1e6D2641779B8EC', + id: HookType.GITCOIN, + name: 'Gitcoin', + }, + ], + }, id: 84532, isTestNetwork: true, keyManagerAddress: '', diff --git a/packages/networks/src/networks/base.ts b/packages/networks/src/networks/base.ts index 94b6ac0b5e2..f722b03efa8 100644 --- a/packages/networks/src/networks/base.ts +++ b/packages/networks/src/networks/base.ts @@ -46,6 +46,11 @@ export const base: NetworkConfig = { id: HookType.PASSWORD_CAPPED, name: 'Passwords with caps. Multiple passwords can be used per contract', }, + { + address: '0xbBBdD46ef548712c203d306F6587336EC15E0d7f', + id: HookType.GITCOIN, + name: 'Gitcoin', + }, ], }, id: 8453, diff --git a/packages/networks/src/networks/bsc.ts b/packages/networks/src/networks/bsc.ts index e24abc06ddf..2282e6b56dd 100644 --- a/packages/networks/src/networks/bsc.ts +++ b/packages/networks/src/networks/bsc.ts @@ -53,6 +53,11 @@ export const bsc: NetworkConfig = { id: HookType.PASSWORD_CAPPED, name: 'Passwords with caps. Multiple passwords can be used per contract', }, + { + address: '0x5B6C5a766edBc6c7988108A689C96AfCEa95a2f1', + id: HookType.GITCOIN, + name: 'Gitcoin', + }, ], }, id: 56, diff --git a/packages/networks/src/networks/gnosis.ts b/packages/networks/src/networks/gnosis.ts index a3907cde3ad..8f859472bbc 100644 --- a/packages/networks/src/networks/gnosis.ts +++ b/packages/networks/src/networks/gnosis.ts @@ -55,6 +55,11 @@ export const gnosis: NetworkConfig = { id: HookType.PASSWORD_CAPPED, name: 'Passwords with caps. Multiple passwords can be used per contract', }, + { + address: '0xd6129cAC45a16187F4D09Dd69C512F68F0f2B371', + id: HookType.GITCOIN, + name: 'Gitcoin', + }, ], }, id: 100, diff --git a/packages/networks/src/networks/optimism.ts b/packages/networks/src/networks/optimism.ts index 31a505f1e92..30d8155d1fc 100644 --- a/packages/networks/src/networks/optimism.ts +++ b/packages/networks/src/networks/optimism.ts @@ -59,6 +59,11 @@ export const optimism: NetworkConfig = { id: HookType.PASSWORD_CAPPED, name: 'Passwords with caps. Multiple passwords can be used per contract', }, + { + address: '0x6a0971717ABFfCfE08f67b53DeAC5D234A6676Ed', + id: HookType.GITCOIN, + name: 'Gitcoin', + }, ], }, id: 10, diff --git a/smart-contracts/scripts/hooks/GitcoinHook.js b/smart-contracts/scripts/hooks/GitcoinHook.js index bb6371ce73d..cb710d40dc4 100644 --- a/smart-contracts/scripts/hooks/GitcoinHook.js +++ b/smart-contracts/scripts/hooks/GitcoinHook.js @@ -1,7 +1,11 @@ -const { ethers } = require('hardhat') +const { networks } = require('@unlock-protocol/networks') +const { ethers, run } = require('hardhat') async function main() { const [user] = await ethers.getSigners() + const { chainId } = await user.provider.getNetwork() + + const unlockNetwork = networks[chainId] console.log('Deploying from :', user.address) @@ -11,11 +15,27 @@ async function main() { await hook.deployed() - console.log( - 'Gitcoin hook deployed to:', - hook.address, - '. You can add signers now and transfer ownership of this hook to the multisig!' - ) + const signers = [ + '0x22c095c69c38b66afAad4eFd4280D94Ec9D12f4C', // prod purchaser + '0x903073735Bb6FDB802bd3CDD3b3a2b00C36Bc2A9', // staging purchaser + '0xd851fe9ba8EfA66e65d7865690bD2B9522C6E99f', // OpenZeppelin purchaser + ] + + console.log('Gitcoin hook deployed to:', hook.address) + for (let i = 0; i < signers.length; i++) { + console.log('Adding signer:', signers[i]) + await hook.addSigner(signers[i]) + } + if (unlockNetwork?.multisig) { + console.log( + 'Transfering ownership to multisig signer:', + unlockNetwork.multisig + ) + await hook.transferOwnership(unlockNetwork.multisig) + } + await run('verify:verify', { + address: hook.address, + }) } main() diff --git a/smart-contracts/scripts/hooks/GuildHook.js b/smart-contracts/scripts/hooks/GuildHook.js index 34c0357373a..0f217e19e68 100644 --- a/smart-contracts/scripts/hooks/GuildHook.js +++ b/smart-contracts/scripts/hooks/GuildHook.js @@ -13,11 +13,10 @@ async function main() { console.log('Deploying from', user.address) - // We get the contract to deploy const signers = [ - '0x22c095c69c38b66afAad4eFd4280D94Ec9D12f4C', - '0x903073735Bb6FDB802bd3CDD3b3a2b00C36Bc2A9', - '0xd851fe9ba8EfA66e65d7865690bD2B9522C6E99f', + '0x22c095c69c38b66afAad4eFd4280D94Ec9D12f4C', // prod purchaser + '0x903073735Bb6FDB802bd3CDD3b3a2b00C36Bc2A9', // staging purchaser + '0xd851fe9ba8EfA66e65d7865690bD2B9522C6E99f', // OpenZeppelin purchaser ] const PurchaseHook = await ethers.getContractFactory('GuildHook')