Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
373 commits
Select commit Hold shift + click to select a range
04805b9
Futures closure fee (#1417)
zyzek Jul 22, 2021
d33f9b2
kovan-ovm-futures (refactored) (#1400)
liamzebedee Jul 23, 2021
996da91
Add confirmation and liquidation booleans to futures position data. (…
zyzek Jul 26, 2021
7b8e067
add missing chainlink feeds to kovan-ovm-futures
liamzebedee Jul 27, 2021
0f157d1
re-run deployment with correct network set
liamzebedee Jul 27, 2021
31814f1
Add global futures settings to data contract. (#1431)
zyzek Jul 28, 2021
e6daf35
Futures markets respect fee reclamation. (#1436)
zyzek Jul 29, 2021
9869a0c
Fix merge history for futures-implementation (#1445)
liamzebedee Aug 6, 2021
0805799
Merge commit 'fa291a7' into futures-implementation
liamzebedee Aug 6, 2021
a4d63d7
Futures order slippage (#1446)
liamzebedee Aug 12, 2021
82657a4
canConfirmOrder respects max market size constraints + error manageme…
zyzek Aug 13, 2021
8c43683
Futures: Market deployment and management scripts (#1440)
liamzebedee Aug 16, 2021
bcfb93a
Richer Futures position and margin events (#1456)
zyzek Aug 16, 2021
9746450
Futures documentation (#1460)
zyzek Aug 16, 2021
61678c5
Dead code cleanup. (#1462)
zyzek Aug 18, 2021
dcc3341
Position ID, PositionOpened, PositionClosed added (#1461)
0xclem Aug 18, 2021
dad617c
Futures spot trades (#1477)
zyzek Aug 25, 2021
2779e8b
Futures position details (#1479)
liamzebedee Aug 29, 2021
3fe88a0
Futures accessible margin (#1484)
zyzek Aug 30, 2021
6c60813
emit sizeDelta with PositionModified event (#1485)
liamzebedee Aug 31, 2021
2ffa1be
Deploy kovan-ovm-futures v0.4.0 (Alpha) (#1487)
liamzebedee Aug 31, 2021
b4a1636
Fix futures position id management + tests. (#1492)
zyzek Sep 5, 2021
c53070d
fix slither crashing in CI and local (#1519)
artdgn Sep 23, 2021
333b07b
Adding gnosis safe multisend functionality to owner (#1513)
Sep 24, 2021
bbbb0c3
SIP-135 Cleanup (#1522)
barrasso Sep 24, 2021
98e46fa
Prepping for the Sargas (2.50) release to OVM (#1526)
Sep 25, 2021
9e26043
Fixing settle for ethers (#1509)
Sep 27, 2021
91ac866
Reduce gas usage for opening loans (#1529)
barrasso Sep 28, 2021
aad6caf
Print deploy param object value (#1534)
barrasso Sep 28, 2021
5e48e5a
add slither code check github integration (#1523)
artdgn Sep 30, 2021
645a49c
Refactor exceedsDebtLimit check (#1539)
barrasso Sep 30, 2021
744265a
Removing unneeded kovan contracts (#1538)
Oct 1, 2021
07c85e5
ci: lavamoat integration (#1517)
drptbl Oct 3, 2021
f84eca5
CI: add codeql (#1544)
drptbl Oct 4, 2021
9a8384a
Adds block tag parameter to interact task (#1528) (#1536)
Oct 4, 2021
294f325
ci: slither github actions improvements (#1543)
drptbl Oct 4, 2021
963f266
Removing integrationProxy from Proxyable (#1521)
Oct 5, 2021
52295d2
up maxMarketValue
liamzebedee Oct 6, 2021
eb88a85
Fix prepare deploy (#1548)
barrasso Oct 6, 2021
28b6f95
Document debt cache (#1533)
liamzebedee Oct 7, 2021
b36a057
Updating packages for audits and temporarily disabling the audit chec…
jjgonecrypto Oct 7, 2021
d89d767
redeploy again
liamzebedee Oct 8, 2021
fded644
ci: fail audit on critical severity (#1557)
drptbl Oct 12, 2021
0f9fcc0
ci: update docker containers to node@14.18 (#1558)
drptbl Oct 12, 2021
ce6d79d
Merge branch 'master' into develop
jjgonecrypto Oct 12, 2021
5529545
Futures: merge develop (#1547)
artdgn Oct 13, 2021
e84f365
Update proportional skew funding calculation to use maxMarketValue an…
jacko125 Oct 13, 2021
819b240
add verified details for some (not all) contracts
liamzebedee Oct 13, 2021
f89c50a
Merge branch 'futures-implementation' of github.com:Synthetixio/synth…
liamzebedee Oct 13, 2021
a414d11
only run if CollateralShort exists
liamzebedee Oct 14, 2021
dc6135e
* Move "sources" into "sips"
liamzebedee Oct 14, 2021
1d64411
fix: disable WETH deployment on L2
liamzebedee Oct 14, 2021
cd913dc
deploy kovan-ovm-futures v0.5.0
liamzebedee Oct 14, 2021
5f79db1
add whitelist for transfering externstateToken (#1565)
jacko125 Oct 14, 2021
f753dac
Merge branch 'futures-implementation' of github.com:Synthetixio/synth…
liamzebedee Oct 14, 2021
999c8be
prepare-deploy kovan-ovm-futures v0.5.1
liamzebedee Oct 14, 2021
f684c6f
prepare-deploy 0.5.2
liamzebedee Oct 14, 2021
fb2a960
prepare-deploy 0.5.3
liamzebedee Oct 14, 2021
3f94636
deploy 0.5.3
liamzebedee Oct 14, 2021
b82f662
revert changes
liamzebedee Oct 14, 2021
03e6d8c
Deploy kovan-ovm-futures v0.5.0 (#1566)
liamzebedee Oct 14, 2021
7e7d1f8
add missing deployments to config.json so verify picks them up
liamzebedee Oct 14, 2021
6beec5f
verified
liamzebedee Oct 14, 2021
d131f92
prepare-deploy 0.5.4
liamzebedee Oct 14, 2021
1ae1644
deploy SynthsETH and SynthsUSD
liamzebedee Oct 14, 2021
e9a9a4d
Merge branch 'futures-implementation' of github.com:Synthetixio/synth…
liamzebedee Oct 14, 2021
fabc4ed
Merge branch 'deploy-kovan-ovm-futures-v0.5.0' into futures-implement…
liamzebedee Oct 14, 2021
476c5a4
During deployment, ensure deprecated synths from Wezen have cache upd…
jjgonecrypto Oct 14, 2021
5f8c732
Update configure loans interactionDelay (#1568)
barrasso Oct 14, 2021
f1fcfcf
update deployer to support EIP-1559 (#1504)
dbeal-eth Oct 15, 2021
cae6895
futures listen to system and synth suspensions (#1530)
artdgn Oct 17, 2021
12f6419
Deploy kovan-ovm-futures v0.6.0 (#1570)
liamzebedee Oct 18, 2021
5d46eab
fix url's to etherscan
liamzebedee Oct 18, 2021
963d78d
SIP-187 fix partial synth updates and debt cache updates (#1551)
jacko125 Oct 19, 2021
916b31c
* revert max market value to higher amount
liamzebedee Oct 19, 2021
1172632
remove gasPrice overrides from simulate-deploy (#1573)
dbeal-eth Oct 19, 2021
1f0c027
Merge branch 'master' into develop
jjgonecrypto Oct 20, 2021
095d193
Exchange rates circuit breaker refactor (#1540)
artdgn Oct 25, 2021
795f1c7
SIP-182 Wrapper Factory (#1489)
dbeal-eth Oct 26, 2021
9d6ac2e
SIP-182 Audit feedback - allowance in constructor (#1584)
barrasso Oct 27, 2021
0743256
Merge branch 'master' into develop
jjgonecrypto Oct 28, 2021
94987e3
Fix param spam during deployment (#1587)
barrasso Oct 29, 2021
6a1f7ee
add missing data in position modified events (#1580)
artdgn Nov 2, 2021
defb035
add expalantion about releases.json in readme (#1569)
artdgn Nov 2, 2021
1c126e1
ci: use node 16 (LTS) (#1588)
drptbl Nov 2, 2021
913d0b3
Removing inverse synths (#1592)
jjgonecrypto Nov 3, 2021
963c7a5
Ensuring SCCP-139 feeds are persisted to future ExchangeRates contrac…
jjgonecrypto Nov 3, 2021
8defb47
Futures rename parameters (#1595)
artdgn Nov 5, 2021
e9eb1cd
Deploy kovan-ovm-futures v0.7.0 (#1589)
liamzebedee Nov 10, 2021
76d43ce
Skip shorts integration tests when cannot open loans (#1597)
jjgonecrypto Nov 10, 2021
073cb12
Add default private key for local-ovm deploys (#1455)
liamzebedee Nov 15, 2021
0cef80c
Update ops node commit to working version in `develop`
liamzebedee Nov 15, 2021
f2172c3
SIP-120: TWAP Exchange Function (#1127)
sohkai Nov 15, 2021
509688a
Adding 6 more potential releases
jjgonecrypto Nov 15, 2021
7fe8e19
Helper script to distribute SNX/sUSD to accounts on kovan-futures-ovm…
liamzebedee Nov 16, 2021
5cdbb23
Futures liquidation fee update (#1594)
artdgn Nov 16, 2021
d7b8c12
adding market debt explanation comments
artdgn Nov 17, 2021
472d20e
Merge branch 'master' into develop
jjgonecrypto Nov 17, 2021
dac3532
Fixing owner script to not submit multiple accept for dupe contracts
jjgonecrypto Nov 17, 2021
2bd3ceb
Upgrading to OVM 2.0 (or the destruction of useless code) (#1598)
jjgonecrypto Nov 18, 2021
682a2ef
Minor fixes for release history
jjgonecrypto Nov 18, 2021
9f38d1a
SIP-167 Introduces an L2 governance bridge (#1402)
eternauta1337 Nov 23, 2021
5c9b643
Removing mistake
jjgonecrypto Nov 23, 2021
fe6a61a
Merge branch 'master' into develop
jjgonecrypto Nov 23, 2021
6a5b7b2
Fixes from menkalinan (#1608)
jjgonecrypto Nov 24, 2021
ffc3d61
Update OVM bytecode (#1613)
barrasso Dec 1, 2021
69fb372
Move debt snapshot to beforeEach block (#1616)
barrasso Dec 1, 2021
1f6dd63
Fix duplicate fee reporting on WrapperFactory (#1617)
dbeal-eth Dec 3, 2021
e1cdc23
Merge branch 'master' into develop
jjgonecrypto Dec 3, 2021
437f62f
SIP-194 Fix Liquidations on L2 (#1621)
jjgonecrypto Dec 7, 2021
92fe9e7
Fix broken unit test (#1622)
jjgonecrypto Dec 8, 2021
c2481ae
Futures next price mechanism (#1609)
artdgn Dec 9, 2021
ef412c9
Futures remove closure fee and rounding (#1610)
artdgn Dec 9, 2021
767229c
reduce storage variables sizes for gas savings (#1614)
artdgn Dec 9, 2021
af2813c
Ensuring job-compile size check matches build command (#1628)
jjgonecrypto Dec 9, 2021
a82fb87
refactor views into mixin to reduce clutter (#1615)
artdgn Dec 9, 2021
d5e9d3c
rename circuit breaker contracts (#1629)
artdgn Dec 9, 2021
b898b4e
Adding exchange gas usage output
jjgonecrypto Dec 13, 2021
f734d9a
Adding gas output to synth issue, burn and claim in int tests
jjgonecrypto Dec 13, 2021
b93863a
SIP-188: Add sETHBTC synth (#1618)
barrasso Dec 13, 2021
70775ee
add tests for debt cache when markets
artdgn Dec 14, 2021
828c24e
SIP-195: L2 CollateralEth Loans (#1632)
barrasso Dec 15, 2021
4513b16
Merge branch 'master' into develop
jjgonecrypto Dec 15, 2021
60f3525
Merge branch 'develop' of github.com:Synthetixio/synthetix into futur…
jacko125 Dec 22, 2021
543bdbe
Merge branch 'futures-implementation' of github.com:Synthetixio/synth…
jacko125 Dec 22, 2021
4c981ba
Sip 196 remove internal oracle (#1636)
artdgn Dec 22, 2021
d94ea7c
Fix contracts compiling after merge
jacko125 Dec 22, 2021
80f573b
Merge branch 'develop' of github.com:Synthetixio/synthetix into futur…
jacko125 Dec 22, 2021
286a1af
Remove LimitedTransferSynth
jacko125 Dec 22, 2021
61eca39
add liquidation tests in integration (#1625)
dbeal-eth Dec 30, 2021
34f85cf
Merge branch 'develop' into futures-implementation
jacko125 Jan 9, 2022
a88b2ee
use new `hardhat-interact` package instead of builtin (#1612)
dbeal-eth Jan 10, 2022
d34061c
fix liquidations fork test fail (#1646)
dbeal-eth Jan 11, 2022
42ab876
Merge branch 'develop' of github.com:Synthetixio/synthetix into futur…
jacko125 Jan 11, 2022
2dd44f8
Merge branch 'futures-implementation' of github.com:Synthetixio/synth…
jacko125 Jan 11, 2022
54a9c52
SIP-193 Reduce size for SystemSettings (#1627)
leckylao Jan 13, 2022
3230d49
Implement interface funcs for BaseDebtCache, EmptyCollateralManager, …
jacko125 Jan 13, 2022
2d56244
Update configuration of loan and system settings (#1637)
barrasso Jan 13, 2022
ab736f0
SIP-200: Fix FeePool Rewards Distribution (#1650)
barrasso Jan 14, 2022
5a5f6f6
migration script helper allows deployment and staging of migration sc…
dbeal-eth Jan 14, 2022
92effdb
deploy futures to kovan-ovm-futures and update configuration scripts
jacko125 Jan 18, 2022
8ad2130
Merge branch 'develop' into futures-implementation
artdgn Jan 19, 2022
32693f7
fix shadowing in empty futures market
artdgn Jan 19, 2022
efc7e88
fix circuit breaker tests
artdgn Jan 19, 2022
62737a7
remove deprecated setLastExchangeRateForSynth
artdgn Jan 19, 2022
9adafe3
Merge branch 'master' into develop
jjgonecrypto Jan 19, 2022
239d5ae
update fund local accounts script
jacko125 Jan 20, 2022
d4b9809
Merge branch 'futures-implementation' of github.com:Synthetixio/synth…
jacko125 Jan 20, 2022
115cbcf
fix atomic exchange circuit breaker tests
artdgn Jan 20, 2022
25c5d18
fix market settings and manager tests
artdgn Jan 20, 2022
ccda4a7
SIP-184 Dynamic Fees (#1649)
artdgn Jan 20, 2022
7da2757
fix status script and fund local accounts
jacko125 Jan 20, 2022
0b4d8d6
Take debt snapshot before funding local accounts (#1657)
0xjocke Jan 21, 2022
0296bc4
Merge branch 'futures-implementation' of https://github.com/Synthetix…
artdgn Jan 21, 2022
d9351f0
fix aggregators usage in futures, setup fixes
artdgn Jan 21, 2022
7d1e2c3
fix futures market test setup
artdgn Jan 21, 2022
b64ab0b
fix futures market data tests
artdgn Jan 21, 2022
515338c
fix next price test setup
artdgn Jan 21, 2022
76b9529
fix system settings tests
artdgn Jan 21, 2022
63923c2
fix integration tests failing to setup markets
artdgn Jan 21, 2022
4e08eaf
fix market debt calculation during setup
artdgn Jan 21, 2022
b3012b0
Deploy SNX/ETH and sUSD/DAI staking rewards on OVM (#1653)
jacko125 Jan 21, 2022
702dc30
remove old RewardEscrow from deployment.json for ovm environments (#1…
barrasso Jan 21, 2022
6b7655e
Update kovan-ovm/feeds.json for OCR (#1659)
barrasso Jan 21, 2022
edf9d33
verify deployment
jacko125 Jan 24, 2022
7f345b2
Merge branch 'futures-implementation' of github.com:Synthetixio/synth…
jacko125 Jan 24, 2022
10743f7
fix market settings tests
artdgn Jan 25, 2022
d9d342c
fix futures market tests
artdgn Jan 25, 2022
84ab991
Update feeds.json for kovan ovm with new OCR proxies (#1664)
barrasso Jan 25, 2022
69bb32a
Optimism Forking with Hardhat (#1656)
dbeal-eth Jan 26, 2022
74e1b11
Remove legacy deployment config from kovan-ovm (#1665)
barrasso Jan 27, 2022
e6ce2b7
Upgrade Gnosis SDK (#1655)
noahlitvin Jan 27, 2022
9f38be7
SIPS 196, 193, 184 - audit fixes, full version (#1661)
artdgn Jan 27, 2022
c34927d
Futures merge 184 (#1672)
artdgn Jan 28, 2022
fb28528
Merge branch 'develop' into futures-implementation
artdgn Jan 28, 2022
038b886
Merge remote-tracking branch 'origin/develop' into futures-implementa…
artdgn Jan 28, 2022
de1f090
fix breaker merge test
artdgn Jan 28, 2022
e53c9c0
fix test lints (#1607)
dbeal-eth Jan 28, 2022
8d0f088
try fix dual itnegration tests
artdgn Jan 31, 2022
2103cd5
Merge branch 'develop' into futures-implementation
artdgn Jan 31, 2022
a265c9d
update migration script to also stage nominations (#1670)
dbeal-eth Feb 1, 2022
77780f7
Merge branch 'develop' into futures-implementation
artdgn Feb 1, 2022
64de1c2
another attempt to fix dual integration tests
artdgn Feb 1, 2022
9a4b8a7
Revert "another attempt to fix dual integration tests"
artdgn Feb 1, 2022
addfca8
Revert "try fix dual itnegration tests"
artdgn Feb 1, 2022
78c2622
Merge branch 'master' into develop
jjgonecrypto Feb 3, 2022
18af676
Removing redundant ExchangeRatesWithInversePricing
jjgonecrypto Feb 3, 2022
6038c76
Ensuring fork tests do compile (#1679)
jjgonecrypto Feb 3, 2022
73c69f4
Futures dynamic fee (#1673)
artdgn Feb 4, 2022
f15cdbc
Sip 185 debt shares (#1601)
dbeal-eth Feb 4, 2022
3cb6efb
Fix the validate deployment CI run (#1680)
jjgonecrypto Feb 4, 2022
204b13b
Removing the redundant owner param from migrations (#1681)
jjgonecrypto Feb 4, 2022
9652047
Collecting Test Metadata in CI (#1683)
noahlitvin Feb 4, 2022
74acf14
SIP-209 Update feeRateForExchange function signature (#1686)
barrasso Feb 5, 2022
d5a336a
Merge branch 'master' into develop
jjgonecrypto Feb 7, 2022
24acb9c
Updating task-node to properly manage the provider
jjgonecrypto Feb 8, 2022
6b8947e
Futures size reduction (#1682)
artdgn Feb 9, 2022
cba430d
address preliminary audit comments (#1691)
artdgn Feb 9, 2022
c3e257f
Futures pausing (#1692)
artdgn Feb 9, 2022
f88c9f3
Merge remote-tracking branch 'origin/develop' into futures-implementa…
artdgn Feb 9, 2022
3b109b4
Basic npm audit fix (#1693)
jjgonecrypto Feb 9, 2022
5e25a0b
Merge branch 'master' into develop
jjgonecrypto Feb 9, 2022
560bb84
Merge remote-tracking branch 'origin/develop' into futures-implementa…
artdgn Feb 10, 2022
86fed3d
Updating mainnet-ovm feeds to new chainlink OCR (#1645)
jjgonecrypto Feb 14, 2022
bba9562
add moar releases (#1698)
barrasso Feb 14, 2022
a52bdaa
Merge branch 'master' into develop
jjgonecrypto Feb 14, 2022
7903058
Fixing ABI anomaly for kovan-ovm for exchangeWithVirtual
jjgonecrypto Feb 16, 2022
d3025fa
Merge branch 'master' into develop
jjgonecrypto Feb 17, 2022
8998026
AIP-202 - Upgrade supply schedule to use target ratio inflation amoun…
jacko125 Feb 18, 2022
20bec5c
Merge branch 'master' into develop
jjgonecrypto Feb 19, 2022
d1ad8b4
Fixing lint
jjgonecrypto Feb 19, 2022
0fe33c3
Updating mainnet-ovm feeds to new chainlink OCR (#1645)
jjgonecrypto Feb 14, 2022
1a36106
add moar releases (#1698)
barrasso Feb 14, 2022
d0a43a6
Polaris release 2.61 to mainnet ovm (#1699)
barrasso Feb 14, 2022
9af19c8
Prepublish step
Feb 14, 2022
1ea400e
2.61.0
Feb 14, 2022
7dc18fa
Fixing ABI anomaly for kovan-ovm for exchangeWithVirtual
jjgonecrypto Feb 16, 2022
d525b6c
Fixing ABI anomaly for kovan-ovm for exchangeWithVirtual
jjgonecrypto Feb 16, 2022
d2f3a13
2.61.1
Feb 16, 2022
7f53a88
AIP-202 - Upgrade supply schedule to use target ratio inflation amoun…
jacko125 Feb 18, 2022
8e0d37a
Hamal release v2.62 mainnet (#1706)
jacko125 Feb 19, 2022
73eb472
Prepublish step
Feb 19, 2022
98cc38a
2.62.0
Feb 19, 2022
cfb30ff
Fixing lint
jjgonecrypto Feb 19, 2022
65a9c7e
Merge branch 'develop' into futures-implementation
artdgn Feb 24, 2022
7282e75
Merge branch 'master' into develop
jjgonecrypto Feb 24, 2022
456f81a
Merge branch 'develop' into futures-implementation
artdgn Feb 24, 2022
59731f0
deploy new futuresMarkets with dynamic fees to kovan-ovm-futures
jacko125 Feb 25, 2022
8f29d1e
verify
jacko125 Feb 25, 2022
2184636
add ovm etherscan key support (#1703)
dbeal-eth Feb 26, 2022
6413b66
Merge branch 'develop' into futures-implementation
artdgn Mar 1, 2022
63fa3f1
address minor audit issues
artdgn Mar 1, 2022
b41a4eb
deploy systemStatus
jacko125 Mar 2, 2022
e975d81
Merge branch 'futures-implementation' of github.com:Synthetixio/synth…
jacko125 Mar 2, 2022
8ab725f
release exchangeRates
jacko125 Mar 2, 2022
7caa059
dual integration test fix attempt
artdgn Mar 3, 2022
f665639
Futures single market pausing (#1711)
artdgn Mar 8, 2022
60fe55d
Futures support multiple markets for same asset (#1713)
artdgn Mar 9, 2022
87c7d29
Futures volume source fee methods (#1714)
artdgn Mar 9, 2022
527ef56
update releases json
artdgn Mar 9, 2022
c7157b1
revert unrelated contract changes
artdgn Mar 9, 2022
f50d15a
Merge pull request #1450 from Synthetixio/futures-implementation
jacko125 Mar 9, 2022
cac4929
fix fork tests (#1717)
artdgn Mar 9, 2022
17a48ae
Debtcache import excluded debt entries (#1716)
artdgn Mar 10, 2022
a3bc598
SIP-165 Debt Orcale (#1694)
dbeal-eth Mar 10, 2022
606dfef
diphda part 1
artdgn Mar 11, 2022
a64f0f6
diphda part 2
artdgn Mar 11, 2022
9aed56f
diphda optimism part 1
artdgn Mar 11, 2022
7da8f9d
diphda ovm part 2
artdgn Mar 11, 2022
f938cb5
Merge branch 'staging' into diphda-release-2.64
artdgn Mar 11, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ETHERSCAN_KEY=SomeEtherscanKey
OVM_ETHERSCAN_KEY=SomeEtherscanKey
PROVIDER_URL=https://network.infura.io/v3/SomeInfuraKey (runtime replaces "network")
PROVIDER_URL_MAINNET=https://mainnet.infura.io/v3/SomeInfuraKey
DEPLOY_PRIVATE_KEY=SomeEthereumPrivateKey (including 0x prefix)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ jobs:
- name: Run slither
run: slither . --sarif slither.sarif || true
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v1
uses: github/codeql-action/upload-sarif@117a67b0743599d091109168df5eb673f1641f6b # pin@codeql-bundle-20220224
with:
sarif_file: "slither.sarif"
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ jobs:
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # pin@v2

- name: Initialize CodeQL
uses: github/codeql-action/init@7112cdaa06f3b661965fe3e2e93c9acaadbe85f3 # pin@codeql-bundle-20210921
uses: github/codeql-action/init@117a67b0743599d091109168df5eb673f1641f6b # pin@codeql-bundle-20220224
with:
queries: security-and-quality
languages: javascript

- name: Autobuild
uses: github/codeql-action/autobuild@7112cdaa06f3b661965fe3e2e93c9acaadbe85f3 # pin@codeql-bundle-20210921
uses: github/codeql-action/autobuild@117a67b0743599d091109168df5eb673f1641f6b # pin@codeql-bundle-20220224

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@7112cdaa06f3b661965fe3e2e93c9acaadbe85f3 # pin@codeql-bundle-20210921
uses: github/codeql-action/analyze@117a67b0743599d091109168df5eb673f1641f6b # pin@codeql-bundle-20220224
2 changes: 1 addition & 1 deletion .github/workflows/slither-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:

- name: Upload lint results
if: always()
uses: github/codeql-action/upload-sarif@7112cdaa06f3b661965fe3e2e93c9acaadbe85f3 # pin@codeql-bundle-20210921
uses: github/codeql-action/upload-sarif@117a67b0743599d091109168df5eb673f1641f6b # pin@codeql-bundle-20220224
with:
sarif_file: slither.sarif
continue-on-error: true
73 changes: 58 additions & 15 deletions contracts/BaseDebtCache.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,8 @@ import "./interfaces/IERC20.sol";
import "./interfaces/ICollateralManager.sol";
import "./interfaces/IEtherWrapper.sol";
import "./interfaces/IWrapperFactory.sol";
import "./interfaces/IFuturesMarketManager.sol";

//
// The debt cache (SIP-91) caches the global debt and the debt of each synth in the system.
// Debt is denominated by the synth supply multiplied by its current exchange rate.
//
// The cache can be invalidated when an exchange rate changes, and thereafter must be
// updated by performing a debt snapshot, which recomputes the global debt sum using
// current synth supplies and exchange rates. This is performed usually by a snapshot keeper.
//
// Some synths are backed by non-SNX collateral, such as sETH being backed by ETH
// held in the EtherWrapper (SIP-112). This debt is called "excluded debt" and is
// excluded from the global debt in `_cachedDebt`.
//
// https://docs.synthetix.io/contracts/source/contracts/debtcache
contract BaseDebtCache is Owned, MixinSystemSettings, IDebtCache {
using SafeMath for uint;
Expand All @@ -42,6 +31,9 @@ contract BaseDebtCache is Owned, MixinSystemSettings, IDebtCache {
uint internal _cacheTimestamp;
bool internal _cacheInvalid = true;

// flag to ensure importing excluded debt is invoked only once
bool public isInitialized = false; // public to avoid needing an event

/* ========== ENCODED NAMES ========== */

bytes32 internal constant sUSD = "sUSD";
Expand All @@ -55,6 +47,7 @@ contract BaseDebtCache is Owned, MixinSystemSettings, IDebtCache {
bytes32 private constant CONTRACT_SYSTEMSTATUS = "SystemStatus";
bytes32 private constant CONTRACT_COLLATERALMANAGER = "CollateralManager";
bytes32 private constant CONTRACT_ETHER_WRAPPER = "EtherWrapper";
bytes32 private constant CONTRACT_FUTURESMARKETMANAGER = "FuturesMarketManager";
bytes32 private constant CONTRACT_WRAPPER_FACTORY = "WrapperFactory";

constructor(address _owner, address _resolver) public Owned(_owner) MixinSystemSettings(_resolver) {}
Expand All @@ -63,14 +56,15 @@ contract BaseDebtCache is Owned, MixinSystemSettings, IDebtCache {

function resolverAddressesRequired() public view returns (bytes32[] memory addresses) {
bytes32[] memory existingAddresses = MixinSystemSettings.resolverAddressesRequired();
bytes32[] memory newAddresses = new bytes32[](7);
bytes32[] memory newAddresses = new bytes32[](8);
newAddresses[0] = CONTRACT_ISSUER;
newAddresses[1] = CONTRACT_EXCHANGER;
newAddresses[2] = CONTRACT_EXRATES;
newAddresses[3] = CONTRACT_SYSTEMSTATUS;
newAddresses[4] = CONTRACT_COLLATERALMANAGER;
newAddresses[5] = CONTRACT_WRAPPER_FACTORY;
newAddresses[6] = CONTRACT_ETHER_WRAPPER;
newAddresses[7] = CONTRACT_FUTURESMARKETMANAGER;
addresses = combineArrays(existingAddresses, newAddresses);
}

Expand Down Expand Up @@ -98,6 +92,10 @@ contract BaseDebtCache is Owned, MixinSystemSettings, IDebtCache {
return IEtherWrapper(requireAndGetAddress(CONTRACT_ETHER_WRAPPER));
}

function futuresMarketManager() internal view returns (IFuturesMarketManager) {
return IFuturesMarketManager(requireAndGetAddress(CONTRACT_FUTURESMARKETMANAGER));
}

function wrapperFactory() internal view returns (IWrapperFactory) {
return IWrapperFactory(requireAndGetAddress(CONTRACT_WRAPPER_FACTORY));
}
Expand Down Expand Up @@ -157,22 +155,25 @@ contract BaseDebtCache is Owned, MixinSystemSettings, IDebtCache {
view
returns (
uint[] memory snxIssuedDebts,
uint _futuresDebt,
uint _excludedDebt,
bool anyRateIsInvalid
)
{
(uint[] memory rates, bool isInvalid) = exchangeRates().ratesAndInvalidForCurrencies(currencyKeys);
uint[] memory values = _issuedSynthValues(currencyKeys, rates);
(uint excludedDebt, bool isAnyNonSnxDebtRateInvalid) = _totalNonSnxBackedDebt(currencyKeys, rates, isInvalid);
(uint futuresDebt, bool futuresDebtIsInvalid) = futuresMarketManager().totalDebt();

return (values, excludedDebt, isAnyNonSnxDebtRateInvalid);
return (values, futuresDebt, excludedDebt, isInvalid || futuresDebtIsInvalid || isAnyNonSnxDebtRateInvalid);
}

function currentSynthDebts(bytes32[] calldata currencyKeys)
external
view
returns (
uint[] memory debtValues,
uint futuresDebt,
uint excludedDebt,
bool anyRateIsInvalid
)
Expand Down Expand Up @@ -206,6 +207,40 @@ contract BaseDebtCache is Owned, MixinSystemSettings, IDebtCache {
return _excludedIssuedDebts(currencyKeys);
}

/// used when migrating to new DebtCache instance in order to import the excluded debt records
/// If this method is not run after upgrading the contract, the debt will be
/// incorrect w.r.t to wrapper factory assets until the values are imported from
/// previous instance of the contract
/// Also, in addition to this method it's possible to use recordExcludedDebtChange since
/// it's accessible to owner in case additional adjustments are required
function importExcludedIssuedDebts(IDebtCache prevDebtCache, IIssuer prevIssuer) external onlyOwner {
// this can only be run once so that recorded debt deltas aren't accidentally
// lost or double counted
require(!isInitialized, "already initialized");
isInitialized = true;

// get the currency keys from **previous** issuer, in case current issuer
// doesn't have all the synths at this point
// warning: if a synth won't be added to the current issuer before the next upgrade of this contract,
// its entry will be lost (because it won't be in the prevIssuer for next time).
// if for some reason this is a problem, it should be possible to use recordExcludedDebtChange() to amend
bytes32[] memory keys = prevIssuer.availableCurrencyKeys();

require(keys.length > 0, "previous Issuer has no synths");

// query for previous debt records
uint[] memory debts = prevDebtCache.excludedIssuedDebts(keys);

// store the values
for (uint i = 0; i < keys.length; i++) {
if (debts[i] > 0) {
// adding the values instead of overwriting in case some deltas were recorded in this
// contract already (e.g. if the upgrade was not atomic)
_excludedIssuedDebt[keys[i]] = _excludedIssuedDebt[keys[i]].add(debts[i]);
}
}
}

// Returns the total sUSD debt backed by non-SNX collateral.
function totalNonSnxBackedDebt() external view returns (uint excludedDebt, bool isInvalid) {
bytes32[] memory currencyKeys = issuer().availableCurrencyKeys();
Expand Down Expand Up @@ -252,9 +287,15 @@ contract BaseDebtCache is Owned, MixinSystemSettings, IDebtCache {
for (uint i; i < numValues; i++) {
total = total.add(values[i]);
}

// Add in the debt accounted for by futures
(uint futuresDebt, bool futuresDebtIsInvalid) = futuresMarketManager().totalDebt();
total = total.add(futuresDebt);

// Ensure that if the excluded non-SNX debt exceeds SNX-backed debt, no overflow occurs
total = total < excludedDebt ? 0 : total.sub(excludedDebt);

return (total, isAnyNonSnxDebtRateInvalid);
return (total, isInvalid || futuresDebtIsInvalid || isAnyNonSnxDebtRateInvalid);
}

function currentDebt() external view returns (uint debt, bool anyRateIsInvalid) {
Expand Down Expand Up @@ -294,6 +335,8 @@ contract BaseDebtCache is Owned, MixinSystemSettings, IDebtCache {

function recordExcludedDebtChange(bytes32 currencyKey, int256 delta) external {}

function updateCachedsUSDDebt(int amount) external {}

/* ========== MODIFIERS ========== */

function _requireSystemActiveIfNotOwner() internal view {
Expand Down
73 changes: 73 additions & 0 deletions contracts/BaseSingleNetworkAggregator.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
pragma solidity ^0.5.16;

//import "@chainlink/contracts-0.0.10/src/v0.5/interfaces/AggregatorV2V3Interface.sol";

import "./AddressResolver.sol";
import "./interfaces/IDebtCache.sol";
import "./interfaces/ISynthetixDebtShare.sol";
import "./interfaces/AggregatorV2V3Interface.sol";

import "./SafeDecimalMath.sol";

// aggregator which reports the data from the system itself
// useful for testing
contract BaseSingleNetworkAggregator is Owned, AggregatorV2V3Interface {
using SafeDecimalMath for uint;

AddressResolver public resolver;

uint public overrideTimestamp;

constructor(AddressResolver _resolver) public Owned(msg.sender) {
resolver = _resolver;
}

function setOverrideTimestamp(uint timestamp) public onlyOwner {
overrideTimestamp = timestamp;

emit SetOverrideTimestamp(timestamp);
}

function latestRoundData()
external
view
returns (
uint80,
int256,
uint256,
uint256,
uint80
)
{
return getRoundData(uint80(latestRound()));
}

function latestRound() public view returns (uint256) {
return 1;
}

function decimals() external view returns (uint8) {
return 0;
}

function getAnswer(uint256 _roundId) external view returns (int256 answer) {
(,answer,,,) = getRoundData(uint80(_roundId));
}

function getTimestamp(uint256 _roundId) external view returns (uint256 timestamp) {
(,,timestamp,,) = getRoundData(uint80(_roundId));
}

function getRoundData(uint80)
public
view
returns (
uint80,
int256,
uint256,
uint256,
uint80
);

event SetOverrideTimestamp(uint timestamp);
}
9 changes: 8 additions & 1 deletion contracts/BaseSynthetixBridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ import "./interfaces/IBaseSynthetixBridge.sol";
// Internal references
import "./interfaces/ISynthetix.sol";
import "./interfaces/IRewardEscrowV2.sol";
import "./interfaces/IFeePool.sol";
import "@eth-optimism/contracts/iOVM/bridge/messaging/iAbs_BaseCrossDomainMessenger.sol";

contract BaseSynthetixBridge is Owned, MixinSystemSettings, IBaseSynthetixBridge {
/* ========== ADDRESS RESOLVER CONFIGURATION ========== */
bytes32 private constant CONTRACT_EXT_MESSENGER = "ext:Messenger";
bytes32 internal constant CONTRACT_SYNTHETIX = "Synthetix";
bytes32 private constant CONTRACT_REWARDESCROW = "RewardEscrowV2";
bytes32 private constant CONTRACT_FEEPOOL = "FeePool";

bool public initiationActive;

Expand All @@ -40,6 +42,10 @@ contract BaseSynthetixBridge is Owned, MixinSystemSettings, IBaseSynthetixBridge
return IRewardEscrowV2(requireAndGetAddress(CONTRACT_REWARDESCROW));
}

function feePool() internal view returns (IFeePool) {
return IFeePool(requireAndGetAddress(CONTRACT_FEEPOOL));
}

function initiatingActive() internal view {
require(initiationActive, "Initiation deactivated");
}
Expand All @@ -48,10 +54,11 @@ contract BaseSynthetixBridge is Owned, MixinSystemSettings, IBaseSynthetixBridge

function resolverAddressesRequired() public view returns (bytes32[] memory addresses) {
bytes32[] memory existingAddresses = MixinSystemSettings.resolverAddressesRequired();
bytes32[] memory newAddresses = new bytes32[](3);
bytes32[] memory newAddresses = new bytes32[](4);
newAddresses[0] = CONTRACT_EXT_MESSENGER;
newAddresses[1] = CONTRACT_SYNTHETIX;
newAddresses[2] = CONTRACT_REWARDESCROW;
newAddresses[3] = CONTRACT_FEEPOOL;
addresses = combineArrays(existingAddresses, newAddresses);
}

Expand Down
9 changes: 7 additions & 2 deletions contracts/DebtCache.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ contract DebtCache is BaseDebtCache {
constructor(address _owner, address _resolver) public BaseDebtCache(_owner, _resolver) {}

bytes32 internal constant EXCLUDED_DEBT_KEY = "EXCLUDED_DEBT";
bytes32 internal constant FUTURES_DEBT_KEY = "FUTURES_DEBT";

/* ========== MUTATIVE FUNCTIONS ========== */

Expand All @@ -26,15 +27,19 @@ contract DebtCache is BaseDebtCache {

function takeDebtSnapshot() external requireSystemActiveIfNotOwner {
bytes32[] memory currencyKeys = issuer().availableCurrencyKeys();
(uint[] memory values, uint excludedDebt, bool isInvalid) = _currentSynthDebts(currencyKeys);
(uint[] memory values, uint futuresDebt, uint excludedDebt, bool isInvalid) = _currentSynthDebts(currencyKeys);

// The total SNX-backed debt is the debt of futures markets plus the debt of circulating synths.
uint snxCollateralDebt = futuresDebt;
_cachedSynthDebt[FUTURES_DEBT_KEY] = futuresDebt;
uint numValues = values.length;
uint snxCollateralDebt;
for (uint i; i < numValues; i++) {
uint value = values[i];
snxCollateralDebt = snxCollateralDebt.add(value);
_cachedSynthDebt[currencyKeys[i]] = value;
}

// Subtract out the excluded non-SNX backed debt from our total
_cachedSynthDebt[EXCLUDED_DEBT_KEY] = excludedDebt;
uint newDebt = snxCollateralDebt.floorsub(excludedDebt);
_cachedDebt = newDebt;
Expand Down
39 changes: 39 additions & 0 deletions contracts/EmptyFuturesMarketManager.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
pragma solidity ^0.5.16;

// Empty contract for ether collateral placeholder for OVM
// https://docs.synthetix.io/contracts/source/contracts/emptyethercollateral

import "./interfaces/IFuturesMarketManager.sol";

contract EmptyFuturesMarketManager is IFuturesMarketManager {
function markets(uint index, uint pageSize) external view returns (address[] memory) {
index;
pageSize;
address[] memory _markets;
return _markets;
}

function numMarkets() external view returns (uint) {
return 0;
}

function allMarkets() external view returns (address[] memory) {
address[] memory _markets;
return _markets;
}

function marketForKey(bytes32 marketKey) external view returns (address) {
marketKey;
return address(0);
}

function marketsForKeys(bytes32[] calldata marketKeys) external view returns (address[] memory) {
marketKeys;
address[] memory _markets;
return _markets;
}

function totalDebt() external view returns (uint debt, bool isInvalid) {
return (0, false);
}
}
Loading