Skip to content

Commit a6bd1bd

Browse files
authored
improve(README): Add details about upgradeability (#909)
Generally clean up docs and add section on how upgradeability works
1 parent 555475c commit a6bd1bd

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

README.md

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,25 @@ liquidity held in a central `HubPool` on Ethereum, which also serves as the cros
55
system. `SpokePool` contracts are deployed to any network that wants to originate token deposits or be the final
66
destination for token transfers, and they are all governed by the `HubPool` on Ethereum.
77

8-
This contract set is the second iteration of the [Across smart contracts](https://github.com/across-protocol/across-smart-contracts)
9-
which facilitate token transfers from any L2 to L1.
8+
These contracts have been continuously audited by OpenZeppelin and the audit reports can be found [here](https://docs.across.to/resources/audits).
109

11-
These contracts were [audited by OpenZeppelin](https://blog.openzeppelin.com/uma-across-v2-audit/) which is a great resource for understanding the contracts.
10+
## Understanding Upgradeability
1211

13-
[This video](https://www.youtube.com/watch?v=iuxf6Crv8MI) is also useful for understanding the technical architecture.
12+
The SpokePool contracts are [UUPSUpgradeable](https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/cbb66aca87521f818d9c1769c69d5dcc1004977a/contracts/proxy/utils/UUPSUpgradeable.sol) Proxy contracts which means that their addresses will always be the same but their implementation code can change.
13+
14+
All SpokePools can be upgraded if the "admin" of the contract calls `upgradeTo`. The SpokePool's admin is set by implementing the [`_requireAdminSender()` virtual function](https://github.com/across-protocol/contracts/blob/555475cdee6109afc85065ca415c740d7f97b992/contracts/SpokePool.sol#L1745) in the child contract. For example here are the [Arbitrum](https://github.com/across-protocol/contracts/blob/555475cdee6109afc85065ca415c740d7f97b992/contracts/Arbitrum_SpokePool.sol#L114) and [Optimism](https://github.com/across-protocol/contracts/blob/555475cdee6109afc85065ca415c740d7f97b992/contracts/Ovm_SpokePool.sol#L208) implementations of the admin check.
15+
16+
All SpokePools are implemented such that the admin is the HubPool, and therefore we describe the SpokePools as having "cross-chain ownership". The owner of the HubPool can call [this function](https://github.com/across-protocol/contracts/blob/555475cdee6109afc85065ca415c740d7f97b992/contracts/HubPool.sol#L249) to send a cross-chain execution of `upgradeTo` on any SpokePool in order to upgrade it.
17+
18+
This [script](https://github.com/across-protocol/contracts/blob/555475cdee6109afc85065ca415c740d7f97b992/tasks/upgradeSpokePool.ts) is useful for creating the calldata to execute a cross-chain upgrade via the HubPool.
1419

1520
## Deployed Contract Versions
1621

17-
The latest contract deployments on Production will always be under the `deployed` tag.
22+
The latest contract deployments can be found in `/deployments/deployments.json`.
1823

1924
## Requirements
2025

21-
This repository assumes you have [Node](https://nodejs.org/en/download/package-manager) installed, with a minimum version of 16.18.0. Depending on what you want to do with the repo you might also need [foundry](https://book.getfoundry.sh/getting-started/installation) and [anchor](https://www.anchor-lang.com/docs/installation) to also be installed. If you have build issues please insure these are both installed first.
26+
This repository assumes you have [Node](https://nodejs.org/en/download/package-manager) installed, with a minimum version of 16.18.0. Depending on what you want to do with the repo you might also need [foundry](https://book.getfoundry.sh/getting-started/installation) and [anchor](https://www.anchor-lang.com/docs/installation) to also be installed. If you have build issues please ensure these are both installed first.
2227

2328
Note if you get build issues on the initial `yarn` command try downgrading to node 20.17 (`nvm use 20.17`). If you've never used anchor before you might need to run `avm use latest` as well.
2429

@@ -56,15 +61,15 @@ NODE_URL_1=https://mainnet.infura.com/xxx yarn hardhat deploy --tags HubPool --n
5661
ETHERSCAN_API_KEY=XXX yarn hardhat etherscan-verify --network mainnet --license AGPL-3.0 --force-license --solc-input
5762
```
5863

59-
## Tasks
64+
## Miscellaneous topics
6065

61-
##### Finalize Scroll Claims from L2 -> L1 (Mainnet | Sepolia)
66+
### Manually Finalizing Scroll Claims from L2 -> L1 (Mainnet | Sepolia)
6267

6368
```shell
6469
yarn hardhat finalize-scroll-claims --l2-address {operatorAddress}
6570
```
6671

67-
## Slither
72+
### Slither
6873

6974
[Slither](https://github.com/crytic/slither) is a Solidity static analysis framework written in Python 3. It runs a
7075
suite of vulnerability detectors, prints visual information about contract details, and provides an API to easily write
@@ -83,11 +88,13 @@ slither contracts/SpokePool.sol
8388

8489
You can replace `SpokePool.sol` with the specific contract you want to analyze.
8590

86-
## ZK Sync Adapter
91+
### ZK Sync Adapter
92+
93+
ZK EVM's typically require a special compiler to convert Solidity into code that can be run on the ZK VM.
8794

88-
These are special instructions for compiling and deploying contracts on `zksync`. The compile command will create `artifacts-zk` and `cache-zk` directories.
95+
There are special instructions for compiling and deploying contracts on `zksync`. The compile command will create `artifacts-zk` and `cache-zk` directories.
8996

90-
### Compile
97+
#### Compile
9198

9299
This step requires [Docker Desktop](https://www.docker.com/products/docker-desktop/) to be running, as the `solc` docker image is fetched as a prerequisite.
93100

0 commit comments

Comments
 (0)