diff --git a/.github/workflows/generic-skip.yaml b/.github/workflows/generic-skip.yaml index 0635cbd11..4ac8251a0 100644 --- a/.github/workflows/generic-skip.yaml +++ b/.github/workflows/generic-skip.yaml @@ -3,6 +3,8 @@ name: Test contracts (Generic Skip) on: pull_request: + types: ['opened', 'edited', 'reopened', 'synchronize', 'ready_for_review'] + branches: ['main', 'dev', 'KIP-3'] paths-ignore: - "packages/contracts/**" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f4c2483ae..d6b7d60c6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,6 +6,8 @@ env: on: push: + types: ['opened', 'edited', 'reopened', 'synchronize', 'ready_for_review'] + branches: ['main', 'dev', 'KIP-3'] paths-ignore: # In future file changes, we can delete the following line # and uncomment the one below. @@ -18,6 +20,8 @@ on: - 'papers/**' - 'images/**' pull_request: + types: ['opened', 'edited', 'reopened', 'synchronize', 'ready_for_review'] + branches: ['main', 'dev', 'KIP-3'] paths-ignore: # In future file changes, we can delete the following line # and uncomment the one below. diff --git a/.github/workflows/test-contracts.yml b/.github/workflows/test-contracts.yml index c65daf5e6..27a0689f9 100644 --- a/.github/workflows/test-contracts.yml +++ b/.github/workflows/test-contracts.yml @@ -6,11 +6,15 @@ env: on: push: + types: ['opened', 'edited', 'reopened', 'synchronize', 'ready_for_review'] + branches: ['main', 'dev', 'KIP-3'] paths: # In future file changes, we can uncomment the following line # - ".github/workflows/test-contracts.yml" - "packages/contracts/**" pull_request: + types: ['opened', 'edited', 'reopened', 'synchronize', 'ready_for_review'] + branches: ['main', 'dev', 'KIP-3'] paths: # In future file changes, we can uncomment the following line # - ".github/workflows/test-contracts.yml" @@ -42,7 +46,7 @@ jobs: coverage: runs-on: ubuntu-latest - if: ${{ contains(github.event.pull_request.labels.*.name, 'coverage') }} + continue-on-error: true steps: diff --git a/packages/contracts/contracts/Interfaces/IStabilityPool.sol b/packages/contracts/contracts/Interfaces/IStabilityPool.sol index fe40907f3..26fac58c5 100644 --- a/packages/contracts/contracts/Interfaces/IStabilityPool.sol +++ b/packages/contracts/contracts/Interfaces/IStabilityPool.sol @@ -42,7 +42,6 @@ interface IStabilityPool is IDeposit { event P_Updated(uint256 _P); event S_Updated(uint256 _S, uint128 _epoch, uint128 _scale); - event G_Updated(uint256 _G, uint128 _epoch, uint128 _scale); event EpochUpdated(uint128 _currentEpoch); event ScaleUpdated(uint128 _currentScale); @@ -58,7 +57,7 @@ interface IStabilityPool is IDeposit { ); event KUMOPaidToFrontEnd(address indexed _frontEnd, uint256 _KUMO); - event DepositSnapshotUpdated(address indexed _depositor, uint256 _P, uint256 _S, uint256 _G); + event DepositSnapshotUpdated(address indexed _depositor, uint256 _P, uint256 _S); event UserDepositChanged(address indexed _depositor, uint256 _newDeposit); event AssetGainWithdrawn(address indexed _depositor, uint256 _Asset, uint256 _kusdLoss); diff --git a/packages/contracts/contracts/StabilityPool.sol b/packages/contracts/contracts/StabilityPool.sol index 0af1e43a4..80551daca 100644 --- a/packages/contracts/contracts/StabilityPool.sol +++ b/packages/contracts/contracts/StabilityPool.sol @@ -164,7 +164,6 @@ contract StabilityPool is KumoBase, CheckContract, IStabilityPool { struct Snapshots { uint256 S; uint256 P; - uint256 G; uint128 scale; uint128 epoch; } @@ -198,15 +197,6 @@ contract StabilityPool is KumoBase, CheckContract, IStabilityPool { */ mapping(uint128 => mapping(uint128 => uint256)) public epochToScaleToSum; - /* - * Similarly, the sum 'G' is used to calculate KUMO gains. During it's lifetime, each deposit d_t earns a KUMO gain of - * ( d_t * [G - G_t] )/P_t, where G_t is the depositor's snapshot of G taken at time t when the deposit was made. - * - * KUMO reward events occur are triggered by depositor operations (new deposit, topup, withdrawal), and liquidations. - * In each case, the KUMO reward is issued (i.e. G is updated), before other state changes are made. - */ - mapping(uint128 => mapping(uint128 => uint256)) public epochToScaleToG; - // Error trackers for the error correction in the offset calculation uint256 public lastETHError_Offset; uint256 public lastKUSDLossError_Offset; @@ -729,25 +719,23 @@ contract StabilityPool is KumoBase, CheckContract, IStabilityPool { if (_newValue == 0) { delete depositSnapshots[_depositor]; - emit DepositSnapshotUpdated(_depositor, 0, 0, 0); + emit DepositSnapshotUpdated(_depositor, 0, 0); return; } uint128 currentScaleCached = currentScale; uint128 currentEpochCached = currentEpoch; uint256 currentP = P; - // Get S and G for the current epoch and current scale + // Get S for the current epoch and current scale uint256 currentS = epochToScaleToSum[currentEpochCached][currentScaleCached]; - uint256 currentG = epochToScaleToG[currentEpochCached][currentScaleCached]; - // Record new snapshots of the latest running product P, sum S, and sum G, for the depositor + // Record new snapshots of the latest running product P, and sum S, for the depositor depositSnapshots[_depositor].P = currentP; depositSnapshots[_depositor].S = currentS; - depositSnapshots[_depositor].G = currentG; depositSnapshots[_depositor].scale = currentScaleCached; depositSnapshots[_depositor].epoch = currentEpochCached; - emit DepositSnapshotUpdated(_depositor, currentP, currentS, currentG); + emit DepositSnapshotUpdated(_depositor, currentP, currentS); // --- Staking part --- stakingSnapshots[_depositor].F_ASSET_Snapshot = F_ASSET;