Skip to content

Commit

Permalink
Production Deploy (#14772)
Browse files Browse the repository at this point in the history
* Manual deploy as of commit:39aeb3f2aa33d352b23ccf8066fb9ecf244a29bc

* fix(locksmith): polyfill for Defender signer

* fix(unlock-app): Render Markdown for event descriptions (#14773)

* render markdown for event overview

* render markdown for event detail drawer

* render markdown for event collection detail view

* fix(deps): update dependency @openzeppelin/defender-sdk to v1.14.4 (#14723)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* feature(unlock-app): Remove individual events in event detail view (#14780)

* add remove action component

* update event detail drawer

* update event detail view

* restrict action to managers alone

* restrict action to managers alone

* fix(unlock-app): Improve event addition via URL (#14774)

* update useEvent hook to return 404

* improve add via url experience

* use proper env

* feature(unlock-app): 404 if queried event collection doesn't exist (#14785)

throw 404 if collection not found

* feature(unlock-app): Sort collection events into upcoming and past (#14784)

* sort events into upcoming and past

* fix typing

---------

Co-authored-by: txbì <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Oct 1, 2024
1 parent 532f3c5 commit 6946c37
Show file tree
Hide file tree
Showing 111 changed files with 2,909 additions and 4,553 deletions.
5 changes: 3 additions & 2 deletions .github/actions/blog/rss_feed.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const fs = require('fs-extra')
const path = require('path')
const feedparser = require('feedparser-promised')
const { Readable } = require('node:stream')
const { writeFile } = require('node:fs/promises')

function escapeMarkdown(str) {
return str.replace(/(["\\])/g, '\\$1')
Expand All @@ -27,8 +29,7 @@ fs.readdirSync(blogDir).forEach((filename) => {

const downloadImage = (url, filepath) => {
return fetch(url)
.then((res) => res.buffer())
.then((buffer) => fs.writeFile(filepath, buffer))
.then((response) => writeFile(filepath, Readable.fromWeb(response.body)))
.catch((error) => console.error(`Error downloading image ${url}:`, error))
}

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/_networks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ jobs:
uses: mshick/[email protected]
with:
message-path: results.txt
message-id: networks-check
refresh-message-position: true
# We rely on a deployment of a proxy service to post comment from forked PRs
# see https://github.com/mshick/add-pr-comment-proxy for more info
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/_subgraph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Subgraphs deployment

on:
workflow_call:
secrets:
OP_SERVICE_ACCOUNT_TOKEN:
required: true

jobs:
coverage:
Expand All @@ -24,6 +27,7 @@ jobs:
with:
export-env: true
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
SUBGRAPH_STUDIO_DEPLOY_KEY: op://secrets/subgraph/studio-deploy-key
- name: Deploying the subgraphs
run: yarn workspace @unlock-protocol/subgraph deploy-all
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ jobs:
deploy-all-subgraphs:
if: ${{ github.repository_owner == 'unlock-protocol' }}
uses: ./.github/workflows/_subgraph.yml
secrets:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}

deploy-locksmith-production:
if: ${{ github.repository_owner == 'unlock-protocol' }}
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
tmp_site/
node_modules/

# ignore all contracts
contracts

# ZeppelinOS
zos.dev-*.json
.zos.session
Expand Down
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn run lint-staged
113 changes: 59 additions & 54 deletions docs/docs/getting-started/what-is-unlock/litepaper.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions governance/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.env
*.tmp
cache
contracts
Expand Down
1 change: 0 additions & 1 deletion governance/.solhintignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
node_modules
contracts/ERC20Patched.sol
contracts/test-artifacts/**
contracts/past-versions/**
contracts/mocks/**
2 changes: 1 addition & 1 deletion governance/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@nomiclabs/hardhat-ethers": "2.2.3",
"@openzeppelin/hardhat-upgrades": "3.2.1",
"@openzeppelin/upgrades-core": "1.37.0",
"@safe-global/api-kit": "2.4.4",
"@safe-global/api-kit": "2.4.6",
"@safe-global/protocol-kit": "4.1.0",
"@tenderly/hardhat-tenderly": "2.3.0",
"@unlock-protocol/contracts": "workspace:./packages/contracts",
Expand Down
120 changes: 120 additions & 0 deletions governance/proposals/udt/017-cross-chain-base-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
const { ethers } = require('hardhat')
const { getNetwork } = require('@unlock-protocol/hardhat-helpers')
const { targetChains, ConnextMod } = require('../../helpers/bridge')
const { parseSafeMulticall } = require('../../helpers/multisig')
const { parseBridgeCall } = require('../../helpers/crossChain')

const BASE_TIMELOCK = '0xB34567C4cA697b39F72e1a8478f285329A98ed1b'

const getProxyAdminAddress = async (providerURL, contractAddress) => {
const provider = new ethers.JsonRpcProvider(providerURL)

const hex = await provider.getStorage(
contractAddress,
'0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103'
)

const adminAddress = ethers.stripZerosLeft(hex)
return adminAddress
}

module.exports = async () => {
const mainnet = await getNetwork(1)
const base = await getNetwork(8453)

// mainnet owmership
const ownable = new ethers.Interface([
`function transferOwnership(address newOwner)`,
])
const mainnetCalls = [
// 1. transfer unlock mainnet to multisig
{
contractAddress: mainnet.unlockAddress,
calldata: ownable.encodeFunctionData('transferOwnership', [
mainnet.multisig,
]),
},
// 2. transfer unlock mainnet proxyAdmin to multisig
{
contractAddress: await getProxyAdminAddress(
mainnet.provider,
mainnet.unlockAddress
),
calldata: ownable.encodeFunctionData('transferOwnership', [
mainnet.multisig,
]),
},
]

// bridge calls to update safe/connext multisig plugins
const bridgeCalls = await Promise.all(
targetChains.map(async (network) => {
const {
governanceBridge: {
modules: { connextMod },
},
id: destChainId,
} = network

const connextModInterface = new ethers.Interface(ConnextMod)

// parse calls for bridge
const destCalls = [
// set origin chain as base
{
contractAddress: connextMod,
calldata: connextModInterface.encodeFunctionData('setOrigin', [
base.governanceBridge.domainId,
]),
},
{
// set origin contract as base DAO timelock
contractAddress: connextMod,
calldata: connextModInterface.encodeFunctionData('setOriginSender', [
BASE_TIMELOCK,
]),
},
]
const { to, value, data, operation } = await parseSafeMulticall({
chainId: destChainId,
calls: destCalls,
})

// encode multicall instructions to be executed by the SAFE
const abiCoder = ethers.AbiCoder.defaultAbiCoder()
const moduleData = abiCoder.encode(
['address', 'uint256', 'bytes', 'bool'],
[
to, // to
value, // value
data, // data
operation, // operation: 0 for CALL, 1 for DELEGATECALL
]
)

const bridgeCall = await parseBridgeCall({
destChainId,
moduleData,
})
return bridgeCall
})
)

const proposalName = `Transfer cross-chain governance to the Base DAO
This proposal transfers the control of the cross-chain governance to the DAO on Base.
It contains two main actions:
1. transfer ownership of Unlock contract + proxy admin on mainnet to a relay multisig (that can recevie instructions from Base)
2. set the “authority source” of all multisig on destination chains to the DAO timelock on Base
After executing this proposal, the DAO on mainnet will have transferred control of the main Unlock contracts to the DAO on Base. Going forward, any cross-chain governance proposals will need to originate from the DAO on Base.
`

return {
proposalName,
calls: [...mainnetCalls, ...bridgeCalls],
}
}
4 changes: 2 additions & 2 deletions governance/scripts/gov/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const { getQuorum, getGovTokenAddress } = require('../../helpers/gov')
const { parseXCalledEvents } = require('../../helpers/bridge')
const { simulateDestCalls } = require('../../helpers/crossChain')
const { addUDT, getEvent } = require('@unlock-protocol/hardhat-helpers')
const { UnlockDiscountTokenV2, UPSwap } = require('@unlock-protocol/contracts')
const { Unlock, UnlockDiscountTokenV2 } = require('@unlock-protocol/contracts')

// workflow
const submit = require('./submit')
Expand All @@ -13,7 +13,7 @@ const queue = require('./queue')
const execute = require('./execute')

// parse logs
const parseLogs = (logs, abi = UPSwap.abi) => {
const parseLogs = (logs, abi = Unlock.abi) => {
const interface = new ethers.Interface(abi)

// parse logs
Expand Down
4 changes: 2 additions & 2 deletions graph-service/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "graph-service",
"dependencies": {
"@cloudflare/workers-types": "4.20240821.1",
"@cloudflare/workers-types": "4.20240925.0",
"@sentry/node": "8.27.0",
"toucan-js": "4.0.0",
"wrangler": "3.67.1"
},
"devDependencies": {
"vitest": "0.34.6"
"vitest": "2.1.1"
},
"scripts": {
"dev": "yarn wrangler dev",
Expand Down
1 change: 1 addition & 0 deletions graph-service/wrangler.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name = "graph-service"
main = "src/index.ts"
compatibility_date = "2024-07-29"
tail_consumers = [{service = "graph-service-tail"}]

[vars]
SENTRY_DSN="https://[email protected]/4507855281979392"
Loading

0 comments on commit 6946c37

Please sign in to comment.