Skip to content

Commit

Permalink
Remove baklava references (#239)
Browse files Browse the repository at this point in the history
* chore: removed all baklava references

* docs: smol README fixes

* chore: update comment for mockCLaggregator

* chore: removed baklava broadcast files

* chore: ignore .trunk from prettier

---------

Co-authored-by: baroooo <[email protected]>
  • Loading branch information
chapati23 and baroooo authored Nov 6, 2024
1 parent ea17e46 commit 0493a31
Show file tree
Hide file tree
Showing 69 changed files with 102 additions and 4,624 deletions.
8 changes: 0 additions & 8 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
CELOSCAN_API_KEY=

CELO_RPC_URL=https://forno.celo.org
BAKLAVA_RPC_URL=https://baklava-forno.celo-testnet.org
ALFAJORES_RPC_URL=https://alfajores-forno.celo-testnet.org

BAKLAVA_DEPLOYER_PK=
ALFAJORES_DEPLOYER_PK=
CELO_DEPLOYER_PK=
MENTO_DEPLOYER_PK=

# Baklava governance keys
BAKLAVA_APPROVER_PK=
BAKLAVA_APPROVER=
BAKLAVA_SIGNER_PK=
BAKLAVA_SIGNER=

# Alfajores governance keys
ALFAJORES_SIGNER=
ALFAJORES_SIGNER_PK=
Expand Down
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# directories
.trunk
.yarn/
**/broadcast
**/cache
Expand All @@ -12,4 +13,4 @@
.pnp.*
coverage.json
yarn-debug.log*
yarn-error.log*
yarn-error.log*
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ git clone [email protected]:mento-protocol/mento-deployment.git
cd mento-deployment

# Install the project dependencies & build the contracts
forge install && forge build
yarn install && forge install && forge build

# Create your .env file (Replace the PK for deployer account)
cp .env.example .env
Expand All @@ -22,7 +22,7 @@ cp .env.example .env
yarn secrets:get

# Execute scripts using forge script command
forge script DeployCircuitBreaker --rpc-url $BAKLAVA_RPC_URL --broadcast --legacy --verify --verifier sourcify
forge script DeployCircuitBreaker --rpc-url $ALFAJORES_RPC_URL --broadcast --legacy --verify --verifier sourcify
```

## Deployment Structure
Expand All @@ -45,27 +45,27 @@ The scripts tend to follow a similar structure, and are either simple helpers or

General options will include:

- `-n`: The network to run on, e.g. `baklava` or `alfajores`
- `-n`: The network to run on, e.g. `celo` or `alfajores`
- `-u`: The upgrade number, e.g. `MU01`
- `-g`: The governance that will be used, e.g. `celo` or `mento`

Check the script file for more details on usage but here's a quick overview:

```bash
# Clean the broadcast folder, will remove all broadcast files pertaining to that network and upgrade combination
> yarn clean -n baklava -u MU01
> yarn clean -n alfajores -u MU01

# Show the list of deployed contracts and their addresses
> yarn show -n baklava -n MU01
> yarn show -n alfajores -u MU01
{"name":"BreakerBoxProxy","address":"0xB881aF21C5A9ff8e8d5E4C900F67F066C6CB7936"}
{"name":"BiPoolManagerProxy","address":"0xFF9a3da00F42839CD6D33AD7adf50bCc97B41411"}
{"name":"BrokerProxy","address":"0x6723749339e320E1EFcd9f1B0D997ecb45587208"}
{"name":"PartialReserveProxy","address":"0x5186f2871b81F057E249c4f4c940a20D2"}
# ...

# Run a development script, with no selector
> yarn script:dev -n baklava
Network is baklava
> yarn script:dev -n alfajores
Network is alfajores
==================================================================
👇 Pick a script to run
------------------------------------------------------------------
Expand All @@ -75,25 +75,25 @@ Check the script file for more details on usage but here's a quick overview:
#?

# Run a development script by index
> yarn script:dev -n baklava -i 2
📠 Network is baklava
> yarn script:dev -n alfajores -i 2
📠 Network is alfajores
==================================================================
🔥 Running CreateMockBridgedUSDC
==================================================================

# Run a development script by name
> yarn script:dev -n baklava -s CreateMockBridgedUSDC
📠 Network is baklava
> yarn script:dev -n alfajores -s CreateMockBridgedUSDC
📠 Network is alfajores
==================================================================
🔥 Running CreateMockBridgedUSDC
==================================================================

# Run an upgrade deployment, will run all deploy scripts in an upgrade
> yarn deploy -n baklava -u MU01
> yarn deploy -n alfajores -u MU01

# Submit an upgrade proposal, will output the proposal ID
> yarn cgp -n baklava -u MU01 -g celo
> yarn cgp -n alfajores -u MU01 -g celo

# Pass a CGP on testnets
> yarn cgp:pass -n baklava -g celo -p <proposal-id>
> yarn cgp:pass -n alfajores -g celo -p <proposal-id>
```
2 changes: 1 addition & 1 deletion bin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Build the contracts for a give upgrade
# Usage: ./bin/build.sh
# -u <upgrade_name> -- name of the upgrade (MU01)
# Example: ./bin/clean.sh -n baklava -u MU01
# Example: ./bin/clean.sh -n alfajores -u MU01
##############################################################################

source "$(dirname "$0")/setup.sh"
Expand Down
4 changes: 2 additions & 2 deletions bin/cgp-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
##############################################################################
# Script for running Governance Proposal Checks on top of a network
# Usage: yarn cgp:check
# -n <baklava|alfajores|celo> -- network to submit the proposal to
# -n <alfajores|celo> -- network to submit the proposal to
# -u <upgrade_name> -- name of the upgrade (MU01)
# -g <celo|mento> -- governance to use
# Example: yarn cgp:check -n baklava -u MU03 -g mento
# Example: yarn cgp:check -n alfajores -u MU03 -g mento
##############################################################################

source "$(dirname "$0")/setup.sh"
Expand Down
4 changes: 2 additions & 2 deletions bin/cgp-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
##############################################################################
# Script for running all deployment tasks for a protocol upgrade
# Usage: ./bin/cgp-deploy.sh
# -n <baklava|alfajores|celo> -- network to submit the proposal to
# -n <alfajores|celo> -- network to submit the proposal to
# -u <upgrade_name> -- name of the upgrade (MU01)
# -s -- name of the script (optional)
# Example: ./bin/cgp-deploy.sh -n baklava -u MU01
# Example: ./bin/cgp-deploy.sh -n alfajores -u MU01
##############################################################################

source "$(dirname "$0")/setup.sh"
Expand Down
4 changes: 2 additions & 2 deletions bin/cgp-diff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
##############################################################################
# Script for passing a Celo Governance Proposal on a testnet.
# Usage: ./bin/cgp-diff.sh <proposal_id_alpha> <proposal_id_beta>
# -n <baklava|alfajores> -- network to pass the proposal on
# Example: ./bin/cgp-diff.sh -n baklava 78 79
# -n <alfajores> -- network to pass the proposal on
# Example: ./bin/cgp-diff.sh -n alfajores 78 79
##############################################################################

source "$(dirname "$0")/setup.sh"
Expand Down
4 changes: 2 additions & 2 deletions bin/cgp-execute.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
# Script for executing a Governance Proposal for a protocol upgrade
# Usage: yarn cgp:execute
# -p -- proposalId
# -n <baklava|alfajores|celo> -- network to submit the proposal to
# -n <alfajores|celo> -- network to submit the proposal to
# -g <celo|mento> -- governance to use
# -s -- simulate the proposal (optional)
# Example: yarn cgp -n baklava -p 1 -g mento
# Example: yarn cgp -n alfajores -p 1 -g mento
##############################################################################

source "$(dirname "$0")/setup.sh"
Expand Down
4 changes: 2 additions & 2 deletions bin/cgp-pass.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
##############################################################################
# Script for passing a Celo Governance Proposal on a tesnet.
# Usage: yarn cgp:pass
# -n <baklava|alfajores> -- network to pass the proposal on
# -n <alfajores> -- network to pass the proposal on
# -p <proposal_id> -- proposal ID
# -g <celo|mento> -- governance to use
# Example: yarn cgp:pass -n baklava -p 79 -g mento
# Example: yarn cgp:pass -n alfajores -p 79 -g mento
##############################################################################

source "$(dirname "$0")/setup.sh"
Expand Down
4 changes: 2 additions & 2 deletions bin/cgp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
##############################################################################
# Script for submitting a Governance Proposal for a protocol upgrade
# Usage: yarn cgp
# -n <baklava|alfajores|celo> -- network to submit the proposal to
# -n <alfajores|celo> -- network to submit the proposal to
# -u <upgrade_name> -- name of the upgrade (MU01)
# -g <celo|mento> -- governance to use
# -s -- simulate the proposal (optional)
# -r -- revert (optional)
# -f -- use forked network (optional)
# Example: yarn cgp -n baklava -u MU01 -g mento
# Example: yarn cgp -n alfajores -u MU01 -g mento
##############################################################################

source "$(dirname "$0")/setup.sh"
Expand Down
4 changes: 2 additions & 2 deletions bin/clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
##############################################################################
# Script for cleaning the broadcast file for an upgrade + network combo
# Usage: ./bin/clean.sh
# -n <baklava|alfajores|celo> -- network to submit the proposal to
# -n <alfajores|celo> -- network to submit the proposal to
# -u <upgrade_name> -- name of the upgrade (MU01)
# Example: ./bin/clean.sh -n baklava -u MU01
# Example: ./bin/clean.sh -n alfajores -u MU01
##############################################################################

source "$(dirname "$0")/setup.sh"
Expand Down
8 changes: 4 additions & 4 deletions bin/dev-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
##############################################################################
# Script for running all deployment tasks for a protocol upgrade
# Usage: ./bin/dev-script.sh
# -n <baklava|alfajores|celo> -- network to submit the proposal to
# -n <alfajores|celo> -- network to submit the proposal to
# -i <script-index> -- index of the script (optional)
# -s <script-name> -- name of the script (optional)
# -r <run-signature> -- signature of the run function (optional)
# Example:
# To pick the script:
# ./bin/deploy.sh -n baklava
# ./bin/deploy.sh -n alfajores
# To pick the script by index:
# ./bin/deploy.sh -n baklava -i 1
# ./bin/deploy.sh -n alfajores -i 1
# To pick the script by name:
# ./bin/deploy.sh -n baklava -s CreateMockBridgedUSDC
# ./bin/deploy.sh -n alfajores -s CreateMockBridgedUSDC
##############################################################################

source "$(dirname "$0")/setup.sh"
Expand Down
2 changes: 1 addition & 1 deletion bin/get-secrets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ set -u # Treat unset variables as an error when substituting

# Set the project ID and the comma-separated list of secret IDs to retrieve
PROJECT_ID="mento-prod"
SECRET_IDS="mento-deployer-pk,baklava-approver-pk,baklava-voter-pk,dune-api-key"
SECRET_IDS="mento-deployer-pk,dune-api-key"

# Set the path to the .env file as the parent directory of the current directory
ENV_FILE="$(dirname "$0")/../.env"
Expand Down
8 changes: 4 additions & 4 deletions bin/merkle-tree.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/*******************************************************************
* Build the airgrab merkle tree for a given network
* Usage: yarn merkle-tree:build
* -n <baklava|alfajores|celo> -- network to build the tree for
* -n <alfajores|celo> -- network to build the tree for
*******************************************************************
*/

import { parseArgs } from "node:util";
import { StandardMerkleTree } from "@openzeppelin/merkle-tree";
import * as fs from "fs";
import { parse } from "csv-parse/sync";
import * as fs from "fs";
import { parseArgs } from "node:util";

const {
values: { network },
Expand All @@ -18,7 +18,7 @@ const {
},
});

if (network !== "baklava" && network !== "alfajores" && network !== "celo") {
if (network !== "alfajores" && network !== "celo") {
throw new Error("Invalid network");
}

Expand Down
9 changes: 0 additions & 9 deletions bin/pre-commit-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ get_network_name() {
"44787")
echo "alfajores"
;;
"62320")
echo "baklava"
;;
*)
echo "Error: Unsupported network ID: $network_id" >&2
exit 1
Expand Down Expand Up @@ -76,12 +73,6 @@ process_file() {
# Get network name
network=$(get_network_name "$network_id")

# Skip checks for Baklava as CeloScan isn't available there
if [ "$network" == "baklava" ]; then
echo "ℹ️ Skipping verification check for Baklava network."
return 0
fi

# Find newly deployed addresses and store them in an array
addresses=($(fetch_addresses "$broadcast_file"))

Expand Down
9 changes: 0 additions & 9 deletions bin/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,6 @@ source "$(dirname "$0")/../.env"

parse_network () { # $1: network, $2: use_fork
case $1 in
"baklava")
APPROVER=$BAKLAVA_APPROVER
APPROVER_PK=$BAKLAVA_APPROVER_PK
SIGNER=$BAKLAVA_SIGNER
SIGNER_PK=$BAKLAVA_SIGNER_PK
RPC_URL=$BAKLAVA_RPC_URL
CHAIN_ID=62320
export FOUNDRY_PROFILE=baklava-deployment
;;
"alfajores")
APPROVER=$ALFAJORES_APPROVER
APPROVER_PK=$ALFAJORES_APPROVER_PK
Expand Down
4 changes: 2 additions & 2 deletions bin/show.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
##############################################################################
# This script will show the addresses of all contracts deployed in a given upgrade
# Usage: ./bin/show.sh
# -n <baklava|alfajores|celo> -- network to target
# -n <alfajores|celo> -- network to target
# -u <upgrade_name> -- name of the upgrade (MU01)
# Example: ./bin/show.sh -n baklava -u MU01
# Example: ./bin/show.sh -n alfajores -u MU01
##############################################################################

source "$(dirname "$0")/setup.sh"
Expand Down
9 changes: 2 additions & 7 deletions bin/verify-bytecodes.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { providers } from "ethers";
import { execSync } from "node:child_process";
import fs from "node:fs";
import { parseArgs } from "node:util";
import process from "node:process";
import { providers } from "ethers";
import { parseArgs } from "node:util";

enum Network {
Baklava = "baklava",
Alfajores = "alfajores",
Celo = "celo",
}
Expand All @@ -28,10 +27,6 @@ type NetworkInfo = {
};

const networkInfoByName: Record<Network, NetworkInfo> = {
[Network.Baklava]: {
id: 62320,
rpcUrl: "https://baklava-forno.celo-testnet.org",
},
[Network.Alfajores]: {
id: 44787,
rpcUrl: "https://alfajores-forno.celo-testnet.org",
Expand Down
Loading

0 comments on commit 0493a31

Please sign in to comment.