Assessment reports>Cega>Threat Models>Function: updateOptionBarrierOracle(address vaultAddress, uint256 index, string _asset, string newOracleName)
GeneralOverview
Threat ModelsWhat are threat models?CegaState.sol
FCNProduct.solFunction: addOptionBarrier(address vaultAddress, OptionBarrier optionBarrier)Function: addToDepositQueue(uint256 amount, address receiver)Function: addToWithdrawalQueue(address vaultAddress, uint256 amountShares, address receiver)Function: calculateCurrentYield(address vaultAddress)Function: calculateVaultFinalPayoff(address vaultAddress)Function: checkBarriers(address vaultAddress)Function: createVault(string _tokenName, string _tokenSymbol, uint256 _vaultStart)Function: openVaultDeposits(address vaultAddress)Function: processDepositQueue(address vaultAddress, uint256 maxProcessCount)Function: processWithdrawalQueue(address vaultAddress, uint256 maxProcessCount)Function: receiveAssetsFromCegaState(address vaultAddress, uint256 amount)Function: removeOptionBarrier(address vaultAddress, uint256 index, string _asset)Function: removeVault(address vaultAddress)Function: rolloverVault(address vaultAddress)Function: setIsDepositQueueOpen(bool _isDepositQueueOpen)Function: setKnockInStatus(address vaultAddress, bool newState)Function: setManagementFeeBps(uint256 _managementFeeBps)Function: setMaxDepositAmountLimit(uint256 _maxDepositAmountLimit)Function: setTradeData(address vaultAddress, uint256 _tradeDate, uint256 _tradeExpiry, uint256 _aprBps, uint256 _tenorInDays)Function: setVaultMetadata(address vaultAddress, FCNVaultMetadata metadata)Function: setVaultStatus(address vaultAddress, VaultStatus _vaultStatus)Function: setYieldFeeBps(uint256 _yieldFeeBps)Function: updateOptionBarrierOracle(address vaultAddress, uint256 index, string _asset, string newOracleName)
Oracle.sol

Function: updateOptionBarrierOracle(address vaultAddress, uint256 index, string _asset, string newOracleName)

Updates the oracle being used by a specific option barrier.

Inputs

  • vaultAddress

    • Control: Fully controlled.

    • Constraints: N/A.

    • Impact: This vault's metadata is updated.

  • index

    • Control: Fully controlled.

    • Constraints: Must be less than the vault metadata's optionBarrierCount.

    • Impact: Used to index into the vault metadata's optionBarriers array.

  • _asset

    • Control: Fully controlled.

    • Constraints: Must match the asset of the option barrier being updated.

    • Impact: N/A.

  • newOracleName

    • Control: Fully controlled.

    • Constraints: Must exist in the CegaState contract's oracleAddresses mapping.

    • Impact: Used to update the option barrier.

Branches and code coverage (including function calls)

Intended branches

  • Should correctly update the oracle of the indexed option barrier.

Negative behaviour

  • Should revert if called by a non--operator-admin role.

  • Should revert if the _asset argument does not match the asset of the indexed option barrier.

  • Should revert if the newOracleName argument does not exist in the CegaState contract's oracleAddresses mapping.

Zellic © 2024Back to top ↑