Skip to content

Commit

Permalink
[PROTOCOL-MONOREPO] remove deprecated networks (#1848)
Browse files Browse the repository at this point in the history
* remove deprecated testnets, add new mainnets where missing

* sync metadata build

* more radical purging

* full OCD
  • Loading branch information
d10r authored Mar 12, 2024
1 parent e58f78d commit 24762f1
Show file tree
Hide file tree
Showing 39 changed files with 68 additions and 985 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/subgraph-bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ assignees: 0xdavinchee
**Describe the bug:**
A clear and concise description of what the bug is. What is the data you are having issues with?

**Subgraph endpoint:** [e.g. https://thegraph.com/hosted-service/subgraph/superfluid-finance/protocol-v1-goerli]
**Subgraph endpoint:** [e.g. https://thegraph.com/hosted-service/subgraph/superfluid-finance/protocol-v1-polygon-mainnet]

**Query:**
e.g.
e.g.
```
query MyQuery {
streams(first: 10) {
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/handler.deploy-to-testnets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ jobs:
defaults:
run:
shell: nix develop -c bash -xe {0}

strategy:
fail-fast: false
matrix:
network: [eth-goerli, eth-sepolia, polygon-mumbai, optimism-goerli, arbitrum-goerli, avalanche-fuji, base-goerli, polygon-zkevm-testnet]
network: [eth-sepolia, polygon-mumbai, optimism-sepolia, avalanche-fuji, scroll-sepolia]

steps:
- uses: actions/checkout@v3
Expand Down
14 changes: 0 additions & 14 deletions .github/workflows/handler.list-super-token.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,3 @@ jobs:
--network ${{ github.event.inputs.network }} \
ops-scripts/resolver-list-super-token.js \
: ${{ github.event.inputs.token_address }}
# workaround for OG networks with a Resolver not emitting events
- name: Trigger Transfer Event
if: >
github.event.inputs.network == 'polygon-mainnet' ||
github.event.inputs.network == 'xdai-mainnet' ||
github.event.inputs.network == 'polygon-mumbai' ||
github.event.inputs.network == 'eth-goerli'
run: |
cd packages/ethereum-contracts
npx truffle exec \
--network ${{ github.event.inputs.network }} \
ops-scripts/tmp-trigger-token-transfer.js \
: ${{ github.event.inputs.token_address }}
2 changes: 1 addition & 1 deletion .github/workflows/handler.verify-contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
strategy:
fail-fast: false
matrix:
network: [eth-goerli, eth-sepolia, polygon-mumbai, optimism-goerli, arbitrum-goerli, avalanche-fuji, base-goerli, polygon-mainnet, optimism-mainnet, arbitrum-one, avalanche-c, bsc-mainnet, celo-mainnet]
network: [eth-sepolia, polygon-mumbai, optimism-sepolia, avalanche-fuji, polygon-mainnet, xdai-mainnet, optimism-mainnet, arbitrum-one, avalanche-c, bsc-mainnet, eth-mainnet, celo-mainnet, base-mainnnet, scroll-mainnet]

defaults:
run:
Expand Down
2 changes: 0 additions & 2 deletions packages/automation-contracts/autowrap/.env-example
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# .env-example

GOERLI_PRIVATE_KEY=
MUMBAI_PRIVATE_KEY=
POLYGON_PRIVATE_KEY=
BSC_PRIVATE_KEY=

GOERLI_URL=
MUMBAI_URL=
POLYGON_URL=
BSC_URL=
Expand Down
2 changes: 0 additions & 2 deletions packages/automation-contracts/autowrap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ When your Super Token balance reaches a certain lower threshold, Auto Wrap steps

PRIVATE_KEY=

GOERLI_PRIVATE_KEY=
MUMBAI_PRIVATE_KEY=
POLYGON_PRIVATE_KEY=
BSC_PRIVATE_KEY=
Expand Down Expand Up @@ -59,7 +58,6 @@ npx hardhat addStrategy --manager <manager_address> --strategy <strategy_address
#### Testnets
| | Manager | WrapStrategy |
|----------|--------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|
| Goerli | [0x0B82D14E9616ca4d260E77454834AdCf5887595F](https://goerli.etherscan.io/address/0x0B82D14E9616ca4d260E77454834AdCf5887595F#code) | [0xea49af829d3e28d3ec49e0e0a0ba1e7860a56f60](https://goerli.etherscan.io/address/0xea49af829d3e28d3ec49e0e0a0ba1e7860a56f60#code) |
| Mumbai | [0x3eAB3c6207F488E475b7955B631B564F0E6317B9](https://mumbai.polygonscan.com/address/0x3eAB3c6207F488E475b7955B631B564F0E6317B9#code) | [0x544728AFDBeEafBeC9e1329031788edb53017bC4](https://mumbai.polygonscan.com/address/0x544728AFDBeEafBeC9e1329031788edb53017bC4#code) |

#### Mainnets
Expand Down
5 changes: 0 additions & 5 deletions packages/automation-contracts/autowrap/hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ module.exports = {
url: "http://127.0.0.1:8545/",
chainId: 31337,
},
goerli: {
url: process.env.GOERLI_URL || "",
accounts:
process.env.GOERLI_PRIVATE_KEY !== undefined ? [process.env.GOERLI_PRIVATE_KEY] : [],
},
mumbai: {
url: process.env.MUMBAI_URL || "",
accounts:
Expand Down
2 changes: 0 additions & 2 deletions packages/automation-contracts/scheduler/.env-example
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# .env-example

GOERLI_PRIVATE_KEY=
MUMBAI_PRIVATE_KEY=
POLYGON_PRIVATE_KEY=
BSC_PRIVATE_KEY=

GOERLI_URL=
MUMBAI_URL=
POLYGON_URL=
BSC_URL=
Expand Down
3 changes: 0 additions & 3 deletions packages/automation-contracts/scheduler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,10 @@ The Vesting Scheduler allows you to schedule the vesting of tokens to a receiver
```bash
# .env-example

GOERLI_PRIVATE_KEY=
MUMBAI_PRIVATE_KEY=
POLYGON_PRIVATE_KEY=
BSC_PRIVATE_KEY=

GOERLI_URL=
MUMBAI_URL=
POLYGON_URL=
BSC_URL=
Expand Down Expand Up @@ -60,7 +58,6 @@ npx hardhat deploy --network <network>
#### Testnets
| | FlowScheduler | VestingScheduler |
|----------|--------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------|
| Goerli | [0xA6134E107FCAEAab6140CB8fb92Dbf5bd9EF6C86](https://goerli.etherscan.io/address/0xA6134E107FCAEAab6140CB8fb92Dbf5bd9EF6C86#code) | [0xb61f8A2CbBd1be5FE437509b51dc2B9BA710c47b](https://goerli.etherscan.io/address/0xb61f8A2CbBd1be5FE437509b51dc2B9BA710c47b#code) |
| Mumbai | [0xF18825d412C061aEfEFB4dF46a1c077636dA50bf](https://mumbai.polygonscan.com/address/0xF18825d412C061aEfEFB4dF46a1c077636dA50bf#code) | [0xD4fCe2a08fd2fA7495BEd900F2fb6c6deDBf8632](https://mumbai.polygonscan.com/address/0xD4fCe2a08fd2fA7495BEd900F2fb6c6deDBf8632#code) |

#### Mainnets
Expand Down
5 changes: 0 additions & 5 deletions packages/automation-contracts/scheduler/hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ module.exports = {
url: "http://127.0.0.1:8545/",
chainId: 31337,
},
goerli: {
url: process.env.GOERLI_URL || "",
accounts:
process.env.GOERLI_PRIVATE_KEY !== undefined ? [process.env.GOERLI_PRIVATE_KEY] : [],
},
mumbai: {
url: process.env.MUMBAI_URL || "",
accounts:
Expand Down
6 changes: 3 additions & 3 deletions packages/ethereum-contracts/.env.template
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
# <NETWORK_NAME>_GAS_PRICE

# Example for the Görli Ethereum testnet:
ETH_GOERLI_PROVIDER_URL=https://goerli.infura.io/v3/<API_KEY>
ETH_GOERLI_MNEMONIC="rigid cradle south ..."
ETH_MAINNET_PROVIDER_URL=https://mainnet.infura.io/v3/<API_KEY>
ETH_MAINNET_MNEMONIC="rigid cradle south ..."


# Fallback mnemonic for all networks - used if no network specific mnemonic is set
Expand All @@ -25,7 +25,7 @@ DEFAULT_MNEMONIC="rigid cradle south ..."


# A few scripts do subgraph queries, for those an endpoint must be configured
#ETH_GOERLI_SUBGRAPH_ENDPOINT=...
#ETH_MAINNET_SUBGRAPH_ENDPOINT=...
#
# Alternatively, you can also provide an endpoint template
#SUBGRAPH_ENDPOINT_TEMPLATE=https://{{NETWORK}}.subgraph.mydomain.xyz
Expand Down
6 changes: 3 additions & 3 deletions packages/ethereum-contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ If you're building a smart contract that uses Superfluid protocol, or even your
### Installation

Prerequisites:
- [node.js v16+](https://nodejs.org/en/download)
- [node.js v18+](https://nodejs.org/en/download)
- [yarn](https://classic.yarnpkg.com/en/docs/install)
- [forge](https://book.getfoundry.sh/getting-started/installation)

Expand Down Expand Up @@ -250,7 +250,7 @@ If you want contribute to Superfluid protocol contracts instead of just interfac

### Setup Development Environment

Prerequisites: You need node.js v16+ and yarn installed.
Prerequisites: You need node.js v18+ and yarn installed.

First, check out this repository and cd into it.
```sh
Expand All @@ -271,7 +271,7 @@ cd packages/ethereum-contracts/
```

Then prepare an `.env` file (see `.env.template`).
The most important config items are RPC endpoint (`<X>_PROVIDER_URL`) and a sender account (`<X>_MNEMONIC`), _<X>_ being a network specific prefix - e.g. `GOERLI_PROVIDER_URL`.
The most important config items are RPC endpoint (`<X>_PROVIDER_URL`) and a sender account (`<X>_MNEMONIC`), _<X>_ being a network specific prefix - e.g. `OPTIMISM_MAINNET_PROVIDER_URL`.
If you provide an actual mnemonic, the key derived at `m/44'/60'/0'/0/0` will be used. You can instead also set private keys (hex format) for `<X>_MNEMONIC`.

In order to get an overview of available config items, look for instances of `process.env` in [truffle-config.js](truffle-config.js) and in files in the [scripts](scripts) folder.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,23 @@ library SuperfluidLoaderLibrary {
uint256 private constant BSC_MAINNET = 56;
uint256 private constant XDAI_MAINNET = 100;
uint256 private constant POLYGON_MAINNET = 137;
uint256 private constant BASE_MAINNET = 8453;
uint256 private constant ARBITRUM_ONE = 42161;
uint256 private constant CELO_MAINNET = 42220;
uint256 private constant AVALANCHE_C = 43114;
uint256 private constant SCROLL_MAINNET = 534352;


// testnets
uint256 private constant ETH_GOERLI = 5;
uint256 private constant ETH_SEPOLIA = 11155111;
uint256 private constant BASE_GOERLI = 84531;
uint256 private constant POLYGON_MUMBAI = 80001;
uint256 private constant ARBITRUM_GOERLI = 421613;
uint256 private constant OPTIMISM_GOERLI = 420;
uint256 private constant AVALANCHE_FUJI = 43113;
uint256 private constant ZKEVM_TESTNET = 1442;

uint256 private constant POLYGON_MUMBAI = 80001;
uint256 private constant SCROLL_SEPOLIA = 534351;
uint256 private constant ETH_SEPOLIA = 11155111;
uint256 private constant OPTIMISM_SEPOLIA = 11155420;


function getHost() public view returns (address) {
// mainnets
if (block.chainid == ETH_MAINNET) {
return 0x4E583d9390082B65Bef884b629DFA426114CED6d;
} else if (block.chainid == OPTIMISM_MAINNET) {
Expand All @@ -36,28 +37,27 @@ library SuperfluidLoaderLibrary {
return 0x2dFe937cD98Ab92e59cF3139138f18c823a4efE7;
} else if (block.chainid == POLYGON_MAINNET) {
return 0x3E14dC1b13c488a8d5D310918780c983bD5982E7;
} else if (block.chainid == BASE_MAINNET) {
return 0x4C073B3baB6d8826b8C5b229f3cfdC1eC6E47E74;
} else if (block.chainid == ARBITRUM_ONE) {
return 0xCf8Acb4eF033efF16E8080aed4c7D5B9285D2192;
} else if (block.chainid == CELO_MAINNET) {
return 0xA4Ff07cF81C02CFD356184879D953970cA957585;
} else if (block.chainid == AVALANCHE_C) {
return 0x60377C7016E4cdB03C87EF474896C11cB560752C;
} else if (block.chainid == ETH_GOERLI) {
return 0x22ff293e14F1EC3A09B137e9e06084AFd63adDF9;
} else if (block.chainid == ARBITRUM_GOERLI) {
return 0xE40983C2476032A0915600b9472B3141aA5B5Ba9;
} else if (block.chainid == OPTIMISM_GOERLI) {
return 0xE40983C2476032A0915600b9472B3141aA5B5Ba9;
} else if (block.chainid == SCROLL_MAINNET) {
return 0x0F86a21F6216c061B222c224e315d9FC34520bb7;
// testnets
} else if (block.chainid == AVALANCHE_FUJI) {
return 0x85Fe79b998509B77BF10A8BD4001D58475D29386;
} else if (block.chainid == POLYGON_MUMBAI) {
return 0xEB796bdb90fFA0f28255275e16936D25d3418603;
} else if (block.chainid == SCROLL_SEPOLIA) {
return 0x42b05a6016B9eED232E13fd56a8F0725693DBF8e;
} else if (block.chainid == ETH_SEPOLIA) {
return 0x109412E3C84f0539b43d39dB691B08c90f58dC7c;
} else if (block.chainid == BASE_GOERLI) {
return 0x507c3a7C6Ccc253884A2e3a3ee2A211cC7E796a6;
} else if (block.chainid == ZKEVM_TESTNET) {
return 0xe64f81d5dDdA1c7172e5C6d964E8ef1BD82D8704;
} else if (block.chainid == OPTIMISM_SEPOLIA) {
return 0xd399e2Fb5f4cf3722a11F65b88FAB6B2B8621005;
} else {
revert UnsupportedNetwork();
}
Expand Down
19 changes: 0 additions & 19 deletions packages/ethereum-contracts/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,13 @@ subtask(TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS).setAction(

const chainIds = {
"eth-mainnet": 1,
"eth-goerli": 5,
"eth-sepolia": 11155111,

"xdai-mainnet": 100,

"optimism-mainnet": 10,
"optimism-goerli": 420,

"arbitrum-one": 42161,
"arbitrum-goerli": 421613,

"polygon-mainnet": 137,
"polygon-mumbai": 80001,
Expand Down Expand Up @@ -114,10 +111,6 @@ const config: HardhatUserConfig = {
...createNetworkConfig("bsc-mainnet"),
url: process.env.BSC_MAINNET_PROVIDER_URL || "",
},
"eth-goerli": {
...createNetworkConfig("eth-goerli"),
url: process.env.ETH_GOERLI_PROVIDER_URL || "",
},
"xdai-mainnet": {
...createNetworkConfig("xdai-mainnet"),
url: process.env.XDAI_MAINNET_PROVIDER_URL || "",
Expand All @@ -126,18 +119,10 @@ const config: HardhatUserConfig = {
...createNetworkConfig("optimism-mainnet"),
url: process.env.OPTIMISM_MAINNET_PROVIDER_URL || "",
},
"optimism-goerli": {
...createNetworkConfig("optimism-goerli"),
url: process.env.OPTIMISM_GOERLI_PROVIDER_URL || "",
},
"arbitrum-one": {
...createNetworkConfig("arbitrum-one"),
url: process.env.ARBITRUM_ONE_PROVIDER_URL || "",
},
"arbitrum-goerli": {
...createNetworkConfig("arbitrum-goerli"),
url: process.env.ARBITRUM_GOERLI_PROVIDER_URL || "",
},
"polygon-mainnet": {
...createNetworkConfig("polygon-mainnet"),
url: process.env.POLYGON_MAINNET_PROVIDER_URL || "",
Expand All @@ -162,10 +147,6 @@ const config: HardhatUserConfig = {
...createNetworkConfig("eth-sepolia"),
url: process.env.ETH_SEPOLIA_PROVIDER_URL || "",
},
"base-goerli": {
...createNetworkConfig("base-goerli"),
url: process.env.BASE_GOERLI_PROVIDER_URL || "",
},
"scroll-sepolia": {
...createNetworkConfig("scroll-sepolia"),
url: process.env.SCROLL_SEPOLIA_PROVIDER_URL || "",
Expand Down
7 changes: 3 additions & 4 deletions packages/ethereum-contracts/ops-scripts/libs/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ async function setResolver(sf, key, value) {
const resolverAdmin = nrAdmins > 0 ?
await ac.getRoleMember(ADMIN_ROLE, nrAdmins - 1):
await (async () => {
// This is for eth-goerli (and maybe other networks too)
console.log(`!!! resolver.getRoleMemberCount() returned 0. Trying account[0] as resolver admin.`);
return (await web3.eth.getAccounts())[0];
})();
Expand Down Expand Up @@ -345,7 +344,7 @@ async function autodetectAdminType(sf, account) {
}

// returns the Safe Tx Service URL or throws if none available
// source: https://github.com/safe-global/safe-docs/blob/main/safe-core-api/available-services.md
// source: https://github.com/safe-global/safe-docs/blob/main/pages/api-supported-networks.md?plain=1
function getSafeTxServiceUrl(chainId) {
const safeChainNames = {
// mainnets
Expand All @@ -356,10 +355,10 @@ function getSafeTxServiceUrl(chainId) {
137: "polygon",
8453: "base",
42161: "arbitrum",
42220: "celo",
43114: "avalanche",
// testnets
5: "goerli",
84531: "base-testnet"
11155111: "sepolia"
};
if (safeChainNames[chainId] === undefined) {
throw new Error(`no Safe tx service url known for chainId ${chainId}`);
Expand Down
3 changes: 0 additions & 3 deletions packages/ethereum-contracts/tasks/deploy-cfa-forwarder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ set -eu
# Usage:
# tasks/deploy-cfa-forwarder.sh <network>
#
# Example:
# tasks/deploy-cfa-forwarder.sh optimism-goerli
#
# The invoking account needs to be (co-)owner of the resolver and governance
#
# important ENV vars:
Expand Down
3 changes: 0 additions & 3 deletions packages/ethereum-contracts/tasks/deploy-gda-forwarder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ set -eu
# Usage:
# tasks/deploy-gda-forwarder.sh <network>
#
# Example:
# tasks/deploy-gda-forwarder.sh optimism-goerli
#
# The invoking account needs to be (co-)owner of the resolver and governance
#
# important ENV vars:
Expand Down
3 changes: 0 additions & 3 deletions packages/ethereum-contracts/tasks/deploy-macro-forwarder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ set -eu
# Usage:
# tasks/deploy-macro-forwarder.sh <network>
#
# Example:
# tasks/deploy-macro-forwarder.sh optimism-goerli
#
# The invoking account needs to be (co-)owner of the resolver and governance
#
# important ENV vars:
Expand Down
Loading

0 comments on commit 24762f1

Please sign in to comment.