Skip to content

Commit

Permalink
deprecate goerli (+ zksync, base, arbitrum, optimism) (#550)
Browse files Browse the repository at this point in the history
* deprecate goerli (+ zksync, base, arbitrum, optimism)

* change Vault example addresse for deployed one in Sepolia
  • Loading branch information
CoveMB committed Apr 30, 2024
1 parent 4c3b089 commit cd7d7cf
Show file tree
Hide file tree
Showing 19 changed files with 45 additions and 60 deletions.
2 changes: 1 addition & 1 deletion examples/action-proposal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ async function main() {
const proposal = await client.createProposal({
contract: {
address: '0xf62322658Cb0F51C71Da36637a6846B0967cA264',
network: 'goerli',
network: 'sepolia',
},
title: 'Set to 42',
description: 'Set value to 42',
Expand Down
10 changes: 5 additions & 5 deletions examples/batch-proposal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ const contracts = [
{
address: ERC20Token,
name: 'ERC20 Token',
network: 'goerli',
network: 'sepolia',
abi: '[{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]',
},
{
address: RolesContract,
network: 'goerli',
network: 'sepolia',
name: 'Roles Contract',
abi: '[{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"}]',
},
Expand All @@ -27,7 +27,7 @@ const safeAddress = '0xba4A8019166BB0E066dF2De99b37fbd5916eCf20';

const steps = [
{
contractId: `goerli-${ERC20Token}`,
contractId: `sepolia-${ERC20Token}`,
targetFunction: {
name: 'mint',
inputs: [{ type: 'uint256', name: 'amount' }],
Expand All @@ -36,7 +36,7 @@ const steps = [
type: 'custom',
},
{
contractId: `goerli-${ERC20Token}`,
contractId: `sepolia-${ERC20Token}`,
targetFunction: {
name: 'transfer',
inputs: [
Expand All @@ -48,7 +48,7 @@ const steps = [
type: 'custom',
},
{
contractId: `goerli-${RolesContract}`,
contractId: `sepolia-${RolesContract}`,
metadata: {
action: 'grantRole',
role: '0x0000000000000000000000000000000000000000000000000000000000000000',
Expand Down
2 changes: 1 addition & 1 deletion examples/create-relayer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ async function main() {

const createParams = {
name: 'MyNewRelayer',
network: 'goerli',
network: 'sepolia',
minBalance: BigInt(1e17).toString(),
policies: {
whitelistReceivers: ['0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B'],
Expand Down
2 changes: 1 addition & 1 deletion examples/create-sentinel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async function main() {

const blockRequestParameters = {
type: 'BLOCK', // BLOCK or FORTA
network: 'goerli',
network: 'sepolia',
// optional
confirmLevel: 1, // if not set, we pick the blockwatcher for the chosen network with the lowest offset
name: 'MyNewSentinel',
Expand Down
2 changes: 1 addition & 1 deletion examples/pause-proposal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ require('dotenv').config();
const { AdminClient } = require('@openzeppelin/defender-admin-client');

const address = '0xB07b1C80371915dEFd254d1C57BeF2bDe6D3b610';
const network = 'goerli';
const network = 'sepolia';

async function main() {
const creds = { apiKey: process.env.ADMIN_API_KEY, apiSecret: process.env.ADMIN_API_SECRET };
Expand Down
2 changes: 1 addition & 1 deletion examples/unpause-proposal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ require('dotenv').config();
const { AdminClient } = require('@openzeppelin/defender-admin-client');

const address = '0xB07b1C80371915dEFd254d1C57BeF2bDe6D3b610';
const network = 'goerli';
const network = 'sepolia';

async function main() {
const creds = { apiKey: process.env.ADMIN_API_KEY, apiSecret: process.env.ADMIN_API_SECRET };
Expand Down
2 changes: 1 addition & 1 deletion examples/upgrade-proposal/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const proxy = '0xB07b1C80371915dEFd254d1C57BeF2bDe6D3b610';
const newImplementation = '0x86690db6c757fcc71ff1b69cf24529e5ab6481fb';
const newImplementationAbi =
'[{"inputs":[{"internalType":"string","name":"newValue","type":"string"}],"name":"changeValue","outputs":[],"stateMutability":"nonpayable","type":"function"}]'; // If no newImplementationAbi is provided the previous implementation ABI will be assumed
const network = 'goerli';
const network = 'sepolia';

async function main() {
const creds = { apiKey: process.env.ADMIN_API_KEY, apiSecret: process.env.ADMIN_API_SECRET };
Expand Down
12 changes: 6 additions & 6 deletions examples/verify-contract/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ async function main() {
'https://raw.githubusercontent.com/OpenZeppelin/defender-client/fa441208febac7f46fe7bb03c787659089315f78/examples/verify-contract/compilation-artifact.json',
solidityFilePath: 'contracts/Vault.sol',
contractName: 'VaultV2',
contractAddress: '0x38e373CC414e90dDec45cf7166d497409902e998',
contractNetwork: 'goerli',
contractAddress: '0xc1a35c687c72AE7ccF7067F018848e5FceED637F',
contractNetwork: 'sepolia',
});

printVerificationToConsole(verification);
Expand All @@ -46,8 +46,8 @@ async function main() {
'https://github.com/OpenZeppelin/defender-client/blob/master/examples/verify-contract/compilation-artifact.json',
solidityFilePath: 'contracts/Vault.sol',
contractName: 'VaultV2',
contractAddress: '0x38e373CC414e90dDec45cf7166d497409902e998',
contractNetwork: 'goerli',
contractAddress: '0xc1a35c687c72AE7ccF7067F018848e5FceED637F',
contractNetwork: 'sepolia',
});

printVerificationToConsole(verification);
Expand All @@ -56,8 +56,8 @@ async function main() {
// state of your contract, you can call `get` providing
// the address and network
verification = await client.getDeploymentVerification({
contractAddress: '0x38e373CC414e90dDec45cf7166d497409902e998',
contractNetwork: 'goerli',
contractAddress: '0xc1a35c687c72AE7ccF7067F018848e5FceED637F',
contractNetwork: 'sepolia',
});

printVerificationToConsole(verification);
Expand Down
26 changes: 13 additions & 13 deletions packages/admin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ To create a `custom` action proposal, you need to provide the function interface

```js
await client.createProposal({
contract: { address: '0x28a8746e75304c0780E011BEd21C72cD78cd535E', network: 'goerli' }, // Target contract
contract: { address: '0x28a8746e75304c0780E011BEd21C72cD78cd535E', network: 'sepolia' }, // Target contract
title: 'Adjust fee to 10%', // Title of the proposal
description: 'Adjust the contract fee collected per action to 10%', // Description of the proposal
type: 'custom', // Use 'custom' for custom admin actions
Expand Down Expand Up @@ -101,7 +101,7 @@ To create an `upgrade` action proposal, provide the proxy contract network and a
```js
const newImplementation = '0x3E5e9111Ae8eB78Fe1CC3bb8915d5D461F3Ef9A9';
const newImplementationAbi = '[...]';
const contract = { network: 'goerli', address: '0x28a8746e75304c0780E011BEd21C72cD78cd535E' };
const contract = { network: 'sepolia', address: '0x28a8746e75304c0780E011BEd21C72cD78cd535E' };
await client.proposeUpgrade({ newImplementation, newImplementationAbi }, contract);
```

Expand All @@ -113,7 +113,7 @@ If your proxies do not implement the [EIP1967 admin slot](https://eips.ethereum.
const newImplementation = '0x3E5e9111Ae8eB78Fe1CC3bb8915d5D461F3Ef9A9';
const proxyAdmin = '0x2fC100f1BeA4ACCD5dA5e5ed725D763c90e8ca96';
const newImplementationAbi = '[...]';
const contract = { network: 'goerli', address: '0x28a8746e75304c0780E011BEd21C72cD78cd535E' };
const contract = { network: 'sepolia', address: '0x28a8746e75304c0780E011BEd21C72cD78cd535E' };
await client.proposeUpgrade({ newImplementation, newImplementationAbi, proxyAdmin }, contract);
```

Expand All @@ -123,7 +123,7 @@ await client.proposeUpgrade({ newImplementation, newImplementationAbi, proxyAdmi
const newImplementation = '0x3E5e9111Ae8eB78Fe1CC3bb8915d5D461F3Ef9A9';
const via = '0xF608FA64c4fF8aDdbEd106E69f3459effb4bC3D1';
const viaType = 'Safe'; // 'Gnosis Multisig', 'Safe' or 'EOA'
const contract = { network: 'goerli', address: '0x28a8746e75304c0780E011BEd21C72cD78cd535E' };
const contract = { network: 'sepolia', address: '0x28a8746e75304c0780E011BEd21C72cD78cd535E' };
const newImplementationAbi = '[...]';
await client.proposeUpgrade({ newImplementation, newImplementationAbi, via, viaType }, contract);
```
Expand All @@ -133,7 +133,7 @@ await client.proposeUpgrade({ newImplementation, newImplementationAbi, via, viaT
To create `pause` and `unpause` action proposals, you need to provide the contract network and address, as well as the multisig that will be used for approving it. Defender takes care of the rest:

```js
const contract = { network: 'goerli', address: '0x28a8746e75304c0780E011BEd21C72cD78cd535E' };
const contract = { network: 'sepolia', address: '0x28a8746e75304c0780E011BEd21C72cD78cd535E' };

// Create a pause proposal
await client.proposePause({ via: '0x22d491Bde2303f2f43325b2108D26f1eAbA1e32b', viaType: 'Safe' }, contract);
Expand All @@ -156,12 +156,12 @@ const contracts = [
{
address: ERC20Token,
name: 'ERC20 Token',
network: 'goerli',
network: 'sepolia',
abi: '[{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]',
},
{
address: RolesContract,
network: 'goerli',
network: 'sepolia',
name: 'Roles Contract',
abi: '[{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"}]',
},
Expand All @@ -171,7 +171,7 @@ const safeAddress = '0x22d491Bde2303f2f43325b2108D26f1eAbA1e32b';

const steps = [
{
contractId: `goerli-${ERC20Token}`,
contractId: `sepolia-${ERC20Token}`,
targetFunction: {
name: 'mint',
inputs: [{ type: 'uint256', name: 'amount' }],
Expand All @@ -180,7 +180,7 @@ const steps = [
type: 'custom',
},
{
contractId: `goerli-${ERC20Token}`,
contractId: `sepolia-${ERC20Token}`,
targetFunction: {
name: 'transfer',
inputs: [
Expand All @@ -192,7 +192,7 @@ const steps = [
type: 'custom',
},
{
contractId: `goerli-${RolesContract}`,
contractId: `sepolia-${RolesContract}`,
metadata: {
action: 'grantRole',
role: '0x0000000000000000000000000000000000000000000000000000000000000000',
Expand All @@ -219,7 +219,7 @@ await client.createProposal({
To use a relayer as an execution strategy you need to provide the `relayerId` as well as setting `via` to the relayer address and `viaType: 'Relayer'`

```js
const contract = { network: 'goerli', address: '0xC73dAd1D9a356Ab2F3c6bC0049034aFe4B59DbB5' };
const contract = { network: 'sepolia', address: '0xC73dAd1D9a356Ab2F3c6bC0049034aFe4B59DbB5' };

const proposal = await client.proposePause(
{
Expand Down Expand Up @@ -313,7 +313,7 @@ If you create a new proposal for a Contract that has not yet been added to Defen

```js
const contract = {
network: 'goerli',
network: 'sepolia',
address: '0x28a8746e75304c0780E011BEd21C72cD78cd535E',
name: 'My contract', // Name of the contract if it is created along with this proposal
abi: '[...]', // ABI to set for this contract if it is created
Expand All @@ -325,7 +325,7 @@ Alternatively, you can add any contract explicitly by using the `addContract` me

```js
await client.addContract({
network: 'goerli',
network: 'sepolia',
address: '0x28a8746e75304c0780E011BEd21C72cD78cd535E',
name: 'My contract',
abi: '[...]',
Expand Down
4 changes: 2 additions & 2 deletions packages/base/src/utils/network.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { fromChainId, isValidNetwork, Network, toChainId } from './network';

describe('utils/network', () => {
describe('fromChainId', () => {
test('valid chainId', () => expect(fromChainId(5)).toEqual('goerli'));
test('valid chainId', () => expect(fromChainId(11155111)).toEqual('sepolia'));
test('invalid chainId', () => expect(fromChainId(99)).toBeUndefined());
});

describe('toChainId', () => {
test('valid network', () => expect(toChainId('goerli')).toEqual(5));
test('valid network', () => expect(toChainId('sepolia')).toEqual(11155111));
test('invalid network', () => expect(toChainId('invalid' as Network)).toBeUndefined());
});

Expand Down
15 changes: 0 additions & 15 deletions packages/base/src/utils/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { findKey } from 'lodash';
type PublicNetwork =
| 'mainnet'
| 'sepolia'
| 'goerli'
| 'xdai'
| 'sokol'
| 'fuse'
Expand All @@ -19,11 +18,9 @@ type PublicNetwork =
| 'avalanche'
| 'fuji'
| 'optimism'
| 'optimism-goerli'
| 'optimism-sepolia'
| 'arbitrum'
| 'arbitrum-nova'
| 'arbitrum-goerli'
| 'arbitrum-sepolia'
| 'celo'
| 'alfajores'
Expand All @@ -34,10 +31,8 @@ type PublicNetwork =
| 'hedera'
| 'hederatest'
| 'zksync'
| 'zksync-goerli'
| 'zksync-sepolia'
| 'base'
| 'base-goerli'
| 'base-sepolia'
| 'linea'
| 'linea-goerli'
Expand All @@ -54,7 +49,6 @@ export type Network = PublicNetwork | CustomNetwork;
export const Networks: Network[] = [
'mainnet',
'sepolia',
'goerli',
'xdai',
'sokol',
'fuse',
Expand All @@ -70,11 +64,9 @@ export const Networks: Network[] = [
'avalanche',
'fuji',
'optimism',
'optimism-goerli',
'optimism-sepolia',
'arbitrum',
'arbitrum-nova',
'arbitrum-goerli',
'arbitrum-sepolia',
'celo',
'alfajores',
Expand All @@ -85,10 +77,8 @@ export const Networks: Network[] = [
'hedera',
'hederatest',
'zksync',
'zksync-goerli',
'zksync-sepolia',
'base',
'base-goerli',
'base-sepolia',
'linea',
'linea-goerli',
Expand All @@ -115,7 +105,6 @@ export function toChainId(network: Network): number | undefined {
const chainIds: { [key in Network]: number } = {
'mainnet': 1,
'sepolia': 11155111,
'goerli': 5,
'xdai': 100,
'sokol': 77,
'fuse': 122,
Expand All @@ -131,11 +120,9 @@ const chainIds: { [key in Network]: number } = {
'avalanche': 0xa86a,
'fuji': 0xa869,
'optimism': 10,
'optimism-goerli': 420,
'optimism-sepolia': 11155420,
'arbitrum': 42161,
'arbitrum-nova': 42170,
'arbitrum-goerli': 421613,
'arbitrum-sepolia': 421614,
'celo': 42220,
'alfajores': 44787,
Expand All @@ -146,10 +133,8 @@ const chainIds: { [key in Network]: number } = {
'hedera': 295,
'hederatest': 296,
'zksync': 324,
'zksync-goerli': 280,
'zksync-sepolia': 300,
'base': 8453,
'base-goerli': 84531,
'base-sepolia': 84532,
'linea': 59144,
'linea-goerli': 59140,
Expand Down
2 changes: 1 addition & 1 deletion packages/deploy/src/api/block-explorer-api-key.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('Block Explorer Api Key Client', () => {

const createPaylod: CreateBlockExplorerApiKeyRequest = {
key: 'random-key',
network: 'goerli',
network: 'sepolia',
};
const updatePaylod: UpdateBlockExplorerApiKeyRequest = {
key: 'random-key',
Expand Down
2 changes: 1 addition & 1 deletion packages/deploy/src/api/deployment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('Deploy Client', () => {
const deployCreatePayload: DeployContractRequest = {
contractName: 'ERC20',
contractPath: 'contracts/ERC20.sol',
network: 'goerli',
network: 'sepolia',
artifactUri: 'url',
verifySourceCode: true,
};
Expand Down
2 changes: 1 addition & 1 deletion packages/relay/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Create a new relayer:
```js
const requestParameters = {
name: 'MyNewRelayer',
network: 'goerli',
network: 'sepolia',
minBalance: BigInt(1e17).toString(),
policies: {
whitelistReceivers: ['0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B'],
Expand Down
2 changes: 1 addition & 1 deletion packages/relay/src/ethers/signer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe('ethers/signer', () => {
jest.resetAllMocks();

relayer.getRelayer.mockResolvedValue({
network: 'goerli',
network: 'sepolia',
address: from,
relayerId: '1',
createdAt: '',
Expand Down
2 changes: 1 addition & 1 deletion packages/relay/src/test/relayClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('RelayClient', () => {
let relayer: TestRelayClient;
const relayerId = '1';
const mockRelayerResponse: RelayerGetResponse = {
network: 'goerli',
network: 'sepolia',
address: '0x0',
relayerId: relayerId,
createdAt: '',
Expand Down
Loading

0 comments on commit cd7d7cf

Please sign in to comment.