From b2a981fda3fbe72535f5cb7ebddf1ce5259ad647 Mon Sep 17 00:00:00 2001 From: tokyo Date: Wed, 22 Dec 2021 00:46:43 +0530 Subject: [PATCH] Refactored the Term "Assurance" Renamed `assurance` to `reassurance` for clarity --- contracts/core/Protocol.sol | 6 +-- contracts/core/lifecycle/Cover.sol | 32 +++++------ contracts/core/lifecycle/CoverProvision.sol | 2 +- ...overAssurance.sol => CoverReassurance.sol} | 36 ++++++------- contracts/core/liquidity/Vault.sol | 2 +- contracts/core/policy/Policy.sol | 8 +-- contracts/interfaces/ICover.sol | 14 ++--- ...verAssurance.sol => ICoverReassurance.sol} | 12 ++--- contracts/interfaces/IPolicy.sol | 6 +-- contracts/libraries/CoverUtilV1.sol | 12 ++--- contracts/libraries/GovernanceUtilV1.sol | 2 +- contracts/libraries/ProtoUtilV1.sol | 14 ++--- contracts/libraries/RegistryLibV1.sol | 6 +-- docs/AccessControl.md | 4 +- docs/AccessControlLibV1.md | 4 +- docs/Address.md | 4 +- docs/BaseLibV1.md | 4 +- docs/BokkyPooBahsDateTimeLibrary.md | 4 +- docs/Commission.md | 4 +- docs/Context.md | 4 +- docs/Controller.md | 4 +- docs/Cover.md | 38 ++++++------- docs/CoverBase.md | 4 +- docs/CoverProvision.md | 6 +-- ...{CoverAssurance.md => CoverReassurance.md} | 54 +++++++++---------- docs/CoverStake.md | 4 +- docs/CoverUtilV1.md | 10 ++-- docs/Destroyable.md | 4 +- docs/ERC165.md | 4 +- docs/ERC20.md | 4 +- docs/FakeRecoverable.md | 4 +- docs/FakeStore.md | 4 +- docs/FakeToken.md | 4 +- docs/FakeUniswapV2RouterLike.md | 4 +- docs/Finalization.md | 4 +- docs/Governance.md | 4 +- docs/GovernanceUtilV1.md | 4 +- docs/IAccessControl.md | 4 +- docs/IClaimsProcessor.md | 4 +- docs/ICommission.md | 4 +- docs/ICover.md | 16 +++--- docs/ICoverProvision.md | 4 +- ...CoverAssurance.md => ICoverReassurance.md} | 34 ++++++------ docs/ICoverStake.md | 4 +- docs/ICxToken.md | 4 +- docs/ICxTokenFactory.md | 4 +- docs/IERC165.md | 4 +- docs/IERC20.md | 4 +- docs/IERC20Metadata.md | 4 +- docs/IFinalization.md | 4 +- docs/IGovernance.md | 4 +- docs/IMember.md | 6 +-- docs/IPausable.md | 4 +- docs/IPolicy.md | 4 +- docs/IPolicyAdmin.md | 4 +- docs/IPriceDiscovery.md | 4 +- docs/IProtocol.md | 4 +- docs/IReporter.md | 4 +- docs/IResolution.md | 4 +- docs/IResolvable.md | 4 +- docs/IStore.md | 4 +- docs/IUniswapV2PairLike.md | 4 +- docs/IUniswapV2RouterLike.md | 4 +- docs/IUnstakable.md | 4 +- docs/IVault.md | 4 +- docs/IVaultFactory.md | 4 +- docs/IWitness.md | 4 +- docs/MaliciousToken.md | 4 +- docs/Migrations.md | 4 +- docs/NTransferUtilV2.md | 4 +- docs/NTransferUtilV2Intermediate.md | 4 +- docs/Ownable.md | 4 +- docs/Pausable.md | 4 +- docs/Policy.md | 6 +-- docs/PolicyAdmin.md | 4 +- docs/PolicyManager.md | 4 +- docs/PriceDiscovery.md | 4 +- docs/Processor.md | 4 +- docs/ProtoBase.md | 4 +- docs/ProtoUtilV1.md | 24 ++++----- docs/Protocol.md | 16 +++--- docs/Recoverable.md | 6 +-- docs/ReentrancyGuard.md | 4 +- docs/RegistryLibV1.md | 16 +++--- docs/Reporter.md | 4 +- docs/Resolution.md | 4 +- docs/Resolvable.md | 4 +- docs/SafeERC20.md | 4 +- docs/SafeMath.md | 4 +- docs/Store.md | 4 +- docs/StoreBase.md | 4 +- docs/StoreKeyUtil.md | 4 +- docs/Strings.md | 4 +- docs/Unstakable.md | 4 +- docs/ValidationLibV1.md | 4 +- docs/Vault.md | 6 +-- docs/VaultBase.md | 4 +- docs/VaultFactory.md | 4 +- docs/VaultFactoryLibV1.md | 4 +- docs/VaultLibV1.md | 4 +- docs/Witness.md | 4 +- docs/cxToken.md | 4 +- docs/cxTokenFactory.md | 4 +- docs/cxTokenFactoryLibV1.md | 4 +- readme.md | 38 ++++++------- stories/0. setup.story.js | 44 +++++++-------- stories/1. policy.story.js | 14 ++--- stories/2. governance.story.js | 6 +-- stories/composer/initializer.js | 12 ++--- test/protocol.spec.js | 32 +++++------ util/key.js | 12 ++--- util/sample.js | 4 +- util/store-util.js | 4 +- util/typedefs.js | 4 +- 114 files changed, 436 insertions(+), 436 deletions(-) rename contracts/core/lifecycle/{CoverAssurance.sol => CoverReassurance.sol} (62%) rename contracts/interfaces/{ICoverAssurance.sol => ICoverReassurance.sol} (57%) rename docs/{CoverAssurance.md => CoverReassurance.md} (77%) rename docs/{ICoverAssurance.md => ICoverReassurance.md} (82%) diff --git a/contracts/core/Protocol.sol b/contracts/core/Protocol.sol index 7925c386..1f4be0ef 100644 --- a/contracts/core/Protocol.sol +++ b/contracts/core/Protocol.sol @@ -20,7 +20,7 @@ contract Protocol is IProtocol, ProtoBase { address uniswapV2RouterLike, address npm, address treasury, - address assuranceVault, + address reassuranceVault, uint256 coverFee, uint256 minStake, uint256 minReportingStake, @@ -36,7 +36,7 @@ contract Protocol is IProtocol, ProtoBase { require(npm != address(0), "Invalid NPM"); require(uniswapV2RouterLike != address(0), "Invalid Router"); require(treasury != address(0), "Invalid Treasury"); - require(assuranceVault != address(0), "Invalid Vault"); + require(reassuranceVault != address(0), "Invalid Vault"); s.setAddressByKey(ProtoUtilV1.NS_CORE, address(this)); s.setBoolByKeys(ProtoUtilV1.NS_CONTRACTS, address(this), true); @@ -45,7 +45,7 @@ contract Protocol is IProtocol, ProtoBase { s.setAddressByKey(ProtoUtilV1.NS_SETUP_NPM, npm); s.setAddressByKey(ProtoUtilV1.NS_SETUP_UNISWAP_V2_ROUTER, uniswapV2RouterLike); s.setAddressByKey(ProtoUtilV1.NS_TREASURY, treasury); - s.setAddressByKey(ProtoUtilV1.NS_ASSURANCE_VAULT, assuranceVault); + s.setAddressByKey(ProtoUtilV1.NS_REASSURANCE_VAULT, reassuranceVault); _setCoverFees(coverFee); _setMinStake(minStake); diff --git a/contracts/core/lifecycle/Cover.sol b/contracts/core/lifecycle/Cover.sol index facb93ed..980961ce 100644 --- a/contracts/core/lifecycle/Cover.sol +++ b/contracts/core/lifecycle/Cover.sol @@ -69,15 +69,15 @@ contract Cover is CoverBase { * * @param key Enter a unique key for this cover * @param info IPFS info of the cover contract - * @param assuranceToken **Optional.** Token added as an assurance of this cover.

+ * @param reassuranceToken **Optional.** Token added as an reassurance of this cover.

* - * Assurance tokens can be added by a project to demonstrate coverage support + * Reassurance tokens can be added by a project to demonstrate coverage support * for their own project. This helps bring the cover fee down and enhances - * liquidity provider confidence. Along with the NPM tokens, the assurance tokens are rewarded + * liquidity provider confidence. Along with the NPM tokens, the reassurance tokens are rewarded * as a support to the liquidity providers when a cover incident occurs. * @param reportingPeriod The period during when reporting happens. - * @param initialAssuranceAmount **Optional.** Enter the initial amount of - * assurance tokens you'd like to add to this pool. + * @param initialReassuranceAmount **Optional.** Enter the initial amount of + * reassurance tokens you'd like to add to this pool. * @param stakeWithFee Enter the total NPM amount (stake + fee) to transfer to this contract. * @param initialLiquidity **Optional.** Enter the initial stablecoin liquidity for this cover. */ @@ -86,8 +86,8 @@ contract Cover is CoverBase { bytes32 info, uint256 reportingPeriod, uint256 stakeWithFee, - address assuranceToken, - uint256 initialAssuranceAmount, + address reassuranceToken, + uint256 initialReassuranceAmount, uint256 initialLiquidity ) external override nonReentrant { // @supress-acl Can only be called by a whitelisted address @@ -101,14 +101,14 @@ contract Cover is CoverBase { uint256 fee = _validateAndGetFee(key, info, stakeWithFee); // Set the basic cover info - _addCover(key, info, reportingPeriod, fee, assuranceToken); + _addCover(key, info, reportingPeriod, fee, reassuranceToken); // Stake the supplied NPM tokens and burn the fees s.getStakingContract().increaseStake(key, msg.sender, stakeWithFee, fee); - // Add cover assurance - if (initialAssuranceAmount > 0) { - s.getAssuranceContract().addAssurance(key, msg.sender, initialAssuranceAmount); + // Add cover reassurance + if (initialReassuranceAmount > 0) { + s.getReassuranceContract().addReassurance(key, msg.sender, initialReassuranceAmount); } // Add initial liquidity @@ -130,14 +130,14 @@ contract Cover is CoverBase { * @param info IPFS info of the cover contract * @param reportingPeriod The period during when reporting happens. * @param fee Fee paid to create this cover - * @param assuranceToken **Optional.** Token added as an assurance of this cover. + * @param reassuranceToken **Optional.** Token added as an reassurance of this cover. */ function _addCover( bytes32 key, bytes32 info, uint256 reportingPeriod, uint256 fee, - address assuranceToken + address reassuranceToken ) private { // Add a new cover s.setBoolByKeys(ProtoUtilV1.NS_COVER, key, true); @@ -149,9 +149,9 @@ contract Cover is CoverBase { s.setBytes32ByKeys(ProtoUtilV1.NS_COVER_INFO, key, info); s.setUintByKeys(ProtoUtilV1.NS_REPORTING_PERIOD, key, reportingPeriod); - // Set assurance token - s.setAddressByKeys(ProtoUtilV1.NS_COVER_ASSURANCE_TOKEN, key, assuranceToken); - s.setUintByKeys(ProtoUtilV1.NS_COVER_ASSURANCE_WEIGHT, key, 500000000 gwei); // Default 50% weight + // Set reassurance token + s.setAddressByKeys(ProtoUtilV1.NS_COVER_REASSURANCE_TOKEN, key, reassuranceToken); + s.setUintByKeys(ProtoUtilV1.NS_COVER_REASSURANCE_WEIGHT, key, 500000000 gwei); // Default 50% weight // Set the fee charged during cover creation s.setUintByKeys(ProtoUtilV1.NS_COVER_FEE, key, fee); diff --git a/contracts/core/lifecycle/CoverProvision.sol b/contracts/core/lifecycle/CoverProvision.sol index 6869f165..3cc7d135 100644 --- a/contracts/core/lifecycle/CoverProvision.sol +++ b/contracts/core/lifecycle/CoverProvision.sol @@ -16,7 +16,7 @@ import "../Recoverable.sol"; * for any given cover. This not only fosters community participation but also incentivizes * the liquidity providers or acts as a defense/support during cover incidents. * - * Along with the NPM provisions, the liquidity providers also have `[Assurance Token Support](CoverAssurance.md)` + * Along with the NPM provisions, the liquidity providers also have `[Reassurance Token Support](CoverReassurance.md)` * for the rainy day. */ contract CoverProvision is ICoverProvision, Recoverable { diff --git a/contracts/core/lifecycle/CoverAssurance.sol b/contracts/core/lifecycle/CoverReassurance.sol similarity index 62% rename from contracts/core/lifecycle/CoverAssurance.sol rename to contracts/core/lifecycle/CoverReassurance.sol index b2f9b8c4..148fbcbe 100644 --- a/contracts/core/lifecycle/CoverAssurance.sol +++ b/contracts/core/lifecycle/CoverReassurance.sol @@ -2,7 +2,7 @@ // SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.0; import "../../interfaces/IStore.sol"; -import "../../interfaces/ICoverAssurance.sol"; +import "../../interfaces/ICoverReassurance.sol"; import "../../libraries/ProtoUtilV1.sol"; import "../../libraries/CoverUtilV1.sol"; import "../../libraries/ValidationLibV1.sol"; @@ -11,17 +11,17 @@ import "../../libraries/NTransferUtilV2.sol"; import "../Recoverable.sol"; /** - * @title Cover Assurance - * @dev Assurance tokens can be added by a covered project to demonstrate coverage support + * @title Cover Reassurance + * @dev Reassurance tokens can be added by a covered project to demonstrate coverage support * for their project. This helps bring the cover fee down and enhances - * liquidity provider confidence. Along with the NPM tokens, the assurance tokens are rewarded + * liquidity provider confidence. Along with the NPM tokens, the reassurance tokens are rewarded * as a support to the liquidity providers when a cover incident occurs. * * Without negatively affecting the price much, - * the protocol will gradually convert the assurance tokens + * the protocol will gradually convert the reassurance tokens * to stablecoin liquidity. */ -contract CoverAssurance is ICoverAssurance, Recoverable { +contract CoverReassurance is ICoverReassurance, Recoverable { using ProtoUtilV1 for bytes; using ProtoUtilV1 for IStore; using StoreKeyUtil for IStore; @@ -34,11 +34,11 @@ contract CoverAssurance is ICoverAssurance, Recoverable { } /** - * @dev Adds assurance to the specified cover contract + * @dev Adds reassurance to the specified cover contract * @param key Enter the cover key * @param amount Enter the amount you would like to supply */ - function addAssurance( + function addReassurance( bytes32 key, address account, uint256 amount @@ -48,14 +48,14 @@ contract CoverAssurance is ICoverAssurance, Recoverable { require(amount > 0, "Provide valid amount"); - IERC20 assuranceToken = IERC20(s.getAddressByKeys(ProtoUtilV1.NS_COVER_ASSURANCE_TOKEN, key)); - address vault = s.getAssuranceVault(); + IERC20 reassuranceToken = IERC20(s.getAddressByKeys(ProtoUtilV1.NS_COVER_REASSURANCE_TOKEN, key)); + address vault = s.getReassuranceVault(); - s.addUintByKeys(ProtoUtilV1.NS_COVER_ASSURANCE, key, amount); + s.addUintByKeys(ProtoUtilV1.NS_COVER_REASSURANCE, key, amount); - assuranceToken.ensureTransferFrom(account, vault, amount); + reassuranceToken.ensureTransferFrom(account, vault, amount); - emit AssuranceAdded(key, amount); + emit ReassuranceAdded(key, amount); } function setWeight(bytes32 key, uint256 weight) external override nonReentrant { @@ -64,15 +64,15 @@ contract CoverAssurance is ICoverAssurance, Recoverable { s.mustBeValidCoverKey(key); - s.setUintByKeys(ProtoUtilV1.NS_COVER_ASSURANCE_WEIGHT, key, weight); + s.setUintByKeys(ProtoUtilV1.NS_COVER_REASSURANCE_WEIGHT, key, weight); } /** - * @dev Gets the assurance amount of the specified cover contract + * @dev Gets the reassurance amount of the specified cover contract * @param key Enter the cover key */ - function getAssurance(bytes32 key) external view override returns (uint256) { - return s.getUintByKeys(ProtoUtilV1.NS_COVER_ASSURANCE, key); + function getReassurance(bytes32 key) external view override returns (uint256) { + return s.getUintByKeys(ProtoUtilV1.NS_COVER_REASSURANCE, key); } /** @@ -86,6 +86,6 @@ contract CoverAssurance is ICoverAssurance, Recoverable { * @dev Name of this contract */ function getName() public pure override returns (bytes32) { - return ProtoUtilV1.CNAME_COVER_ASSURANCE; + return ProtoUtilV1.CNAME_COVER_REASSURANCE; } } diff --git a/contracts/core/liquidity/Vault.sol b/contracts/core/liquidity/Vault.sol index 69831c18..85890e1e 100644 --- a/contracts/core/liquidity/Vault.sol +++ b/contracts/core/liquidity/Vault.sol @@ -15,7 +15,7 @@ import "./VaultBase.sol"; * - The protocol supplies a small portion of idle assets to lending protocols (v2). * - Flash loan interest also gets added back to the pool. * - To protect liquidity providers from cover incidents, they can redeem upto 25% of the cover payouts through NPM provision. - * - To protect liquidity providers from cover incidents, they can redeem upto 25% of the cover payouts through `assurance token` allocation. + * - To protect liquidity providers from cover incidents, they can redeem upto 25% of the cover payouts through `reassurance token` allocation. */ contract Vault is VaultBase { constructor( diff --git a/contracts/core/policy/Policy.sol b/contracts/core/policy/Policy.sol index 33149d6c..c659617b 100644 --- a/contracts/core/policy/Policy.sol +++ b/contracts/core/policy/Policy.sol @@ -233,7 +233,7 @@ contract Policy is IPolicy, Recoverable { // UTILIZATION RATIO = COVER_COMMITMENT / AMOUNT_IN_COVER_POOL utilizationRatio = (1 ether * values[1]) / values[0]; - // TOTAL AVAILABLE LIQUIDITY = AMOUNT_IN_COVER_POOL - COVER_COMMITMENT + (NEP_REWARD_POOL_SUPPORT * NEP_PRICE) + (ASSURANCE_POOL_SUPPORT * ASSURANCE_TOKEN_PRICE * ASSURANCE_POOL_WEIGHT) + // TOTAL AVAILABLE LIQUIDITY = AMOUNT_IN_COVER_POOL - COVER_COMMITMENT + (NEP_REWARD_POOL_SUPPORT * NEP_PRICE) + (REASSURANCE_POOL_SUPPORT * REASSURANCE_TOKEN_PRICE * REASSURANCE_POOL_WEIGHT) totalAvailableLiquidity = values[0] - values[1] + ((values[2] * values[3]) / 1 ether) + ((values[4] * values[5] * values[6]) / (1 ether * 1 ether)); // COVER RATIO = UTILIZATION_RATIO + COVER_DURATION * AMOUNT_TO_COVER / AVAILABLE_LIQUIDITY @@ -249,9 +249,9 @@ contract Policy is IPolicy, Recoverable { * @param _values[1] The total commitment amount * @param _values[2] The total amount of NPM provision * @param _values[3] NPM price - * @param _values[4] The total amount of assurance tokens - * @param _values[5] Assurance token price - * @param _values[6] Assurance pool weight + * @param _values[4] The total amount of reassurance tokens + * @param _values[5] Reassurance token price + * @param _values[6] Reassurance pool weight */ function getCoverPoolSummary(bytes32 key) external view override returns (uint256[] memory _values) { return s.getCoverPoolSummary(key); diff --git a/contracts/interfaces/ICover.sol b/contracts/interfaces/ICover.sol index 8e37a790..6b9b24a8 100644 --- a/contracts/interfaces/ICover.sol +++ b/contracts/interfaces/ICover.sol @@ -35,15 +35,15 @@ interface ICover is IMember { * * @param key Enter a unique key for this cover * @param info IPFS info of the cover contract - * @param assuranceToken **Optional.** Token added as an assurance of this cover.

+ * @param reassuranceToken **Optional.** Token added as an reassurance of this cover.

* - * Assurance tokens can be added by a project to demonstrate coverage support + * Reassurance tokens can be added by a project to demonstrate coverage support * for their own project. This helps bring the cover fee down and enhances - * liquidity provider confidence. Along with the NPM tokens, the assurance tokens are rewarded + * liquidity provider confidence. Along with the NPM tokens, the reassurance tokens are rewarded * as a support to the liquidity providers when a cover incident occurs. * @param reportingPeriod The period during when reporting happens. - * @param initialAssuranceAmount **Optional.** Enter the initial amount of - * assurance tokens you'd like to add to this pool. + * @param initialReassuranceAmount **Optional.** Enter the initial amount of + * reassurance tokens you'd like to add to this pool. * @param stakeWithFee Enter the total NPM amount (stake + fee) to transfer to this contract. * @param initialLiquidity **Optional.** Enter the initial stablecoin liquidity for this cover. */ @@ -52,8 +52,8 @@ interface ICover is IMember { bytes32 info, uint256 reportingPeriod, uint256 stakeWithFee, - address assuranceToken, - uint256 initialAssuranceAmount, + address reassuranceToken, + uint256 initialReassuranceAmount, uint256 initialLiquidity ) external; diff --git a/contracts/interfaces/ICoverAssurance.sol b/contracts/interfaces/ICoverReassurance.sol similarity index 57% rename from contracts/interfaces/ICoverAssurance.sol rename to contracts/interfaces/ICoverReassurance.sol index a5c5ef8d..589e298c 100644 --- a/contracts/interfaces/ICoverAssurance.sol +++ b/contracts/interfaces/ICoverReassurance.sol @@ -3,15 +3,15 @@ pragma solidity 0.8.0; import "./IMember.sol"; -interface ICoverAssurance is IMember { - event AssuranceAdded(bytes32 key, uint256 amount); +interface ICoverReassurance is IMember { + event ReassuranceAdded(bytes32 key, uint256 amount); /** - * @dev Adds assurance to the specified cover contract + * @dev Adds reassurance to the specified cover contract * @param key Enter the cover key * @param amount Enter the amount you would like to supply */ - function addAssurance( + function addReassurance( bytes32 key, address account, uint256 amount @@ -20,8 +20,8 @@ interface ICoverAssurance is IMember { function setWeight(bytes32 key, uint256 weight) external; /** - * @dev Gets the assurance amount of the specified cover contract + * @dev Gets the reassurance amount of the specified cover contract * @param key Enter the cover key */ - function getAssurance(bytes32 key) external view returns (uint256); + function getReassurance(bytes32 key) external view returns (uint256); } diff --git a/contracts/interfaces/IPolicy.sol b/contracts/interfaces/IPolicy.sol index 9a751f47..e0495b2a 100644 --- a/contracts/interfaces/IPolicy.sol +++ b/contracts/interfaces/IPolicy.sol @@ -49,9 +49,9 @@ interface IPolicy is IMember { * @param _values[1] The total commitment amount * @param _values[2] The total amount of NPM provision * @param _values[3] NPM price - * @param _values[4] The total amount of assurance tokens - * @param _values[5] Assurance token price - * @param _values[6] Assurance pool weight + * @param _values[4] The total amount of reassurance tokens + * @param _values[5] Reassurance token price + * @param _values[6] Reassurance pool weight */ function getCoverPoolSummary(bytes32 key) external view returns (uint256[] memory _values); diff --git a/contracts/libraries/CoverUtilV1.sol b/contracts/libraries/CoverUtilV1.sol index b90faf4b..446f890f 100644 --- a/contracts/libraries/CoverUtilV1.sol +++ b/contracts/libraries/CoverUtilV1.sol @@ -69,9 +69,9 @@ library CoverUtilV1 { * @param _values[1] The total commitment amount * @param _values[2] The total amount of NPM provision * @param _values[3] NPM price - * @param _values[4] The total amount of assurance tokens - * @param _values[5] Assurance token price - * @param _values[6] Assurance pool weight + * @param _values[4] The total amount of reassurance tokens + * @param _values[5] Reassurance token price + * @param _values[6] Reassurance pool weight */ function getCoverPoolSummary(IStore s, bytes32 key) external view returns (uint256[] memory _values) { require(getCoverStatus(s, key) == CoverStatus.Normal, "Invalid cover"); @@ -83,9 +83,9 @@ library CoverUtilV1 { _values[1] = s.getUintByKeys(ProtoUtilV1.NS_COVER_LIQUIDITY_COMMITTED, key); // <-- Todo: liquidity commitment should expire as policies expire _values[2] = s.getUintByKeys(ProtoUtilV1.NS_COVER_PROVISION, key); _values[3] = discovery.getTokenPriceInStableCoin(address(s.npmToken()), 1 ether); - _values[4] = s.getUintByKeys(ProtoUtilV1.NS_COVER_ASSURANCE, key); - _values[5] = discovery.getTokenPriceInStableCoin(address(s.getAddressByKeys(ProtoUtilV1.NS_COVER_ASSURANCE_TOKEN, key)), 1 ether); - _values[6] = s.getUintByKeys(ProtoUtilV1.NS_COVER_ASSURANCE_WEIGHT, key); + _values[4] = s.getUintByKeys(ProtoUtilV1.NS_COVER_REASSURANCE, key); + _values[5] = discovery.getTokenPriceInStableCoin(address(s.getAddressByKeys(ProtoUtilV1.NS_COVER_REASSURANCE_TOKEN, key)), 1 ether); + _values[6] = s.getUintByKeys(ProtoUtilV1.NS_COVER_REASSURANCE_WEIGHT, key); } function getPolicyRates(IStore s, bytes32 key) external view returns (uint256 floor, uint256 ceiling) { diff --git a/contracts/libraries/GovernanceUtilV1.sol b/contracts/libraries/GovernanceUtilV1.sol index 198444d5..315f1c91 100644 --- a/contracts/libraries/GovernanceUtilV1.sol +++ b/contracts/libraries/GovernanceUtilV1.sol @@ -5,7 +5,7 @@ import "../interfaces/IStore.sol"; import "../interfaces/IPolicy.sol"; import "../interfaces/ICoverStake.sol"; import "../interfaces/IPriceDiscovery.sol"; -import "../interfaces/ICoverAssurance.sol"; +import "../interfaces/ICoverReassurance.sol"; import "../interfaces/IVault.sol"; import "../interfaces/IVaultFactory.sol"; import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol"; diff --git a/contracts/libraries/ProtoUtilV1.sol b/contracts/libraries/ProtoUtilV1.sol index af1ba47a..e305a88c 100644 --- a/contracts/libraries/ProtoUtilV1.sol +++ b/contracts/libraries/ProtoUtilV1.sol @@ -10,7 +10,7 @@ library ProtoUtilV1 { using StoreKeyUtil for IStore; bytes32 public constant NS_CORE = "proto:core"; - bytes32 public constant NS_ASSURANCE_VAULT = "proto:core:assurance:vault"; + bytes32 public constant NS_REASSURANCE_VAULT = "proto:core:reassurance:vault"; /// @dev The address where burn tokens are sent or collected. /// This behavior (collection) is required if the instance of @@ -54,9 +54,9 @@ library ProtoUtilV1 { /// @dev Claims processor contract address bytes32 public constant NS_CLAIMS_PROCESSOR = "proto:claims:processor"; - bytes32 public constant NS_COVER_ASSURANCE = "proto:cover:assurance"; - bytes32 public constant NS_COVER_ASSURANCE_TOKEN = "proto:cover:assurance:token"; - bytes32 public constant NS_COVER_ASSURANCE_WEIGHT = "proto:cover:assurance:weight"; + bytes32 public constant NS_COVER_REASSURANCE = "proto:cover:reassurance"; + bytes32 public constant NS_COVER_REASSURANCE_TOKEN = "proto:cover:reassurance:token"; + bytes32 public constant NS_COVER_REASSURANCE_WEIGHT = "proto:cover:reassurance:weight"; bytes32 public constant NS_COVER_CLAIMABLE = "proto:cover:claimable"; bytes32 public constant NS_COVER_FEE = "proto:cover:fee"; bytes32 public constant NS_COVER_INFO = "proto:cover:info"; @@ -147,7 +147,7 @@ library ProtoUtilV1 { bytes32 public constant CNAME_CXTOKEN_FACTORY = "cxTokenFactory"; bytes32 public constant CNAME_COVER_PROVISION = "CoverProvison"; bytes32 public constant CNAME_COVER_STAKE = "CoverStake"; - bytes32 public constant CNAME_COVER_ASSURANCE = "CoverAssurance"; + bytes32 public constant CNAME_COVER_REASSURANCE = "CoverReassurance"; bytes32 public constant CNAME_LIQUIDITY_VAULT = "Vault"; function getProtocol(IStore s) external view returns (IProtocol) { @@ -209,8 +209,8 @@ library ProtoUtilV1 { return s.getAddressByKey(NS_TREASURY); } - function getAssuranceVault(IStore s) external view returns (address) { - return s.getAddressByKey(NS_ASSURANCE_VAULT); + function getReassuranceVault(IStore s) external view returns (address) { + return s.getAddressByKey(NS_REASSURANCE_VAULT); } function getLiquidityToken(IStore s) public view returns (address) { diff --git a/contracts/libraries/RegistryLibV1.sol b/contracts/libraries/RegistryLibV1.sol index deaa8a50..34643254 100644 --- a/contracts/libraries/RegistryLibV1.sol +++ b/contracts/libraries/RegistryLibV1.sol @@ -8,7 +8,7 @@ import "../interfaces/IPolicy.sol"; import "../interfaces/ICoverStake.sol"; import "../interfaces/IPriceDiscovery.sol"; import "../interfaces/ICxTokenFactory.sol"; -import "../interfaces/ICoverAssurance.sol"; +import "../interfaces/ICoverReassurance.sol"; import "../interfaces/IGovernance.sol"; import "../interfaces/IVault.sol"; import "../interfaces/IVaultFactory.sol"; @@ -41,8 +41,8 @@ library RegistryLibV1 { return IPolicy(s.getContract(ProtoUtilV1.NS_COVER_POLICY)); } - function getAssuranceContract(IStore s) public view returns (ICoverAssurance) { - return ICoverAssurance(s.getContract(ProtoUtilV1.NS_COVER_ASSURANCE)); + function getReassuranceContract(IStore s) public view returns (ICoverReassurance) { + return ICoverReassurance(s.getContract(ProtoUtilV1.NS_COVER_REASSURANCE)); } function getVault(IStore s, bytes32 key) public view returns (IVault) { diff --git a/docs/AccessControl.md b/docs/AccessControl.md index 41c08a72..0cd11fe9 100644 --- a/docs/AccessControl.md +++ b/docs/AccessControl.md @@ -435,9 +435,9 @@ function _revokeRole(bytes32 role, address account) internal virtual { * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -457,8 +457,8 @@ function _revokeRole(bytes32 role, address account) internal virtual { * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/AccessControlLibV1.md b/docs/AccessControlLibV1.md index 14dd67d7..55ae0c64 100644 --- a/docs/AccessControlLibV1.md +++ b/docs/AccessControlLibV1.md @@ -354,9 +354,9 @@ function hasAccess( * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -376,8 +376,8 @@ function hasAccess( * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/Address.md b/docs/Address.md index 5c8e87c5..73492a2d 100644 --- a/docs/Address.md +++ b/docs/Address.md @@ -432,9 +432,9 @@ function verifyCallResult( * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -454,8 +454,8 @@ function verifyCallResult( * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/BaseLibV1.md b/docs/BaseLibV1.md index e5dfaf45..adc4b146 100644 --- a/docs/BaseLibV1.md +++ b/docs/BaseLibV1.md @@ -89,9 +89,9 @@ function recoverToken( * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -111,8 +111,8 @@ function recoverToken( * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/BokkyPooBahsDateTimeLibrary.md b/docs/BokkyPooBahsDateTimeLibrary.md index 7721906f..01da7a60 100644 --- a/docs/BokkyPooBahsDateTimeLibrary.md +++ b/docs/BokkyPooBahsDateTimeLibrary.md @@ -1165,9 +1165,9 @@ function diffSeconds(uint256 fromTimestamp, uint256 toTimestamp) internal pure r * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -1187,8 +1187,8 @@ function diffSeconds(uint256 fromTimestamp, uint256 toTimestamp) internal pure r * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/Commission.md b/docs/Commission.md index 9f44f8f3..5386fe0c 100644 --- a/docs/Commission.md +++ b/docs/Commission.md @@ -19,9 +19,9 @@ View Source: [contracts/core/lifecycle/_Commission.sol](../contracts/core/lifecy * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -41,8 +41,8 @@ View Source: [contracts/core/lifecycle/_Commission.sol](../contracts/core/lifecy * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/Context.md b/docs/Context.md index 35e7b4cc..61231dfc 100644 --- a/docs/Context.md +++ b/docs/Context.md @@ -74,9 +74,9 @@ function _msgData() internal view virtual returns (bytes calldata) { * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -96,8 +96,8 @@ function _msgData() internal view virtual returns (bytes calldata) { * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/Controller.md b/docs/Controller.md index 1bd1f8fe..31ac429d 100644 --- a/docs/Controller.md +++ b/docs/Controller.md @@ -43,9 +43,9 @@ constructor(IStore store) Recoverable(store) { * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -65,8 +65,8 @@ constructor(IStore store) Recoverable(store) { * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/Cover.md b/docs/Cover.md index d62da290..60553b87 100644 --- a/docs/Cover.md +++ b/docs/Cover.md @@ -12,8 +12,8 @@ The cover contract facilitates you create and update covers - [constructor(IStore store)](#) - [updateCover(bytes32 key, bytes32 info)](#updatecover) -- [addCover(bytes32 key, bytes32 info, uint256 reportingPeriod, uint256 stakeWithFee, address assuranceToken, uint256 initialAssuranceAmount, uint256 initialLiquidity)](#addcover) -- [_addCover(bytes32 key, bytes32 info, uint256 reportingPeriod, uint256 fee, address assuranceToken)](#_addcover) +- [addCover(bytes32 key, bytes32 info, uint256 reportingPeriod, uint256 stakeWithFee, address reassuranceToken, uint256 initialReassuranceAmount, uint256 initialLiquidity)](#addcover) +- [_addCover(bytes32 key, bytes32 info, uint256 reportingPeriod, uint256 fee, address reassuranceToken)](#_addcover) - [_validateAndGetFee(bytes32 key, bytes32 info, uint256 stakeWithFee)](#_validateandgetfee) - [updateWhitelist(address account, bool status)](#updatewhitelist) - [checkIfWhitelisted(address account)](#checkifwhitelisted) @@ -93,7 +93,7 @@ Adds a new coverage pool or cover contract. https://docs.neptunemutual.com/covers/contract-creators ```solidity -function addCover(bytes32 key, bytes32 info, uint256 reportingPeriod, uint256 stakeWithFee, address assuranceToken, uint256 initialAssuranceAmount, uint256 initialLiquidity) external nonpayable nonReentrant +function addCover(bytes32 key, bytes32 info, uint256 reportingPeriod, uint256 stakeWithFee, address reassuranceToken, uint256 initialReassuranceAmount, uint256 initialLiquidity) external nonpayable nonReentrant ``` **Arguments** @@ -104,8 +104,8 @@ function addCover(bytes32 key, bytes32 info, uint256 reportingPeriod, uint256 st | info | bytes32 | IPFS info of the cover contract | | reportingPeriod | uint256 | The period during when reporting happens. | | stakeWithFee | uint256 | Enter the total NPM amount (stake + fee) to transfer to this contract. | -| assuranceToken | address | **Optional.** Token added as an assurance of this cover.

Assurance tokens can be added by a project to demonstrate coverage support for their own project. This helps bring the cover fee down and enhances liquidity provider confidence. Along with the NPM tokens, the assurance tokens are rewarded as a support to the liquidity providers when a cover incident occurs. | -| initialAssuranceAmount | uint256 | **Optional.** Enter the initial amount of assurance tokens you'd like to add to this pool. | +| reassuranceToken | address | **Optional.** Token added as an reassurance of this cover.

Reassurance tokens can be added by a project to demonstrate coverage support for their own project. This helps bring the cover fee down and enhances liquidity provider confidence. Along with the NPM tokens, the reassurance tokens are rewarded as a support to the liquidity providers when a cover incident occurs. | +| initialReassuranceAmount | uint256 | **Optional.** Enter the initial amount of reassurance tokens you'd like to add to this pool. | | initialLiquidity | uint256 | **Optional.** Enter the initial stablecoin liquidity for this cover. |
@@ -117,8 +117,8 @@ function addCover( bytes32 info, uint256 reportingPeriod, uint256 stakeWithFee, - address assuranceToken, - uint256 initialAssuranceAmount, + address reassuranceToken, + uint256 initialReassuranceAmount, uint256 initialLiquidity ) external override nonReentrant { // @supress-acl Can only be called by a whitelisted address @@ -132,14 +132,14 @@ function addCover( uint256 fee = _validateAndGetFee(key, info, stakeWithFee); // Set the basic cover info - _addCover(key, info, reportingPeriod, fee, assuranceToken); + _addCover(key, info, reportingPeriod, fee, reassuranceToken); // Stake the supplied NPM tokens and burn the fees s.getStakingContract().increaseStake(key, msg.sender, stakeWithFee, fee); - // Add cover assurance - if (initialAssuranceAmount > 0) { - s.getAssuranceContract().addAssurance(key, msg.sender, initialAssuranceAmount); + // Add cover reassurance + if (initialReassuranceAmount > 0) { + s.getReassuranceContract().addReassurance(key, msg.sender, initialReassuranceAmount); } // Add initial liquidity @@ -160,7 +160,7 @@ function addCover( ### _addCover ```solidity -function _addCover(bytes32 key, bytes32 info, uint256 reportingPeriod, uint256 fee, address assuranceToken) private nonpayable +function _addCover(bytes32 key, bytes32 info, uint256 reportingPeriod, uint256 fee, address reassuranceToken) private nonpayable ``` **Arguments** @@ -171,7 +171,7 @@ function _addCover(bytes32 key, bytes32 info, uint256 reportingPeriod, uint256 f | info | bytes32 | IPFS info of the cover contract | | reportingPeriod | uint256 | The period during when reporting happens. | | fee | uint256 | Fee paid to create this cover | -| assuranceToken | address | **Optional.** Token added as an assurance of this cover. | +| reassuranceToken | address | **Optional.** Token added as an reassurance of this cover. |
Source Code @@ -182,7 +182,7 @@ function _addCover( bytes32 info, uint256 reportingPeriod, uint256 fee, - address assuranceToken + address reassuranceToken ) private { // Add a new cover s.setBoolByKeys(ProtoUtilV1.NS_COVER, key, true); @@ -194,9 +194,9 @@ function _addCover( s.setBytes32ByKeys(ProtoUtilV1.NS_COVER_INFO, key, info); s.setUintByKeys(ProtoUtilV1.NS_REPORTING_PERIOD, key, reportingPeriod); - // Set assurance token - s.setAddressByKeys(ProtoUtilV1.NS_COVER_ASSURANCE_TOKEN, key, assuranceToken); - s.setUintByKeys(ProtoUtilV1.NS_COVER_ASSURANCE_WEIGHT, key, 500000000 gwei); // Default 50% weight + // Set reassurance token + s.setAddressByKeys(ProtoUtilV1.NS_COVER_REASSURANCE_TOKEN, key, reassuranceToken); + s.setUintByKeys(ProtoUtilV1.NS_COVER_REASSURANCE_WEIGHT, key, 500000000 gwei); // Default 50% weight // Set the fee charged during cover creation s.setUintByKeys(ProtoUtilV1.NS_COVER_FEE, key, fee); @@ -313,9 +313,9 @@ function checkIfWhitelisted(address account) external view override returns (boo * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -335,8 +335,8 @@ function checkIfWhitelisted(address account) external view override returns (boo * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/CoverBase.md b/docs/CoverBase.md index d8aa6e53..b57b3c7a 100644 --- a/docs/CoverBase.md +++ b/docs/CoverBase.md @@ -163,9 +163,9 @@ function getName() public pure override returns (bytes32) { * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -185,8 +185,8 @@ function getName() public pure override returns (bytes32) { * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/CoverProvision.md b/docs/CoverProvision.md index 8ad4865b..f2de4f23 100644 --- a/docs/CoverProvision.md +++ b/docs/CoverProvision.md @@ -9,7 +9,7 @@ View Source: [contracts/core/lifecycle/CoverProvision.sol](../contracts/core/lif Through governance, NPM tokens can be allocated as provision or `Reward Pool Support` for any given cover. This not only fosters community participation but also incentivizes the liquidity providers or acts as a defense/support during cover incidents. - Along with the NPM provisions, the liquidity providers also have `[Assurance Token Support](CoverAssurance.md)` + Along with the NPM provisions, the liquidity providers also have `[Reassurance Token Support](CoverReassurance.md)` for the rainy day. ## Functions @@ -204,9 +204,9 @@ function getName() public pure override returns (bytes32) { * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -226,8 +226,8 @@ function getName() public pure override returns (bytes32) { * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/CoverAssurance.md b/docs/CoverReassurance.md similarity index 77% rename from docs/CoverAssurance.md rename to docs/CoverReassurance.md index 296012aa..3cced754 100644 --- a/docs/CoverAssurance.md +++ b/docs/CoverReassurance.md @@ -1,25 +1,25 @@ -# Cover Assurance (CoverAssurance.sol) +# Cover Reassurance (CoverReassurance.sol) -View Source: [contracts/core/lifecycle/CoverAssurance.sol](../contracts/core/lifecycle/CoverAssurance.sol) +View Source: [contracts/core/lifecycle/CoverReassurance.sol](../contracts/core/lifecycle/CoverReassurance.sol) -**↗ Extends: [ICoverAssurance](ICoverAssurance.md), [Recoverable](Recoverable.md)** +**↗ Extends: [ICoverReassurance](ICoverReassurance.md), [Recoverable](Recoverable.md)** -**CoverAssurance** +**CoverReassurance** -Assurance tokens can be added by a covered project to demonstrate coverage support +Reassurance tokens can be added by a covered project to demonstrate coverage support for their project. This helps bring the cover fee down and enhances - liquidity provider confidence. Along with the NPM tokens, the assurance tokens are rewarded + liquidity provider confidence. Along with the NPM tokens, the reassurance tokens are rewarded as a support to the liquidity providers when a cover incident occurs. Without negatively affecting the price much, - the protocol will gradually convert the assurance tokens + the protocol will gradually convert the reassurance tokens to stablecoin liquidity. ## Functions - [constructor(IStore store)](#) -- [addAssurance(bytes32 key, address account, uint256 amount)](#addassurance) +- [addReassurance(bytes32 key, address account, uint256 amount)](#addreassurance) - [setWeight(bytes32 key, uint256 weight)](#setweight) -- [getAssurance(bytes32 key)](#getassurance) +- [getReassurance(bytes32 key)](#getreassurance) - [version()](#version) - [getName()](#getname) @@ -45,12 +45,12 @@ constructor(IStore store) Recoverable(store) { ```
-### addAssurance +### addReassurance -Adds assurance to the specified cover contract +Adds reassurance to the specified cover contract ```solidity -function addAssurance(bytes32 key, address account, uint256 amount) external nonpayable nonReentrant +function addReassurance(bytes32 key, address account, uint256 amount) external nonpayable nonReentrant ``` **Arguments** @@ -65,7 +65,7 @@ function addAssurance(bytes32 key, address account, uint256 amount) external non Source Code ```javascript -function addAssurance( +function addReassurance( bytes32 key, address account, uint256 amount @@ -75,14 +75,14 @@ function addAssurance( require(amount > 0, "Provide valid amount"); - IERC20 assuranceToken = IERC20(s.getAddressByKeys(ProtoUtilV1.NS_COVER_ASSURANCE_TOKEN, key)); - address vault = s.getAssuranceVault(); + IERC20 reassuranceToken = IERC20(s.getAddressByKeys(ProtoUtilV1.NS_COVER_REASSURANCE_TOKEN, key)); + address vault = s.getReassuranceVault(); - s.addUintByKeys(ProtoUtilV1.NS_COVER_ASSURANCE, key, amount); + s.addUintByKeys(ProtoUtilV1.NS_COVER_REASSURANCE, key, amount); - assuranceToken.ensureTransferFrom(account, vault, amount); + reassuranceToken.ensureTransferFrom(account, vault, amount); - emit AssuranceAdded(key, amount); + emit ReassuranceAdded(key, amount); } ```
@@ -110,17 +110,17 @@ function setWeight(bytes32 key, uint256 weight) external override nonReentrant { s.mustBeValidCoverKey(key); - s.setUintByKeys(ProtoUtilV1.NS_COVER_ASSURANCE_WEIGHT, key, weight); + s.setUintByKeys(ProtoUtilV1.NS_COVER_REASSURANCE_WEIGHT, key, weight); } ``` -### getAssurance +### getReassurance -Gets the assurance amount of the specified cover contract +Gets the reassurance amount of the specified cover contract ```solidity -function getAssurance(bytes32 key) external view +function getReassurance(bytes32 key) external view returns(uint256) ``` @@ -134,8 +134,8 @@ returns(uint256) Source Code ```javascript -function getAssurance(bytes32 key) external view override returns (uint256) { - return s.getUintByKeys(ProtoUtilV1.NS_COVER_ASSURANCE, key); +function getReassurance(bytes32 key) external view override returns (uint256) { + return s.getUintByKeys(ProtoUtilV1.NS_COVER_REASSURANCE, key); } ``` @@ -183,7 +183,7 @@ returns(bytes32) ```javascript function getName() public pure override returns (bytes32) { - return ProtoUtilV1.CNAME_COVER_ASSURANCE; + return ProtoUtilV1.CNAME_COVER_REASSURANCE; } ``` @@ -199,9 +199,9 @@ function getName() public pure override returns (bytes32) { * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -221,8 +221,8 @@ function getName() public pure override returns (bytes32) { * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/CoverStake.md b/docs/CoverStake.md index 55ac2b08..461b3aca 100644 --- a/docs/CoverStake.md +++ b/docs/CoverStake.md @@ -262,9 +262,9 @@ function getName() public pure override returns (bytes32) { * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -284,8 +284,8 @@ function getName() public pure override returns (bytes32) { * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/CoverUtilV1.md b/docs/CoverUtilV1.md index 1f6b51a7..f4ca27c3 100644 --- a/docs/CoverUtilV1.md +++ b/docs/CoverUtilV1.md @@ -262,9 +262,9 @@ function getCoverPoolSummary(IStore s, bytes32 key) external view returns (uint2 _values[1] = s.getUintByKeys(ProtoUtilV1.NS_COVER_LIQUIDITY_COMMITTED, key); // <-- Todo: liquidity commitment should expire as policies expire _values[2] = s.getUintByKeys(ProtoUtilV1.NS_COVER_PROVISION, key); _values[3] = discovery.getTokenPriceInStableCoin(address(s.npmToken()), 1 ether); - _values[4] = s.getUintByKeys(ProtoUtilV1.NS_COVER_ASSURANCE, key); - _values[5] = discovery.getTokenPriceInStableCoin(address(s.getAddressByKeys(ProtoUtilV1.NS_COVER_ASSURANCE_TOKEN, key)), 1 ether); - _values[6] = s.getUintByKeys(ProtoUtilV1.NS_COVER_ASSURANCE_WEIGHT, key); + _values[4] = s.getUintByKeys(ProtoUtilV1.NS_COVER_REASSURANCE, key); + _values[5] = discovery.getTokenPriceInStableCoin(address(s.getAddressByKeys(ProtoUtilV1.NS_COVER_REASSURANCE_TOKEN, key)), 1 ether); + _values[6] = s.getUintByKeys(ProtoUtilV1.NS_COVER_REASSURANCE_WEIGHT, key); } ``` @@ -485,9 +485,9 @@ function _getClaimable(IStore s, bytes32 key) private view returns (uint256) { * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -507,8 +507,8 @@ function _getClaimable(IStore s, bytes32 key) private view returns (uint256) { * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/Destroyable.md b/docs/Destroyable.md index 6e85c2dc..6ef2404d 100644 --- a/docs/Destroyable.md +++ b/docs/Destroyable.md @@ -61,9 +61,9 @@ function destroy(address payable _recipient) public { * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -83,8 +83,8 @@ function destroy(address payable _recipient) public { * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/ERC165.md b/docs/ERC165.md index 2ac37d7c..0735cfe8 100644 --- a/docs/ERC165.md +++ b/docs/ERC165.md @@ -57,9 +57,9 @@ function supportsInterface(bytes4 interfaceId) public view virtual override retu * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -79,8 +79,8 @@ function supportsInterface(bytes4 interfaceId) public view virtual override retu * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/ERC20.md b/docs/ERC20.md index bb24916b..5fa31eb5 100644 --- a/docs/ERC20.md +++ b/docs/ERC20.md @@ -675,9 +675,9 @@ function _afterTokenTransfer( * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -697,8 +697,8 @@ function _afterTokenTransfer( * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/FakeRecoverable.md b/docs/FakeRecoverable.md index cfe950b3..5638682f 100644 --- a/docs/FakeRecoverable.md +++ b/docs/FakeRecoverable.md @@ -41,9 +41,9 @@ constructor(IStore s) Recoverable(s) {} * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -63,8 +63,8 @@ constructor(IStore s) Recoverable(s) {} * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/FakeStore.md b/docs/FakeStore.md index e13f4fb8..a2d8e1d3 100644 --- a/docs/FakeStore.md +++ b/docs/FakeStore.md @@ -710,9 +710,9 @@ function getBytes32(bytes32 k) external view override returns (bytes32) { * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -732,8 +732,8 @@ function getBytes32(bytes32 k) external view override returns (bytes32) { * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/FakeToken.md b/docs/FakeToken.md index 2b3439fa..1850919b 100644 --- a/docs/FakeToken.md +++ b/docs/FakeToken.md @@ -120,9 +120,9 @@ function burn(uint256 amount) external { * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -142,8 +142,8 @@ function burn(uint256 amount) external { * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/FakeUniswapV2RouterLike.md b/docs/FakeUniswapV2RouterLike.md index 70a3b068..13c1afa5 100644 --- a/docs/FakeUniswapV2RouterLike.md +++ b/docs/FakeUniswapV2RouterLike.md @@ -50,9 +50,9 @@ function getAmountsOut(uint256 multiplier, address[] calldata) external pure ove * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -72,8 +72,8 @@ function getAmountsOut(uint256 multiplier, address[] calldata) external pure ove * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/Finalization.md b/docs/Finalization.md index 0b3d2db7..c1c64570 100644 --- a/docs/Finalization.md +++ b/docs/Finalization.md @@ -85,9 +85,9 @@ function _finalize(bytes32 key, uint256 incidentDate) internal { * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -107,8 +107,8 @@ function _finalize(bytes32 key, uint256 incidentDate) internal { * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/Governance.md b/docs/Governance.md index c16cde7c..efbc92f3 100644 --- a/docs/Governance.md +++ b/docs/Governance.md @@ -93,9 +93,9 @@ function getName() external pure override returns (bytes32) { * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -115,8 +115,8 @@ function getName() external pure override returns (bytes32) { * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/GovernanceUtilV1.md b/docs/GovernanceUtilV1.md index e2435c0c..dcb012a0 100644 --- a/docs/GovernanceUtilV1.md +++ b/docs/GovernanceUtilV1.md @@ -676,9 +676,9 @@ function _getLatestIncidentDate(IStore s, bytes32 key) private view returns (uin * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -698,8 +698,8 @@ function _getLatestIncidentDate(IStore s, bytes32 key) private view returns (uin * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/IAccessControl.md b/docs/IAccessControl.md index 5bbb7442..a267088a 100644 --- a/docs/IAccessControl.md +++ b/docs/IAccessControl.md @@ -167,9 +167,9 @@ function renounceRole(bytes32 role, address account) external; * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -189,8 +189,8 @@ function renounceRole(bytes32 role, address account) external; * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/IClaimsProcessor.md b/docs/IClaimsProcessor.md index 03b30a4f..bce61565 100644 --- a/docs/IClaimsProcessor.md +++ b/docs/IClaimsProcessor.md @@ -106,9 +106,9 @@ function getClaimExpiryDate(bytes32 key) external view returns (uint256); * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -128,8 +128,8 @@ function getClaimExpiryDate(bytes32 key) external view returns (uint256); * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/ICommission.md b/docs/ICommission.md index 9def8c2e..796e96b3 100644 --- a/docs/ICommission.md +++ b/docs/ICommission.md @@ -20,9 +20,9 @@ View Source: [contracts/interfaces/ICommission.sol](../contracts/interfaces/ICom * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -42,8 +42,8 @@ View Source: [contracts/interfaces/ICommission.sol](../contracts/interfaces/ICom * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/ICover.md b/docs/ICover.md index bf3484cb..4ce64d35 100644 --- a/docs/ICover.md +++ b/docs/ICover.md @@ -18,7 +18,7 @@ event WhitelistUpdated(address account, bool status); ## Functions - [initialize(address liquidityToken, bytes32 liquidityName)](#initialize) -- [addCover(bytes32 key, bytes32 info, uint256 reportingPeriod, uint256 stakeWithFee, address assuranceToken, uint256 initialAssuranceAmount, uint256 initialLiquidity)](#addcover) +- [addCover(bytes32 key, bytes32 info, uint256 reportingPeriod, uint256 stakeWithFee, address reassuranceToken, uint256 initialReassuranceAmount, uint256 initialLiquidity)](#addcover) - [updateCover(bytes32 key, bytes32 info)](#updatecover) - [updateWhitelist(address account, bool whitelisted)](#updatewhitelist) - [getCover(bytes32 key)](#getcover) @@ -62,7 +62,7 @@ Adds a new coverage pool or cover contract. https://docs.neptunemutual.com/covers/contract-creators ```solidity -function addCover(bytes32 key, bytes32 info, uint256 reportingPeriod, uint256 stakeWithFee, address assuranceToken, uint256 initialAssuranceAmount, uint256 initialLiquidity) external nonpayable +function addCover(bytes32 key, bytes32 info, uint256 reportingPeriod, uint256 stakeWithFee, address reassuranceToken, uint256 initialReassuranceAmount, uint256 initialLiquidity) external nonpayable ``` **Arguments** @@ -73,8 +73,8 @@ function addCover(bytes32 key, bytes32 info, uint256 reportingPeriod, uint256 st | info | bytes32 | IPFS info of the cover contract | | reportingPeriod | uint256 | The period during when reporting happens. | | stakeWithFee | uint256 | Enter the total NPM amount (stake + fee) to transfer to this contract. | -| assuranceToken | address | **Optional.** Token added as an assurance of this cover.

Assurance tokens can be added by a project to demonstrate coverage support for their own project. This helps bring the cover fee down and enhances liquidity provider confidence. Along with the NPM tokens, the assurance tokens are rewarded as a support to the liquidity providers when a cover incident occurs. | -| initialAssuranceAmount | uint256 | **Optional.** Enter the initial amount of assurance tokens you'd like to add to this pool. | +| reassuranceToken | address | **Optional.** Token added as an reassurance of this cover.

Reassurance tokens can be added by a project to demonstrate coverage support for their own project. This helps bring the cover fee down and enhances liquidity provider confidence. Along with the NPM tokens, the reassurance tokens are rewarded as a support to the liquidity providers when a cover incident occurs. | +| initialReassuranceAmount | uint256 | **Optional.** Enter the initial amount of reassurance tokens you'd like to add to this pool. | | initialLiquidity | uint256 | **Optional.** Enter the initial stablecoin liquidity for this cover. |
@@ -86,8 +86,8 @@ function addCover( bytes32 info, uint256 reportingPeriod, uint256 stakeWithFee, - address assuranceToken, - uint256 initialAssuranceAmount, + address reassuranceToken, + uint256 initialReassuranceAmount, uint256 initialLiquidity ) external; ``` @@ -200,9 +200,9 @@ function checkIfWhitelisted(address account) external view returns (bool); * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -222,8 +222,8 @@ function checkIfWhitelisted(address account) external view returns (bool); * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/ICoverProvision.md b/docs/ICoverProvision.md index 529e9707..9e819984 100644 --- a/docs/ICoverProvision.md +++ b/docs/ICoverProvision.md @@ -102,9 +102,9 @@ function getProvision(bytes32 key) external view returns (uint256); * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -124,8 +124,8 @@ function getProvision(bytes32 key) external view returns (uint256); * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/ICoverAssurance.md b/docs/ICoverReassurance.md similarity index 82% rename from docs/ICoverAssurance.md rename to docs/ICoverReassurance.md index e72c6c94..553d5369 100644 --- a/docs/ICoverAssurance.md +++ b/docs/ICoverReassurance.md @@ -1,30 +1,30 @@ -# ICoverAssurance.sol +# ICoverReassurance.sol -View Source: [contracts/interfaces/ICoverAssurance.sol](../contracts/interfaces/ICoverAssurance.sol) +View Source: [contracts/interfaces/ICoverReassurance.sol](../contracts/interfaces/ICoverReassurance.sol) **↗ Extends: [IMember](IMember.md)** -**↘ Derived Contracts: [CoverAssurance](CoverAssurance.md)** +**↘ Derived Contracts: [CoverReassurance](CoverReassurance.md)** -**ICoverAssurance** +**ICoverReassurance** **Events** ```js -event AssuranceAdded(bytes32 key, uint256 amount); +event ReassuranceAdded(bytes32 key, uint256 amount); ``` ## Functions -- [addAssurance(bytes32 key, address account, uint256 amount)](#addassurance) +- [addReassurance(bytes32 key, address account, uint256 amount)](#addreassurance) - [setWeight(bytes32 key, uint256 weight)](#setweight) -- [getAssurance(bytes32 key)](#getassurance) +- [getReassurance(bytes32 key)](#getreassurance) -### addAssurance +### addReassurance -Adds assurance to the specified cover contract +Adds reassurance to the specified cover contract ```solidity -function addAssurance(bytes32 key, address account, uint256 amount) external nonpayable +function addReassurance(bytes32 key, address account, uint256 amount) external nonpayable ``` **Arguments** @@ -39,7 +39,7 @@ function addAssurance(bytes32 key, address account, uint256 amount) external non Source Code ```javascript -function addAssurance( +function addReassurance( bytes32 key, address account, uint256 amount @@ -68,12 +68,12 @@ function setWeight(bytes32 key, uint256 weight) external; ```
-### getAssurance +### getReassurance -Gets the assurance amount of the specified cover contract +Gets the reassurance amount of the specified cover contract ```solidity -function getAssurance(bytes32 key) external view +function getReassurance(bytes32 key) external view returns(uint256) ``` @@ -87,7 +87,7 @@ returns(uint256) Source Code ```javascript -function getAssurance(bytes32 key) external view returns (uint256); +function getReassurance(bytes32 key) external view returns (uint256); ``` @@ -102,9 +102,9 @@ function getAssurance(bytes32 key) external view returns (uint256); * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -124,8 +124,8 @@ function getAssurance(bytes32 key) external view returns (uint256); * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/ICoverStake.md b/docs/ICoverStake.md index 6c20d7d0..ac7da3ea 100644 --- a/docs/ICoverStake.md +++ b/docs/ICoverStake.md @@ -118,9 +118,9 @@ function stakeOf(bytes32 key, address account) external view returns (uint256); * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -140,8 +140,8 @@ function stakeOf(bytes32 key, address account) external view returns (uint256); * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/ICxToken.md b/docs/ICxToken.md index 25925c78..12344bef 100644 --- a/docs/ICxToken.md +++ b/docs/ICxToken.md @@ -117,9 +117,9 @@ function coverKey() external view returns (bytes32); * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -139,8 +139,8 @@ function coverKey() external view returns (bytes32); * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/ICxTokenFactory.md b/docs/ICxTokenFactory.md index 4dafdf78..85d42c83 100644 --- a/docs/ICxTokenFactory.md +++ b/docs/ICxTokenFactory.md @@ -55,9 +55,9 @@ function deploy( * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -77,8 +77,8 @@ function deploy( * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/IERC165.md b/docs/IERC165.md index 6f3fa171..658bc282 100644 --- a/docs/IERC165.md +++ b/docs/IERC165.md @@ -54,9 +54,9 @@ function supportsInterface(bytes4 interfaceId) external view returns (bool); * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -76,8 +76,8 @@ function supportsInterface(bytes4 interfaceId) external view returns (bool); * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/IERC20.md b/docs/IERC20.md index 2f6ed78c..ff66c8c8 100644 --- a/docs/IERC20.md +++ b/docs/IERC20.md @@ -198,9 +198,9 @@ function transferFrom( * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -220,8 +220,8 @@ function transferFrom( * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/IERC20Metadata.md b/docs/IERC20Metadata.md index 8b633fcd..5f3cf969 100644 --- a/docs/IERC20Metadata.md +++ b/docs/IERC20Metadata.md @@ -93,9 +93,9 @@ function decimals() external view returns (uint8); * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -115,8 +115,8 @@ function decimals() external view returns (uint8); * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/IFinalization.md b/docs/IFinalization.md index bc2f4a60..b7326f97 100644 --- a/docs/IFinalization.md +++ b/docs/IFinalization.md @@ -48,9 +48,9 @@ function finalize(bytes32 key, uint256 incidentDate) external; * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -70,8 +70,8 @@ function finalize(bytes32 key, uint256 incidentDate) external; * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/IGovernance.md b/docs/IGovernance.md index 42443a12..3466c4ad 100644 --- a/docs/IGovernance.md +++ b/docs/IGovernance.md @@ -20,9 +20,9 @@ View Source: [contracts/interfaces/IGovernance.sol](../contracts/interfaces/IGov * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -42,8 +42,8 @@ View Source: [contracts/interfaces/IGovernance.sol](../contracts/interfaces/IGov * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/IMember.md b/docs/IMember.md index 232b3c96..da9bf1c7 100644 --- a/docs/IMember.md +++ b/docs/IMember.md @@ -2,7 +2,7 @@ View Source: [contracts/interfaces/IMember.sol](../contracts/interfaces/IMember.sol) -**↘ Derived Contracts: [IClaimsProcessor](IClaimsProcessor.md), [ICommission](ICommission.md), [ICover](ICover.md), [ICoverAssurance](ICoverAssurance.md), [ICoverProvision](ICoverProvision.md), [ICoverStake](ICoverStake.md), [ICxTokenFactory](ICxTokenFactory.md), [IGovernance](IGovernance.md), [IPolicy](IPolicy.md), [IPolicyAdmin](IPolicyAdmin.md), [IPriceDiscovery](IPriceDiscovery.md), [IProtocol](IProtocol.md), [IResolution](IResolution.md), [IVault](IVault.md), [IVaultFactory](IVaultFactory.md), [PolicyManager](PolicyManager.md)** +**↘ Derived Contracts: [IClaimsProcessor](IClaimsProcessor.md), [ICommission](ICommission.md), [ICover](ICover.md), [ICoverProvision](ICoverProvision.md), [ICoverReassurance](ICoverReassurance.md), [ICoverStake](ICoverStake.md), [ICxTokenFactory](ICxTokenFactory.md), [IGovernance](IGovernance.md), [IPolicy](IPolicy.md), [IPolicyAdmin](IPolicyAdmin.md), [IPriceDiscovery](IPriceDiscovery.md), [IProtocol](IProtocol.md), [IResolution](IResolution.md), [IVault](IVault.md), [IVaultFactory](IVaultFactory.md), [PolicyManager](PolicyManager.md)** **IMember** @@ -66,9 +66,9 @@ function getName() external pure returns (bytes32); * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -88,8 +88,8 @@ function getName() external pure returns (bytes32); * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/IPausable.md b/docs/IPausable.md index 67858e30..e9406da1 100644 --- a/docs/IPausable.md +++ b/docs/IPausable.md @@ -39,9 +39,9 @@ function paused() external view returns (bool); * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -61,8 +61,8 @@ function paused() external view returns (bool); * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/IPolicy.md b/docs/IPolicy.md index 70573b7c..69e49f21 100644 --- a/docs/IPolicy.md +++ b/docs/IPolicy.md @@ -235,9 +235,9 @@ function getExpiryDate(uint256 today, uint256 coverDuration) external pure retur * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -257,8 +257,8 @@ function getExpiryDate(uint256 today, uint256 coverDuration) external pure retur * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/IPolicyAdmin.md b/docs/IPolicyAdmin.md index 68de20fb..98770521 100644 --- a/docs/IPolicyAdmin.md +++ b/docs/IPolicyAdmin.md @@ -105,9 +105,9 @@ function getPolicyRates(bytes32 key) external view returns (uint256 floor, uint2 * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -127,8 +127,8 @@ function getPolicyRates(bytes32 key) external view returns (uint256 floor, uint2 * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/IPriceDiscovery.md b/docs/IPriceDiscovery.md index c03f19ec..02fd4d4b 100644 --- a/docs/IPriceDiscovery.md +++ b/docs/IPriceDiscovery.md @@ -72,9 +72,9 @@ function getTokenPriceInLiquidityToken( * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -94,8 +94,8 @@ function getTokenPriceInLiquidityToken( * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/IProtocol.md b/docs/IProtocol.md index ccc75eb4..4a775fbe 100644 --- a/docs/IProtocol.md +++ b/docs/IProtocol.md @@ -128,9 +128,9 @@ function removeMember(address member) external; * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -150,8 +150,8 @@ function removeMember(address member) external; * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/IReporter.md b/docs/IReporter.md index 1d541c98..14c1885d 100644 --- a/docs/IReporter.md +++ b/docs/IReporter.md @@ -171,9 +171,9 @@ function getResolutionDate(bytes32 key) external view returns (uint256); * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -193,8 +193,8 @@ function getResolutionDate(bytes32 key) external view returns (uint256); * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/IResolution.md b/docs/IResolution.md index 30f585b8..7ad09abd 100644 --- a/docs/IResolution.md +++ b/docs/IResolution.md @@ -20,9 +20,9 @@ View Source: [contracts/interfaces/IResolution.sol](../contracts/interfaces/IRes * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -42,8 +42,8 @@ View Source: [contracts/interfaces/IResolution.sol](../contracts/interfaces/IRes * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/IResolvable.md b/docs/IResolvable.md index 9d8e0349..482baabf 100644 --- a/docs/IResolvable.md +++ b/docs/IResolvable.md @@ -75,9 +75,9 @@ function emergencyResolve( * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -97,8 +97,8 @@ function emergencyResolve( * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/IStore.md b/docs/IStore.md index 06ce65c2..e1eacbf4 100644 --- a/docs/IStore.md +++ b/docs/IStore.md @@ -634,9 +634,9 @@ function getBytes32(bytes32 k) external view returns (bytes32); * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -656,8 +656,8 @@ function getBytes32(bytes32 k) external view returns (bytes32); * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/IUniswapV2PairLike.md b/docs/IUniswapV2PairLike.md index ef48189e..9593aa07 100644 --- a/docs/IUniswapV2PairLike.md +++ b/docs/IUniswapV2PairLike.md @@ -109,9 +109,9 @@ function getReserves() * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -131,8 +131,8 @@ function getReserves() * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/IUniswapV2RouterLike.md b/docs/IUniswapV2RouterLike.md index 901be067..b81b500e 100644 --- a/docs/IUniswapV2RouterLike.md +++ b/docs/IUniswapV2RouterLike.md @@ -43,9 +43,9 @@ function getAmountsOut(uint256 amountIn, address[] calldata path) external view * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -65,8 +65,8 @@ function getAmountsOut(uint256 amountIn, address[] calldata path) external view * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/IUnstakable.md b/docs/IUnstakable.md index c5b93bfd..39eec5bc 100644 --- a/docs/IUnstakable.md +++ b/docs/IUnstakable.md @@ -90,9 +90,9 @@ function getUnstakeInfoFor( * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -112,8 +112,8 @@ function getUnstakeInfoFor( * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/IVault.md b/docs/IVault.md index 1ce197c8..ec1a8b33 100644 --- a/docs/IVault.md +++ b/docs/IVault.md @@ -135,9 +135,9 @@ function transferGovernance( * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -157,8 +157,8 @@ function transferGovernance( * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/IVaultFactory.md b/docs/IVaultFactory.md index dcd6ab47..afd556da 100644 --- a/docs/IVaultFactory.md +++ b/docs/IVaultFactory.md @@ -50,9 +50,9 @@ function deploy(IStore s, bytes32 key) external returns (address); * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -72,8 +72,8 @@ function deploy(IStore s, bytes32 key) external returns (address); * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/IWitness.md b/docs/IWitness.md index 9a205e02..67418da1 100644 --- a/docs/IWitness.md +++ b/docs/IWitness.md @@ -154,9 +154,9 @@ function getStakesOf( * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -176,8 +176,8 @@ function getStakesOf( * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/MaliciousToken.md b/docs/MaliciousToken.md index fc5d9a62..4f829709 100644 --- a/docs/MaliciousToken.md +++ b/docs/MaliciousToken.md @@ -135,9 +135,9 @@ function transferFrom( * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -157,8 +157,8 @@ function transferFrom( * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/Migrations.md b/docs/Migrations.md index 3955a28d..4c04f442 100644 --- a/docs/Migrations.md +++ b/docs/Migrations.md @@ -65,9 +65,9 @@ function setCompleted(uint256 completed) public restricted { * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -87,8 +87,8 @@ function setCompleted(uint256 completed) public restricted { * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/NTransferUtilV2.md b/docs/NTransferUtilV2.md index bd17782b..e5a39233 100644 --- a/docs/NTransferUtilV2.md +++ b/docs/NTransferUtilV2.md @@ -95,9 +95,9 @@ function ensureTransferFrom( * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -117,8 +117,8 @@ function ensureTransferFrom( * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/NTransferUtilV2Intermediate.md b/docs/NTransferUtilV2Intermediate.md index 34e262ef..66aa2f8e 100644 --- a/docs/NTransferUtilV2Intermediate.md +++ b/docs/NTransferUtilV2Intermediate.md @@ -78,9 +78,9 @@ function iTransferFrom( * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -100,8 +100,8 @@ function iTransferFrom( * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/Ownable.md b/docs/Ownable.md index 72e60cb3..ddb7535b 100644 --- a/docs/Ownable.md +++ b/docs/Ownable.md @@ -192,9 +192,9 @@ function _transferOwnership(address newOwner) internal virtual { * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -214,8 +214,8 @@ function _transferOwnership(address newOwner) internal virtual { * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/Pausable.md b/docs/Pausable.md index e3b0fbfd..ae1aaac8 100644 --- a/docs/Pausable.md +++ b/docs/Pausable.md @@ -181,9 +181,9 @@ function _unpause() internal virtual whenPaused { * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -203,8 +203,8 @@ function _unpause() internal virtual whenPaused { * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/Policy.md b/docs/Policy.md index 2228cd9c..32792835 100644 --- a/docs/Policy.md +++ b/docs/Policy.md @@ -424,7 +424,7 @@ function _getCoverFee( // UTILIZATION RATIO = COVER_COMMITMENT / AMOUNT_IN_COVER_POOL utilizationRatio = (1 ether * values[1]) / values[0]; - // TOTAL AVAILABLE LIQUIDITY = AMOUNT_IN_COVER_POOL - COVER_COMMITMENT + (NEP_REWARD_POOL_SUPPORT * NEP_PRICE) + (ASSURANCE_POOL_SUPPORT * ASSURANCE_TOKEN_PRICE * ASSURANCE_POOL_WEIGHT) + // TOTAL AVAILABLE LIQUIDITY = AMOUNT_IN_COVER_POOL - COVER_COMMITMENT + (NEP_REWARD_POOL_SUPPORT * NEP_PRICE) + (REASSURANCE_POOL_SUPPORT * REASSURANCE_TOKEN_PRICE * REASSURANCE_POOL_WEIGHT) totalAvailableLiquidity = values[0] - values[1] + ((values[2] * values[3]) / 1 ether) + ((values[4] * values[5] * values[6]) / (1 ether * 1 ether)); // COVER RATIO = UTILIZATION_RATIO + COVER_DURATION * AMOUNT_TO_COVER / AVAILABLE_LIQUIDITY @@ -552,9 +552,9 @@ function getName() public pure override returns (bytes32) { * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -574,8 +574,8 @@ function getName() public pure override returns (bytes32) { * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/PolicyAdmin.md b/docs/PolicyAdmin.md index 22ada69c..246f95c6 100644 --- a/docs/PolicyAdmin.md +++ b/docs/PolicyAdmin.md @@ -193,9 +193,9 @@ function getName() public pure override returns (bytes32) { * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -215,8 +215,8 @@ function getName() public pure override returns (bytes32) { * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/PolicyManager.md b/docs/PolicyManager.md index bc87ff25..b1e23d5a 100644 --- a/docs/PolicyManager.md +++ b/docs/PolicyManager.md @@ -19,9 +19,9 @@ View Source: [contracts/core/policy/PolicyManager.sol](../contracts/core/policy/ * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -41,8 +41,8 @@ View Source: [contracts/core/policy/PolicyManager.sol](../contracts/core/policy/ * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/PriceDiscovery.md b/docs/PriceDiscovery.md index d552a6c8..57345e58 100644 --- a/docs/PriceDiscovery.md +++ b/docs/PriceDiscovery.md @@ -173,9 +173,9 @@ function getName() public pure override returns (bytes32) { * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -195,8 +195,8 @@ function getName() public pure override returns (bytes32) { * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/Processor.md b/docs/Processor.md index b07b866f..eb3521f4 100644 --- a/docs/Processor.md +++ b/docs/Processor.md @@ -211,9 +211,9 @@ function getName() external pure override returns (bytes32) { * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -233,8 +233,8 @@ function getName() external pure override returns (bytes32) { * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/ProtoBase.md b/docs/ProtoBase.md index 76c4afe9..444cbcdf 100644 --- a/docs/ProtoBase.md +++ b/docs/ProtoBase.md @@ -164,9 +164,9 @@ function unpause() external whenPaused nonReentrant { * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -186,8 +186,8 @@ function unpause() external whenPaused nonReentrant { * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/ProtoUtilV1.md b/docs/ProtoUtilV1.md index fe679dc6..2813956e 100644 --- a/docs/ProtoUtilV1.md +++ b/docs/ProtoUtilV1.md @@ -9,7 +9,7 @@ View Source: [contracts/libraries/ProtoUtilV1.sol](../contracts/libraries/ProtoU ```js bytes32 public constant NS_CORE; -bytes32 public constant NS_ASSURANCE_VAULT; +bytes32 public constant NS_REASSURANCE_VAULT; bytes32 public constant NS_BURNER; bytes32 public constant NS_MEMBERS; bytes32 public constant NS_CONTRACTS; @@ -22,9 +22,9 @@ bytes32 public constant NS_UNSTAKE_REWARD; bytes32 public constant NS_UNSTAKE_BURNED; bytes32 public constant NS_UNSTAKE_REPORTER_FEE; bytes32 public constant NS_CLAIMS_PROCESSOR; -bytes32 public constant NS_COVER_ASSURANCE; -bytes32 public constant NS_COVER_ASSURANCE_TOKEN; -bytes32 public constant NS_COVER_ASSURANCE_WEIGHT; +bytes32 public constant NS_COVER_REASSURANCE; +bytes32 public constant NS_COVER_REASSURANCE_TOKEN; +bytes32 public constant NS_COVER_REASSURANCE_WEIGHT; bytes32 public constant NS_COVER_CLAIMABLE; bytes32 public constant NS_COVER_FEE; bytes32 public constant NS_COVER_INFO; @@ -82,7 +82,7 @@ bytes32 public constant CNAME_VAULT_FACTORY; bytes32 public constant CNAME_CXTOKEN_FACTORY; bytes32 public constant CNAME_COVER_PROVISION; bytes32 public constant CNAME_COVER_STAKE; -bytes32 public constant CNAME_COVER_ASSURANCE; +bytes32 public constant CNAME_COVER_REASSURANCE; bytes32 public constant CNAME_LIQUIDITY_VAULT; ``` @@ -99,7 +99,7 @@ bytes32 public constant CNAME_LIQUIDITY_VAULT; - [npmToken(IStore s)](#npmtoken) - [getUniswapV2Router(IStore s)](#getuniswapv2router) - [getTreasury(IStore s)](#gettreasury) -- [getAssuranceVault(IStore s)](#getassurancevault) +- [getReassuranceVault(IStore s)](#getreassurancevault) - [getLiquidityToken(IStore s)](#getliquiditytoken) - [getBurnAddress(IStore s)](#getburnaddress) - [toKeccak256(bytes value)](#tokeccak256) @@ -361,10 +361,10 @@ function getTreasury(IStore s) external view returns (address) { ``` -### getAssuranceVault +### getReassuranceVault ```solidity -function getAssuranceVault(IStore s) external view +function getReassuranceVault(IStore s) external view returns(address) ``` @@ -378,8 +378,8 @@ returns(address) Source Code ```javascript -function getAssuranceVault(IStore s) external view returns (address) { - return s.getAddressByKey(NS_ASSURANCE_VAULT); +function getReassuranceVault(IStore s) external view returns (address) { + return s.getAddressByKey(NS_REASSURANCE_VAULT); } ``` @@ -753,9 +753,9 @@ function _removeMember(IStore s, address member) private { * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -775,8 +775,8 @@ function _removeMember(IStore s, address member) private { * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/Protocol.md b/docs/Protocol.md index 36b7bf81..231416ce 100644 --- a/docs/Protocol.md +++ b/docs/Protocol.md @@ -17,7 +17,7 @@ uint256 public initialized; ## Functions - [constructor(IStore store)](#) -- [initialize(address uniswapV2RouterLike, address npm, address treasury, address assuranceVault, uint256 coverFee, uint256 minStake, uint256 minReportingStake, uint256 minLiquidityPeriod, uint256 claimPeriod, uint256 burnRate, uint256 reporterCommission)](#initialize) +- [initialize(address uniswapV2RouterLike, address npm, address treasury, address reassuranceVault, uint256 coverFee, uint256 minStake, uint256 minReportingStake, uint256 minLiquidityPeriod, uint256 claimPeriod, uint256 burnRate, uint256 reporterCommission)](#initialize) - [setReportingBurnRate(uint256 value)](#setreportingburnrate) - [setReportingCommission(uint256 value)](#setreportingcommission) - [setClaimPeriod(uint256 value)](#setclaimperiod) @@ -62,7 +62,7 @@ constructor(IStore store) ProtoBase(store) {} ### initialize ```solidity -function initialize(address uniswapV2RouterLike, address npm, address treasury, address assuranceVault, uint256 coverFee, uint256 minStake, uint256 minReportingStake, uint256 minLiquidityPeriod, uint256 claimPeriod, uint256 burnRate, uint256 reporterCommission) external nonpayable nonReentrant whenNotPaused +function initialize(address uniswapV2RouterLike, address npm, address treasury, address reassuranceVault, uint256 coverFee, uint256 minStake, uint256 minReportingStake, uint256 minLiquidityPeriod, uint256 claimPeriod, uint256 burnRate, uint256 reporterCommission) external nonpayable nonReentrant whenNotPaused ``` **Arguments** @@ -72,7 +72,7 @@ function initialize(address uniswapV2RouterLike, address npm, address treasury, | uniswapV2RouterLike | address | | | npm | address | | | treasury | address | | -| assuranceVault | address | | +| reassuranceVault | address | | | coverFee | uint256 | | | minStake | uint256 | | | minReportingStake | uint256 | | @@ -89,7 +89,7 @@ function initialize( address uniswapV2RouterLike, address npm, address treasury, - address assuranceVault, + address reassuranceVault, uint256 coverFee, uint256 minStake, uint256 minReportingStake, @@ -105,7 +105,7 @@ function initialize( require(npm != address(0), "Invalid NPM"); require(uniswapV2RouterLike != address(0), "Invalid Router"); require(treasury != address(0), "Invalid Treasury"); - require(assuranceVault != address(0), "Invalid Vault"); + require(reassuranceVault != address(0), "Invalid Vault"); s.setAddressByKey(ProtoUtilV1.NS_CORE, address(this)); s.setBoolByKeys(ProtoUtilV1.NS_CONTRACTS, address(this), true); @@ -114,7 +114,7 @@ function initialize( s.setAddressByKey(ProtoUtilV1.NS_SETUP_NPM, npm); s.setAddressByKey(ProtoUtilV1.NS_SETUP_UNISWAP_V2_ROUTER, uniswapV2RouterLike); s.setAddressByKey(ProtoUtilV1.NS_TREASURY, treasury); - s.setAddressByKey(ProtoUtilV1.NS_ASSURANCE_VAULT, assuranceVault); + s.setAddressByKey(ProtoUtilV1.NS_REASSURANCE_VAULT, reassuranceVault); _setCoverFees(coverFee); _setMinStake(minStake); @@ -647,9 +647,9 @@ function getName() public pure override returns (bytes32) { * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -669,8 +669,8 @@ function getName() public pure override returns (bytes32) { * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/Recoverable.md b/docs/Recoverable.md index 87aacc00..abd8e738 100644 --- a/docs/Recoverable.md +++ b/docs/Recoverable.md @@ -3,7 +3,7 @@ View Source: [contracts/core/Recoverable.sol](../contracts/core/Recoverable.sol) **↗ Extends: [ReentrancyGuard](ReentrancyGuard.md)** -**↘ Derived Contracts: [Commission](Commission.md), [Controller](Controller.md), [CoverAssurance](CoverAssurance.md), [CoverBase](CoverBase.md), [CoverProvision](CoverProvision.md), [CoverStake](CoverStake.md), [cxToken](cxToken.md), [cxTokenFactory](cxTokenFactory.md), [FakeRecoverable](FakeRecoverable.md), [Finalization](Finalization.md), [Policy](Policy.md), [PolicyAdmin](PolicyAdmin.md), [PolicyManager](PolicyManager.md), [PriceDiscovery](PriceDiscovery.md), [Processor](Processor.md), [ProtoBase](ProtoBase.md), [VaultBase](VaultBase.md), [VaultFactory](VaultFactory.md), [Witness](Witness.md)** +**↘ Derived Contracts: [Commission](Commission.md), [Controller](Controller.md), [CoverBase](CoverBase.md), [CoverProvision](CoverProvision.md), [CoverReassurance](CoverReassurance.md), [CoverStake](CoverStake.md), [cxToken](cxToken.md), [cxTokenFactory](cxTokenFactory.md), [FakeRecoverable](FakeRecoverable.md), [Finalization](Finalization.md), [Policy](Policy.md), [PolicyAdmin](PolicyAdmin.md), [PolicyManager](PolicyManager.md), [PriceDiscovery](PriceDiscovery.md), [Processor](Processor.md), [ProtoBase](ProtoBase.md), [VaultBase](VaultBase.md), [VaultFactory](VaultFactory.md), [Witness](Witness.md)** **Recoverable** @@ -112,9 +112,9 @@ function recoverToken(address token, address sendTo) external nonReentrant { * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -134,8 +134,8 @@ function recoverToken(address token, address sendTo) external nonReentrant { * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/ReentrancyGuard.md b/docs/ReentrancyGuard.md index 0435b824..1c4acfa6 100644 --- a/docs/ReentrancyGuard.md +++ b/docs/ReentrancyGuard.md @@ -85,9 +85,9 @@ constructor() { * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -107,8 +107,8 @@ constructor() { * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/RegistryLibV1.md b/docs/RegistryLibV1.md index c9a0859e..e4cbbd5e 100644 --- a/docs/RegistryLibV1.md +++ b/docs/RegistryLibV1.md @@ -12,7 +12,7 @@ View Source: [contracts/libraries/RegistryLibV1.sol](../contracts/libraries/Regi - [getStakingContract(IStore s)](#getstakingcontract) - [getCxTokenFactory(IStore s)](#getcxtokenfactory) - [getPolicyContract(IStore s)](#getpolicycontract) -- [getAssuranceContract(IStore s)](#getassurancecontract) +- [getReassuranceContract(IStore s)](#getreassurancecontract) - [getVault(IStore s, bytes32 key)](#getvault) - [getVaultFactoryContract(IStore s)](#getvaultfactorycontract) @@ -154,11 +154,11 @@ function getPolicyContract(IStore s) public view returns (IPolicy) { ``` -### getAssuranceContract +### getReassuranceContract ```solidity -function getAssuranceContract(IStore s) public view -returns(contract ICoverAssurance) +function getReassuranceContract(IStore s) public view +returns(contract ICoverReassurance) ``` **Arguments** @@ -171,8 +171,8 @@ returns(contract ICoverAssurance) Source Code ```javascript -function getAssuranceContract(IStore s) public view returns (ICoverAssurance) { - return ICoverAssurance(s.getContract(ProtoUtilV1.NS_COVER_ASSURANCE)); +function getReassuranceContract(IStore s) public view returns (ICoverReassurance) { + return ICoverReassurance(s.getContract(ProtoUtilV1.NS_COVER_REASSURANCE)); } ``` @@ -237,9 +237,9 @@ function getVaultFactoryContract(IStore s) public view returns (IVaultFactory) { * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -259,8 +259,8 @@ function getVaultFactoryContract(IStore s) public view returns (IVaultFactory) { * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/Reporter.md b/docs/Reporter.md index 9b381535..bd9c59e9 100644 --- a/docs/Reporter.md +++ b/docs/Reporter.md @@ -223,9 +223,9 @@ function getMinStake() public view override returns (uint256) { * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -245,8 +245,8 @@ function getMinStake() public view override returns (uint256) { * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/Resolution.md b/docs/Resolution.md index 81697933..fce3ecf3 100644 --- a/docs/Resolution.md +++ b/docs/Resolution.md @@ -93,9 +93,9 @@ function getName() external pure override returns (bytes32) { * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -115,8 +115,8 @@ function getName() external pure override returns (bytes32) { * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/Resolvable.md b/docs/Resolvable.md index a6047980..d355d583 100644 --- a/docs/Resolvable.md +++ b/docs/Resolvable.md @@ -131,9 +131,9 @@ function _resolve( * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -153,8 +153,8 @@ function _resolve( * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/SafeERC20.md b/docs/SafeERC20.md index 85d32f96..ae5d8c33 100644 --- a/docs/SafeERC20.md +++ b/docs/SafeERC20.md @@ -225,9 +225,9 @@ function _callOptionalReturn(IERC20 token, bytes memory data) private { * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -247,8 +247,8 @@ function _callOptionalReturn(IERC20 token, bytes memory data) private { * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/SafeMath.md b/docs/SafeMath.md index 676e89b6..74e7815c 100644 --- a/docs/SafeMath.md +++ b/docs/SafeMath.md @@ -465,9 +465,9 @@ function mod( * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -487,8 +487,8 @@ function mod( * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/Store.md b/docs/Store.md index 856f58f0..3fd33279 100644 --- a/docs/Store.md +++ b/docs/Store.md @@ -750,9 +750,9 @@ function getBytes32(bytes32 k) external view override returns (bytes32) { * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -772,8 +772,8 @@ function getBytes32(bytes32 k) external view override returns (bytes32) { * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/StoreBase.md b/docs/StoreBase.md index 488165fc..544e7c4f 100644 --- a/docs/StoreBase.md +++ b/docs/StoreBase.md @@ -231,9 +231,9 @@ function _throwIfSenderNotProtocolMember() internal view { * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -253,8 +253,8 @@ function _throwIfSenderNotProtocolMember() internal view { * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/StoreKeyUtil.md b/docs/StoreKeyUtil.md index 0409befc..d51b7f57 100644 --- a/docs/StoreKeyUtil.md +++ b/docs/StoreKeyUtil.md @@ -1334,9 +1334,9 @@ function getAddressBooleanByKeys( * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -1356,8 +1356,8 @@ function getAddressBooleanByKeys( * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/Strings.md b/docs/Strings.md index f152ec9c..45fbe688 100644 --- a/docs/Strings.md +++ b/docs/Strings.md @@ -142,9 +142,9 @@ function toHexString(uint256 value, uint256 length) internal pure returns (strin * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -164,8 +164,8 @@ function toHexString(uint256 value, uint256 length) internal pure returns (strin * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/Unstakable.md b/docs/Unstakable.md index 8be505ac..8311a20d 100644 --- a/docs/Unstakable.md +++ b/docs/Unstakable.md @@ -156,9 +156,9 @@ function getUnstakeInfoFor( * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -178,8 +178,8 @@ function getUnstakeInfoFor( * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/ValidationLibV1.md b/docs/ValidationLibV1.md index 3d4ff6cf..15e199bb 100644 --- a/docs/ValidationLibV1.md +++ b/docs/ValidationLibV1.md @@ -633,9 +633,9 @@ function mustBeAfterClaimExpiry(IStore s, bytes32 key) public view { * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -655,8 +655,8 @@ function mustBeAfterClaimExpiry(IStore s, bytes32 key) public view { * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/Vault.md b/docs/Vault.md index 1db015b7..fe7a4971 100644 --- a/docs/Vault.md +++ b/docs/Vault.md @@ -14,7 +14,7 @@ Liquidity providers can earn fees by adding stablecoin liquidity - The protocol supplies a small portion of idle assets to lending protocols (v2). - Flash loan interest also gets added back to the pool. - To protect liquidity providers from cover incidents, they can redeem upto 25% of the cover payouts through NPM provision. - - To protect liquidity providers from cover incidents, they can redeem upto 25% of the cover payouts through `assurance token` allocation. + - To protect liquidity providers from cover incidents, they can redeem upto 25% of the cover payouts through `reassurance token` allocation. ## Functions @@ -59,9 +59,9 @@ constructor( * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -81,8 +81,8 @@ constructor( * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/VaultBase.md b/docs/VaultBase.md index a1af2373..b10b642b 100644 --- a/docs/VaultBase.md +++ b/docs/VaultBase.md @@ -286,9 +286,9 @@ function getName() public pure override returns (bytes32) { * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -308,8 +308,8 @@ function getName() public pure override returns (bytes32) { * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/VaultFactory.md b/docs/VaultFactory.md index 0bfc77fe..e4466a4d 100644 --- a/docs/VaultFactory.md +++ b/docs/VaultFactory.md @@ -147,9 +147,9 @@ function getName() public pure override returns (bytes32) { * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -169,8 +169,8 @@ function getName() public pure override returns (bytes32) { * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/VaultFactoryLibV1.md b/docs/VaultFactoryLibV1.md index 4d8e663d..acb091d4 100644 --- a/docs/VaultFactoryLibV1.md +++ b/docs/VaultFactoryLibV1.md @@ -51,9 +51,9 @@ function getByteCode( * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -73,8 +73,8 @@ function getByteCode( * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/VaultLibV1.md b/docs/VaultLibV1.md index c8602e49..88ea14f7 100644 --- a/docs/VaultLibV1.md +++ b/docs/VaultLibV1.md @@ -250,9 +250,9 @@ function removeLiquidity( * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -272,8 +272,8 @@ function removeLiquidity( * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/Witness.md b/docs/Witness.md index bb15125a..0da60181 100644 --- a/docs/Witness.md +++ b/docs/Witness.md @@ -240,9 +240,9 @@ function getStakesOf( * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -262,8 +262,8 @@ function getStakesOf( * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/cxToken.md b/docs/cxToken.md index c2461fa5..4e7f23c2 100644 --- a/docs/cxToken.md +++ b/docs/cxToken.md @@ -131,9 +131,9 @@ function burn(uint256 amount) external override nonReentrant { * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -153,8 +153,8 @@ function burn(uint256 amount) external override nonReentrant { * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/cxTokenFactory.md b/docs/cxTokenFactory.md index e9962b13..ba373426 100644 --- a/docs/cxTokenFactory.md +++ b/docs/cxTokenFactory.md @@ -156,9 +156,9 @@ function getName() public pure override returns (bytes32) { * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -178,8 +178,8 @@ function getName() public pure override returns (bytes32) { * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/docs/cxTokenFactoryLibV1.md b/docs/cxTokenFactoryLibV1.md index a2bd70fa..c5031b42 100644 --- a/docs/cxTokenFactoryLibV1.md +++ b/docs/cxTokenFactoryLibV1.md @@ -51,9 +51,9 @@ function getByteCode( * [Context](Context.md) * [Controller](Controller.md) * [Cover](Cover.md) -* [CoverAssurance](CoverAssurance.md) * [CoverBase](CoverBase.md) * [CoverProvision](CoverProvision.md) +* [CoverReassurance](CoverReassurance.md) * [CoverStake](CoverStake.md) * [CoverUtilV1](CoverUtilV1.md) * [cxToken](cxToken.md) @@ -73,8 +73,8 @@ function getByteCode( * [IClaimsProcessor](IClaimsProcessor.md) * [ICommission](ICommission.md) * [ICover](ICover.md) -* [ICoverAssurance](ICoverAssurance.md) * [ICoverProvision](ICoverProvision.md) +* [ICoverReassurance](ICoverReassurance.md) * [ICoverStake](ICoverStake.md) * [ICxToken](ICxToken.md) * [ICxTokenFactory](ICxTokenFactory.md) diff --git a/readme.md b/readme.md index f0caacab..a97f1058 100644 --- a/readme.md +++ b/readme.md @@ -21,8 +21,8 @@ The cover contract facilitates you create and update covers - [constructor(IStore store)](#) - [updateCover(bytes32 key, bytes32 info)](#updatecover) -- [addCover(bytes32 key, bytes32 info, uint256 reportingPeriod, uint256 stakeWithFee, address assuranceToken, uint256 initialAssuranceAmount, uint256 initialLiquidity)](#addcover) -- [_addCover(bytes32 key, bytes32 info, uint256 reportingPeriod, uint256 fee, address assuranceToken)](#_addcover) +- [addCover(bytes32 key, bytes32 info, uint256 reportingPeriod, uint256 stakeWithFee, address reassuranceToken, uint256 initialReassuranceAmount, uint256 initialLiquidity)](#addcover) +- [_addCover(bytes32 key, bytes32 info, uint256 reportingPeriod, uint256 fee, address reassuranceToken)](#_addcover) - [_validateAndGetFee(bytes32 key, bytes32 info, uint256 stakeWithFee)](#_validateandgetfee) - [updateWhitelist(address account, bool status)](#updatewhitelist) - [checkIfWhitelisted(address account)](#checkifwhitelisted) @@ -102,7 +102,7 @@ Adds a new coverage pool or cover contract. https://docs.neptunemutual.com/covers/contract-creators ```solidity -function addCover(bytes32 key, bytes32 info, uint256 reportingPeriod, uint256 stakeWithFee, address assuranceToken, uint256 initialAssuranceAmount, uint256 initialLiquidity) external nonpayable nonReentrant +function addCover(bytes32 key, bytes32 info, uint256 reportingPeriod, uint256 stakeWithFee, address reassuranceToken, uint256 initialReassuranceAmount, uint256 initialLiquidity) external nonpayable nonReentrant ``` **Arguments** @@ -113,8 +113,8 @@ function addCover(bytes32 key, bytes32 info, uint256 reportingPeriod, uint256 st | info | bytes32 | IPFS info of the cover contract | | reportingPeriod | uint256 | The period during when reporting happens. | | stakeWithFee | uint256 | Enter the total NPM amount (stake + fee) to transfer to this contract. | -| assuranceToken | address | **Optional.** Token added as an assurance of this cover.

Assurance tokens can be added by a project to demonstrate coverage support for their own project. This helps bring the cover fee down and enhances liquidity provider confidence. Along with the NPM tokens, the assurance tokens are rewarded as a support to the liquidity providers when a cover incident occurs. | -| initialAssuranceAmount | uint256 | **Optional.** Enter the initial amount of assurance tokens you'd like to add to this pool. | +| reassuranceToken | address | **Optional.** Token added as an reassurance of this cover.

Reassurance tokens can be added by a project to demonstrate coverage support for their own project. This helps bring the cover fee down and enhances liquidity provider confidence. Along with the NPM tokens, the reassurance tokens are rewarded as a support to the liquidity providers when a cover incident occurs. | +| initialReassuranceAmount | uint256 | **Optional.** Enter the initial amount of reassurance tokens you'd like to add to this pool. | | initialLiquidity | uint256 | **Optional.** Enter the initial stablecoin liquidity for this cover. |
@@ -126,8 +126,8 @@ function addCover( bytes32 info, uint256 reportingPeriod, uint256 stakeWithFee, - address assuranceToken, - uint256 initialAssuranceAmount, + address reassuranceToken, + uint256 initialReassuranceAmount, uint256 initialLiquidity ) external override nonReentrant { // @supress-acl Can only be called by a whitelisted address @@ -141,14 +141,14 @@ function addCover( uint256 fee = _validateAndGetFee(key, info, stakeWithFee); // Set the basic cover info - _addCover(key, info, reportingPeriod, fee, assuranceToken); + _addCover(key, info, reportingPeriod, fee, reassuranceToken); // Stake the supplied NPM tokens and burn the fees s.getStakingContract().increaseStake(key, msg.sender, stakeWithFee, fee); - // Add cover assurance - if (initialAssuranceAmount > 0) { - s.getAssuranceContract().addAssurance(key, msg.sender, initialAssuranceAmount); + // Add cover reassurance + if (initialReassuranceAmount > 0) { + s.getReassuranceContract().addReassurance(key, msg.sender, initialReassuranceAmount); } // Add initial liquidity @@ -169,7 +169,7 @@ function addCover( ### _addCover ```solidity -function _addCover(bytes32 key, bytes32 info, uint256 reportingPeriod, uint256 fee, address assuranceToken) private nonpayable +function _addCover(bytes32 key, bytes32 info, uint256 reportingPeriod, uint256 fee, address reassuranceToken) private nonpayable ``` **Arguments** @@ -180,7 +180,7 @@ function _addCover(bytes32 key, bytes32 info, uint256 reportingPeriod, uint256 f | info | bytes32 | IPFS info of the cover contract | | reportingPeriod | uint256 | The period during when reporting happens. | | fee | uint256 | Fee paid to create this cover | -| assuranceToken | address | **Optional.** Token added as an assurance of this cover. | +| reassuranceToken | address | **Optional.** Token added as an reassurance of this cover. |
Source Code @@ -191,7 +191,7 @@ function _addCover( bytes32 info, uint256 reportingPeriod, uint256 fee, - address assuranceToken + address reassuranceToken ) private { // Add a new cover s.setBoolByKeys(ProtoUtilV1.NS_COVER, key, true); @@ -203,9 +203,9 @@ function _addCover( s.setBytes32ByKeys(ProtoUtilV1.NS_COVER_INFO, key, info); s.setUintByKeys(ProtoUtilV1.NS_REPORTING_PERIOD, key, reportingPeriod); - // Set assurance token - s.setAddressByKeys(ProtoUtilV1.NS_COVER_ASSURANCE_TOKEN, key, assuranceToken); - s.setUintByKeys(ProtoUtilV1.NS_COVER_ASSURANCE_WEIGHT, key, 500000000 gwei); // Default 50% weight + // Set reassurance token + s.setAddressByKeys(ProtoUtilV1.NS_COVER_REASSURANCE_TOKEN, key, reassuranceToken); + s.setUintByKeys(ProtoUtilV1.NS_COVER_REASSURANCE_WEIGHT, key, 500000000 gwei); // Default 50% weight // Set the fee charged during cover creation s.setUintByKeys(ProtoUtilV1.NS_COVER_FEE, key, fee); @@ -322,9 +322,9 @@ function checkIfWhitelisted(address account) external view override returns (boo * [Context](docs/Context.md) * [Controller](docs/Controller.md) * [Cover](docs/Cover.md) -* [CoverAssurance](docs/CoverAssurance.md) * [CoverBase](docs/CoverBase.md) * [CoverProvision](docs/CoverProvision.md) +* [CoverReassurance](docs/CoverReassurance.md) * [CoverStake](docs/CoverStake.md) * [CoverUtilV1](docs/CoverUtilV1.md) * [cxToken](docs/cxToken.md) @@ -344,8 +344,8 @@ function checkIfWhitelisted(address account) external view override returns (boo * [IClaimsProcessor](docs/IClaimsProcessor.md) * [ICommission](docs/ICommission.md) * [ICover](docs/ICover.md) -* [ICoverAssurance](docs/ICoverAssurance.md) * [ICoverProvision](docs/ICoverProvision.md) +* [ICoverReassurance](docs/ICoverReassurance.md) * [ICoverStake](docs/ICoverStake.md) * [ICxToken](docs/ICxToken.md) * [ICxTokenFactory](docs/ICxTokenFactory.md) diff --git a/stories/0. setup.story.js b/stories/0. setup.story.js index 65818188..0326b70a 100644 --- a/stories/0. setup.story.js +++ b/stories/0. setup.story.js @@ -41,12 +41,12 @@ describe('Protocol Initialization Stories', () => { fetchedAddress.should.equal(contracts.stakingContract.address) }) - it('assurance contract was correctly deployed', async () => { - contracts.assuranceContract.address.should.not.be.empty - contracts.assuranceContract.address.should.not.equal(helper.zerox) + it('reassurance contract was correctly deployed', async () => { + contracts.reassuranceContract.address.should.not.be.empty + contracts.reassuranceContract.address.should.not.equal(helper.zerox) - const fetchedAddress = await contracts.store.getAddress(key.qualifyBytes32(key.NS.COVER_ASSURANCE)) - fetchedAddress.should.equal(contracts.assuranceContract.address) + const fetchedAddress = await contracts.store.getAddress(key.qualifyBytes32(key.NS.COVER_REASSURANCE)) + fetchedAddress.should.equal(contracts.reassuranceContract.address) }) it('provision contract was correctly deployed', async () => { @@ -79,23 +79,23 @@ describe('Protocol Initialization Stories', () => { // console.info(`https://ipfs.infura.io/ipfs/${ipfs.toIPFShash(info)}`) const stakeWithFee = helper.ether(10000) - const initialAssuranceAmount = helper.ether(1000000) + const initialReassuranceAmount = helper.ether(1000000) const initialLiquidity = helper.ether(4000000) const reportingPeriod = 7 * DAYS await contracts.npm.approve(contracts.stakingContract.address, stakeWithFee) - await contracts.assuranceToken.approve(contracts.assuranceContract.address, initialAssuranceAmount) + await contracts.reassuranceToken.approve(contracts.reassuranceContract.address, initialReassuranceAmount) await contracts.wxDai.approve(contracts.cover.address, initialLiquidity) const vault = await composer.vault.getVault(contracts, coverKey) - const assuranceVault = await storeUtil.getAssuranceVaultAddress(contracts.store) + const reassuranceVault = await storeUtil.getReassuranceVaultAddress(contracts.store) previous = { wxDaiBalance: (await contracts.wxDai.balanceOf(vault.address)).toString(), - assuranceTokenBalance: (await contracts.assuranceToken.balanceOf(assuranceVault)).toString() + reassuranceTokenBalance: (await contracts.reassuranceToken.balanceOf(reassuranceVault)).toString() } - await contracts.cover.addCover(coverKey, info, reportingPeriod, stakeWithFee, contracts.assuranceToken.address, initialAssuranceAmount, initialLiquidity) + await contracts.cover.addCover(coverKey, info, reportingPeriod, stakeWithFee, contracts.reassuranceToken.address, initialReassuranceAmount, initialLiquidity) }) it('corretness rule: xDai should\'ve been correctly added to the vault', async () => { @@ -108,15 +108,15 @@ describe('Protocol Initialization Stories', () => { previous.wxDaiBalance = expected }) - it('corretness rule: assurance token should\'ve been correctly transferred to the assurance vault', async () => { - const vault = await storeUtil.getAssuranceVaultAddress(contracts.store) + it('corretness rule: reassurance token should\'ve been correctly transferred to the reassurance vault', async () => { + const vault = await storeUtil.getReassuranceVaultAddress(contracts.store) - const balance = await contracts.assuranceToken.balanceOf(vault) + const balance = await contracts.reassuranceToken.balanceOf(vault) - const expected = helper.add(previous.assuranceTokenBalance, helper.ether(1000000)) + const expected = helper.add(previous.reassuranceTokenBalance, helper.ether(1000000)) balance.should.equal(expected) - previous.assuranceTokenBalance = expected + previous.reassuranceTokenBalance = expected }) it('xDai liquidity was added again', async () => { @@ -142,21 +142,21 @@ describe('Protocol Initialization Stories', () => { pods.should.equal(previous.wxDaiBalance.toString()) }) - it('assurance token allocation was increased', async () => { + it('reassurance token allocation was increased', async () => { const [owner] = await ethers.getSigners() const liquidity = helper.ether(20000) - const vault = await storeUtil.getAssuranceVaultAddress(contracts.store) + const vault = await storeUtil.getReassuranceVaultAddress(contracts.store) - await contracts.assuranceToken.approve(contracts.assuranceContract.address, liquidity) - await contracts.assuranceContract.addAssurance(coverKey, owner.address, liquidity) + await contracts.reassuranceToken.approve(contracts.reassuranceContract.address, liquidity) + await contracts.reassuranceContract.addReassurance(coverKey, owner.address, liquidity) - const expected = helper.add(previous.assuranceTokenBalance, liquidity) + const expected = helper.add(previous.reassuranceTokenBalance, liquidity) - const balance = await contracts.assuranceToken.balanceOf(vault) + const balance = await contracts.reassuranceToken.balanceOf(vault) balance.should.equal(expected) - previous.assuranceTokenBalance = expected + previous.reassuranceTokenBalance = expected }) it('the vault generated a fictional income', async () => { diff --git a/stories/1. policy.story.js b/stories/1. policy.story.js index bd10b588..41b60341 100644 --- a/stories/1. policy.story.js +++ b/stories/1. policy.story.js @@ -29,15 +29,15 @@ describe('Policy Purchase Stories', () => { // console.info(`https://ipfs.infura.io/ipfs/${ipfs.toIPFShash(info)}`) const stakeWithFee = helper.ether(10_000) - const initialAssuranceAmount = helper.ether(1_000_000) + const initialReassuranceAmount = helper.ether(1_000_000) const initialLiquidity = helper.ether(4_000_000) const reportingPeriod = 7 * DAYS await contracts.npm.approve(contracts.stakingContract.address, stakeWithFee) - await contracts.assuranceToken.approve(contracts.assuranceContract.address, initialAssuranceAmount) + await contracts.reassuranceToken.approve(contracts.reassuranceContract.address, initialReassuranceAmount) await contracts.wxDai.approve(contracts.cover.address, initialLiquidity) - await contracts.cover.addCover(coverKey, info, reportingPeriod, stakeWithFee, contracts.assuranceToken.address, initialAssuranceAmount, initialLiquidity) + await contracts.cover.addCover(coverKey, info, reportingPeriod, stakeWithFee, contracts.reassuranceToken.address, initialReassuranceAmount, initialLiquidity) }) it('provision of 1M NPM tokens was added to the `Compound Finance Cover` pool', async () => { @@ -57,15 +57,15 @@ describe('Policy Purchase Stories', () => { it('cover pool summary values are accurate', async () => { const result = await contracts.policy.getCoverPoolSummary(coverKey) - const [totalAmountInPool, totalCommitment, provision, nepPrice, assurance, assurancePrice, assuranceWeight] = result + const [totalAmountInPool, totalCommitment, provision, nepPrice, reassurance, reassurancePrice, reassuranceWeight] = result totalAmountInPool.should.equal(helper.ether(4_000_000)) totalCommitment.should.equal(helper.ether(0)) provision.should.equal(helper.ether(1_000_000)) nepPrice.should.equal(helper.ether(1)) - assurance.should.equal(helper.ether(1_000_000)) - assurancePrice.should.equal(helper.ether(1)) - assuranceWeight.should.equal(helper.ether(0.5)) + reassurance.should.equal(helper.ether(1_000_000)) + reassurancePrice.should.equal(helper.ether(1)) + reassuranceWeight.should.equal(helper.ether(0.5)) }) it('fee should be ~$58.33 xDai when purchasing 10K xDai cover for 1 month', async () => { diff --git a/stories/2. governance.story.js b/stories/2. governance.story.js index 714382c4..2ad0b2a2 100644 --- a/stories/2. governance.story.js +++ b/stories/2. governance.story.js @@ -76,17 +76,17 @@ describe('Governance Stories', () => { // console.info(`https://ipfs.infura.io/ipfs/${ipfs.toIPFShash(info)}`) const stakeWithFee = helper.ether(10_000) - const initialAssuranceAmount = helper.ether(1_000_000) + const initialReassuranceAmount = helper.ether(1_000_000) const initialLiquidity = helper.ether(4_000_000) const reportingPeriod = 7 * constants.DAYS // Submit approvals await contracts.npm.approve(contracts.stakingContract.address, stakeWithFee) - await contracts.assuranceToken.approve(contracts.assuranceContract.address, initialAssuranceAmount) + await contracts.reassuranceToken.approve(contracts.reassuranceContract.address, initialReassuranceAmount) await contracts.wxDai.approve(contracts.cover.address, initialLiquidity) // Create a new cover - await contracts.cover.addCover(coverKey, info, reportingPeriod, stakeWithFee, contracts.assuranceToken.address, initialAssuranceAmount, initialLiquidity) + await contracts.cover.addCover(coverKey, info, reportingPeriod, stakeWithFee, contracts.reassuranceToken.address, initialReassuranceAmount, initialLiquidity) // Add provision const provision = helper.ether(1_000_001) diff --git a/stories/composer/initializer.js b/stories/composer/initializer.js index f8b82b37..462ff34f 100644 --- a/stories/composer/initializer.js +++ b/stories/composer/initializer.js @@ -16,7 +16,7 @@ const initialize = async (suite, deploymentId) => { const store = await storeComposer.deploy(cache) const fakes = await fakesComposer.deployAll(cache) - const [npm, wxDai, assuranceToken] = await tokenComposer.deploySeveral(cache, [ + const [npm, wxDai, reassuranceToken] = await tokenComposer.deploySeveral(cache, [ { name: 'Neptune Mutual Token', symbol: 'NPM' }, { name: 'Wrapped Dai', symbol: 'WXDAI' }, { name: 'Compound', symbol: 'CMP' } @@ -44,7 +44,7 @@ const initialize = async (suite, deploymentId) => { fakes.router.address, npm.address, sample.fake.TREASURY, - sample.fake.ASSURANCE_VAULT, + sample.fake.REASSURANCE_VAULT, helper.ether(0), // Cover Fee helper.ether(0), // Min Cover Stake helper.ether(250), // Min Reporting Stake @@ -65,7 +65,7 @@ const initialize = async (suite, deploymentId) => { await intermediate(cache, protocol, 'addContract', key.toBytes32(key.NS.COVER_STAKE), stakingContract.address) - const assuranceContract = await deployer.deployWithLibraries(cache, 'CoverAssurance', { + const reassuranceContract = await deployer.deployWithLibraries(cache, 'CoverReassurance', { BaseLibV1: libs.baseLibV1.address, AccessControlLibV1: libs.accessControlLibV1.address, StoreKeyUtil: libs.storeKeyUtil.address, @@ -74,7 +74,7 @@ const initialize = async (suite, deploymentId) => { ValidationLibV1: libs.validationLib.address }, store.address) - await intermediate(cache, protocol, 'addContract', key.toBytes32(key.NS.COVER_ASSURANCE), assuranceContract.address) + await intermediate(cache, protocol, 'addContract', key.toBytes32(key.NS.COVER_REASSURANCE), reassuranceContract.address) const vaultFactory = await deployer.deployWithLibraries(cache, 'VaultFactory', { @@ -209,10 +209,10 @@ const initialize = async (suite, deploymentId) => { store, npm, wxDai, - assuranceToken, + reassuranceToken, protocol, stakingContract, - assuranceContract, + reassuranceContract, provisionContract, vaultFactory, cxTokenFactory, diff --git a/test/protocol.spec.js b/test/protocol.spec.js index e1eeca5e..8aa35bf9 100644 --- a/test/protocol.spec.js +++ b/test/protocol.spec.js @@ -60,7 +60,7 @@ const deployDependencies = async () => { describe('Constructor & Initializer', () => { const treasury = helper.randomAddress() - const assuranceVault = helper.randomAddress() + const reassuranceVault = helper.randomAddress() let npm, store, router, storeKeyUtil, protoUtilV1, accessControlLibV1, validationLibV1, baseLibV1 beforeEach(async () => { @@ -95,7 +95,7 @@ describe('Constructor & Initializer', () => { router.address, npm.address, treasury, - assuranceVault, + reassuranceVault, helper.ether(0), // Cover Fee helper.ether(0), // Min Cover Stake helper.ether(250), // Min Reporting Stake @@ -128,7 +128,7 @@ describe('Constructor & Initializer', () => { router.address, npm.address, treasury, - assuranceVault, + reassuranceVault, helper.ether(0), // Cover Fee helper.ether(0), // Min Cover Stake helper.ether(250), // Min Reporting Stake @@ -153,8 +153,8 @@ describe('Constructor & Initializer', () => { const sTreasury = await store.getAddress(key.toBytes32(key.NS.TREASURY)) sTreasury.should.equal(treasury) - const sAssuranceVault = await store.getAddress(key.toBytes32(key.NS.ASSURANCE_VAULT)) - sAssuranceVault.should.equal(assuranceVault) + const sReassuranceVault = await store.getAddress(key.toBytes32(key.NS.REASSURANCE_VAULT)) + sReassuranceVault.should.equal(reassuranceVault) }) it('should fail when zero address is provided as store', async () => { @@ -189,7 +189,7 @@ describe('Constructor & Initializer', () => { router.address, helper.zerox, treasury, - assuranceVault, + reassuranceVault, helper.ether(0), // Cover Fee helper.ether(0), // Min Cover Stake helper.ether(250), // Min Reporting Stake @@ -219,7 +219,7 @@ describe('Constructor & Initializer', () => { router.address, npm.address, helper.zerox, - assuranceVault, + reassuranceVault, helper.ether(0), // Cover Fee helper.ether(0), // Min Cover Stake helper.ether(250), // Min Reporting Stake @@ -230,7 +230,7 @@ describe('Constructor & Initializer', () => { ).should.be.revertedWith('Invalid Treasury') }) - it('should fail when zero address is provided as assurance vault', async () => { + it('should fail when zero address is provided as reassurance vault', async () => { const protocol = await deployer.deployWithLibraries(cache, 'Protocol', { StoreKeyUtil: storeKeyUtil.address, @@ -263,7 +263,7 @@ describe('Constructor & Initializer', () => { describe('Adding a New Protocol Contract', () => { const treasury = helper.randomAddress() - const assuranceVault = helper.randomAddress() + const reassuranceVault = helper.randomAddress() let npm, store, router, protocol beforeEach(async () => { @@ -295,7 +295,7 @@ describe('Adding a New Protocol Contract', () => { router.address, npm.address, treasury, - assuranceVault, + reassuranceVault, helper.ether(0), // Cover Fee helper.ether(0), // Min Cover Stake helper.ether(250), // Min Reporting Stake @@ -323,7 +323,7 @@ describe('Adding a New Protocol Contract', () => { describe('Upgrading Protocol Contract(s)', () => { const treasury = helper.randomAddress() - const assuranceVault = helper.randomAddress() + const reassuranceVault = helper.randomAddress() let npm, store, router, protocol beforeEach(async () => { @@ -355,7 +355,7 @@ describe('Upgrading Protocol Contract(s)', () => { router.address, npm.address, treasury, - assuranceVault, + reassuranceVault, helper.ether(0), // Cover Fee helper.ether(0), // Min Cover Stake helper.ether(250), // Min Reporting Stake @@ -403,7 +403,7 @@ describe('Upgrading Protocol Contract(s)', () => { describe('Adding a New Protocol Member', () => { const treasury = helper.randomAddress() - const assuranceVault = helper.randomAddress() + const reassuranceVault = helper.randomAddress() let npm, store, router, protocol beforeEach(async () => { @@ -436,7 +436,7 @@ describe('Adding a New Protocol Member', () => { router.address, npm.address, treasury, - assuranceVault, + reassuranceVault, helper.ether(0), // Cover Fee helper.ether(0), // Min Cover Stake helper.ether(250), // Min Reporting Stake @@ -469,7 +469,7 @@ describe('Adding a New Protocol Member', () => { describe('Removing Protocol Member(s)', () => { const treasury = helper.randomAddress() - const assuranceVault = helper.randomAddress() + const reassuranceVault = helper.randomAddress() let npm, store, router, protocol beforeEach(async () => { @@ -501,7 +501,7 @@ describe('Removing Protocol Member(s)', () => { router.address, npm.address, treasury, - assuranceVault, + reassuranceVault, helper.ether(0), // Cover Fee helper.ether(0), // Min Cover Stake helper.ether(250), // Min Reporting Stake diff --git a/util/key.js b/util/key.js index 4f73cff7..a6f0ab0c 100644 --- a/util/key.js +++ b/util/key.js @@ -7,14 +7,14 @@ const qualify = (k) => encodeKeys(['bytes32', 'address'], [toBytes32(NS.CONTRACT const qualifyMember = (k) => encodeKeys(['bytes32', 'address'], [toBytes32(NS.MEMBERS), k]) const NS = { - ASSURANCE_VAULT: 'proto:core:assurance:vault', + REASSURANCE_VAULT: 'proto:core:reassurance:vault', BURNER: 'proto:core:burner', CONTRACTS: 'proto:contracts', MEMBERS: 'proto:members', CORE: 'proto:core', COVER: 'proto:cover', - COVER_ASSURANCE: 'proto:cover:assurance', - COVER_ASSURANCE_TOKEN: 'proto:cover:assurance:token', + COVER_REASSURANCE: 'proto:cover:reassurance', + COVER_REASSURANCE_TOKEN: 'proto:cover:reassurance:token', COVER_CLAIMABLE: 'proto:cover:claimable', COVER_FEE: 'proto:cover:fee', GOVERNANCE: 'proto:gov', @@ -71,7 +71,7 @@ const CNAME = { CXTOKEN_FACTORY: 'cxTokenFactory', COVER_PROVISION: 'CoverProvison', COVER_STAKE: 'CoverStake', - COVER_ASSURANCE: 'CoverAssurance', + COVER_REASSURANCE: 'CoverReassurance', LIQUIDITY_VAULT: 'Vault' } @@ -86,7 +86,7 @@ const CNAME_KEYS = { CXTOKEN_FACTORY: toBytes32(CNAME.CXTOKEN_FACTORY), COVER_PROVISION: toBytes32(CNAME.COVER_PROVISION), COVER_STAKE: toBytes32(CNAME.COVER_STAKE), - COVER_ASSURANCE: toBytes32(CNAME.COVER_ASSURANCE), + COVER_REASSURANCE: toBytes32(CNAME.COVER_REASSURANCE), LIQUIDITY_VAULT: toBytes32(CNAME.LIQUIDITY_VAULT) } @@ -99,7 +99,7 @@ const CNAME_KEYS_FQN = { CXTOKEN_FACTORY: qualifyBytes32(CNAME.CXTOKEN_FACTORY), COVER_PROVISION: qualifyBytes32(CNAME.COVER_PROVISION), COVER_STAKE: qualifyBytes32(CNAME.COVER_STAKE), - COVER_ASSURANCE: qualifyBytes32(CNAME.COVER_ASSURANCE), + COVER_REASSURANCE: qualifyBytes32(CNAME.COVER_REASSURANCE), LIQUIDITY_VAULT: qualifyBytes32(CNAME.LIQUIDITY_VAULT) } diff --git a/util/sample.js b/util/sample.js index f365c1bd..71cf01a1 100644 --- a/util/sample.js +++ b/util/sample.js @@ -28,7 +28,7 @@ const info = { reportingPeriod: 7, selfCoveragePeriod: 30, resolutionSources: ['https://twitter.com/compoundfinance', 'https://medium.com/compound-finance', 'https://twitter.com/neptunemutual'], - assuranceToken: { + reassuranceToken: { at: '0x0e7c8a8545352663ee070f1c9a0174f4a50532dc', name: 'Compound', symbol: 'COMP', @@ -40,7 +40,7 @@ const info = { const fake = { TREASURY: '0xECd0023B976c4008ef3D3FBD58c84C6d1A59c59e', - ASSURANCE_VAULT: '0x34f12E31DC5EBC3c2cDBdeEBf6a74005B3301902' + REASSURANCE_VAULT: '0x34f12E31DC5EBC3c2cDBdeEBf6a74005B3301902' } module.exports = { info, fake } diff --git a/util/store-util.js b/util/store-util.js index 41c1690c..9cc31188 100644 --- a/util/store-util.js +++ b/util/store-util.js @@ -1,11 +1,11 @@ const key = require('./key') const getStoreAddressCustom = async (store, namespace, coverKey) => await store.getAddress(key.getCoverContractKey(namespace, coverKey)) -const getAssuranceVaultAddress = async (store) => await store.getAddress(key.toBytes32(key.NS.ASSURANCE_VAULT)) +const getReassuranceVaultAddress = async (store) => await store.getAddress(key.toBytes32(key.NS.REASSURANCE_VAULT)) const getVaultAddress = async (store, coverKey) => await store.getAddress(key.encodeKeys(['bytes32', 'bytes32', 'bytes32'], [key.toBytes32(key.NS.CONTRACTS), key.toBytes32(key.NS.COVER_VAULT), coverKey])) module.exports = { getStoreAddressCustom, - getAssuranceVaultAddress, + getReassuranceVaultAddress, getVaultAddress } diff --git a/util/typedefs.js b/util/typedefs.js index d3d00637..3ed58e8f 100644 --- a/util/typedefs.js +++ b/util/typedefs.js @@ -21,10 +21,10 @@ * @property {Object} store - Store contract * @property {Object} npm - NPM Token contract * @property {Object} wxDai - wxDai contract - * @property {Object} assuranceToken - Assurance token + * @property {Object} reassuranceToken - Reassurance token * @property {Object} protocol - The base protocol contract * @property {Object} stakingContract - NPM staking contract - * @property {Object} assuranceContract - Assurance contract + * @property {Object} reassuranceContract - Reassurance contract * @property {Object} provisionContract - NPM provision contract * @property {Object} vaultFactory - Liquidity vault factory * @property {Object} cxTokenFactory - cxToken factory