Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(version): rc-v1.0.0-beta, and update deployment instructions in Readme #75

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 89 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ For more details on Circles and details of the implementation please refer to [h

## Getting Started

🐲 **Beta Status**: This repository is in beta and actively developed in the open. While initial reviews are on-going, we welcome community engagement for wider testing and integration. As AGPL-licensed software, it's provided as-is. We encourage thorough review and testing before any production use.
🐲 **Beta Status**: This repository is in beta and actively developed in the open. Initial reviews have been completed, we welcome community engagement for wider testing and integration. As AGPL-licensed software, it's provided as-is. We encourage thorough review and testing before any production use.


### Prerequisites
Expand Down Expand Up @@ -56,16 +56,91 @@ For more details on Circles and details of the implementation please refer to [h
```bash
forge test --gas-report
```

### Deployment

To deploy to the Chiado testnet:
#### To deploy to the Chiado testnet:

1. Copy `.env.example` to `.env` and set your private key and API keys.
1. Copy `.env.example` to `.env` and set your (Chiado) private key and (Blockscout) API keys.
2. Run the deployment script:
```bash
./script/deployments/chiadoDeploy.sh
```

#### To deploy to Gnosis Chain mainnet:

1. **Checkout out the release candidate `rc-v1.0.0-beta`**
```
git checkout rc-v1.0.0-beta
```
2. Copy `.env.example` to `.env` and set your private key; in particular for deployment the script only requires a private key for a deployer address on Gnosis Chain (with minimal funding, deployment costs are far less than 1 XDAI):
```
PRIVATE_KEY_GNOSIS='YOUR_PRIVATE_KEY'
```
3. Run the mainnet deployment script:
```
cd script/deployments
./gnosisChainDeploy.sh
```
Forge SHOULD auto-configure the build parameters from the foundry.toml file,
but for clarity on a deterministic build, we require the following build parameters:
- solc compiler version: v0.8.24+commit.e11b9ed9
- optimization enabled: Yes
- Optimizer runs: 200
- EVM version: cancun
- License: GNU AGPLv3

Note that the production deployment script waits 20 seconds between each deployment,
so feel free to go stretch your legs.

4. The deploy script will create a folder locally on your machine:
```
<root>/script/deployments/gnosischain-rc-1.0.0-beta-<commit>-<day>-<time>/
```
with two important files (and extra helper files):
- `gnosischain-artefacts-<identifier>.txt` with verification data for each deployed contract
- and `gnosischain-<identifier>.log` with a better human-readable summary of the deployment

The deployment script should have deployed 9 contracts:
- Hub,
- Migration,
- NameRegistry,
- ERC20Lift,
- StandardTreasury,
- BaseGroupMintPolicy,
- MastercopyDemurrageERC20,
- MastercopyInflationaryERC20 and
- MastercopyStandardVault

### Optionally, verifying your contracts

Note, as we are looking for redundant deterministic deployments, it is likely for `rc-v1.0.0-beta` that your deployment will already be recognised by the block explorers.

However, in case that is not the case, below are instructions to help you get started

#### Gnosis Blockscout

You will need to set a `BLOCKSCOUT_API_KEY` set in the `.env` file. Go to Blockscout.com to configure your account and get an API key.

An easy way to verify the contracts on `gnosis.blockscout.com` is to run the same deployment
on Chiado testnet (see instructions above). You will need to add a private key with testnet xdai funding on Chiado to the `.env` file.
The Chiado deployment script will attempt to directly verify as it is deploying the contracts to Chiado through blockscout. This can intermittently fail, so we don't use these options for the mainnet deployment script. However, on Chiado, should this fail you can run it a second time. Once a contract is verified on Chaido it will also be recognised on Blockscout Gnosis Chain.

### Gnosisscan

WIP: there is a `verifyDeployment.sh` script which aims to verify through the gnosisscan.io API, however it has a bug where Gnosisscan does not receive the correct EVM version `cancun` and compilation on their side will fail for Hub.sol.

Manually verifying on gnosisscan.io can be done, by going to your deployed address and following the instructions there.
The required parameters are listed above in the deployment section. However to obtain a single "flattened source code file" (recommended), you can use forge as follows, eg. for Hub.sol from the project root:

```
forge flatten ./src/hub/Hub.sol -o flattened_hub.sol
```

### Sourcify

(later), might also help with gnosisscan.io if they cooperate.

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.
Expand All @@ -76,7 +151,16 @@ This project is licensed under the [AGPL-3.0 License](LICENSE).

## Disclaimer

This project is under active development. The code has not completed externally reviews and should not be used in production environments without proper review and testing.
This project is currently under active development and should be considered in beta stage. While the contracts for Circles v2 have undergone both internal and external reviews (reports available in the `/reviews` directory), users should be aware of the following:

- **Caution for Production Use**: This software is in beta stage. Use in production environments should be approached with caution and only after thorough review, testing, and appropriate risk assessment.
- **As-Is Basis**: The software is provided "as-is" without any warranties, express or implied.
- **No Liability**: The developers and contributors of this project shall not be held liable for any damages or losses arising from the use of this software.
- **License**: This project is released under the GNU Affero General Public License v3.0 (AGPL-3.0). Users must comply with the terms of this license when using, modifying, or distributing the software.
- **Security**: While efforts have been made to ensure the security of the contracts, users should conduct their own security audits before any significant use.
- **Updates**: This software may undergo significant changes. Users are advised to regularly check for updates and review the changelog.

By using this software, you acknowledge that you have read this disclaimer, understand its contents, and agree to its terms.

## Contact

Expand All @@ -85,4 +169,4 @@ For questions or support regarding this project, please contact:
- About Circles <support@aboutcircles.com>
- Ben <benjamin.bollen@gnosis.io>

We appreciate your interest and feedback!
We appreciate your interest, feedback and contributions!
2 changes: 1 addition & 1 deletion script/deployments/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "deploy-circles",
"version": "rc-0.3.7-beta",
"version": "rc-1.0.0-beta",
"type": "module",
"dependencies": {
"dotenv": "^16.4.5",
Expand Down
Loading