Skip to content

Commit

Permalink
Indent all things (#44)
Browse files Browse the repository at this point in the history
* Indent all things

* Add and configure prettier with toml plugin

* Apply prettier

* Add Lint action
  • Loading branch information
noisekit authored Sep 8, 2023
1 parent 9bb191e commit d0f30ff
Show file tree
Hide file tree
Showing 70 changed files with 3,275 additions and 700 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Lint

on:
pull_request: {}
push:
branches:
- "test"

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Install Foundry (Cannon)
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- run: anvil -V
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18"
cache: "yarn"
- run: yarn --version
- run: yarn install --immutable
- run: yarn dedupe --check
- run: yarn pretty:check
14 changes: 13 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
.DS_Store
.DS_Store
.vscode
.idea
*.log

# Yarn v3
.yarn/*
.yarn/cache
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
.yarn/versions
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.yarn/
.idea/
26 changes: 26 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"printWidth": 100,
"useTabs": false,
"overrides": [
{
"files": "*.toml",
"options": {
"plugins": ["prettier-plugin-toml"],
"tabWidth": 4,
"useTabs": false,
"singleQuote": false,
"bracketSpacing": false
}
},
{
"files": ["*.js", "*.ts", "*.md"],
"options": {
"tabWidth": 2,
"semi": true,
"singleQuote": true,
"bracketSpacing": true,
"trailingComma": "es5"
}
}
]
}
541 changes: 541 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Large diffs are not rendered by default.

874 changes: 874 additions & 0 deletions .yarn/releases/yarn-3.6.3.cjs

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
nodeLinker: node-modules

npmRegistryServer: "https://registry.npmjs.org"

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"

supportedArchitectures:
cpu:
- x64
- arm64
libc:
- glibc
- musl
os:
- darwin
- linux

yarnPath: .yarn/releases/yarn-3.6.3.cjs
1 change: 0 additions & 1 deletion omnibus-arbitrum-goerli.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ defaultValue = "1"
defaultValue = "0x48914229deDd5A9922f44441ffCCfC2Cb7856Ee9"

# Chainlink Configuration

[setting.ccip_router]
defaultValue = "0x88e492127709447a5abefdab8788a15b4567589e"

Expand Down
53 changes: 27 additions & 26 deletions omnibus-base-goerli-competition.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,36 @@ include = [
"tomls/core.toml",
"tomls/permissions.toml",
"tomls/collaterals/weth.toml",
"tomls/collaterals/wbtc.toml",
"tomls/collaterals/op.toml",
"tomls/collaterals/wbtc.toml",
"tomls/collaterals/op.toml",
"tomls/pools/spartan-council.toml",
"tomls/pools/passive-snx.toml",
"tomls/permit-all-createPool.toml",
"tomls/permit-all-registerMarket.toml",
"tomls/permit-all-transferCrossChain.toml",
"tomls/markets/spot/eth.toml",
"tomls/markets/spot/btc.toml",
"tomls/markets/spot/snx.toml",
"tomls/markets/spot/link.toml",
"tomls/markets/spot/op.toml",
"tomls/markets/perps/eth.toml",
"tomls/markets/perps/btc.toml",
"tomls/markets/perps/snx.toml",
"tomls/markets/perps/link.toml",
"tomls/markets/perps/op.toml",

# overrides for the oracles (will replace imports from above modules to use pyth instead of chainlink)
"tomls/oracles/pyth-eth.toml",
"tomls/oracles/pyth-btc.toml",
"tomls/oracles/pyth-snx.toml",
"tomls/oracles/pyth-link.toml",
"tomls/oracles/pyth-op.toml",

"tomls/markets/spot/eth.toml",
"tomls/markets/spot/btc.toml",
"tomls/markets/spot/snx.toml",
"tomls/markets/spot/link.toml",
"tomls/markets/spot/op.toml",
"tomls/markets/perps/eth.toml",
"tomls/markets/perps/btc.toml",
"tomls/markets/perps/snx.toml",
"tomls/markets/perps/link.toml",
"tomls/markets/perps/op.toml",
# overrides for the oracles (will replace imports from above modules to use pyth instead of chainlink)
"tomls/oracles/pyth-eth.toml",
"tomls/oracles/pyth-btc.toml",
"tomls/oracles/pyth-snx.toml",
"tomls/oracles/pyth-link.toml",
"tomls/oracles/pyth-op.toml",
# overrides for perp markets
"tomls/omnibus-base-goerli-competition/perps/global.toml",
"tomls/omnibus-base-goerli-competition/perps/btc.toml",
"tomls/omnibus-base-goerli-competition/perps/eth.toml",
"tomls/omnibus-base-goerli-competition/perps/op.toml",
"tomls/omnibus-base-goerli-competition/perps/link.toml",
"tomls/omnibus-base-goerli-competition/perps/snx.toml",

# overrides for synth markets
"tomls/omnibus-base-goerli-competition/synths/btc.toml",
"tomls/omnibus-base-goerli-competition/synths/eth.toml",
Expand Down Expand Up @@ -119,11 +116,8 @@ defaultValue = "0x48914229deDd5A9922f44441ffCCfC2Cb7856Ee9"
[invoke.addMulticallThroughToPyth]
target = ["system.CoreProxy", "perpsFactory.PerpsMarketProxy", "spotFactory.SpotMarketProxy"]
fromCall.func = "owner"

func = "setAllowlistedMulticallTarget"

args = ["<%= settings.eth_aggregator_address %>", true]

depends = ["provision.perpsFactory"]

[invoke.setScPoolConfig]
Expand All @@ -142,5 +136,12 @@ args = [
{ marketId = "<%= imports.perpsFactory.extras.superMarketId %>", weightD18 = 1, maxDebtShareValueD18 = "<%= parseEther('1') %>" }
],
]

depends=["invoke.createScPool", "invoke.createEthSynth", "invoke.createBtcSynth", "invoke.createSnxSynth", "invoke.createLinkSynth", "invoke.createOpSynth", "provision.perpsFactory"]
depends = [
"invoke.createScPool",
"invoke.createEthSynth",
"invoke.createBtcSynth",
"invoke.createSnxSynth",
"invoke.createLinkSynth",
"invoke.createOpSynth",
"provision.perpsFactory"
]
2 changes: 1 addition & 1 deletion omnibus-base-goerli.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@ args = [
{ marketId = "<%= extras.synth_eth_market_id %>", weightD18 = 1, maxDebtShareValueD18 = "<%= parseEther('1') %>" }
],
]
depends=["invoke.createScPool", "invoke.createEthSynth"]
depends = ["invoke.createScPool", "invoke.createEthSynth"]
2 changes: 1 addition & 1 deletion omnibus-goerli.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ defaultValue = "0x48914229deDd5A9922f44441ffCCfC2Cb7856Ee9"
defaultValue = "0x48914229deDd5A9922f44441ffCCfC2Cb7856Ee9"

[setting.ccip_token_pool]
defaultValue = "0x48914229deDd5A9922f44441ffCCfC2Cb7856Ee9"
defaultValue = "0x48914229deDd5A9922f44441ffCCfC2Cb7856Ee9"
33 changes: 13 additions & 20 deletions omnibus-optimism-goerli.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,29 @@ include = [
"tomls/settings-testnet.toml",
"tomls/core.toml",
"tomls/permissions.toml",

"tomls/collaterals/snx.toml",
"tomls/collaterals/weth.toml",

"tomls/pools/spartan-council.toml",
"tomls/pools/passive-snx.toml",

"tomls/permit-all-createPool.toml",
"tomls/permit-all-registerMarket.toml",
"tomls/permit-all-perps-createAccount.toml",
"tomls/permit-all-transferCrossChain.toml",

"tomls/markets/spot/eth.toml",
"tomls/markets/spot/btc.toml",
"tomls/markets/spot/link.toml",

"tomls/markets/perps/eth.toml",
"tomls/markets/perps/btc.toml",

# overrides for the oracles (will replace imports from above modules to use pyth instead of chainlink)
# "tomls/oracles/pyth-eth.toml",
# "tomls/oracles/pyth-btc.toml",
# "tomls/oracles/pyth-snx.toml",
# "tomls/oracles/pyth-link.toml",
# "tomls/oracles/pyth-op.toml",

# overrides for the oracles (will replace imports from above modules to use pyth instead of chainlink)
# "tomls/oracles/pyth-eth.toml",
# "tomls/oracles/pyth-btc.toml",
# "tomls/oracles/pyth-snx.toml",
# "tomls/oracles/pyth-link.toml",
# "tomls/oracles/pyth-op.toml",
# overrides for perp markets
"tomls/omnibus-optimism-goerli/perps/global.toml",
"tomls/omnibus-optimism-goerli/perps/btc.toml",
"tomls/omnibus-optimism-goerli/perps/eth.toml",

# overrides for synth markets
"tomls/omnibus-optimism-goerli/synths/btc.toml",
"tomls/omnibus-optimism-goerli/synths/eth.toml",
Expand Down Expand Up @@ -110,13 +102,9 @@ defaultValue = "0xd23c2ef3a533040b57cadaf33ccb111edbaca018"

# Note: this is now added to the event but because the synth is already created
# we need to manually set it here


# ETH Synth Configuration

# Note: this is now added to the event but because the synth is already created
# we need to manually set it here

# Pyth settlement strategy config
[setting.pythFeedUrl]
defaultValue = "https://api.synthetix.io/pyth-testnet/api/get_vaa_ccip?data={data}"
Expand All @@ -138,5 +126,10 @@ args = [
{ marketId = "<%= imports.perpsFactory.extras.superMarketId %>", weightD18 = 1, maxDebtShareValueD18 = "<%= parseEther('1') %>" }
],
]

depends=["invoke.createScPool", "invoke.createEthSynth", "invoke.createBtcSynth", "invoke.createLinkSynth", "provision.perpsFactory"]
depends = [
"invoke.createScPool",
"invoke.createEthSynth",
"invoke.createBtcSynth",
"invoke.createLinkSynth",
"provision.perpsFactory"
]
5 changes: 2 additions & 3 deletions omnibus-optimism-mainnet.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ include = [
"tomls/core.toml",
"tomls/permissions.toml",
"tomls/collaterals/snx.toml",
# eth collateral is not enabled/set up on v3
# eth collateral is not enabled/set up on v3
#"tomls/collaterals/weth.toml",
"tomls/pools/spartan-council.toml",
"tomls/pools/passive-snx.toml",
Expand Down Expand Up @@ -69,7 +69,6 @@ defaultValue = "0x261c05167db67B2b619f9d312e0753f3721ad6E8"
defaultValue = "0xe470A3068302CF045Eec3B800dDBFf42B42e18D8"

# ETH Synth Configuration

[setting.synthEthAsyncFixedFee]
defaultValue = "0.001"

Expand Down Expand Up @@ -112,4 +111,4 @@ args = [
{ marketId = "<%= extras.synth_eth_market_id %>", weightD18 = 1, maxDebtShareValueD18 = "<%= parseEther('1') %>" }
],
]
depends=["invoke.createScPool", "invoke.createEthSynth"]
depends = ["invoke.createScPool", "invoke.createEthSynth"]
1 change: 0 additions & 1 deletion omnibus-polygon-mumbai.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ defaultValue = "1"
defaultValue = "0x48914229deDd5A9922f44441ffCCfC2Cb7856Ee9"

# Chainlink Configuration

[setting.ccip_router]
defaultValue = "0x70499c328e1e2a3c41108bd3730f6670a44595d1"

Expand Down
2 changes: 1 addition & 1 deletion omnibus-sepolia.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ defaultValue = "0x48914229deDd5A9922f44441ffCCfC2Cb7856Ee9"
defaultValue = "0xd0daae2231e9cb96b94c8512223533293c3693bf"

[setting.ccip_token_pool]
defaultValue = "0x9b65749b38278060c5787cce0391ac7f1094c8e8"
defaultValue = "0x9b65749b38278060c5787cce0391ac7f1094c8e8"
19 changes: 19 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "synthetix-deployments",
"version": "0.0.0",
"main": "index.js",
"repository": "synthetixio/synthetix-deployments",
"author": "Synthetix",
"license": "MIT",
"private": true,
"scripts": {
"pretty": "prettier . '**/*.toml' --write",
"pretty:check": "prettier . '**/*.toml' --check"
},
"devDependencies": {
"@usecannon/cli": "^2.5.4",
"prettier": "^3.0.3",
"prettier-plugin-toml": "^1.0.0"
},
"packageManager": "[email protected]"
}
11 changes: 3 additions & 8 deletions tomls/collaterals/op.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
include = [
"../oracles/pyth-op.toml"
]
include = ["../oracles/pyth-op.toml"]

[setting.op_address]

Expand All @@ -9,9 +7,6 @@ target = ["system.CoreProxy"]
fromCall.func = "owner"
func = "configureCollateral"
args = [
{ tokenAddress = "<%= settings.op_address %>", oracleNodeId = "<%= extras.op_oracle_id %>", issuanceRatioD18 = "<%= parseEther('3') %>", liquidationRatioD18 = "<%= parseEther('1.5') %>", liquidationRewardD18 = "<%= parseEther('0.01') %>", minDelegationD18 = "<%= parseEther('0.01') %>", depositingEnabled = true }
]

depends = [
"invoke.registerOpOracleNode"
{ tokenAddress = "<%= settings.op_address %>", oracleNodeId = "<%= extras.op_oracle_id %>", issuanceRatioD18 = "<%= parseEther('3') %>", liquidationRatioD18 = "<%= parseEther('1.5') %>", liquidationRewardD18 = "<%= parseEther('0.01') %>", minDelegationD18 = "<%= parseEther('0.01') %>", depositingEnabled = true }
]
depends = ["invoke.registerOpOracleNode"]
11 changes: 3 additions & 8 deletions tomls/collaterals/snx.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
include = [
"../oracles/snx.toml"
]
include = ["../oracles/snx.toml"]

[setting.snx_address]

Expand All @@ -11,9 +9,6 @@ target = ["system.CoreProxy"]
fromCall.func = "owner"
func = "configureCollateral"
args = [
{ tokenAddress = "<%= settings.snx_address %>", oracleNodeId = "<%= extras.snx_oracle_id %>", issuanceRatioD18 = "<%= parseEther('4') %>", liquidationRatioD18 = "<%= parseEther('1.5') %>", liquidationRewardD18 = "<%= settings.snx_liquidation_reward %>", minDelegationD18 = "<%= settings.snx_liquidation_reward %>", depositingEnabled = true }
{ tokenAddress = "<%= settings.snx_address %>", oracleNodeId = "<%= extras.snx_oracle_id %>", issuanceRatioD18 = "<%= parseEther('4') %>", liquidationRatioD18 = "<%= parseEther('1.5') %>", liquidationRewardD18 = "<%= settings.snx_liquidation_reward %>", minDelegationD18 = "<%= settings.snx_liquidation_reward %>", depositingEnabled = true }
]

depends = [
"invoke.registerSnxOracleManager"
]
depends = ["invoke.registerSnxOracleManager"]
11 changes: 3 additions & 8 deletions tomls/collaterals/wbtc.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
include = [
"../oracles/btc.toml"
]
include = ["../oracles/btc.toml"]

[setting.wbtc_address]

Expand All @@ -9,9 +7,6 @@ target = ["system.CoreProxy"]
fromCall.func = "owner"
func = "configureCollateral"
args = [
{ tokenAddress = "<%= settings.wbtc_address %>", oracleNodeId = "<%= extras.btc_oracle_id %>", issuanceRatioD18 = "<%= parseEther('3') %>", liquidationRatioD18 = "<%= parseEther('1.5') %>", liquidationRewardD18 = "<%= parseEther('0.01') %>", minDelegationD18 = "<%= parseEther('0.01') %>", depositingEnabled = true }
]

depends = [
"invoke.registerBtcOracleNode"
{ tokenAddress = "<%= settings.wbtc_address %>", oracleNodeId = "<%= extras.btc_oracle_id %>", issuanceRatioD18 = "<%= parseEther('3') %>", liquidationRatioD18 = "<%= parseEther('1.5') %>", liquidationRewardD18 = "<%= parseEther('0.01') %>", minDelegationD18 = "<%= parseEther('0.01') %>", depositingEnabled = true }
]
depends = ["invoke.registerBtcOracleNode"]
Loading

0 comments on commit d0f30ff

Please sign in to comment.