Skip to content

Commit

Permalink
feat(networks): gitcoin hook deployed (unlock-protocol#13634)
Browse files Browse the repository at this point in the history
gitcoin hook deployed
  • Loading branch information
julien51 authored Apr 15, 2024
1 parent 182f1d6 commit 7028c01
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 12 deletions.
5 changes: 5 additions & 0 deletions packages/networks/src/networks/arbitrum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 10 additions & 2 deletions packages/networks/src/networks/base-sepolia.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NetworkConfig } from '@unlock-protocol/types'
import { HookType, NetworkConfig } from '@unlock-protocol/types'

export const baseSepolia: NetworkConfig = {
blockScan: {
Expand All @@ -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: '',
Expand Down
5 changes: 5 additions & 0 deletions packages/networks/src/networks/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 5 additions & 0 deletions packages/networks/src/networks/bsc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 5 additions & 0 deletions packages/networks/src/networks/gnosis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 5 additions & 0 deletions packages/networks/src/networks/optimism.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
32 changes: 26 additions & 6 deletions smart-contracts/scripts/hooks/GitcoinHook.js
Original file line number Diff line number Diff line change
@@ -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)

Expand All @@ -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()
Expand Down
7 changes: 3 additions & 4 deletions smart-contracts/scripts/hooks/GuildHook.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 7028c01

Please sign in to comment.