Skip to content

Commit

Permalink
Phecda-release-v2.96.0-alpha (#2161)
Browse files Browse the repository at this point in the history
* SCCP-293 (#2076)

As part of SCCP-293:
- LPM can only increase by 25% until reaches target
- LBR can only increase by 10% until it reaches targets
- skewScale can only increase by 10% until reaches target

* SIP-298 - Add new markets (#2075)

* Set SIP-298 markets as resumed (already on-chain) (#2080)

* Set markets as resumed (already on-chain)

* fix test

* SIP-2014: New PerpsV2 Markets (#2082)

* set markets for SIP-2014 and prepare SIP-2015

* Add missing asset

* use CL decimals instead of hardcoded 8 decimals

* Add SIP-2015 markets (#2084)

* Add SIP-2015 markets

* Update perpsv2-markets.json (#2085)

---------

Co-authored-by: kaleb <[email protected]>

* Update Perp Parameters & set Paused to False (#2087)

* Update perpsv2-markets.json - optimism-goerli (#2083)

* fix(chainMapping): fix typos in chain mappings (#1959)

* Bump webpack from 5.75.0 to 5.76.0 (#2050)

Bumps [webpack](https://github.com/webpack/webpack) from 5.75.0 to 5.76.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](webpack/webpack@v5.75.0...v5.76.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: meb <[email protected]>

* Fix CI Test failing due to fork limitation (#2090)

* Update Perps V2 Market Settings - Skew Scale (#2088)

* Update perpsv2-markets.json (#2091)

* Update SCCP-293/2005 (#2092)

* implements sccp-2009 (#2094)

updates minAge to 4 and magAge to 60 seconds - post-bedrock changes

* Implement SIP-2021 (stETH) (#2095)

* Add missing markets to goerli (#2096)

* Add missing markets to goerli

* update goerli values with optimism ones

* SCCP-2012-2014-2015 (#2101)

* Update perpsv2-markets.json

* Update perpsv2-markets.json

* update goerli parameters

* Configure sSTETHPERP on Goerli-ovm (#2104)

* Configure sSTETHPERP on Goerli-ovm

* fix range in test

* Update perps v2 config (#2109)

* fix test (updated config out of range)

* Update on mainnet json

Incorporates
- SCCP-2016
- SCCP-2017
- SCCP-2018
- SCCP-2019
- SCCP-2020
- SCCP-2021
- SCCP-2022

* update to goerli json

* lint

---------

Co-authored-by: Leonardo Massazza <[email protected]>

* update as per sccp (#2112)

* update as per 2024 (#2113)

Co-authored-by: Leonardo Massazza <[email protected]>

* update json (#2114)

* update sccp-2026-2027 (#2117)

* update address (#2111)

* Add new markets (SIP-2009/23/24/25/26/27) (#2110)

* Add new markets (SIP-2009/23/24/25)

* Update Parameters + Include SIP 2026 & 2027 (#2116)

* Update Parameters + Include SIP 2026 & 2027

* update default min age to 2 seconds

* fix feeds (#2118)

* add missing stETH info

* fix release name

---------

Co-authored-by: kaleb <[email protected]>

* update eth/btc and etc feeds (#2120)

* Update feeds.json

* Update feeds.json

* SCCP 2029 & 2030 (#2124)

* update sccps

* update georli

* sccp-2031 (#2125)

* SIP-2028 (#2123)

* update repo

* update chainlink feed

* lint and offchain market key fix

* add release info

* fix feeds

---------

Co-authored-by: Leonardo Massazza <[email protected]>

* sccp-2032-2033 (#2128)

* update perps v2 json (#2130)

* SIP-2030 (#2129)

* Adding USDT

Update perpsv2-markets.json

* update parameters

* update max market value

* Add releases info

---------

Co-authored-by: Leonardo Massazza <[email protected]>

* Update Optimism Goerli Chainlink Feeds  / Executes SCCP-2036 (#2134)

* Update feeds.json

* update mkr

* flip USDT liquidation parameters

* update to bp

* npm audit fix (#2138)

* update json (#2136)

Co-authored-by: Leonardo Massazza <[email protected]>

* update json (#2140)

* update perps v2 json (#2142)

* SIP-2029, SIP-2031, SIP-2032, SIP-2033 markets (#2137)

* SIP-2033 markets

* SIP-2032 (#2139)

* SIP-2032 - fakeFeeds

* fix THOR -> RUNE

* fix feed (fakes using wrong template)

* continue on exception from Tenderly

* Add SEI market (SIP-2029)

* Update added feeds

* update release feeds (#2141)

* update release feeds

- Missing

* update perps v2 settings

* update goerli feeds

* Update feeds.json

* remove fake feed

* Update feeds.json (#2144)

* fix wrong config

* update RNDR parameters (#2145)

---------

Co-authored-by: kaleb <[email protected]>

* update as per sccp-2040 (#2147)

* unpause new markets (#2149)

* update json - sccp-2041-2042 (#2150)

* Update steth eth goerli feed (#2151)

Co-authored-by: Leonardo Massazza <[email protected]>

* update as per sccp-2044 (#2152)

* sccp-2045 (#2153)

* implement 2046 (#2154)

* sccp-2048 (#2155)

* update skew scale as per sccp-2049 (#2156)

* Fix CI - Use a new foundry cache (#2157)

* use a new foundry cache

* another try

* rm repo

* fix integration test too

* pr review

* sccp-2050 (#2158)

* implements sccp-2052 (#2159)

* SIP-2036 fix reward distributor to bubble failures (#2160)

* fix reward distributor to bubble failures

in the simplest possible way, fix a bug which prevents reward
distribution from getting sent to L2 due to internal OOG gas logic in
optimism contract (normally if you are OOG then the remaining code in
RewardsDistribution would also fail, but optimism deliberately consumes
an excessive amount of gas in a way that causes only the internal call
to fail)

in accordance with [SIP-2036](https://sips-go29dg4x3-synthetixio.vercel.app/sips/sip-2036/)

note: if you are wondering why I didnt just call the rewards
distribution receiver contract normally and continue to be using hte low
level call, the reason is im trying to keep changes to a minimal and
this change basically ended up being a 1 line changes.

* fix bug

* fix bug where reward distribution dispursement is sent

should be an and not an or

* adding notify reward amount to the trading rewards

otherwise sending rewards to l2 will fail

* Goerli deployment artifacts

* Goerli deployment artifacts

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: kaleb <[email protected]>
Co-authored-by: meb <[email protected]>
Co-authored-by: Will Cory <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dbeal <[email protected]>
  • Loading branch information
6 people authored Oct 20, 2023
1 parent 6bbfe8d commit ef579ea
Show file tree
Hide file tree
Showing 11 changed files with 345 additions and 288 deletions.
62 changes: 40 additions & 22 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# DO NOT EDIT MANUALLY! instead run `npm run build:ci`
# autogenerated by `.circleci/pack.js` from contents of `jobs` .yml files
version: 2.1
orbs:
orbs:
rust: circleci/[email protected]
commands:
cmd-wait-for-port:
Expand Down Expand Up @@ -35,21 +35,30 @@ jobs:
image: ubuntu-2204:2022.04.1
docker_layer_caching: true
environment:
foundry_locked_commit: "232f66f9"
foundry_cache_version: "1"
steps:
- restore_cache:
keys:
- foundry-bin-${foundry_locked_commit}-12
- foundry-bin-latest-${foundry_cache_version}
- rust/install: {}
- run: |
if [ ! -d ~/.foundry ]; then
curl -O https://raw.githubusercontent.com/foundry-rs/foundry/master/foundryup/foundryup && chmod +x ./foundryup
./foundryup -C $foundry_locked_commit
fi
rm -rf *
echo 'export PATH="$PATH:$HOME/.foundry/bin"' >> $BASH_ENV
- run:
name: "Install Foundry"
working_directory: ~/
environment:
SHELL: /bin/bash
command: |-
export PATH="$PATH:$HOME/.foundry/bin"
echo 'export PATH=$PATH:$HOME/.foundry/bin' >> $BASH_ENV
if command -v anvil; then
echo "Anvil already installed"
anvil --version
else
curl -L https://foundry.paradigm.xyz | bash
foundryup
fi
rm -rf *
- save_cache:
key: foundry-bin-${foundry_locked_commit}-12
key: foundry-bin-latest-${foundry_cache_version}
paths:
- ~/.foundry/bin
- checkout
Expand Down Expand Up @@ -125,22 +134,31 @@ jobs:
image: ubuntu-2204:2022.04.1
docker_layer_caching: true
environment:
foundry_locked_commit: "232f66f9"
foundry_cache_version: "1"
resource_class: large
steps:
- restore_cache:
keys:
- foundry-bin-${foundry_locked_commit}-12
- foundry-bin-latest-${foundry_cache_version}
- rust/install: {}
- run: |
if [ ! -d ~/.foundry ]; then
curl -O https://raw.githubusercontent.com/foundry-rs/foundry/master/foundryup/foundryup && chmod +x ./foundryup
./foundryup -C $foundry_locked_commit
fi
rm -rf *
echo 'export PATH="$PATH:$HOME/.foundry/bin"' >> $BASH_ENV
- run:
name: "Install Foundry"
working_directory: ~/
environment:
SHELL: /bin/bash
command: |-
export PATH="$PATH:$HOME/.foundry/bin"
echo 'export PATH=$PATH:$HOME/.foundry/bin' >> $BASH_ENV
if command -v anvil; then
echo "Anvil already installed"
anvil --version
else
curl -L https://foundry.paradigm.xyz | bash
foundryup
fi
rm -rf *
- save_cache:
key: foundry-bin-${foundry_locked_commit}-12
key: foundry-bin-latest-${foundry_cache_version}
paths:
- ~/.foundry/bin
- checkout
Expand Down Expand Up @@ -288,7 +306,7 @@ jobs:
image: ubuntu-2204:2022.04.1
docker_layer_caching: true
environment:
foundry_locked_commit: "232f66f9"
foundry_cache_version: "1"
resource_class: large
steps:
- restore_cache:
Expand Down
28 changes: 19 additions & 9 deletions .circleci/src/jobs/job-cannon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,28 @@ steps:
# get foundry
- restore_cache:
keys:
- foundry-bin-${foundry_locked_commit}-12
- foundry-bin-latest-${foundry_cache_version}
- rust/install: {}
- run: |
if [ ! -d ~/.foundry ]; then
curl -O https://raw.githubusercontent.com/foundry-rs/foundry/master/foundryup/foundryup && chmod +x ./foundryup
./foundryup -C $foundry_locked_commit
fi
rm -rf *
echo 'export PATH="$PATH:$HOME/.foundry/bin"' >> $BASH_ENV
- run:
name: "Install Foundry"
working_directory: ~/
environment:
SHELL: /bin/bash
command: |-
export PATH="$PATH:$HOME/.foundry/bin"
echo 'export PATH=$PATH:$HOME/.foundry/bin' >> $BASH_ENV
if command -v anvil; then
echo "Anvil already installed"
anvil --version
else
curl -L https://foundry.paradigm.xyz | bash
foundryup
fi
rm -rf *
- save_cache:
key: foundry-bin-${foundry_locked_commit}-12
key: foundry-bin-latest-${foundry_cache_version}
paths:
- ~/.foundry/bin

Expand Down
28 changes: 19 additions & 9 deletions .circleci/src/jobs/job-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,28 @@ steps:
# get foundry
- restore_cache:
keys:
- foundry-bin-${foundry_locked_commit}-12
- foundry-bin-latest-${foundry_cache_version}
- rust/install: {}
- run: |
if [ ! -d ~/.foundry ]; then
curl -O https://raw.githubusercontent.com/foundry-rs/foundry/master/foundryup/foundryup && chmod +x ./foundryup
./foundryup -C $foundry_locked_commit
fi
rm -rf *
echo 'export PATH="$PATH:$HOME/.foundry/bin"' >> $BASH_ENV
- run:
name: "Install Foundry"
working_directory: ~/
environment:
SHELL: /bin/bash
command: |-
export PATH="$PATH:$HOME/.foundry/bin"
echo 'export PATH=$PATH:$HOME/.foundry/bin' >> $BASH_ENV
if command -v anvil; then
echo "Anvil already installed"
anvil --version
else
curl -L https://foundry.paradigm.xyz | bash
foundryup
fi
rm -rf *
- save_cache:
key: foundry-bin-${foundry_locked_commit}-12
key: foundry-bin-latest-${foundry_cache_version}
paths:
- ~/.foundry/bin

Expand Down
2 changes: 1 addition & 1 deletion .circleci/src/snippets/job-header-machine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ machine:
image: ubuntu-2204:2022.04.1
docker_layer_caching: true
environment:
foundry_locked_commit: "232f66f9"
foundry_cache_version: "1"
10 changes: 7 additions & 3 deletions contracts/RewardsDistribution.sol
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ contract RewardsDistribution is Owned, IRewardsDistribution {

// Iterate the array of distributions sending the configured amounts
for (uint i = 0; i < distributions.length; i++) {
if (distributions[i].destination != address(0) || distributions[i].amount != 0) {
if (distributions[i].destination != address(0) && distributions[i].amount != 0) {
remainder = remainder.sub(distributions[i].amount);

// Transfer the SNX
Expand All @@ -166,10 +166,14 @@ contract RewardsDistribution is Owned, IRewardsDistribution {
bytes memory payload = abi.encodeWithSignature("notifyRewardAmount(uint256)", distributions[i].amount);

// solhint-disable avoid-low-level-calls
(bool success, ) = distributions[i].destination.call(payload);
(bool success, bytes memory result) = distributions[i].destination.call(payload);

if (!success) {
// Note: we're ignoring the return value as it will fail for contracts that do not implement RewardsDistributionRecipient.sol
// if the error was emitted by the destination contract, bubble
uint len = result.length;
assembly {
revert(add(result, 0x20), len)
}
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion contracts/TradingRewards.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pragma solidity ^0.5.16;
import "./Pausable.sol";
import "./MixinResolver.sol";
import "./Owned.sol";
import "./RewardsDistributionRecipient.sol";

// External dependencies.
import "openzeppelin-solidity-2.3.0/contracts/token/ERC20/SafeERC20.sol";
Expand All @@ -17,7 +18,7 @@ import "./interfaces/ITradingRewards.sol";
import "./interfaces/IExchanger.sol";

// https://docs.synthetix.io/contracts/source/contracts/tradingrewards
contract TradingRewards is ITradingRewards, ReentrancyGuard, Owned, Pausable, MixinResolver {
contract TradingRewards is ITradingRewards, ReentrancyGuard, Owned, Pausable, MixinResolver, RewardsDistributionRecipient {
using SafeMath for uint;
using SafeDecimalMath for uint;
using SafeERC20 for IERC20;
Expand Down Expand Up @@ -256,6 +257,8 @@ contract TradingRewards is ITradingRewards, ReentrancyGuard, Owned, Pausable, Mi
emit AssignedRewardTokensRecovered(recoverAddress, amount, periodID);
}

function notifyRewardAmount(uint256 reward) external {}

function _validateRecoverAddress(address recoverAddress) internal view {
if (recoverAddress == address(0) || recoverAddress == address(this)) {
revert("Invalid recover address");
Expand Down
3 changes: 1 addition & 2 deletions publish/deployed/goerli-ovm/feeds.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,7 @@
"feed": "0x6db19664922b194C59FE972f28CFCAD9667e5dDf"
},
"STETHETH": {
"fakeFeed": true,
"feed": "0x57241A37733983F97C4Ab06448F244A1E0Ca0ba8"
"feed": "0x93A0D1B1cdF50b6bC83bc89bb59fA3Aa7A93B3e3"
},
"MAV": {
"asset": "MAV",
Expand Down
Loading

0 comments on commit ef579ea

Please sign in to comment.