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

Deploy to sepolia-ethereum #2217

Merged
merged 16 commits into from
Mar 20, 2024
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ snx.getPathToNetwork({ network: 'mainnet' });
//'.../Synthetixio/synthetix/publish/deployed/mainnet'

// retrieve an object detailing the contract ABI and bytecode
snx.getSource({ network: 'goerli', contract: 'Proxy' });
snx.getSource({ network: 'sepolia', contract: 'Proxy' });
/*
{
bytecode: '0..0',
Expand All @@ -198,20 +198,20 @@ snx.getSuspensionReasons();
*/

// retrieve the array of synths used
snx.getSynths({ network: 'goerli' }).map(({ name }) => name);
snx.getSynths({ network: 'sepolia' }).map(({ name }) => name);
// ['sUSD', 'sEUR', ...]

// retrieve an object detailing the contract deployed to the given network.
snx.getTarget({ network: 'goerli', contract: 'ProxySynthetix' });
snx.getTarget({ network: 'sepolia', contract: 'ProxySynthetix' });
/*
{
name: 'ProxySynthetix',
address: '0x322A3346bf24363f451164d96A5b5cd5A7F4c337',
source: 'Proxy',
link: 'https://goerli.etherscan.io/address/0x322A3346bf24363f451164d96A5b5cd5A7F4c337',
link: 'https://sepolia.etherscan.io/address/0x322A3346bf24363f451164d96A5b5cd5A7F4c337',
timestamp: '2019-03-06T23:05:43.914Z',
txn: '',
network: 'goerli'
network: 'sepolia'
}
*/

Expand All @@ -238,7 +238,7 @@ snx.getVersions();
{ tag: 'v2.21.12-107',
fulltag: 'v2.21.12-107',
release: 'Hadar',
network: 'goerli',
network: 'sepolia',
date: '2020-05-08T12:52:06-04:00',
commit: '19997724bc7eaceb902c523a6742e0bd74fc75cb',
contracts: { ReadProxyAddressResolver: [Object] }
Expand All @@ -247,7 +247,7 @@ snx.getVersions();
*/

snx.networks;
// [ 'local', 'goerli', 'mainnet' ]
// [ 'local', 'sepolia', 'mainnet' ]

snx.toBytes32('sUSD');
// '0x7355534400000000000000000000000000000000000000000000000000000000'
Expand Down Expand Up @@ -279,9 +279,9 @@ $ npx synthetix bytes32 sUSD
0x7355534400000000000000000000000000000000000000000000000000000000

$ npx synthetix networks
[ 'local', 'goerli', 'mainnet' ]
[ 'local', 'sepolia', 'mainnet' ]

$ npx synthetix source --network goerli --contract Proxy
$ npx synthetix source --network sepolia --contract Proxy
{
"bytecode": "0..0",
"abi": [ ... ]
Expand All @@ -290,17 +290,17 @@ $ npx synthetix source --network goerli --contract Proxy
$ npx synthetix suspension-reason --code 2
Market Closure

$ npx synthetix synths --network goerli --key name
$ npx synthetix synths --network sepolia --key name
["sUSD", "sEUR", ... ]

$ npx synthetix target --network goerli --contract ProxySynthetix
$ npx synthetix target --network sepolia --contract ProxySynthetix
{
"name": "ProxySynthetix",
"address": "0x322A3346bf24363f451164d96A5b5cd5A7F4c337",
"source": "Proxy",
"link": "https://goerli.etherscan.io/address/0x322A3346bf24363f451164d96A5b5cd5A7F4c337",
"link": "https://sepolia.etherscan.io/address/0x322A3346bf24363f451164d96A5b5cd5A7F4c337",
"timestamp": "2019-03-06T23:05:43.914Z",
"network": "goerli"
"network": "sepolia"
}

$ npx synthetix users --network mainnet --user oracle
Expand Down
2 changes: 1 addition & 1 deletion cannonfile.release.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ version = "<%= package.version %>"
# overrides the deployed contracts used by the deployer
# not to be confused with the cannon network
[setting.network]
defaultValue = "goerli"
defaultValue = "sepolia"

[run.synthetix]
exec = "./publish/cannon.js"
Expand Down
20 changes: 6 additions & 14 deletions hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,26 +76,18 @@ module.exports = {
chainId: 10,
accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : [],
},
goerli: {
url: process.env.PROVIDER_URL?.replace('network', 'goerli') || 'http://localhost:8545',
chainId: 5,
accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : [],
},
'goerli-ovm': {
url: process.env.OVM_GOERLI_PROVIDER_URL || 'https://goerli.optimism.io/',
chainId: 420,
sepolia: {
url:
process.env.PROVIDER_URL?.replace('network', 'sepolia') ||
'https://ethereum-sepolia-rpc.publicnode.com',
chainId: 11155111,
accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : [],
},
'sepolia-ovm': {
url: process.env.OVM_SEPOLIA_PROVIDER_URL || 'https://sepolia.optimism.io/',
chainId: 11155420,
accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : [],
},
rinkeby: {
url: process.env.PROVIDER_URL?.replace('network', 'rinkeby') || '',
chainId: 4,
accounts: process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : [],
},
local: {
chainId: 31337,
url: 'http://localhost:8545/',
Expand All @@ -118,7 +110,7 @@ module.exports = {
},
etherscan: {
apiKey: {
goerli: process.env.ETHERSCAN_KEY,
sepolia: process.env.ETHERSCAN_KEY,
},
},
cannon: {
Expand Down
25 changes: 6 additions & 19 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ const abiDecoder = require('abi-decoder');
// load the data in explicitly (not programmatically) so webpack knows what to bundle
const data = {
mainnet: require('./publish/deployed/mainnet'),
goerli: require('./publish/deployed/goerli'),
'goerli-ovm': require('./publish/deployed/goerli-ovm'),
sepolia: require('./publish/deployed/sepolia'),
'sepolia-ovm': require('./publish/deployed/sepolia-ovm'),
'local-ovm': require('./publish/deployed/local-ovm'),
'mainnet-ovm': require('./publish/deployed/mainnet-ovm'),
Expand All @@ -17,15 +16,12 @@ const assets = require('./publish/assets.json');
const nonUpgradeable = require('./publish/non-upgradeable.json');
const releases = require('./publish/releases.json');

const networks = ['local', 'mainnet', 'goerli', 'sepolia'];
const networks = ['local', 'mainnet', 'sepolia'];

const chainIdMapping = Object.entries({
1: {
network: 'mainnet',
},
5: {
network: 'goerli',
},
// Hardhat fork of mainnet: https://hardhat.org/config/#hardhat-network
31337: {
network: 'mainnet',
Expand All @@ -36,9 +32,8 @@ const chainIdMapping = Object.entries({
network: 'mainnet',
useOvm: true,
},
420: {
network: 'goerli',
useOvm: true,
11155111: {
network: 'sepolia',
},
11155420: {
network: 'sepolia',
Expand Down Expand Up @@ -163,20 +158,16 @@ const defaults = {

RENBTC_ERC20_ADDRESSES: {
mainnet: '0xEB4C2781e4ebA804CE9a9803C67d0893436bB27D',
goerli: '0x9B2fE385cEDea62D839E4dE89B0A23EF4eacC717',
// Adding zero addresses here - we don't actually support renBTC anymore.
'mainnet-ovm': '0x0000000000000000000000000000000000000000',
sepolia: '0x0000000000000000000000000000000000000000',
'sepolia-ovm': '0x0000000000000000000000000000000000000000',
// TODO: get actual goerli address
},
WETH_ERC20_ADDRESSES: {
mainnet: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
goerli: '0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6',
sepolia: '0x7b79995e5f793A07Bc00c21412e50Ecae098E7f9',
'mainnet-ovm': '0x4200000000000000000000000000000000000006',
'goerli-ovm': '0x4200000000000000000000000000000000000006',
'sepolia-ovm': '0x4200000000000000000000000000000000000006',
// TODO: get actual goerli-ovm address
},
INITIAL_ISSUANCE: w3utils.toWei(`${100e6}`),
CROSS_DOMAIN_DEPOSIT_GAS_LIMIT: `${3e6}`,
Expand Down Expand Up @@ -734,11 +725,7 @@ const getUsers = ({ network = 'mainnet', user, useOvm = false } = {}) => {
owner: '0x6d4a64C57612841c2C6745dB2a4E4db34F002D20',
deployer: '0xEde8a407913A874Dd7e3d5B731AFcA135D30375E',
}),
goerli: Object.assign({}, base, {
owner: '0x48914229deDd5A9922f44441ffCCfC2Cb7856Ee9',
deployer: '0x48914229deDd5A9922f44441ffCCfC2Cb7856Ee9',
}),
'goerli-ovm': Object.assign({}, base, {
sepolia: Object.assign({}, base, {
owner: '0x48914229deDd5A9922f44441ffCCfC2Cb7856Ee9',
deployer: '0x48914229deDd5A9922f44441ffCCfC2Cb7856Ee9',
}),
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "synthetix",
"version": "2.100.0",
"version": "2.100.1-alpha",
"license": "MIT",
"author": "Synthetix",
"description": "The smart contracts which make up the Synthetix system. (synthetix.io)",
Expand Down Expand Up @@ -54,8 +54,7 @@
"publish/*.json",
"publish/deployed/mainnet/*",
"publish/deployed/mainnet-ovm/*",
"publish/deployed/goerli/*",
"publish/deployed/goerli-ovm/*",
"publish/deployed/sepolia/*",
"publish/deployed/sepolia-ovm/*",
"publish/deployed/local-ovm/*"
],
Expand Down
30 changes: 15 additions & 15 deletions publish/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ node publish deploy # "--help" for options
- `-a, --add-new-synths` Whether or not any new synths in the synths.json file should be deployed if there is no entry in the config file.
- `-b, --build-path [value]` Path for built files to go. (default of `./build` - relative to the root of this repo). The folders `compiled` and `flattened` will be made under this path and the respective files will go in there.
- `-c, --contract-deployment-gas-limit <value>` Contract deployment gas limit (default: 7000000 (7m))
- `-d, --deployment-path <value>` Path to a folder that has your input configuration file (`config.json`), the synths list (`synths.json`) and where your `deployment.json` file will be written (and read from if it currently exists). The `config.json` should be in the following format ([here's an example](deployed/goerli/config.json)):
- `-d, --deployment-path <value>` Path to a folder that has your input configuration file (`config.json`), the synths list (`synths.json`) and where your `deployment.json` file will be written (and read from if it currently exists). The `config.json` should be in the following format ([here's an example](deployed/sepolia/config.json)):

```javascript
// config.json
Expand All @@ -46,7 +46,7 @@ node publish deploy # "--help" for options

- `-g, --gas-price <value>` Gas price in GWEI (default: "1")
- `-m, --method-call-gas-limit <value>` Method call gas limit (default: 150000)
- `-n, --network <value>` The network to run off. Either mainnet or goerli. (default: "goerli")
- `-n, --network <value>` The network to run off. Either mainnet or sepolia. (default: "sepolia")
- `-o, --oracle <value>` The address of the oracle to use. (default: `0xac1e8b385230970319906c03a1d8567e3996d1d5` - used for all testnets)
- `-f, --fee-auth <value>` The address of the fee Authority to use for feePool. (default:
`0xfee056f4d9d63a63d6cf16707d49ffae7ff3ff01` - used for all testnets)
Expand All @@ -55,8 +55,8 @@ node publish deploy # "--help" for options
### Examples

```bash
# deploy to goerli with 20 gwei gas
node publish deploy -n goerli -d publish/deployed/goerli -g 20
# deploy to sepolia with 20 gwei gas
node publish deploy -n sepolia -d publish/deployed/sepolia -g 20
node publish deploy -n local -d publish/deployed/local -g 8
```

Expand All @@ -74,8 +74,8 @@ node publish verify # "--help" for options
### Examples

```bash
# verify on goerli.etherscan
node publish verify -n goerli -d publish/deployed/goerli
# verify on sepolia.etherscan
node publish verify -n sepolia -d publish/deployed/sepolia
```

## 4. Nominate New Owner
Expand All @@ -89,8 +89,8 @@ node publish nominate # "--help" for options
### Example

```bash
node publish nominate -n goerli -d publish/deployed/goerli -g 3 -c Synthetix -c ProxysUSD -o 0x0000000000000000000000000000000000000000
node publish nominate -o 0xB64fF7a4a33Acdf48d97dab0D764afD0F6176882 -n goerli -c ProxysUSD -d publish/deployed/goerli -g 20
node publish nominate -n sepolia -d publish/deployed/sepolia -g 3 -c Synthetix -c ProxysUSD -o 0x0000000000000000000000000000000000000000
node publish nominate -o 0xB64fF7a4a33Acdf48d97dab0D764afD0F6176882 -n sepolia -c ProxysUSD -d publish/deployed/sepolia -g 20
```

## 5. Owner Actions
Expand All @@ -112,7 +112,7 @@ node publish remove-synths # "--help" for options
### Example

```bash
node publish remove-synths -n goerli -d publish/deployed/goerli -g 3 -s sRUB -s sETH
node publish remove-synths -n sepolia -d publish/deployed/sepolia -g 3 -s sRUB -s sETH
```

## 7. Replace Synths
Expand Down Expand Up @@ -150,7 +150,7 @@ node publish deploy-staking-rewards # "--help" for options
### Examples

```bash
node publish deploy-staking-rewards -n goerli -d publish/deployed/goerli -t sBTC --dry-run
node publish deploy-staking-rewards -n sepolia -d publish/deployed/sepolia -t sBTC --dry-run
node publish deploy-staking-rewards -n local -d publish/deployed/local

```
Expand All @@ -165,10 +165,10 @@ node publish release --version 2.22.0 --branch master --release Altair

For `synthetix` repo, we are using the following branch mapping:

- `alpha` is `GOERLI`
- `alpha` is `sepolia`
- `master` is `MAINNET`

PRs should start being merged into `develop` then deployed onto `GOERLI`, then merged into `staging` once deployed for releasing onto `goerli` for staging into a `mainnet` release. These can be done multiple times for each branch, as long as we keep these up to date.
PRs should start being merged into `develop` then deployed onto `sepolia`, then merged into `staging` once deployed for releasing onto `sepolia` for staging into a `mainnet` release. These can be done multiple times for each branch, as long as we keep these up to date.

### Versioning

Expand All @@ -178,12 +178,12 @@ Using semantic versioning ([semver](https://semver.org/)): `v[MAJOR].[MINOR].[PA
- `MINOR` are any changes to the underlying Solidity contracts
- `PATCH` are for any JavaScript or deployed contract JSON changes
- `ADDITIONAL` are for testnet deployments
- `-alpha` is for `Goerli`
- `-alpha` is for `sepolia`

### Examples

- Say `v3.1.8` is a mainnet release
- `v3.1.9-alpha` is a Goerli deployment of new synths (no contract changes)
- `v3.1.9-alpha` is a sepolia deployment of new synths (no contract changes)
- `v3.1.9` is the mainnet release with all environments

### Example
Expand All @@ -209,7 +209,7 @@ node publish release --version 2.22.0 --branch master --release Altair
## How and when to update in PRs

- Any PRs that involve a SIP must always add an entry to `sips` list.
- However they should never allocate a SIP to a release (in `releases` list) - this is done once we are ready to promote a release to Goerli (and thus staging), this way, your PRs are disconnected from releases as they should be.
- However they should never allocate a SIP to a release (in `releases` list) - this is done once we are ready to promote a release to sepolia (and thus staging), this way, your PRs are disconnected from releases as they should be.

## Testing

Expand Down
Loading
Loading