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

Merge develop to audit/freeze #79

Merged
merged 49 commits into from
May 30, 2022
Merged

Merge develop to audit/freeze #79

merged 49 commits into from
May 30, 2022

Conversation

heyaibi
Copy link
Contributor

@heyaibi heyaibi commented May 30, 2022

Merging the latest development version to the audit/freeze branch

flashburst and others added 30 commits April 27, 2022 20:48
- Removed the outdated provision contract in favor of directly funding liquidity pools via bond pool. The bond pool funding process requires team approval, is discretionary, and therefore done manually
- Refactored tests
- Dropped redundant store address from `deploy` function of `cxTokenFactory` and `VaultFactory` contracts.
- Refactored dependent contracts according to this change.
- Refactored tests
The recoverable contract enables protocol admins to recover accidentally-sent ERC20 tokens to the Neptune Mutual protocol contracts.

https://docs.neptunemutual.com/usage/recovering-cryptocurrencies

This pull request helps maintain compatibility with some tokens which do not properly return a boolean value to indicate the transfer state by dropping the require statements on the return value of IERC20.transfer.
Added validation checks to `addCover` function
Dropped the redundant and wrong check `AccessControlLibV1.mustBeCoverManager(s)`
…s-whitelist-acl

Updated ACL on `updateCoverUsersWhitelist`
Added the missing functionality of burning PODs whenever liquidity is removed.
Dropped unused and redundant statement on the function `getReportingUnstakenAmountInternal`.
…n-amount

Refactored `getReportingUnstakenAmountInternal`
- Persisted the cover creation timestamp when a new cover is created
- Refactored the `decreaseStake` function to make it publicly accessible
- Cover creators can optionally withdraw their full stake after 365 days of cover creation
- Refactored events `StakeAdded` and `StakeRemoved` to add “account” argument
Only allow to exit if liquidity provider can unstake all of their NPM
Fixed withdrawal of liquidity stake while exit
Fix state update interval and  calculation of deposit amount for lending
## Lag:

Coverage lag is a specified time period that can be set globally or on a per-cover basis to delay the start of coverage. The coverage of a policy begins at the EOD timestamp of the policy purchase date plus the coverage lag.

This allows us to defend against time-based opportunistic attacks, which occur when an attacker purchases coverage after an incident has occurred but before the incident has been reported.

## Blacklist:

Blacklisted accounts are unable to claim their cxTokens. Cover managers can use the blacklist feature to prohibit an account from claiming their cover. This usually happens when we suspect a policyholder of being the attacker. After performing KYC, we may be able to lift the blacklist.
binodnpm and others added 19 commits May 24, 2022 15:58
Implemented a block height offset feature so that there is a distance of at least a couple of blocks between deposits and withdrawals.
Added `capitalizePool` function on the reassurance contract. This feature transfers a portion of the reassurance fund back to the cover liquidity pool to minimize liquidity provider loss. The `capitalizePool` can be called multiple times before finalization if the cover creator adds more liquidity to the reassurance pool.

- Refactored to enable the reassurance contract to hold custody of the reassurance funds
- Dropped external reassurance vault
- Refactored `addCover` function to include reassurance rate
- Refactored the `claim` function to keep an account of claims payout paid
- Added `capitalizePool` function as explained above
- Refactored `finalize` function to revert if reassurance transferrable amount is detected

Other Changes

- Refactored tests
- Fixed some slither issues
- Generated keys and ABIs
- Updated the documentation
- Added NpmPriceOracle contract implementing Uniswap TWAP and Fair LP token pricing
- Refactored PriceLibV1 to use the oracle
- Refactored bond contract to use the oracle
- Refactored the protocol initializer to include price oracle contract
- Dropped redundant contracts PriceDiscovery and and its interface
- For consistency, refactored abbreviation in function names to conform to camel case standard
- Refactored `getCoverPoolSummaryInternal` of `CoverUtilV1`
- Refactored tests
- Updated keys and ABIs
Bumps [cross-fetch](https://github.com/lquixada/cross-fetch) from 2.2.5 to 2.2.6.
- [Release notes](https://github.com/lquixada/cross-fetch/releases)
- [Commits](lquixada/cross-fetch@v2.2.5...v2.2.6)

---
updated-dependencies:
- dependency-name: cross-fetch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
…rn/cross-fetch-2.2.6

Bump cross-fetch from 2.2.5 to 2.2.6
Refactored `StoreBase` and `BaseLibV1` to use `safeTransfer` for the recovery feature.
- Added `deleteStrategy` feature in the `LiquidityEgnine` contract
- Updated `callerMustBeStrategyContract` to accept both active and disabled strategies
@heyaibi heyaibi merged commit 466f6ac into audit/freeze May 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants