Skip to content

Commit

Permalink
Production Deploy (#13636)
Browse files Browse the repository at this point in the history
Manual deploy as of commit:7028c0149d7621a0f9455029f25615cf563e361d
  • Loading branch information
julien51 authored Apr 16, 2024
1 parent 14d86bb commit 4c1b831
Show file tree
Hide file tree
Showing 159 changed files with 6,253 additions and 2,927 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Please read more about contributing in our [contributor guide](https://github.co
Unlock uses a monorepo which includes all the services and applications we develop.

```
# get the code
git clone https://github.com/unlock-protocol/unlock
cd unlock
Expand Down
12 changes: 6 additions & 6 deletions docker/development/eth-node/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1094,11 +1094,11 @@ __metadata:
linkType: hard

"@types/node@npm:*":
version: 20.12.2
resolution: "@types/node@npm:20.12.2"
version: 20.12.4
resolution: "@types/node@npm:20.12.4"
dependencies:
undici-types: "npm:~5.26.4"
checksum: 10/f1f0ebfe475aefa183763b856e0023b81b76554196e8676a45b9fcfd1012cdd20d32adefb3c0330001c0011e074676603c34c24821a4924228250ea13a75da43
checksum: 10/eab4ed07774b96ea77fc23eb27508dbfe094b52c8326764f5044c609c036a1570fd8708ba770e13db7ad7b69d8a834bf3a4e59fc2f1ade31d6501db76cf5a39b
languageName: node
linkType: hard

Expand Down Expand Up @@ -4188,11 +4188,11 @@ __metadata:
linkType: hard

"undici@npm:^5.14.0":
version: 5.28.3
resolution: "undici@npm:5.28.3"
version: 5.28.4
resolution: "undici@npm:5.28.4"
dependencies:
"@fastify/busboy": "npm:^2.0.0"
checksum: 10/779856ce14ba6907c0759df8e4babd61608b1f502569d44de7dd1d014afb7c67a0a2997b4f706e0daff8a55d87ee2f25b830b195fc0202cb6fbd25abe2d941eb
checksum: 10/a666a9f5ac4270c659fafc33d78b6b5039a0adbae3e28f934774c85dcc66ea91da907896f12b414bd6f578508b44d5dc206fa636afa0e49a4e1c9e99831ff065
languageName: node
linkType: hard

Expand Down
7 changes: 4 additions & 3 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
"private": true,
"dependencies": {
"@babel/helper-get-function-arity": "7.16.7",
"@docusaurus/core": "3.1.1",
"@docusaurus/plugin-client-redirects": "3.1.1",
"@docusaurus/plugin-content-docs": "3.1.1",
"@cookbookdev/docsbot": "4.5.0",
"@docusaurus/core": "3.2.1",
"@docusaurus/plugin-client-redirects": "3.2.1",
"@docusaurus/plugin-content-docs": "3.2.1",
"@flockler/react-flockler-embed": "1.0.4",
"@mdx-js/react": "3.0.1",
"@unlock-protocol/networks": "workspace:./packages/networks",
Expand Down
3 changes: 3 additions & 0 deletions docs/src/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['@unlock-protocol/eslint-config'],
}
24 changes: 24 additions & 0 deletions docs/src/theme/SearchBar/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from 'react'
import SearchBar from '@theme-original/SearchBar'
import BrowserOnly from '@docusaurus/BrowserOnly'

export default function SearchBarWrapper(props) {
return (
<>
<SearchBar {...props} />
<BrowserOnly fallback={null}>
{() => {
const AskCookbook = require('@cookbookdev/docsbot/react-fixed')
return (
<AskCookbook
apiKey="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI2NWQ5OTljM2Q0NWUzNzIxM2UxZDgzMGMiLCJpYXQiOjE3MDg3NTk0OTEsImV4cCI6MjAyNDMzNTQ5MX0.2DgWnOpRQgPWfQeIOH5XRP3v1v_XDU5RSy6pqUUwwVg"
noFastMode
/>
)
}}
</BrowserOnly>
</>
)
}

// Ask Cookbook API key obtainable at https://cms.cookbook.dev with an invite from an admin of the project.
46 changes: 46 additions & 0 deletions governance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,3 +234,49 @@ Edit directly the amounts and prices in the script
```
yarn run scripts/uniswap/addLiquidity.js
```

## Cross-Chain DAO Proposals

To maintain the integrity of the protocol accross various chains, we use a pattern of DAO proposals that allows execution on multiple chains. Messaging is sent accross the [Connext bridge](https://connext.network) to all supported chains.

### Prepare a cross-chain proposal

#### Write a cross-chain DAO proposal

Read the explanations and follow the template in [`./proposals/006-cross-bridge-proposal.js`](./proposals/006-cross-bridge-proposal.js) to submit a cross-chain proposal to the DAO.

#### Test a cross-chain DAO proposal

To make sure all calls can be executed properly, you can use Tenderly forks to test execution of calls on each destination chains.

### After proposal execution

#### Pay bridge fees

Each transaction contained in the proposal is sent separately to the bridge. For each tx, the bridge fee needs to be paid on origin chain (mainnet) for the txs to proceed. To pay all fees for the bridge, use the following script:

```
# update the txId accordingly
yarn hardhat run scripts/bridge/payFee.js --network mainnet
```

#### Check status of the calls

You can check the status of all calls on various chains manually with the [Connext explorer](https://connextscan.io/) or directly parse calls from the execution tx using the following script:

```
# update the txId accordingly
yarn hardhat run scripts/bridge/status.js --network mainnet
```

NB: This will create a temporary JSON file named `xcalled.json.tmp` with the info and statuses of all tx.

### Execute all tx on destination chains

Once all calls have crossed the bridges they stay in cooldown in multisigs. Once cooldown ends, they can be executed. To execute the calls, use the following command _for each network_:

```
yarn hardhat run scripts/bridge/execTx.js --network optimism
```

NB: The tmp file with all txs statuses is required, so you need to first run the "Check status" step above
1 change: 1 addition & 0 deletions governance/hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ require('./tasks/deploy')
require('./tasks/set')
require('./tasks/unlock')
require('./tasks/lock')
require('./tasks/uniswap')

/**
* @type import('hardhat/config').HardhatUserConfig
Expand Down
51 changes: 51 additions & 0 deletions governance/helpers/bridge/abis/IConnext.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
module.exports = [
{
inputs: [
{
internalType: 'uint32',
name: '_destination',
type: 'uint32',
},
{
internalType: 'address',
name: '_to',
type: 'address',
},
{
internalType: 'address',
name: '_asset',
type: 'address',
},
{
internalType: 'address',
name: '_delegate',
type: 'address',
},
{
internalType: 'uint256',
name: '_amount',
type: 'uint256',
},
{
internalType: 'uint256',
name: '_slippage',
type: 'uint256',
},
{
internalType: 'bytes',
name: '_callData',
type: 'bytes',
},
],
name: 'xcall',
outputs: [
{
internalType: 'bytes32',
name: '',
type: 'bytes32',
},
],
stateMutability: 'payable',
type: 'function',
},
]
124 changes: 124 additions & 0 deletions governance/helpers/bridge/abis/IXCalled.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
module.exports = [
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: 'bytes32',
name: 'transferId',
type: 'bytes32',
},
{
indexed: true,
internalType: 'uint256',
name: 'nonce',
type: 'uint256',
},
{
indexed: true,
internalType: 'bytes32',
name: 'messageHash',
type: 'bytes32',
},
{
components: [
{
internalType: 'uint32',
name: 'originDomain',
type: 'uint32',
},
{
internalType: 'uint32',
name: 'destinationDomain',
type: 'uint32',
},
{
internalType: 'uint32',
name: 'canonicalDomain',
type: 'uint32',
},
{
internalType: 'address',
name: 'to',
type: 'address',
},
{
internalType: 'address',
name: 'delegate',
type: 'address',
},
{
internalType: 'bool',
name: 'receiveLocal',
type: 'bool',
},
{
internalType: 'bytes',
name: 'callData',
type: 'bytes',
},
{
internalType: 'uint256',
name: 'slippage',
type: 'uint256',
},
{
internalType: 'address',
name: 'originSender',
type: 'address',
},
{
internalType: 'uint256',
name: 'bridgedAmt',
type: 'uint256',
},
{
internalType: 'uint256',
name: 'normalizedIn',
type: 'uint256',
},
{
internalType: 'uint256',
name: 'nonce',
type: 'uint256',
},
{
internalType: 'bytes32',
name: 'canonicalId',
type: 'bytes32',
},
],
indexed: false,
internalType: 'struct TransferInfo',
name: 'params',
type: 'tuple',
},
{
indexed: false,
internalType: 'address',
name: 'asset',
type: 'address',
},
{
indexed: false,
internalType: 'uint256',
name: 'amount',
type: 'uint256',
},
{
indexed: false,
internalType: 'address',
name: 'local',
type: 'address',
},
{
indexed: false,
internalType: 'bytes',
name: 'messageBody',
type: 'bytes',
},
],
name: 'XCalled',
type: 'event',
},
]
Loading

0 comments on commit 4c1b831

Please sign in to comment.