Nayms 2024 (Retainer)

QuantstampRepository at commit 2f08d24

Audit

Part of Quantstamp’s retainer series

Quantstamp reviewed Nayms 2024 (Retainer) on 3 May 2024: 33 findings, 0 critical; 18 marked fixed, 11 acknowledged, 4 open.

No open critical findings
Open the reportOpen Nayms 2024 (Retainer)’s security record

Report hosted on certificate.quantstamp.com.

Trustblock does not review code.

Findings33

Statuses are the security firm’s own, from its report.

SeverityOpenAcknowledgedFixed
Critical000
High004
Medium202
Low21112
HighA malicious user can reduce other users' rewards due to incorrect accounting of stake balancesFixed

In the function `_unstake()`, the stake balance of the entity is not reduced for the current interval, namely `s.stakeBalance[vTokenId][_entityId]` is not reduced by the amount unstaked. This is problematic because a user can stake and unstake in the current interval, but this only increases the stake balance of the entity for the current interval. This means the actual amount of tokens staked in `_entityId` is not accurately represented by the `stakeBalance` mapping. This in turn leads to wrong accounting in `_payRewards()` if the entity admin decides to pay rewards at the current interval after the user's unstaking. In particular, some rewards will be unclaimable because a portion of the rewards is allocated to the "unstaked" user. Furthermore, an attacker can deny other users from claiming their rewards by staking a huge amount and then immediately unstaking.

HighIncorrect accounting when users of a staking entity stake into that entityFixed

As staking happens on behalf of a users' entity and due to missing checks, it is possible for users of a staking entity to stake into their entity on its behalf. In particular, this could lead to following accounting issues: 1. `LibTokenizedVaultStaking._stake()`: Double accounting in `L124`, `L129` and `L142-L147`. 2. `AppStorage.stakeCollected[][]`: Variable is used to track a staker's last collected interval as well as a staking entity's last paid out reward interval, leading to incorrect last interval accounting for users of a staking entity.

HighNot All Objects in the System Are Existing Objects or Have an Object Type, Which Could Lead to Unexpected Collisions or Issues for Future FeaturesFixed

The Nayms platform uses a `bytes32` identifier to distinguish the different objects in the system and store relational attributes between them in mappings, for instance, the token balances of each object, or the access permissions between objects. The mapping `existingObjects(bytes32 => bool)` stores the fact that an object with a specific identifier exists or not. However, not all objects identified by an identifier are in this mapping. For instance, roles and groups have an identifier but are not considered as existing in the system. This could lead to collisions when we can create an object `b` with the same identifier as the object `a` which is already used by the system but is not an existing object according to the mapping. One example of a negative consequence is illustrated in the Exploit section below. Another example is the fact that, when the first address is granted a `sysAdmin` role in `LibInitDiamond.setSystemAdmin()`, the associated identifier of this address becomes an existing id (mapping `existingObjects`). However, when other `sysAdmin` roles are granted via `LibACL._assignRole()`, the addresses receiving that role do not become existing objects. Finally, the concept of object type was introduced in the last update of the codebase and adds to the identifier of an object `12` bytes to define the type of the object. However, objects that were created before this update still exist in the system but do not have in their identifier these `12` bytes to define their type. As a result, if in the future, some features check that a given object must be of a given type (for example: a policy), legacy objects created before the update will not be compatible with this new feature.

HighUser can artificially inflate stake boosts for the next interval by repeating stake and unstake actionsFixed

In `_unstake()`, we only set `s.stakeBoost[vTokenId][_stakerId] = 0;` back to zero, but we do not set the stake boost for the next `vTokenId` back to zero. When a user stake in the current interval, part of the stake boost will be allocated to the next `vTokenId` proportional to the time it was staked between the current interval and the next interval, as shown in the following lines: ``` uint256 boostTotal = (_amount * _getA(_entityId)) / _getD(_entityId); uint256 boostNext; if (_isStakingInitialized(_entityId)) { boostNext = (boostTotal * (block.timestamp - _calculateStartTimeOfCurrentInterval(_entityId))) / s.stakingConfigs[_entityId].interval; } uint256 boost = boostTotal - boostNext; // give to the staker s.stakeBoost[vTokenId][_stakerId] += boost; s.stakeBoost[nextVTokenId][_stakerId] += boostNext; ``` Since the stake boost is never reset for the next `vTokenId`, an attacker can inflate the stake boost for the next interval by repeatedly staking and unstaking in the current interval. Then, at the start of the next interval, an attacker can simply stake a small amount, but he will be able to claim more rewards than should be allowed due to the inflated boost.

Medium`ACLFacet.updateRoleGroup()` may change `GROUP_SYSTEM_ADMINS`, bypassing the existing checkFixed

The function `ACLFacet.updateRoleGroup()` allows system administrators to change the group membership for a given role. While the following check prevents changing the membership to group `LC.GROUP_SYSTEM_ADMINS`, it can be bypassed: ``` require(!LibString.eq(_group, LC.GROUP_SYSTEM_ADMINS), "system admins group is not modifiable"); ``` In details, this check can be bypassed by providing a `_group` string with the value `LC.GROUP_SYSTEM_ADMINS` padded with enough zero bytes such that the function `eq()` returns `false` but the function `LibACL._updateRoleGroup()` still uses the value of `LC.GROUP_SYSTEM_ADMINS` (i.e. `System Admins\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000` - The string `System Admins` padded with null-bytes to 32 bytes length, which may be passed like this or may contain arbitrary other bytes afterwards).

MediumUnrestricted Access Control Rule for Internal Transfers From Objects' ChildrenFixed

The function `TokenizedVaultFacet.internalTransferFromEntity()` is no longer protected by an "onlyEntityAdmin" modifier. Since the fact that the parent of `msg.sender` is not checked to be an entity, any address being the child of an object id owning tokens can trigger a transfer of any token to an arbitrary other internal address. This could lead to unexpected consequences in the current version of the system and future ones as well.

Low[PR-100] Incorrect accounting of `depositTotal`Fixed

In `LibTokenizedVaultIO`, functions `_externalWithdraw()` and `_externalDeposit()`, the value of `depositTotal` should be updated with the exact amounts deposited and withdrawn instead of the requested amounts (cases of rebasing tokens and fee-on-transfer tokens).

Low[PR-100] Unclear rationale for the update of `depositTotal` with an hardcoded amount instead of the current balanceFixed

In `LibTokenizedVault`, function `_rebaseERC20()`, the rationale of providing an `_amount` parameter to the function `_rebaseERC20()` is unclear, and could harm the system, since any value between `0` and `currentBalance` is a valid input to hardcode the new value of `s.depositTotal[_tokenId]`. An alternative could be to use all the amount available instead.

LowChildren Objects Can Trigger Staking-Related Operations on Behalf of Their ParentFixed

The normal behavior for the staking feature is to let children objects of an entity trigger the following operations on behalf of their parent entity: `stake()`, `unstake()`, and `collectRewards()`. While this behavior makes sense, the fact that the parent is an entity is not checked. As a result, edge cases may be possible for parent-child relationships where the child is an address (EOA or contract) able to call one of these three operations, and the parent is not an entity that owns the staking token. In such a case, the child will be able to trigger a transfer of staking tokens on behalf of his parent. Such an operation, if feasible, could negatively impact the system and its accounting.

LowConsolidation of best practicesFixed

1. qs-badge-fixed In the repo `naym-coin`: some items are imported but not used. 2. qs-badge-fixed In `naym-coin/InitDiamond`: there is a "//todo" comment. 3. In `contracts-v3/ACLFacet`: consider caching in a local variable the value of `LibHelpers._stringToBytes32(_role)` to save gas. 4. qs-badge-fixed In `contracts-v3/LibSimplePolicy `: in `_payClaim()`, we could replace `>` with `>=` in the following statement: `require(availableBalance > _amount, "not enough balance")`. 5. In `contracts-v3/LibFeeRouter`: </br>a. In `_addFeeSchedule()`, consider caching in a local variable the value of `feeSchedule.receiver.length` to save gas. </br>b. Code could be reused between the functions `_payPremiumFees()`, `_payTradingFees()`, `_calculatePremiumFees()` and `_calculateTradingFees()` to reduce the code complexity. </br>c. qs-badge-fixed In `_calculatePremiumFees()`, the line `uint256 totalReceiverCount;` can be merged with the next one. </br>d. qs-badge-fixed The fields `FeeAllocation.from` and `FeeAllocation.token` are not used. </br>e. qs-badge-fixed In the function `_payPremiumFees()`, the fact that `fee > 0` is only checked in the second for loop. 6. qs-badge-fixed In `contracts-v3/SimplePolicyFacet`: in `getSimplePolicyInfo()`, consider caching in a local variable the value of `LibSimplePolicy._getSimplePolicyInfo(_policyId)` to save gas. 7. qs-badge-fixed In `contracts-v3/StakingFacet`: according to [Nayms code standard](https://docs.nayms.com/contracts-docs-copy/docs-static/code_standards/), `AppStorage` should not be accessed via facets. 8. qs-badge-fixed In `contracts-v3/LibTokenizedVaultIO`: double-check if the keyword `indexed` should be used for the events `ExternalDeposit` and `ExternalWithdraw`. 9. In `contracts-v3/LibMarket`: </br>a. qs-badge-fixed In `_createOffer()`, cache in a local variable the values of `s.objectMinimumSell[_buyToken]` and `s.objectMinimumSell[_sellToken]` to save gas. </br>b. qs-badge-fixed In `_takeOffer()`, cache in a local variable the values of `s.objectMinimumSell[s.offers[_offerId].sellToken]` to save gas. </br>c. Consider using a constant instead of a magic value `1`. 10. In `contracts-v3/LibTokenizedVaultStaking`: </br>a. qs-badge-fixed In `addUniqueValue()`, cache in a local variable the value of `rewards.currencies.length` to save gas. </br>b. qs-badge-fixed In `addUniqueValue()`, the line `rewards_.lastPaidInterval = i;` could be removed from the loop, and updated after the loop, based on the size of the list. </br>c. qs-badge-fixed Code could be reused between the functions `_getStakingStateWithRewardsBalances()` and `getStakingState()` to reduce the code complexity. 11. qs-badge-fixed In `contracts-v3/LibObject`: the function `LibObject._tokenSymbolNotUsed()` is not used. 12. qs-badge-fixed In `contracts-v3/Modifiers`: the modifier `assertIsInGroup`is not used anymore.

Show 8 more
LowEmergency locking mechanism could be improved to improve the exhaustiveness, robustness, and reactivity of the systemFixed

The system provides the option to pause functions atomically, as well as one way to pause all the flows in a single transaction. It is said that all functions involving updates of funds should be lockable. Three functions with these properties are currently not lockable: * `SimplePolicyFacet.cancelSimplePolicy()`; * `EntityFacet.createSimplePolicy()`; * `SystemFacet.createEntity()`; Also, in case of an emergency, people in charge of pausing the system will need to take time to make sure about the impact of pausing a subset of functions atomically, because locking one function could make other functions active. In this situation, some users could take this opportunity to interact with the system because they are sure that other users with opposite interests cannot do operations (currently locked) in immediate reaction to the operation. Identifying sets of conflicting lockable functions would reduce the time to think about which set of functions we have to lock if we identify a potential hack on a given function.

LowIncorrect values used for events `ExternalDeposit `, `OrderMatched ` and `TokenStakingStarted`Fixed

1. In the function `_externalDeposit()`, the amount to be used for the event `ExternalDeposit` should be `mintAmount` instead of `_amount`. 2. In the function `_matchToExistingOffers()`, the amount to be used for the events `OrderMatched` should be the final amounts calculated, meaning the normalized amounts if there was a normalization. 3. In the function `_initStaking()`, the event `TokenStakingStarted` is using `block.timestamp`, which is redundant since it is already metadata of the event. Also, it is unclear if the objective is to log the moment when the boosts will start or the moment when staking is initiated.

LowKey State Changes Are Missing EventsFixed

To validate the proper deployment and initialization of the contracts, it is a good practice to emit events. Also, any important state transitions can be logged, which is beneficial for monitoring the contract and tracking eventual bugs or hacks. Below is a list of events that could be added: 1. in the repo `naym-coin`, when the storage variables `sysAdmins` and `minter` are updated; 2. in `contracts-v3/LibAdmin._addSupportedExternalToken()`, when the initial amount of `minimumSell` is set; 3. `In contracts-v3/LibFeeRouter._removeFeeSchedule()`, when fee schedules are updated;

LowMismatch between code and documentation in the function `internalTransferBySystemAdmin()`Fixed

In the function `internalTransferBySystemAdmin()`, the documentation mentions that: 1. it should let the admin transfer funds from one entity to another. However, no check makes sure that the sender and the receiver are entities. As a result, the admin can transfer tokens from any object to any object; 2. the caller must be an entity admin of the from entity, but this is not enforced;

LowPotential incorrect checksFixed

1. In the function `_validateSimplePolicyCreation()`, the line `require(commissionReceiversArrayLength <= _stakeholders.roles.length, "too many commission receivers"); // error too many POLICY level commission receivers` may be updated to enforce strict equality. 2. In the function `_removeFeeSchedule()`, the line `require(_entityId != LibConstants.DEFAULT_FEE_SCHEDULE, "cannot remove default fees");` seems incorrect since we compare an entity ID with a `feeScheduleType`. It should be confirmed to be working as expected. 3. In the original code, there was a rule enforced to make sure that an internal trade is either exchanging external supported tokens for p-tokens or vice-versa. This rule was removed in the updated codebase. The intention of the conditional blocks `if (buyExternalToken) ... else ...`) was that if we are not buying external tokens (i.e. `buyExternalToken` is `false`), then the maker must be buying external token. However, this conditional block is not suited anymore for the case where we are trading external token for external token.

LowPotential Silent Failures During Signature VerificationFixed

The function `getSigner()` is used to get the signer of a signature using the `ECDSA` library. This function can silently fail and return an incorrect signature: 1. if `signature.length != 65`, `tryRecover()` will be called with a value of `0` for `r`, `s` and `v`; 2. if `tryRecover()` returns an error message, the function will not revert. Note that the signer can be `address(0)` but also a random address. The severity is [Low], because the signature recovery feature is only used when creating a policy and an additional check makes sure that the `address(0)` is not in the list of stakeholders. Still, it could be technically possible to add `address(0)` as a stakeholder by the system manager, but it is unlikely.

LowTransfer of ownership can be lost if transferred to an address owned by no oneFixed

In the contract `NaymsOwnershipFacet`, in the function `transferOwnership()`, the ownership can be lost if `_newOwner` is an address owned by no one. A two-step transfer could solve this.

LowUnsafe downcast in `_calculateStartTimeOfInterval()`Fixed

In the function `_calculateStartTimeOfInterval()`, an unlikely unsafe downcast can happen when the value of `intervalTime_` is downcasted to `uint64`.

Contracts in scope

No deployed address is recorded for this audit.

The report names a repository or files. Open the report to see its scope.

Repository and files the report names (245)

  • https://github.com/nayms/contracts-v3/docs/src/src/shared/AppStorage.sol/struct.AppStorage.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/CustomErrors.sol/error.ExternalWithdrawAmountCannotBeZero.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/libs/LibObject.sol/library.LibObject.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/test/UpdateFees.t.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/CustomErrors.sol/error.StakingAlreadyStarted.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/solidity.min.js at commit 2f08d24
  • https://github.com/nayms/contracts-v3/test/fixtures/SimplePolicyFixture.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/src/facets/TokenizedVaultFacet.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/cli-tools/postproc-broadcasts.js at commit 2f08d24
  • https://github.com/nayms/contracts-v3/src/shared/AppStorage.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/Makefile at commit 2f08d24
  • https://github.com/nayms/contracts-v3/src/facets/SimplePolicyFacet.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/test/utils/DummyToken.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/.github/workflows/lint.yml at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/FreeStructs.sol/struct.UpdateEntityTypeCell.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/CustomErrors.sol/error.OwnerCannotBeSystemAdmin.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/remappings.txt at commit 2f08d24
  • https://github.com/nayms/contracts-v3/test/T02Access.t.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/FreeStructs.sol/struct.SimplePolicyInfo.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/CustomErrors.sol/error.EntityOnboardingNotApproved.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/FreeStructs.sol/struct.SimplePolicy.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/CustomErrors.sol/error.IntervalRewardPayedOutAlready.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/FreeStructs.sol/struct.CalculatedFees.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/src/facets/UserFacet.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/book.toml at commit 2f08d24
  • https://github.com/nayms/contracts-v3/.solhint.json at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/CustomErrors.sol/error.InvalidRValue.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/test/defaults/D02TestSetup.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/facets/TokenizedVaultIOFacet.sol/contract.TokenizedVaultIOFacet.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/utils/README.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/SUMMARY.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/CustomErrors.sol/error.FeeBasisPointsExceedHalfMax.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/src/libs/LibMarket.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/LICENSE at commit 2f08d24
  • https://github.com/nayms/contracts-v3/test/T06Staking.t.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/CustomErrors.sol/error.SimplePolicyPremiumsPaidShouldStartAtZero.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/CustomErrors.sol/error.InvalidGroupPrivilege.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/facets/PhasedDiamondCutFacet.sol/error.PhasedDiamondCutUpgradeFailed.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/.github/workflows/solstat.yml at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/FreeStructs.sol/struct.FeeSchedule.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/book.css at commit 2f08d24
  • https://github.com/nayms/contracts-v3/src/libs/LibHelpers.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/src/interfaces/IERC165.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/libs/LibEntity.sol/library.LibEntity.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/CustomErrors.sol/error.CancelCannotBeTrueWhenCreatingSimplePolicy.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/FreeStructs.sol/struct.FeeAllocation.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/libs/LibConstants.sol/library.LibConstants.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/test/fixtures/TokenizedVaultFixture.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/test/utils/DSILib.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/cli-tools/filter-lcov.js at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/facets/AdminFacet.sol/contract.AdminFacet.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/facets/GovernanceFacet.sol/contract.GovernanceFacet.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/src/libs/LibACL.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/cli-tools/get-filenames.js at commit 2f08d24
  • https://github.com/nayms/contracts-v3/src/libs/LibGovernance.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/test/T02Admin.t.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/facets/UserFacet.sol/contract.UserFacet.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/generated/LibDiamondHelper.sol/library.LibDiamondHelper.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/README.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/test/T03SystemFacet.t.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/test/ReplaceDiamondCut.t.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/.github/workflows/test.yml at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/CustomErrors.sol/error.PolicyDoesNotExist.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/CustomErrors.sol/error.AssignerCannotUnassignRole.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/mythril.config.json at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/FreeStructs.sol/struct.EntityApproval.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/interfaces/README.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/.gas-snapshot at commit 2f08d24
  • https://github.com/nayms/contracts-v3/test/T04Market.t.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/interfaces/IERC165.sol/interface.IERC165.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/.github/workflows/npm.yml at commit 2f08d24
  • https://github.com/nayms/contracts-v3/src/libs/LibEIP712.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/CustomErrors.sol/error.EntityDoesNotExist.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/facets/SystemFacet.sol/contract.SystemFacet.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/src/facets/GovernanceFacet.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/test/T01LibERC20.t.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/facets/EntityFacet.sol/contract.EntityFacet.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/.prettierrc at commit 2f08d24
  • https://github.com/nayms/contracts-v3/gemforge.config.cjs at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/utils/ReentrancyGuard.sol/abstract.ReentrancyGuard.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/script/gemforge/utils/index.js at commit 2f08d24
  • https://github.com/nayms/contracts-v3/src/libs/LibInitDiamond.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/src/facets/AdminFacet.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/src/shared/CustomErrors.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/src/facets/PhasedDiamondCutFacet.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/src/libs/LibConstants.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/init/README.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/test/mocks/data/facet-cut-struct-1.json at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/init/InitDiamond.sol/contract.InitDiamond.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/test/defaults/D00GlobalDefaults.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/CustomErrors.sol/error.MinimumSellCannotBeZero.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/init/InitDiamond.sol/error.DiamondAlreadyInitialized.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/CustomErrors.sol/error.ObjectTokenNameInvalid.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/.gitignore at commit 2f08d24
  • https://github.com/nayms/contracts-v3/.prettierignore at commit 2f08d24
  • https://github.com/nayms/contracts-v3/index.js at commit 2f08d24
  • https://github.com/nayms/contracts-v3/src/facets/StakingFacet.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/libs/LibTokenizedVaultStaking.sol/library.LibTokenizedVaultStaking.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/FreeStructs.sol/struct.RewardsBalances.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/libs/LibEIP712.sol/library.LibEIP712.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/src/shared/Modifiers.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/.gitmodules at commit 2f08d24
  • https://github.com/nayms/contracts-v3/src/libs/LibTokenizedVaultIO.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/.vscode/extensions.json at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/CustomErrors.sol/error.InvalidIntervalSecondsValue.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/CustomErrors.sol/error.RoleIsMissing.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/libs/LibSimplePolicy.sol/library.LibSimplePolicy.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/facets/README.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/FreeStructs.sol/struct.StakingCheckpoint.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/interfaces/IERC173.sol/interface.IERC173.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/src/libs/LibTokenizedVault.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/src/libs/LibAdmin.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/src/libs/LibEntity.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/CustomErrors.sol/error.ObjectTokenSymbolAlreadyInUse.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/README.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/FreeStructs.sol/struct.MarketInfo.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/FreeStructs.sol/struct.Stakeholders.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/CustomErrors.sol/error.InvalidObjectType.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/CustomErrors.sol/error.PolicyCannotCancelAfterMaturation.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/libs/LibACL.sol/library.LibACL.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/test/NewFees.t.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/facets/NaymsOwnershipFacet.sol/contract.NaymsOwnershipFacet.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/.eslintrc.js at commit 2f08d24
  • https://github.com/nayms/contracts-v3/.vscode/settings.json at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/generated/README.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/src/libs/LibSimplePolicy.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/script/deployment/DeployERC20.s.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/libs/LibTokenizedVaultIO.sol/library.LibTokenizedVaultIO.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/CustomErrors.sol/error.InsufficientBalance.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/CustomErrors.sol/error.InvalidDividerValue.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs-static/test_plan.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/facets/TokenizedVaultFacet.sol/contract.TokenizedVaultFacet.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/foundry.toml at commit 2f08d24
  • https://github.com/nayms/contracts-v3/src/facets/SystemFacet.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/libs/README.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/script/gemforge/verify.js at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/CustomErrors.sol/error.DuplicateSignerCreatingSimplePolicy.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/src/shared/FreeStructs.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/facets/ACLFacet.sol/contract.ACLFacet.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/.gitignore at commit 2f08d24
  • https://github.com/nayms/contracts-v3/test/T01LibHelpers.t.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/generated/IDiamondProxy.sol/interface.IDiamondProxy.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/README.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/.gemforge/.gitignore at commit 2f08d24
  • https://github.com/nayms/contracts-v3/src/generated/.gitignore at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/FreeStructs.sol/struct.TokenAmount.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/cli-tools/docgen.js at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/CustomErrors.sol/error.InvalidStakingInitDate.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/src/facets/NaymsOwnershipFacet.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/facets/MarketFacet.sol/contract.MarketFacet.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/test/defaults/D03ProtocolDefaults.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/CustomErrors.sol/error.InvalidObjectIdForAddress.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/CustomErrors.sol/error.SimplePolicyClaimsPaidShouldStartAtZero.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/CustomErrors.sol/error.UtilizedCapacityGreaterThanMaxCapacity.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/CustomErrors.sol/error.ExternalWithdrawInvalidReceiver.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/test/T03TokenizedVault.t.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/src/init/InitDiamond.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/cli-tools/code-recon.js at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/libs/LibAdmin.sol/library.LibAdmin.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/src/facets/MarketFacet.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/.npmignore at commit 2f08d24
  • https://github.com/nayms/contracts-v3/test/T01Deployment.t.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/script/.solhint.json at commit 2f08d24
  • https://github.com/nayms/contracts-v3/src/libs/LibTokenizedVaultStaking.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/src/facets/TokenizedVaultIOFacet.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/test/T02ACL.t.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/libs/LibHelpers.sol/library.LibHelpers.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/cli-tools/contract.hbs at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/CustomErrors.sol/error.FeeBasisPointsExceedMax.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/FreeStructs.sol/struct.StakingConfig.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/cli-tools/anvil_bootstrap.sh at commit 2f08d24
  • https://github.com/nayms/contracts-v3/test/T04Entity.t.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/libs/LibInitDiamond.sol/library.LibInitDiamond.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/libs/LibGovernance.sol/library.LibGovernance.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/src/utils/ReentrancyGuard.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/src/utils/ERC20Wrapper.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/CustomErrors.sol/error.APlusRCannotBeGreaterThanDivider.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs-static/code_standards.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/AppStorage.sol/struct.FunctionLockedStorage.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/CustomErrors.sol/error.CannotAddNullDiscountToken.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/test/fixtures/InitDiamondFixture.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/interfaces/IERC20.sol/interface.IERC20.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/test/mocks/data/facet-cut-struct-3.json at commit 2f08d24
  • https://github.com/nayms/contracts-v3/src/libs/LibFeeRouter.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/FreeStructs.sol/struct.Entity.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/utils/Create3Deployer.sol/contract.Create3Deployer.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/test/T02User.t.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/script/gemforge/deploy.js at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/CustomErrors.sol/error.EntityExistsAlready.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/script/AddSupportedExternalToken.s.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/CustomErrors.sol/error.ObjectTokenSymbolInvalid.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/.env.example at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/Modifiers.sol/contract.Modifiers.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/.solhintignore at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/facets/SimplePolicyFacet.sol/contract.SimplePolicyFacet.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/CustomErrors.sol/error.EntityOnboardingAlreadyApproved.md at commit 2f08d24
  • https://github.com/nayms/contracts-v3/test/utils/users/MockAccounts.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/test/utils/BadToken.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/test/T03NaymsOwnership.t.sol at commit 2f08d24
  • https://github.com/nayms/contracts-v3/docs/src/src/shared/CustomErrors.sol/error.CannotAddNullSupportedExternalToken.md at commit 2f08d24

Part of Nayms 2024 (Retainer)’s security record

Nayms 2024 (Retainer)
Audits3 audits by 1 firmLast audit May 2024, by Quantstamp.
Critical findingsNo open critical findingsAcross 3 reports.
Open Nayms 2024 (Retainer)’s security record

Security firm

Quantstamp

236 projects reviewed · 332 reports · latest Oct 2026

See Quantstamp’s audits

Something wrong on this page? A missing report, a wrong date, a finding that was fixed since. Tell us and we check it against its source.

Tell us