From 840b12efc4f9e0baec716197abca9c7e587f0703 Mon Sep 17 00:00:00 2001 From: Alex Roan Date: Thu, 11 Jul 2024 13:15:10 +0300 Subject: [PATCH] Fix TempleDao repo issues (#577) --- .github/workflows/cargo.yml | 18 + .gitmodules | 3 + Makefile | 3 +- aderyn_core/src/ast/variables.rs | 10 +- aderyn_core/src/context/workspace_context.rs | 65 +- .../src/detect/low/zero_address_check.rs | 2 +- cli/reportgen.sh | 3 + reports/templegold-report.md | 8337 +++++++++++++++++ tests/2024-07-templegold | 1 + 9 files changed, 8398 insertions(+), 44 deletions(-) create mode 100644 reports/templegold-report.md create mode 160000 tests/2024-07-templegold diff --git a/.github/workflows/cargo.yml b/.github/workflows/cargo.yml index b4822aa27..fd34f3a12 100644 --- a/.github/workflows/cargo.yml +++ b/.github/workflows/cargo.yml @@ -49,6 +49,11 @@ jobs: - uses: pnpm/action-setup@v3 with: version: 8 + + - uses: actions/setup-node@v3 + with: + node-version: 20 + cache: 'npm' - name: Make run: | @@ -215,6 +220,19 @@ jobs: cat ./reports/prb-math-report-workflow.md diff ./reports/prb-math-report.md ./reports/prb-math-report-workflow.md + + - name: Generate 2024-07-templegold-report-workflow.md + uses: actions-rs/cargo@v1 + with: + command: run + args: -- ./tests/2024-07-templegold/protocol -o ./reports/2024-07-templegold-report-workflow.md --skip-update-check + + - name: Check 2024-07-templegold-report.md vs 2024-07-templegold-report-workflow.md + run: | + cat ./reports/2024-07-templegold-report-workflow.md + diff ./reports/templegold-report.md ./reports/2024-07-templegold-report-workflow.md + + # Verify report.json - name: Generate report-workflow.json diff --git a/.gitmodules b/.gitmodules index eb93ad76a..b0a34e89e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -28,3 +28,6 @@ [submodule "tests/prb-math"] path = tests/prb-math url = https://github.com/PaulRBerg/prb-math +[submodule "tests/2024-07-templegold"] + path = tests/2024-07-templegold + url = https://github.com/Cyfrin/2024-07-templegold.git diff --git a/Makefile b/Makefile index dfe6feb3b..46c014d15 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,8 @@ setup: yarn install && forge build cd tests/prb-math/;\ npm install && forge build - + cd tests/2024-07-templegold/;\ + yarn # Check for tests to pass .PHONY: test diff --git a/aderyn_core/src/ast/variables.rs b/aderyn_core/src/ast/variables.rs index 2c01de878..da2843bbb 100644 --- a/aderyn_core/src/ast/variables.rs +++ b/aderyn_core/src/ast/variables.rs @@ -103,15 +103,15 @@ impl VariableDeclaration { /// Returns the mutability of the variable that was declared. /// /// This is a helper to check variable mutability across Solidity versions. - pub fn mutability(&self) -> &Mutability { + pub fn mutability(&self) -> Option<&Mutability> { if let Some(mutability) = &self.mutability { - mutability + Some(mutability) } else if self.constant { - &Mutability::Constant + Some(&Mutability::Constant) } else if self.state_variable { - &Mutability::Mutable + Some(&Mutability::Mutable) } else { - unreachable!() + None } } } diff --git a/aderyn_core/src/context/workspace_context.rs b/aderyn_core/src/context/workspace_context.rs index 40facfd38..469140091 100644 --- a/aderyn_core/src/context/workspace_context.rs +++ b/aderyn_core/src/context/workspace_context.rs @@ -1661,46 +1661,37 @@ impl WorkspaceContext { let absolute_path = source_unit.absolute_path.as_ref().unwrap().clone(); let source_line = node .src() - .map(|src| source_unit.source_line(src).unwrap_or(0)) // If `src` is `Some`, get the line number, else return 0 - .unwrap_or(0); // If `src` is `None`, default to 0 + .map(|src| source_unit.source_line(src).unwrap_or(0)) + .unwrap_or(0); - // If the node is one of these, and it has a `name_location`, use that instead of the full `src` let src_location = match node { - ASTNode::ContractDefinition(node) => { - if let Some(name_location) = &node.name_location { - name_location - } else { - &node.src - } - } - ASTNode::FunctionDefinition(node) => { - if let Some(name_location) = &node.name_location { - name_location - } else { - &node.src - } - } - ASTNode::ModifierDefinition(node) => { - if let Some(name_location) = &node.name_location { - name_location - } else { - &node.src - } - } - ASTNode::VariableDeclaration(node) => { - if let Some(name_location) = &node.name_location { - name_location - } else { - &node.src - } - } - _ => node.src().unwrap_or(""), + ASTNode::ContractDefinition(contract_node) => contract_node + .name_location + .as_ref() + .filter(|loc| !loc.contains("-1")) + .map_or_else(|| contract_node.src.clone(), |loc| loc.clone()), + ASTNode::FunctionDefinition(function_node) => function_node + .name_location + .as_ref() + .filter(|loc| !loc.contains("-1")) + .map_or_else(|| function_node.src.clone(), |loc| loc.clone()), + ASTNode::ModifierDefinition(modifier_node) => modifier_node + .name_location + .as_ref() + .filter(|loc| !loc.contains("-1")) + .map_or_else(|| modifier_node.src.clone(), |loc| loc.clone()), + ASTNode::VariableDeclaration(variable_node) => variable_node + .name_location + .as_ref() + .filter(|loc| !loc.contains("-1")) + .map_or_else(|| variable_node.src.clone(), |loc| loc.clone()), + _ => node.src().unwrap_or("").to_string(), }; - let chopped_location = match src_location.rfind(':') { - Some(index) => &src_location[..index], - None => src_location, // No colon found, return the original string - } - .to_string(); + + let chopped_location = src_location + .rfind(':') + .map(|index| src_location[..index].to_string()) + .unwrap_or(src_location); (absolute_path, source_line, chopped_location) } diff --git a/aderyn_core/src/detect/low/zero_address_check.rs b/aderyn_core/src/detect/low/zero_address_check.rs index a176ef401..2e0312117 100644 --- a/aderyn_core/src/detect/low/zero_address_check.rs +++ b/aderyn_core/src/detect/low/zero_address_check.rs @@ -32,7 +32,7 @@ impl IssueDetector for ZeroAddressCheckDetector { .iter() .filter_map(|&var_decl| { if !var_decl.constant - && matches!(var_decl.mutability(), Mutability::Mutable) + && matches!(var_decl.mutability(), Some(Mutability::Mutable)) && var_decl.state_variable && (var_decl .type_descriptions diff --git a/cli/reportgen.sh b/cli/reportgen.sh index 723baf2ac..28e7deca1 100755 --- a/cli/reportgen.sh +++ b/cli/reportgen.sh @@ -24,6 +24,9 @@ FOUNDRY_PROFILE=uniswap cargo run tests/contract-playground/ -o ./reports/uniswa # PRB Math (uses new solidity features) cargo run -- tests/prb-math -o reports/prb-math-report.md --skip-update-check & +# TempleGold +cargo run -- tests/2024-07-templegold/protocol -o reports/templegold-report.md --skip-update-check & + ##### JSON REPORTS ######## # Basic report.json diff --git a/reports/templegold-report.md b/reports/templegold-report.md new file mode 100644 index 000000000..e9bfcc46b --- /dev/null +++ b/reports/templegold-report.md @@ -0,0 +1,8337 @@ +# Aderyn Analysis Report + +This report was generated by [Aderyn](https://github.com/Cyfrin/aderyn), a static analysis tool built by [Cyfrin](https://cyfrin.io), a blockchain security company. This report is not a substitute for manual audit or security review. It should not be relied upon for any purpose other than to assist in the identification of potential security vulnerabilities. +# Table of Contents + +- [Summary](#summary) + - [Files Summary](#files-summary) + - [Files Details](#files-details) + - [Issue Summary](#issue-summary) +- [High Issues](#high-issues) + - [H-1: Arbitrary `from` passed to `transferFrom` (or `safeTransferFrom`)](#h-1-arbitrary-from-passed-to-transferfrom-or-safetransferfrom) + - [H-2: Unprotected initializer](#h-2-unprotected-initializer) + - [H-3: Unsafe Casting](#h-3-unsafe-casting) +- [Low Issues](#low-issues) + - [L-1: Centralization Risk for trusted owners](#l-1-centralization-risk-for-trusted-owners) + - [L-2: `ecrecover` is susceptible to signature malleability](#l-2-ecrecover-is-susceptible-to-signature-malleability) + - [L-3: Unsafe ERC20 Operations should not be used](#l-3-unsafe-erc20-operations-should-not-be-used) + - [L-4: Solidity pragma should be specific, not wide](#l-4-solidity-pragma-should-be-specific-not-wide) + - [L-5: Missing checks for `address(0)` when assigning values to address state variables](#l-5-missing-checks-for-address0-when-assigning-values-to-address-state-variables) + - [L-6: `public` functions not used internally could be marked `external`](#l-6-public-functions-not-used-internally-could-be-marked-external) + - [L-7: Define and use `constant` variables instead of using literals](#l-7-define-and-use-constant-variables-instead-of-using-literals) + - [L-8: Event is missing `indexed` fields](#l-8-event-is-missing-indexed-fields) + - [L-9: Empty `require()` / `revert()` statements](#l-9-empty-require--revert-statements) + - [L-10: PUSH0 is not supported by all chains](#l-10-push0-is-not-supported-by-all-chains) + - [L-11: Modifiers invoked only once can be shoe-horned into the function](#l-11-modifiers-invoked-only-once-can-be-shoe-horned-into-the-function) + - [L-12: Empty Block](#l-12-empty-block) + - [L-13: Large literal values multiples of 10000 can be replaced with scientific notation](#l-13-large-literal-values-multiples-of-10000-can-be-replaced-with-scientific-notation) + - [L-14: Internal functions called only once can be inlined](#l-14-internal-functions-called-only-once-can-be-inlined) + - [L-15: Inconsistency in declaring uint256/uint (or) int256/int variables within a contract. Use explicit size declarations (uint256 or int256).](#l-15-inconsistency-in-declaring-uint256uint-or-int256int-variables-within-a-contract-use-explicit-size-declarations-uint256-or-int256) + - [L-16: Unused Custom Error](#l-16-unused-custom-error) + - [L-17: Loop contains `require`/`revert` statements](#l-17-loop-contains-requirerevert-statements) + - [L-18: Incorrect Order of Division and Multiplication](#l-18-incorrect-order-of-division-and-multiplication) + + +# Summary + +## Files Summary + +| Key | Value | +| --- | --- | +| .sol Files | 129 | +| Total nSLOC | 10216 | + + +## Files Details + +| Filepath | nSLOC | +| --- | --- | +| contracts/admin/TempleTeamPayments.sol | 80 | +| contracts/admin/TempleTeamPaymentsFactory.sol | 113 | +| contracts/admin/TempleTeamPaymentsV2.sol | 68 | +| contracts/amm/TempleStableAMMRouter.sol | 174 | +| contracts/amm/TempleUniswapV2Pair.sol | 146 | +| contracts/amm/TreasuryIV.sol | 17 | +| contracts/amo/AuraStaking.sol | 99 | +| contracts/amo/Ramos.sol | 350 | +| contracts/amo/helpers/AMOCommon.sol | 17 | +| contracts/amo/helpers/BalancerPoolHelper.sol | 329 | +| contracts/amo/test/RamosTestnetAuraStaking.sol | 79 | +| contracts/amo/test/RamosTestnetTempleTokenVault.sol | 28 | +| contracts/amo/test/external/IAuraStakingProxy.sol | 6 | +| contracts/amo/test/external/IAuraToken.sol | 4 | +| contracts/amo/test/external/IBalancerAuthorizer.sol | 13 | +| contracts/amo/test/external/IBalancerAuthorizerAdapter.sol | 7 | +| contracts/amo/test/external/IBalancerHelpers.sol | 27 | +| contracts/amo/test/external/IBalancerVotingEscrow.sol | 4 | +| contracts/amo/test/external/IGaugeAdder.sol | 4 | +| contracts/amo/test/external/IGaugeController.sol | 7 | +| contracts/amo/test/external/ILiquidityGaugeFactory.sol | 4 | +| contracts/amo/test/external/IPoolManagerProxy.sol | 4 | +| contracts/amo/test/external/IPoolManagerV3.sol | 5 | +| contracts/amo/test/external/IStashRewards.sol | 7 | +| contracts/amo/test/external/IWeightPool2Tokens.sol | 4 | +| contracts/amo/test/external/goerli/Goerli_ILiquidityGaugeFactory.sol | 5 | +| contracts/common/CommonEventsAndErrors.sol | 11 | +| contracts/common/SafeCast.sol | 10 | +| contracts/common/TempleMath.sol | 10 | +| contracts/core/Exposure.sol | 68 | +| contracts/core/JoiningFee.sol | 30 | +| contracts/core/MultiOtcOffer.sol | 163 | +| contracts/core/OpsManager.sol | 110 | +| contracts/core/OpsManagerLib.sol | 76 | +| contracts/core/OtcOffer.sol | 91 | +| contracts/core/Rational.sol | 5 | +| contracts/core/RebasingERC20.sol | 45 | +| contracts/core/TempleERC20Token.sol | 23 | +| contracts/core/TreasuryFarmingRevenue.sol | 44 | +| contracts/core/Vault.sol | 117 | +| contracts/core/VaultEarlyWithdraw.sol | 49 | +| contracts/core/VaultProxy.sol | 84 | +| contracts/core/VaultedTemple.sol | 26 | +| contracts/deprecated/Faith.sol | 41 | +| contracts/deprecated/IExitQueue.sol | 4 | +| contracts/deprecated/InstantExitQueue.sol | 20 | +| contracts/deprecated/LockedOGTemple.sol | 59 | +| contracts/deprecated/OGTemple.sol | 13 | +| contracts/deprecated/TempleStaking.sol | 98 | +| contracts/fakes/FakeERC20.sol | 20 | +| contracts/fakes/FakeERC20CustomDecimals.sol | 26 | +| contracts/fakes/NoopLiquidator.sol | 13 | +| contracts/fakes/NoopVaultedTempleLiquidator.sol | 16 | +| contracts/fakes/UniswapV2Factory.sol | 2 | +| contracts/fakes/UniswapV2Router02NoEth.sol | 353 | +| contracts/fakes/governance/DummyTimelockController.sol | 28 | +| contracts/fakes/templegold/TempleGoldMock.sol | 78 | +| contracts/fakes/templegold/TempleGoldStakingMock.sol | 435 | +| contracts/fakes/templegold/TempleTokenMock.sol | 21 | +| contracts/fakes/v2/TempleDebtTokenTestnetAdmin.sol | 45 | +| contracts/fakes/v2/strategies/DsrBaseStrategyTestnet.sol | 116 | +| contracts/governance/ElderElection.sol | 108 | +| contracts/governance/Templar.sol | 49 | +| contracts/governance/TemplarMetadata.sol | 23 | +| contracts/interfaces/amo/IAuraStaking.sol | 40 | +| contracts/interfaces/amo/IRamos.sol | 106 | +| contracts/interfaces/amo/helpers/IBalancerPoolHelper.sol | 86 | +| contracts/interfaces/amo/helpers/IRamosTokenVault.sol | 7 | +| contracts/interfaces/core/IMultiOtcOffer.sol | 60 | +| contracts/interfaces/core/ITempleERC20Token.sol | 7 | +| contracts/interfaces/external/aura/IAuraBaseRewardPool.sol | 15 | +| contracts/interfaces/external/aura/IAuraBooster.sol | 21 | +| contracts/interfaces/external/balancer/IBalancerBptToken.sol | 5 | +| contracts/interfaces/external/balancer/IBalancerHelpers.sol | 16 | +| contracts/interfaces/external/balancer/IBalancerVault.sol | 66 | +| contracts/interfaces/external/makerDao/IMakerDaoDaiJoinLike.sol | 7 | +| contracts/interfaces/external/makerDao/IMakerDaoPotLike.sol | 10 | +| contracts/interfaces/external/makerDao/IMakerDaoVatLike.sol | 5 | +| contracts/interfaces/templegold/IAuctionBase.sol | 26 | +| contracts/interfaces/templegold/IDaiGoldAuction.sol | 33 | +| contracts/interfaces/templegold/ISpiceAuction.sol | 37 | +| contracts/interfaces/templegold/ISpiceAuctionFactory.sol | 10 | +| contracts/interfaces/templegold/ITempleGold.sol | 57 | +| contracts/interfaces/templegold/ITempleGoldAdmin.sol | 19 | +| contracts/interfaces/templegold/ITempleGoldStaking.sol | 86 | +| contracts/interfaces/templegold/ITempleTeleporter.sol | 24 | +| contracts/interfaces/v2/ITempleDebtToken.sol | 60 | +| contracts/interfaces/v2/ITreasuryPriceIndexOracle.sol | 20 | +| contracts/interfaces/v2/ITreasuryReservesVault.sol | 118 | +| contracts/interfaces/v2/access/ITempleElevatedAccess.sol | 23 | +| contracts/interfaces/v2/circuitBreaker/ITempleCircuitBreaker.sol | 5 | +| contracts/interfaces/v2/circuitBreaker/ITempleCircuitBreakerProxy.sol | 27 | +| contracts/interfaces/v2/interestRate/IInterestRateModel.sol | 6 | +| contracts/interfaces/v2/safeGuards/IThresholdSafeGuard.sol | 16 | +| contracts/interfaces/v2/strategies/ITempleBaseStrategy.sol | 8 | +| contracts/interfaces/v2/strategies/ITempleStrategy.sol | 35 | +| contracts/interfaces/v2/strategies/ITlcStrategy.sol | 5 | +| contracts/interfaces/v2/templeLineOfCredit/ITempleLineOfCredit.sol | 54 | +| contracts/interfaces/v2/templeLineOfCredit/ITlcDataTypes.sol | 38 | +| contracts/interfaces/v2/templeLineOfCredit/ITlcEventsAndErrors.sol | 19 | +| contracts/templegold/AuctionBase.sol | 10 | +| contracts/templegold/DaiGoldAuction.sol | 162 | +| contracts/templegold/EpochLib.sol | 13 | +| contracts/templegold/SpiceAuction.sol | 197 | +| contracts/templegold/SpiceAuctionFactory.sol | 42 | +| contracts/templegold/TempleGold.sol | 172 | +| contracts/templegold/TempleGoldAdmin.sol | 50 | +| contracts/templegold/TempleGoldStaking.sol | 354 | +| contracts/templegold/TempleTeleporter.sol | 58 | +| contracts/util/ABDKMath64x64.sol | 478 | +| contracts/util/ABDKMathQuad.sol | 793 | +| contracts/v2/TempleDebtToken.sol | 421 | +| contracts/v2/TreasuryPriceIndexOracle.sol | 58 | +| contracts/v2/TreasuryReservesVault.sol | 448 | +| contracts/v2/access/TempleElevatedAccess.sol | 78 | +| contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol | 96 | +| contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol | 49 | +| contracts/v2/interestRate/BaseInterestRateModel.sol | 16 | +| contracts/v2/interestRate/CompoundedInterest.sol | 15 | +| contracts/v2/interestRate/LinearWithKinkInterestRateModel.sol | 94 | +| contracts/v2/safeGuards/SafeForked.sol | 65 | +| contracts/v2/safeGuards/ThresholdSafeGuard.sol | 124 | +| contracts/v2/strategies/AbstractStrategy.sol | 106 | +| contracts/v2/strategies/DsrBaseStrategy.sol | 163 | +| contracts/v2/strategies/GnosisStrategy.sol | 104 | +| contracts/v2/strategies/RamosStrategy.sol | 156 | +| contracts/v2/strategies/TempleTokenBaseStrategy.sol | 62 | +| contracts/v2/strategies/TlcStrategy.sol | 56 | +| contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol | 468 | +| **Total** | **10216** | + + +## Issue Summary + +| Category | No. of Issues | +| --- | --- | +| High | 3 | +| Low | 18 | + + +# High Issues + +## H-1: Arbitrary `from` passed to `transferFrom` (or `safeTransferFrom`) + +Passing an arbitrary `from` address to `transferFrom` (or `safeTransferFrom`) can lead to loss of funds, because anyone can transfer tokens from the `from` address if an approval is made. + +
4 Found Instances + + +- Found in contracts/core/MultiOtcOffer.sol [Line: 306](../tests/2024-07-templegold/protocol/contracts/core/MultiOtcOffer.sol#L306) + + ```solidity + _userBuyToken.safeTransferFrom(_fundsOwner, msg.sender, buyTokenAmount); + ``` + +- Found in contracts/core/OtcOffer.sol [Line: 140](../tests/2024-07-templegold/protocol/contracts/core/OtcOffer.sol#L140) + + ```solidity + userBuyToken.safeTransferFrom(_fundsOwner, msg.sender, buyTokenAmount); + ``` + +- Found in contracts/v2/TreasuryReservesVault.sol [Line: 776](../tests/2024-07-templegold/protocol/contracts/v2/TreasuryReservesVault.sol#L776) + + ```solidity + token.safeTransferFrom(from, address(this), repayAmount); + ``` + +- Found in contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol [Line: 717](../tests/2024-07-templegold/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L717) + + ```solidity + daiToken.safeTransferFrom(_fromAccount, address(this), _repayAmount); + ``` + +
+ + + +## H-2: Unprotected initializer + +Consider protecting the initializer functions with modifiers. + +
5 Found Instances + + +- Found in contracts/amo/test/external/IStashRewards.sol [Line: 9](../tests/2024-07-templegold/protocol/contracts/amo/test/external/IStashRewards.sol#L9) + + ```solidity + function initialize(uint256 _pid, address _operator, address _staker, address _gauge, address _rewardFactory) external; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 422](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L422) + + ```solidity + function isInfinity (bytes16 x) internal pure returns (bool) { + ``` + +- Found in contracts/v2/TempleDebtToken.sol [Line: 597](../tests/2024-07-templegold/protocol/contracts/v2/TempleDebtToken.sol#L597) + + ```solidity + function _initBaseCache(BaseCache memory _baseCache) private view returns (bool dirty) { + ``` + +- Found in contracts/v2/TempleDebtToken.sol [Line: 672](../tests/2024-07-templegold/protocol/contracts/v2/TempleDebtToken.sol#L672) + + ```solidity + function _initDebtorCache( + ``` + +- Found in contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol [Line: 618](../tests/2024-07-templegold/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L618) + + ```solidity + function _initDebtTokenCache(DebtTokenCache memory _cache) private view returns (bool dirty) { + ``` + +
+ + + +## H-3: Unsafe Casting + +Downcasting int/uints in Solidity can be unsafe due to the potential for data loss and unintended behavior.When downcasting a larger integer type to a smaller one (e.g., uint256 to uint128), the value may exceed the range of the target type,leading to truncation and loss of significant digits. Use OpenZeppelin's SafeCast library to safely downcast integers. + +
2 Found Instances + + +- Found in contracts/util/ABDKMath64x64.sol [Line: 483](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L483) + + ```solidity + return int128 (result); + ``` + +- Found in contracts/v2/interestRate/LinearWithKinkInterestRateModel.sol [Line: 140](../tests/2024-07-templegold/protocol/contracts/v2/interestRate/LinearWithKinkInterestRateModel.sol#L140) + + ```solidity + return uint96(interestRate); + ``` + +
+ + + +# Low Issues + +## L-1: Centralization Risk for trusted owners + +Contracts have owners with privileged rights to perform admin tasks and need to be trusted to not perform malicious updates or drain funds. + +
91 Found Instances + + +- Found in contracts/admin/TempleTeamPayments.sol [Line: 8](../tests/2024-07-templegold/protocol/contracts/admin/TempleTeamPayments.sol#L8) + + ```solidity + contract TempleTeamPayments is Ownable { + ``` + +- Found in contracts/admin/TempleTeamPayments.sol [Line: 32](../tests/2024-07-templegold/protocol/contracts/admin/TempleTeamPayments.sol#L32) + + ```solidity + ) external onlyOwner { + ``` + +- Found in contracts/admin/TempleTeamPayments.sol [Line: 44](../tests/2024-07-templegold/protocol/contracts/admin/TempleTeamPayments.sol#L44) + + ```solidity + function setAllocation(address _address, uint256 _amount) external onlyOwner { + ``` + +- Found in contracts/admin/TempleTeamPayments.sol [Line: 51](../tests/2024-07-templegold/protocol/contracts/admin/TempleTeamPayments.sol#L51) + + ```solidity + onlyOwner + ``` + +- Found in contracts/admin/TempleTeamPayments.sol [Line: 83](../tests/2024-07-templegold/protocol/contracts/admin/TempleTeamPayments.sol#L83) + + ```solidity + function adhocPayment(address _to, uint256 _amount) external onlyOwner { + ``` + +- Found in contracts/admin/TempleTeamPayments.sol [Line: 92](../tests/2024-07-templegold/protocol/contracts/admin/TempleTeamPayments.sol#L92) + + ```solidity + onlyOwner + ``` + +- Found in contracts/admin/TempleTeamPaymentsFactory.sol [Line: 9](../tests/2024-07-templegold/protocol/contracts/admin/TempleTeamPaymentsFactory.sol#L9) + + ```solidity + contract TempleTeamPaymentsFactory is Ownable { + ``` + +- Found in contracts/admin/TempleTeamPaymentsFactory.sol [Line: 58](../tests/2024-07-templegold/protocol/contracts/admin/TempleTeamPaymentsFactory.sol#L58) + + ```solidity + function withdrawToken(IERC20 _token, uint256 _amount) external onlyOwner { + ``` + +- Found in contracts/admin/TempleTeamPaymentsFactory.sol [Line: 66](../tests/2024-07-templegold/protocol/contracts/admin/TempleTeamPaymentsFactory.sol#L66) + + ```solidity + ) external onlyOwner { + ``` + +- Found in contracts/admin/TempleTeamPaymentsFactory.sol [Line: 84](../tests/2024-07-templegold/protocol/contracts/admin/TempleTeamPaymentsFactory.sol#L84) + + ```solidity + ) external onlyOwner returns (TempleTeamPaymentsV2) { + ``` + +- Found in contracts/admin/TempleTeamPaymentsFactory.sol [Line: 123](../tests/2024-07-templegold/protocol/contracts/admin/TempleTeamPaymentsFactory.sol#L123) + + ```solidity + ) external onlyOwner { + ``` + +- Found in contracts/admin/TempleTeamPaymentsV2.sol [Line: 39](../tests/2024-07-templegold/protocol/contracts/admin/TempleTeamPaymentsV2.sol#L39) + + ```solidity + ) external onlyOwner { + ``` + +- Found in contracts/admin/TempleTeamPaymentsV2.sol [Line: 46](../tests/2024-07-templegold/protocol/contracts/admin/TempleTeamPaymentsV2.sol#L46) + + ```solidity + ) external onlyOwner { + ``` + +- Found in contracts/admin/TempleTeamPaymentsV2.sol [Line: 59](../tests/2024-07-templegold/protocol/contracts/admin/TempleTeamPaymentsV2.sol#L59) + + ```solidity + function withdrawToken(IERC20 _token, uint256 _amount) external onlyOwner { + ``` + +- Found in contracts/admin/TempleTeamPaymentsV2.sol [Line: 65](../tests/2024-07-templegold/protocol/contracts/admin/TempleTeamPaymentsV2.sol#L65) + + ```solidity + function toggleMember(address _address) external onlyOwner { + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 22](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L22) + + ```solidity + contract TempleStableAMMRouter is Ownable { + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 48](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L48) + + ```solidity + function addPair(address _token, address _pair) external onlyOwner { + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 52](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L52) + + ```solidity + function setTreasury(ITreasuryIV _templeTreasury) external onlyOwner { + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 56](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L56) + + ```solidity + function setDefendStable(address _defendStable) external onlyOwner { + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 226](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L226) + + ```solidity + function withdraw(address token, address to, uint256 amount) external onlyOwner { + ``` + +- Found in contracts/amm/TreasuryIV.sol [Line: 9](../tests/2024-07-templegold/protocol/contracts/amm/TreasuryIV.sol#L9) + + ```solidity + contract TreasuryIV is Ownable { + ``` + +- Found in contracts/amm/TreasuryIV.sol [Line: 23](../tests/2024-07-templegold/protocol/contracts/amm/TreasuryIV.sol#L23) + + ```solidity + function setIV(uint256 frax, uint256 temple) external onlyOwner { + ``` + +- Found in contracts/core/Exposure.sol [Line: 15](../tests/2024-07-templegold/protocol/contracts/core/Exposure.sol#L15) + + ```solidity + contract Exposure is Ownable, RebasingERC20 { + ``` + +- Found in contracts/core/Exposure.sol [Line: 47](../tests/2024-07-templegold/protocol/contracts/core/Exposure.sol#L47) + + ```solidity + function increaseReval(uint256 amount) external onlyOwner { + ``` + +- Found in contracts/core/Exposure.sol [Line: 57](../tests/2024-07-templegold/protocol/contracts/core/Exposure.sol#L57) + + ```solidity + function decreaseReval(uint256 amount) external onlyOwner { + ``` + +- Found in contracts/core/Exposure.sol [Line: 67](../tests/2024-07-templegold/protocol/contracts/core/Exposure.sol#L67) + + ```solidity + function setLiqidator(ILiquidator _liquidator) external onlyOwner { + ``` + +- Found in contracts/core/Exposure.sol [Line: 76](../tests/2024-07-templegold/protocol/contracts/core/Exposure.sol#L76) + + ```solidity + function setMinterState(address account, bool state) external onlyOwner { + ``` + +- Found in contracts/core/JoiningFee.sol [Line: 16](../tests/2024-07-templegold/protocol/contracts/core/JoiningFee.sol#L16) + + ```solidity + contract JoiningFee is Ownable { + ``` + +- Found in contracts/core/JoiningFee.sol [Line: 41](../tests/2024-07-templegold/protocol/contracts/core/JoiningFee.sol#L41) + + ```solidity + function setHourlyJoiningFeeFor(address vault, uint256 amount) external onlyOwner { + ``` + +- Found in contracts/core/OpsManager.sol [Line: 17](../tests/2024-07-templegold/protocol/contracts/core/OpsManager.sol#L17) + + ```solidity + contract OpsManager is Ownable { + ``` + +- Found in contracts/core/OpsManager.sol [Line: 49](../tests/2024-07-templegold/protocol/contracts/core/OpsManager.sol#L49) + + ```solidity + ) external onlyOwner { + ``` + +- Found in contracts/core/OpsManager.sol [Line: 70](../tests/2024-07-templegold/protocol/contracts/core/OpsManager.sol#L70) + + ```solidity + ) external onlyOwner { + ``` + +- Found in contracts/core/OpsManager.sol [Line: 110](../tests/2024-07-templegold/protocol/contracts/core/OpsManager.sol#L110) + + ```solidity + function addRevenue(IERC20[] memory exposureTokens, uint256[] memory amounts) external onlyOwner { + ``` + +- Found in contracts/core/OpsManager.sol [Line: 121](../tests/2024-07-templegold/protocol/contracts/core/OpsManager.sol#L121) + + ```solidity + function updateExposureReval(IERC20[] memory exposureTokens, uint256[] memory revals) external onlyOwner { + ``` + +- Found in contracts/core/OpsManager.sol [Line: 130](../tests/2024-07-templegold/protocol/contracts/core/OpsManager.sol#L130) + + ```solidity + function increaseVaultTemple(Vault[] memory vaults, uint256[] memory amountsTemple) external onlyOwner { + ``` + +- Found in contracts/core/OpsManager.sol [Line: 144](../tests/2024-07-templegold/protocol/contracts/core/OpsManager.sol#L144) + + ```solidity + function liquidateExposures(Vault[] memory vaults, IERC20[] memory exposureTokens) external onlyOwner { + ``` + +- Found in contracts/core/OpsManager.sol [Line: 170](../tests/2024-07-templegold/protocol/contracts/core/OpsManager.sol#L170) + + ```solidity + function setExposureLiquidator(IERC20 exposureToken, ILiquidator _liquidator) external onlyOwner { + ``` + +- Found in contracts/core/OpsManager.sol [Line: 178](../tests/2024-07-templegold/protocol/contracts/core/OpsManager.sol#L178) + + ```solidity + function setExposureMinterState(IERC20 exposureToken, address account, bool state) external onlyOwner { + ``` + +- Found in contracts/core/OtcOffer.sol [Line: 19](../tests/2024-07-templegold/protocol/contracts/core/OtcOffer.sol#L19) + + ```solidity + contract OtcOffer is Pausable, Ownable { + ``` + +- Found in contracts/core/OtcOffer.sol [Line: 98](../tests/2024-07-templegold/protocol/contracts/core/OtcOffer.sol#L98) + + ```solidity + function pause() external onlyOwner { + ``` + +- Found in contracts/core/OtcOffer.sol [Line: 103](../tests/2024-07-templegold/protocol/contracts/core/OtcOffer.sol#L103) + + ```solidity + function unpause() external onlyOwner { + ``` + +- Found in contracts/core/OtcOffer.sol [Line: 108](../tests/2024-07-templegold/protocol/contracts/core/OtcOffer.sol#L108) + + ```solidity + function setFundsOwner(address _fundsOwner) external onlyOwner { + ``` + +- Found in contracts/core/OtcOffer.sol [Line: 116](../tests/2024-07-templegold/protocol/contracts/core/OtcOffer.sol#L116) + + ```solidity + function setOfferPrice(uint256 _offerPrice) external onlyOwner { + ``` + +- Found in contracts/core/OtcOffer.sol [Line: 123](../tests/2024-07-templegold/protocol/contracts/core/OtcOffer.sol#L123) + + ```solidity + function setOfferPriceRange(uint128 _minValidOfferPrice, uint128 _maxValidOfferPrice) external onlyOwner { + ``` + +- Found in contracts/core/TempleERC20Token.sol [Line: 11](../tests/2024-07-templegold/protocol/contracts/core/TempleERC20Token.sol#L11) + + ```solidity + contract TempleERC20Token is ERC20, ERC20Burnable, Ownable, AccessControl { + ``` + +- Found in contracts/core/TempleERC20Token.sol [Line: 23](../tests/2024-07-templegold/protocol/contracts/core/TempleERC20Token.sol#L23) + + ```solidity + function addMinter(address account) external onlyOwner { + ``` + +- Found in contracts/core/TempleERC20Token.sol [Line: 27](../tests/2024-07-templegold/protocol/contracts/core/TempleERC20Token.sol#L27) + + ```solidity + function removeMinter(address account) external onlyOwner { + ``` + +- Found in contracts/core/TreasuryFarmingRevenue.sol [Line: 17](../tests/2024-07-templegold/protocol/contracts/core/TreasuryFarmingRevenue.sol#L17) + + ```solidity + contract TreasuryFarmingRevenue is Ownable { + ``` + +- Found in contracts/core/TreasuryFarmingRevenue.sol [Line: 48](../tests/2024-07-templegold/protocol/contracts/core/TreasuryFarmingRevenue.sol#L48) + + ```solidity + function addRevenue(uint256 revenueEarned) onlyOwner public { + ``` + +- Found in contracts/core/TreasuryFarmingRevenue.sol [Line: 56](../tests/2024-07-templegold/protocol/contracts/core/TreasuryFarmingRevenue.sol#L56) + + ```solidity + function increaseShares(address account, uint256 amount) onlyOwner external { + ``` + +- Found in contracts/core/TreasuryFarmingRevenue.sol [Line: 69](../tests/2024-07-templegold/protocol/contracts/core/TreasuryFarmingRevenue.sol#L69) + + ```solidity + function decreaseShares(address account, uint256 amount) onlyOwner external { + ``` + +- Found in contracts/core/Vault.sol [Line: 29](../tests/2024-07-templegold/protocol/contracts/core/Vault.sol#L29) + + ```solidity + contract Vault is Nonces, EIP712, Ownable, RebasingERC20 { + ``` + +- Found in contracts/core/Vault.sol [Line: 113](../tests/2024-07-templegold/protocol/contracts/core/Vault.sol#L113) + + ```solidity + function redeemExposures(Exposure[] memory exposures) external onlyOwner { + ``` + +- Found in contracts/core/VaultEarlyWithdraw.sol [Line: 15](../tests/2024-07-templegold/protocol/contracts/core/VaultEarlyWithdraw.sol#L15) + + ```solidity + contract VaultEarlyWithdraw is Pausable, Ownable { + ``` + +- Found in contracts/core/VaultEarlyWithdraw.sol [Line: 41](../tests/2024-07-templegold/protocol/contracts/core/VaultEarlyWithdraw.sol#L41) + + ```solidity + function pause() external onlyOwner { + ``` + +- Found in contracts/core/VaultEarlyWithdraw.sol [Line: 45](../tests/2024-07-templegold/protocol/contracts/core/VaultEarlyWithdraw.sol#L45) + + ```solidity + function unpause() external onlyOwner { + ``` + +- Found in contracts/core/VaultEarlyWithdraw.sol [Line: 49](../tests/2024-07-templegold/protocol/contracts/core/VaultEarlyWithdraw.sol#L49) + + ```solidity + function setMinWithdrawAmount(uint256 amount) external onlyOwner { + ``` + +- Found in contracts/core/VaultEarlyWithdraw.sol [Line: 73](../tests/2024-07-templegold/protocol/contracts/core/VaultEarlyWithdraw.sol#L73) + + ```solidity + function recoverToken(address token, address to, uint256 amount) external onlyOwner { + ``` + +- Found in contracts/core/VaultProxy.sol [Line: 16](../tests/2024-07-templegold/protocol/contracts/core/VaultProxy.sol#L16) + + ```solidity + contract VaultProxy is Ownable { + ``` + +- Found in contracts/core/VaultProxy.sol [Line: 118](../tests/2024-07-templegold/protocol/contracts/core/VaultProxy.sol#L118) + + ```solidity + function toggleFaithClaimEnabled() external onlyOwner { + ``` + +- Found in contracts/core/VaultProxy.sol [Line: 125](../tests/2024-07-templegold/protocol/contracts/core/VaultProxy.sol#L125) + + ```solidity + function withdraw(address token, address to, uint256 amount) external onlyOwner { + ``` + +- Found in contracts/core/VaultedTemple.sol [Line: 35](../tests/2024-07-templegold/protocol/contracts/core/VaultedTemple.sol#L35) + + ```solidity + contract VaultedTemple is ILiquidator, Ownable { + ``` + +- Found in contracts/core/VaultedTemple.sol [Line: 52](../tests/2024-07-templegold/protocol/contracts/core/VaultedTemple.sol#L52) + + ```solidity + function withdraw(address token, address to, uint256 amount) external onlyOwner { + ``` + +- Found in contracts/deprecated/Faith.sol [Line: 6](../tests/2024-07-templegold/protocol/contracts/deprecated/Faith.sol#L6) + + ```solidity + contract Faith is Ownable { + ``` + +- Found in contracts/deprecated/Faith.sol [Line: 50](../tests/2024-07-templegold/protocol/contracts/deprecated/Faith.sol#L50) + + ```solidity + function addManager(address account) external onlyOwner { + ``` + +- Found in contracts/deprecated/Faith.sol [Line: 54](../tests/2024-07-templegold/protocol/contracts/deprecated/Faith.sol#L54) + + ```solidity + function removeManager(address account) external onlyOwner { + ``` + +- Found in contracts/deprecated/OGTemple.sol [Line: 16](../tests/2024-07-templegold/protocol/contracts/deprecated/OGTemple.sol#L16) + + ```solidity + contract OGTemple is ERC20, ERC20Burnable, Ownable { + ``` + +- Found in contracts/deprecated/OGTemple.sol [Line: 19](../tests/2024-07-templegold/protocol/contracts/deprecated/OGTemple.sol#L19) + + ```solidity + function mint(address to, uint256 amount) external onlyOwner { + ``` + +- Found in contracts/deprecated/TempleStaking.sol [Line: 18](../tests/2024-07-templegold/protocol/contracts/deprecated/TempleStaking.sol#L18) + + ```solidity + contract TempleStaking is Ownable { + ``` + +- Found in contracts/deprecated/TempleStaking.sol [Line: 67](../tests/2024-07-templegold/protocol/contracts/deprecated/TempleStaking.sol#L67) + + ```solidity + function setExitQueue(IExitQueue _EXIT_QUEUE) external onlyOwner { + ``` + +- Found in contracts/deprecated/TempleStaking.sol [Line: 72](../tests/2024-07-templegold/protocol/contracts/deprecated/TempleStaking.sol#L72) + + ```solidity + function setEpy(uint256 _numerator, uint256 _denominator) external onlyOwner { + ``` + +- Found in contracts/fakes/templegold/TempleGoldMock.sol [Line: 58](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleGoldMock.sol#L58) + + ```solidity + function authorizeContract(address _contract, bool _whitelist) external onlyOwner { + ``` + +- Found in contracts/fakes/templegold/TempleTokenMock.sol [Line: 9](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleTokenMock.sol#L9) + + ```solidity + contract TempleTokenMock is ERC20, ERC20Burnable, Ownable, AccessControl { + ``` + +- Found in contracts/fakes/templegold/TempleTokenMock.sol [Line: 21](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleTokenMock.sol#L21) + + ```solidity + function addMinter(address account) external onlyOwner { + ``` + +- Found in contracts/fakes/templegold/TempleTokenMock.sol [Line: 25](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleTokenMock.sol#L25) + + ```solidity + function removeMinter(address account) external onlyOwner { + ``` + +- Found in contracts/governance/ElderElection.sol [Line: 24](../tests/2024-07-templegold/protocol/contracts/governance/ElderElection.sol#L24) + + ```solidity + contract ElderElection is Nonces, AccessControl { + ``` + +- Found in contracts/governance/ElderElection.sol [Line: 73](../tests/2024-07-templegold/protocol/contracts/governance/ElderElection.sol#L73) + + ```solidity + function nominate(uint256 discordId) external onlyRole(CAN_NOMINATE) { + ``` + +- Found in contracts/governance/ElderElection.sol [Line: 86](../tests/2024-07-templegold/protocol/contracts/governance/ElderElection.sol#L86) + + ```solidity + function resign(uint256 discordId) external onlyRole(CAN_NOMINATE) { + ``` + +- Found in contracts/governance/Templar.sol [Line: 12](../tests/2024-07-templegold/protocol/contracts/governance/Templar.sol#L12) + + ```solidity + contract Templar is ERC721, AccessControl { + ``` + +- Found in contracts/governance/Templar.sol [Line: 35](../tests/2024-07-templegold/protocol/contracts/governance/Templar.sol#L35) + + ```solidity + function setBaseUri(string calldata _baseUri) external onlyRole(OWNER) { + ``` + +- Found in contracts/governance/Templar.sol [Line: 49](../tests/2024-07-templegold/protocol/contracts/governance/Templar.sol#L49) + + ```solidity + ) external onlyRole(CAN_ASSIGN) { + ``` + +- Found in contracts/governance/TemplarMetadata.sol [Line: 10](../tests/2024-07-templegold/protocol/contracts/governance/TemplarMetadata.sol#L10) + + ```solidity + contract TemplarMetadata is AccessControl { + ``` + +- Found in contracts/governance/TemplarMetadata.sol [Line: 31](../tests/2024-07-templegold/protocol/contracts/governance/TemplarMetadata.sol#L31) + + ```solidity + ) external onlyRole(CAN_UPDATE) { + ``` + +- Found in contracts/templegold/TempleGold.sol [Line: 79](../tests/2024-07-templegold/protocol/contracts/templegold/TempleGold.sol#L79) + + ```solidity + function setStaking(address _staking) external override onlyOwner { + ``` + +- Found in contracts/templegold/TempleGold.sol [Line: 89](../tests/2024-07-templegold/protocol/contracts/templegold/TempleGold.sol#L89) + + ```solidity + function setEscrow(address _escrow) external override onlyOwner { + ``` + +- Found in contracts/templegold/TempleGold.sol [Line: 99](../tests/2024-07-templegold/protocol/contracts/templegold/TempleGold.sol#L99) + + ```solidity + function setTeamGnosis(address _gnosis) external override onlyOwner { + ``` + +- Found in contracts/templegold/TempleGold.sol [Line: 110](../tests/2024-07-templegold/protocol/contracts/templegold/TempleGold.sol#L110) + + ```solidity + function authorizeContract(address _contract, bool _whitelist) external override onlyOwner { + ``` + +- Found in contracts/templegold/TempleGold.sol [Line: 120](../tests/2024-07-templegold/protocol/contracts/templegold/TempleGold.sol#L120) + + ```solidity + function setDistributionParams(DistributionParams calldata _params) external override onlyOwner { + ``` + +- Found in contracts/templegold/TempleGold.sol [Line: 130](../tests/2024-07-templegold/protocol/contracts/templegold/TempleGold.sol#L130) + + ```solidity + function setVestingFactor(VestingFactor calldata _factor) external override onlyOwner { + ``` + +
+ + + +## L-2: `ecrecover` is susceptible to signature malleability + +The `ecrecover` function is susceptible to signature malleability. This means that the same message can be signed in multiple ways, allowing an attacker to change the message signature without invalidating it. This can lead to unexpected behavior in smart contracts, such as the loss of funds or the ability to bypass access control. Consider using OpenZeppelin's ECDSA library instead of the built-in function. + +
2 Found Instances + + +- Found in contracts/v2/safeGuards/SafeForked.sol [Line: 120](../tests/2024-07-templegold/protocol/contracts/v2/safeGuards/SafeForked.sol#L120) + + ```solidity + currentOwner = ecrecover(keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", dataHash)), v - 4, r, s); + ``` + +- Found in contracts/v2/safeGuards/SafeForked.sol [Line: 124](../tests/2024-07-templegold/protocol/contracts/v2/safeGuards/SafeForked.sol#L124) + + ```solidity + currentOwner = ecrecover(dataHash, v, r, s); + ``` + +
+ + + +## L-3: Unsafe ERC20 Operations should not be used + +ERC20 functions may not behave as expected. For example: return values are not always meaningful. It is recommended to use OpenZeppelin's SafeERC20 library. + +
5 Found Instances + + +- Found in contracts/amo/Ramos.sol [Line: 195](../tests/2024-07-templegold/protocol/contracts/amo/Ramos.sol#L195) + + ```solidity + protocolToken.approve(previousVault, 0); + ``` + +- Found in contracts/amo/Ramos.sol [Line: 196](../tests/2024-07-templegold/protocol/contracts/amo/Ramos.sol#L196) + + ```solidity + quoteToken.approve(previousVault, 0); + ``` + +- Found in contracts/amo/Ramos.sol [Line: 489](../tests/2024-07-templegold/protocol/contracts/amo/Ramos.sol#L489) + + ```solidity + quoteToken.approve(address(balancerVault), 0); + ``` + +- Found in contracts/fakes/UniswapV2Router02NoEth.sol [Line: 108](../tests/2024-07-templegold/protocol/contracts/fakes/UniswapV2Router02NoEth.sol#L108) + + ```solidity + IUniswapV2Pair(pair).transferFrom(msg.sender, pair, liquidity); // send liquidity to pair + ``` + +- Found in contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol [Line: 394](../tests/2024-07-templegold/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L394) + + ```solidity + daiToken.approve(previousTrv, 0); + ``` + +
+ + + +## L-4: Solidity pragma should be specific, not wide + +Consider using a specific version of Solidity in your contracts instead of a wide version. For example, instead of `pragma solidity ^0.8.0;`, use `pragma solidity 0.8.0;` + +
81 Found Instances + + +- Found in contracts/admin/TempleTeamPayments.sol [Line: 2](../tests/2024-07-templegold/protocol/contracts/admin/TempleTeamPayments.sol#L2) + + ```solidity + pragma solidity ^0.8.0; + ``` + +- Found in contracts/admin/TempleTeamPaymentsFactory.sol [Line: 2](../tests/2024-07-templegold/protocol/contracts/admin/TempleTeamPaymentsFactory.sol#L2) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/admin/TempleTeamPaymentsV2.sol [Line: 2](../tests/2024-07-templegold/protocol/contracts/admin/TempleTeamPaymentsV2.sol#L2) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/amm/TreasuryIV.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/amm/TreasuryIV.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/amo/AuraStaking.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/amo/AuraStaking.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/amo/Ramos.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/amo/Ramos.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/common/CommonEventsAndErrors.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/common/CommonEventsAndErrors.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/common/SafeCast.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/common/SafeCast.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/common/TempleMath.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/common/TempleMath.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/core/Exposure.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/core/Exposure.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/core/JoiningFee.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/core/JoiningFee.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/core/MultiOtcOffer.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/core/MultiOtcOffer.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/core/OpsManager.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/core/OpsManager.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/core/OpsManagerLib.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/core/OpsManagerLib.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/core/OtcOffer.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/core/OtcOffer.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/core/Rational.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/core/Rational.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/core/RebasingERC20.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/core/RebasingERC20.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/core/TempleERC20Token.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/core/TempleERC20Token.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/core/TreasuryFarmingRevenue.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/core/TreasuryFarmingRevenue.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/core/Vault.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/core/Vault.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/core/VaultEarlyWithdraw.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/core/VaultEarlyWithdraw.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/core/VaultProxy.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/core/VaultProxy.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/core/VaultedTemple.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/core/VaultedTemple.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/deprecated/Faith.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/deprecated/Faith.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/deprecated/IExitQueue.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/deprecated/IExitQueue.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/deprecated/InstantExitQueue.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/deprecated/InstantExitQueue.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/deprecated/LockedOGTemple.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/deprecated/LockedOGTemple.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/deprecated/OGTemple.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/deprecated/OGTemple.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/deprecated/TempleStaking.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/deprecated/TempleStaking.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/fakes/FakeERC20.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/fakes/FakeERC20.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/fakes/FakeERC20CustomDecimals.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/fakes/FakeERC20CustomDecimals.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/fakes/NoopLiquidator.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/fakes/NoopLiquidator.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/fakes/NoopVaultedTempleLiquidator.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/fakes/NoopVaultedTempleLiquidator.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/fakes/templegold/TempleGoldMock.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleGoldMock.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/fakes/templegold/TempleGoldStakingMock.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleGoldStakingMock.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/fakes/templegold/TempleTokenMock.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleTokenMock.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/fakes/v2/TempleDebtTokenTestnetAdmin.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/fakes/v2/TempleDebtTokenTestnetAdmin.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/fakes/v2/strategies/DsrBaseStrategyTestnet.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/fakes/v2/strategies/DsrBaseStrategyTestnet.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/governance/ElderElection.sol [Line: 2](../tests/2024-07-templegold/protocol/contracts/governance/ElderElection.sol#L2) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/governance/Templar.sol [Line: 2](../tests/2024-07-templegold/protocol/contracts/governance/Templar.sol#L2) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/governance/TemplarMetadata.sol [Line: 2](../tests/2024-07-templegold/protocol/contracts/governance/TemplarMetadata.sol#L2) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/interfaces/core/ITempleERC20Token.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/core/ITempleERC20Token.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/interfaces/templegold/IAuctionBase.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/IAuctionBase.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/interfaces/templegold/IDaiGoldAuction.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/IDaiGoldAuction.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/interfaces/templegold/ISpiceAuction.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ISpiceAuction.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/interfaces/templegold/ISpiceAuctionFactory.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ISpiceAuctionFactory.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/interfaces/templegold/ITempleGold.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ITempleGold.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/interfaces/templegold/ITempleGoldAdmin.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ITempleGoldAdmin.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/interfaces/templegold/ITempleGoldStaking.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ITempleGoldStaking.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/interfaces/templegold/ITempleTeleporter.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ITempleTeleporter.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/templegold//AuctionBase.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/templegold/AuctionBase.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/templegold/AuctionBase.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/templegold/AuctionBase.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/templegold/DaiGoldAuction.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/templegold/DaiGoldAuction.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/templegold/EpochLib.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/templegold/EpochLib.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/templegold/SpiceAuction.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/templegold/SpiceAuction.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/templegold/SpiceAuctionFactory.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/templegold/SpiceAuctionFactory.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/templegold/TempleGold.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/templegold/TempleGold.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/templegold/TempleGoldAdmin.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/templegold/TempleGoldAdmin.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/templegold/TempleGoldStaking.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/templegold/TempleGoldStaking.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/templegold/TempleTeleporter.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/templegold/TempleTeleporter.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 6](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L6) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 6](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L6) + + ```solidity + pragma solidity ^0.8.0; + ``` + +- Found in contracts/v2/TempleDebtToken.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/v2/TempleDebtToken.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/v2/TreasuryPriceIndexOracle.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/v2/TreasuryPriceIndexOracle.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/v2/TreasuryReservesVault.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/v2/TreasuryReservesVault.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/v2/access/TempleElevatedAccess.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/v2/access/TempleElevatedAccess.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/v2/interestRate/BaseInterestRateModel.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/v2/interestRate/BaseInterestRateModel.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/v2/interestRate/CompoundedInterest.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/v2/interestRate/CompoundedInterest.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/v2/interestRate/LinearWithKinkInterestRateModel.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/v2/interestRate/LinearWithKinkInterestRateModel.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/v2/safeGuards/SafeForked.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/v2/safeGuards/SafeForked.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/v2/safeGuards/ThresholdSafeGuard.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/v2/safeGuards/ThresholdSafeGuard.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/v2/strategies/AbstractStrategy.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/v2/strategies/AbstractStrategy.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/v2/strategies/DsrBaseStrategy.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/v2/strategies/DsrBaseStrategy.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/v2/strategies/GnosisStrategy.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/v2/strategies/GnosisStrategy.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/v2/strategies/RamosStrategy.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/v2/strategies/RamosStrategy.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/v2/strategies/TempleTokenBaseStrategy.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/v2/strategies/TempleTokenBaseStrategy.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/v2/strategies/TlcStrategy.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/v2/strategies/TlcStrategy.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +
+ + + +## L-5: Missing checks for `address(0)` when assigning values to address state variables + +Check for `address(0)` when assigning values to address state variables. + +
43 Found Instances + + +- Found in contracts/admin/TempleTeamPaymentsFactory.sol [Line: 41](../tests/2024-07-templegold/protocol/contracts/admin/TempleTeamPaymentsFactory.sol#L41) + + ```solidity + templeTeamPaymentsImplementation = _implementation; + ``` + +- Found in contracts/admin/TempleTeamPaymentsV2.sol [Line: 27](../tests/2024-07-templegold/protocol/contracts/admin/TempleTeamPaymentsV2.sol#L27) + + ```solidity + temple = _temple; + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 44](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L44) + + ```solidity + templeTreasury = _templeTreasury; + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 45](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L45) + + ```solidity + defendStable = _defendStable; + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 53](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L53) + + ```solidity + templeTreasury = _templeTreasury; + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 57](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L57) + + ```solidity + defendStable = _defendStable; + ``` + +- Found in contracts/amm/TempleUniswapV2Pair.sol [Line: 68](../tests/2024-07-templegold/protocol/contracts/amm/TempleUniswapV2Pair.sol#L68) + + ```solidity + owner = _owner; + ``` + +- Found in contracts/amm/TempleUniswapV2Pair.sol [Line: 69](../tests/2024-07-templegold/protocol/contracts/amm/TempleUniswapV2Pair.sol#L69) + + ```solidity + token0 = _token0; + ``` + +- Found in contracts/amm/TempleUniswapV2Pair.sol [Line: 70](../tests/2024-07-templegold/protocol/contracts/amm/TempleUniswapV2Pair.sol#L70) + + ```solidity + token1 = _token1; + ``` + +- Found in contracts/amm/TempleUniswapV2Pair.sol [Line: 76](../tests/2024-07-templegold/protocol/contracts/amm/TempleUniswapV2Pair.sol#L76) + + ```solidity + router = _router; + ``` + +- Found in contracts/amo/AuraStaking.sol [Line: 49](../tests/2024-07-templegold/protocol/contracts/amo/AuraStaking.sol#L49) + + ```solidity + rewardsRecipient = _recipient; + ``` + +- Found in contracts/amo/Ramos.sol [Line: 123](../tests/2024-07-templegold/protocol/contracts/amo/Ramos.sol#L123) + + ```solidity + feeCollector = _feeCollector; + ``` + +- Found in contracts/amo/Ramos.sol [Line: 135](../tests/2024-07-templegold/protocol/contracts/amo/Ramos.sol#L135) + + ```solidity + poolHelper = IBalancerPoolHelper(_poolHelper); + ``` + +- Found in contracts/amo/Ramos.sol [Line: 183](../tests/2024-07-templegold/protocol/contracts/amo/Ramos.sol#L183) + + ```solidity + tpiOracle = ITreasuryPriceIndexOracle(newTpiOracle); + ``` + +- Found in contracts/amo/Ramos.sol [Line: 199](../tests/2024-07-templegold/protocol/contracts/amo/Ramos.sol#L199) + + ```solidity + tokenVault = IRamosTokenVault(vault); + ``` + +- Found in contracts/core/Exposure.sol [Line: 41](../tests/2024-07-templegold/protocol/contracts/core/Exposure.sol#L41) + + ```solidity + revalToken = _revalToken; + ``` + +- Found in contracts/core/Exposure.sol [Line: 68](../tests/2024-07-templegold/protocol/contracts/core/Exposure.sol#L68) + + ```solidity + liquidator = _liquidator; + ``` + +- Found in contracts/core/OpsManager.sol [Line: 35](../tests/2024-07-templegold/protocol/contracts/core/OpsManager.sol#L35) + + ```solidity + templeExposure = new Exposure("vaulted temple", "V_TEMPLE", _templeToken); + ``` + +- Found in contracts/core/OpsManager.sol [Line: 37](../tests/2024-07-templegold/protocol/contracts/core/OpsManager.sol#L37) + + ```solidity + vaultedTemple = new VaultedTemple(_templeToken, address(templeExposure)); + ``` + +- Found in contracts/core/OtcOffer.sol [Line: 80](../tests/2024-07-templegold/protocol/contracts/core/OtcOffer.sol#L80) + + ```solidity + fundsOwner = _fundsOwner; + ``` + +- Found in contracts/deprecated/InstantExitQueue.sol [Line: 18](../tests/2024-07-templegold/protocol/contracts/deprecated/InstantExitQueue.sol#L18) + + ```solidity + templeStaking = _templeStaking; + ``` + +- Found in contracts/deprecated/InstantExitQueue.sol [Line: 19](../tests/2024-07-templegold/protocol/contracts/deprecated/InstantExitQueue.sol#L19) + + ```solidity + templeToken = _templeToken; + ``` + +- Found in contracts/deprecated/LockedOGTemple.sol [Line: 27](../tests/2024-07-templegold/protocol/contracts/deprecated/LockedOGTemple.sol#L27) + + ```solidity + OG_TEMPLE = _OG_TEMPLE; + ``` + +- Found in contracts/deprecated/TempleStaking.sol [Line: 55](../tests/2024-07-templegold/protocol/contracts/deprecated/TempleStaking.sol#L55) + + ```solidity + EXIT_QUEUE = _EXIT_QUEUE; + ``` + +- Found in contracts/deprecated/TempleStaking.sol [Line: 68](../tests/2024-07-templegold/protocol/contracts/deprecated/TempleStaking.sol#L68) + + ```solidity + EXIT_QUEUE = _EXIT_QUEUE; + ``` + +- Found in contracts/fakes/NoopLiquidator.sol [Line: 16](../tests/2024-07-templegold/protocol/contracts/fakes/NoopLiquidator.sol#L16) + + ```solidity + templeToken = _templeToken; + ``` + +- Found in contracts/fakes/NoopVaultedTempleLiquidator.sol [Line: 18](../tests/2024-07-templegold/protocol/contracts/fakes/NoopVaultedTempleLiquidator.sol#L18) + + ```solidity + templeToken = _templeToken; + ``` + +- Found in contracts/fakes/NoopVaultedTempleLiquidator.sol [Line: 19](../tests/2024-07-templegold/protocol/contracts/fakes/NoopVaultedTempleLiquidator.sol#L19) + + ```solidity + vaultedTemple = _vaultedTemple; + ``` + +- Found in contracts/fakes/templegold/TempleGoldStakingMock.sol [Line: 143](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleGoldStakingMock.sol#L143) + + ```solidity + previousStaking = ITempleGoldStaking(_previousStaking); + ``` + +- Found in contracts/fakes/templegold/TempleGoldStakingMock.sol [Line: 192](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleGoldStakingMock.sol#L192) + + ```solidity + distributionStarter = _starter; + ``` + +- Found in contracts/governance/ElderElection.sol [Line: 60](../tests/2024-07-templegold/protocol/contracts/governance/ElderElection.sol#L60) + + ```solidity + templars = _templars; + ``` + +- Found in contracts/governance/TemplarMetadata.sol [Line: 21](../tests/2024-07-templegold/protocol/contracts/governance/TemplarMetadata.sol#L21) + + ```solidity + templars = _templars; + ``` + +- Found in contracts/templegold/DaiGoldAuction.sol [Line: 56](../tests/2024-07-templegold/protocol/contracts/templegold/DaiGoldAuction.sol#L56) + + ```solidity + bidToken = IERC20(_bidToken); + ``` + +- Found in contracts/templegold/DaiGoldAuction.sol [Line: 81](../tests/2024-07-templegold/protocol/contracts/templegold/DaiGoldAuction.sol#L81) + + ```solidity + auctionStarter = _starter; + ``` + +- Found in contracts/templegold/SpiceAuction.sol [Line: 63](../tests/2024-07-templegold/protocol/contracts/templegold/SpiceAuction.sol#L63) + + ```solidity + daoExecutor = _daoExecutor; + ``` + +- Found in contracts/templegold/TempleGold.sol [Line: 69](../tests/2024-07-templegold/protocol/contracts/templegold/TempleGold.sol#L69) + + ```solidity + staking = ITempleGoldStaking(_initArgs.staking); + ``` + +- Found in contracts/templegold/TempleGold.sol [Line: 70](../tests/2024-07-templegold/protocol/contracts/templegold/TempleGold.sol#L70) + + ```solidity + escrow = IDaiGoldAuction(_initArgs.escrow); + ``` + +- Found in contracts/templegold/TempleGold.sol [Line: 71](../tests/2024-07-templegold/protocol/contracts/templegold/TempleGold.sol#L71) + + ```solidity + teamGnosis = _initArgs.gnosis; + ``` + +- Found in contracts/templegold/TempleGoldStaking.sol [Line: 127](../tests/2024-07-templegold/protocol/contracts/templegold/TempleGoldStaking.sol#L127) + + ```solidity + distributionStarter = _starter; + ``` + +- Found in contracts/v2/TreasuryReservesVault.sol [Line: 101](../tests/2024-07-templegold/protocol/contracts/v2/TreasuryReservesVault.sol#L101) + + ```solidity + tpiOracle = ITreasuryPriceIndexOracle(_tpiOracle); + ``` + +- Found in contracts/v2/TreasuryReservesVault.sol [Line: 120](../tests/2024-07-templegold/protocol/contracts/v2/TreasuryReservesVault.sol#L120) + + ```solidity + borrowTokens[token] = BorrowTokenConfig({ + ``` + +- Found in contracts/v2/strategies/AbstractStrategy.sol [Line: 46](../tests/2024-07-templegold/protocol/contracts/v2/strategies/AbstractStrategy.sol#L46) + + ```solidity + treasuryReservesVault = ITreasuryReservesVault(_treasuryReservesVault); + ``` + +- Found in contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol [Line: 389](../tests/2024-07-templegold/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L389) + + ```solidity + tlcStrategy = ITlcStrategy(newTlcStrategy); + ``` + +
+ + + +## L-6: `public` functions not used internally could be marked `external` + +Instead of marking a function as `public`, consider marking it as `external` if it is not used internally. + +
41 Found Instances + + +- Found in contracts/admin/TempleTeamPaymentsV2.sol [Line: 25](../tests/2024-07-templegold/protocol/contracts/admin/TempleTeamPaymentsV2.sol#L25) + + ```solidity + function initialize(IERC20 _temple) public initializer { + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 105](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L105) + + ```solidity + function removeLiquidity( + ``` + +- Found in contracts/core/Exposure.sol [Line: 115](../tests/2024-07-templegold/protocol/contracts/core/Exposure.sol#L115) + + ```solidity + function amountPerShare() public view override returns (uint256 p, uint256 q) { + ``` + +- Found in contracts/core/MultiOtcOffer.sol [Line: 183](../tests/2024-07-templegold/protocol/contracts/core/MultiOtcOffer.sol#L183) + + ```solidity + function quote(bytes32 marketId, uint256 sellTokenAmount) public override view returns (uint256 buyTokenAmount) { + ``` + +- Found in contracts/core/MultiOtcOffer.sol [Line: 195](../tests/2024-07-templegold/protocol/contracts/core/MultiOtcOffer.sol#L195) + + ```solidity + function quote( + ``` + +- Found in contracts/core/OpsManagerLib.sol [Line: 12](../tests/2024-07-templegold/protocol/contracts/core/OpsManagerLib.sol#L12) + + ```solidity + function createExposure( + ``` + +- Found in contracts/core/OpsManagerLib.sol [Line: 32](../tests/2024-07-templegold/protocol/contracts/core/OpsManagerLib.sol#L32) + + ```solidity + function setExposureLiquidator( + ``` + +- Found in contracts/core/OpsManagerLib.sol [Line: 45](../tests/2024-07-templegold/protocol/contracts/core/OpsManagerLib.sol#L45) + + ```solidity + function setExposureMinterState( + ``` + +- Found in contracts/core/OpsManagerLib.sol [Line: 55](../tests/2024-07-templegold/protocol/contracts/core/OpsManagerLib.sol#L55) + + ```solidity + function rebalance( + ``` + +- Found in contracts/core/OpsManagerLib.sol [Line: 79](../tests/2024-07-templegold/protocol/contracts/core/OpsManagerLib.sol#L79) + + ```solidity + function requiresRebalance( + ``` + +- Found in contracts/core/OpsManagerLib.sol [Line: 97](../tests/2024-07-templegold/protocol/contracts/core/OpsManagerLib.sol#L97) + + ```solidity + function updateExposureReval(IERC20[] memory exposureTokens, uint256[] memory revals, mapping(IERC20 => TreasuryFarmingRevenue) storage pools) public { + ``` + +- Found in contracts/core/TreasuryFarmingRevenue.sol [Line: 48](../tests/2024-07-templegold/protocol/contracts/core/TreasuryFarmingRevenue.sol#L48) + + ```solidity + function addRevenue(uint256 revenueEarned) onlyOwner public { + ``` + +- Found in contracts/core/Vault.sol [Line: 86](../tests/2024-07-templegold/protocol/contracts/core/Vault.sol#L86) + + ```solidity + function withdraw(uint256 amount) public { + ``` + +- Found in contracts/core/Vault.sol [Line: 96](../tests/2024-07-templegold/protocol/contracts/core/Vault.sol#L96) + + ```solidity + function withdrawFor(address owner, uint256 amount, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public { + ``` + +- Found in contracts/core/Vault.sol [Line: 121](../tests/2024-07-templegold/protocol/contracts/core/Vault.sol#L121) + + ```solidity + function amountPerShare() public view override returns (uint256 p, uint256 q) { + ``` + +- Found in contracts/core/Vault.sol [Line: 167](../tests/2024-07-templegold/protocol/contracts/core/Vault.sol#L167) + + ```solidity + function deposit(uint256 amount) public { + ``` + +- Found in contracts/core/VaultProxy.sol [Line: 58](../tests/2024-07-templegold/protocol/contracts/core/VaultProxy.sol#L58) + + ```solidity + function depositTempleWithFaith(uint256 _amountTemple, uint112 _amountFaith, Vault vault) public { + ``` + +- Found in contracts/core/VaultProxy.sol [Line: 109](../tests/2024-07-templegold/protocol/contracts/core/VaultProxy.sol#L109) + + ```solidity + function depositTempleFor(uint256 _amount, Vault vault) public { + ``` + +- Found in contracts/fakes/FakeERC20CustomDecimals.sol [Line: 34](../tests/2024-07-templegold/protocol/contracts/fakes/FakeERC20CustomDecimals.sol#L34) + + ```solidity + function decimals() override public view returns (uint8) { + ``` + +- Found in contracts/fakes/UniswapV2Router02NoEth.sol [Line: 115](../tests/2024-07-templegold/protocol/contracts/fakes/UniswapV2Router02NoEth.sol#L115) + + ```solidity + function removeLiquidityETH( + ``` + +- Found in contracts/fakes/UniswapV2Router02NoEth.sol [Line: 153](../tests/2024-07-templegold/protocol/contracts/fakes/UniswapV2Router02NoEth.sol#L153) + + ```solidity + function removeLiquidityETHSupportingFeeOnTransferTokens( + ``` + +- Found in contracts/fakes/UniswapV2Router02NoEth.sol [Line: 323](../tests/2024-07-templegold/protocol/contracts/fakes/UniswapV2Router02NoEth.sol#L323) + + ```solidity + function quote(uint amountA, uint reserveA, uint reserveB) public pure virtual override returns (uint amountB) { + ``` + +- Found in contracts/fakes/templegold/TempleGoldMock.sol [Line: 77](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleGoldMock.sol#L77) + + ```solidity + function circulatingSupply() public view returns (uint256) { + ``` + +- Found in contracts/fakes/templegold/TempleGoldStakingMock.sol [Line: 431](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleGoldStakingMock.sol#L431) + + ```solidity + function balanceOf(address account) public view returns (uint256) { + ``` + +- Found in contracts/fakes/v2/strategies/DsrBaseStrategyTestnet.sol [Line: 93](../tests/2024-07-templegold/protocol/contracts/fakes/v2/strategies/DsrBaseStrategyTestnet.sol#L93) + + ```solidity + function latestAssetBalances() public override(AbstractStrategy, ITempleBaseStrategy) view returns ( + ``` + +- Found in contracts/governance/Templar.sol [Line: 25](../tests/2024-07-templegold/protocol/contracts/governance/Templar.sol#L25) + + ```solidity + function supportsInterface(bytes4 interfaceId) public view override(ERC721, AccessControl) returns (bool) { + ``` + +- Found in contracts/governance/Templar.sol [Line: 65](../tests/2024-07-templegold/protocol/contracts/governance/Templar.sol#L65) + + ```solidity + function checkExists(uint256 discordId) public view { + ``` + +- Found in contracts/templegold/DaiGoldAuction.sol [Line: 199](../tests/2024-07-templegold/protocol/contracts/templegold/DaiGoldAuction.sol#L199) + + ```solidity + function nextEpoch() public view override returns (uint256) { + ``` + +- Found in contracts/templegold/TempleGold.sol [Line: 197](../tests/2024-07-templegold/protocol/contracts/templegold/TempleGold.sol#L197) + + ```solidity + function circulatingSupply() public override view returns (uint256) { + ``` + +- Found in contracts/templegold/TempleGoldAdmin.sol [Line: 96](../tests/2024-07-templegold/protocol/contracts/templegold/TempleGoldAdmin.sol#L96) + + ```solidity + function setPreCrime(address _preCrime) public virtual onlyElevatedAccess { + ``` + +- Found in contracts/templegold/TempleGoldAdmin.sol [Line: 107](../tests/2024-07-templegold/protocol/contracts/templegold/TempleGoldAdmin.sol#L107) + + ```solidity + function setDelegate(address _delegate) public onlyElevatedAccess { + ``` + +- Found in contracts/templegold/TempleGoldAdmin.sol [Line: 121](../tests/2024-07-templegold/protocol/contracts/templegold/TempleGoldAdmin.sol#L121) + + ```solidity + function setPeer(uint32 _eid, bytes32 _peer) public virtual onlyElevatedAccess { + ``` + +- Found in contracts/templegold/TempleGoldAdmin.sol [Line: 135](../tests/2024-07-templegold/protocol/contracts/templegold/TempleGoldAdmin.sol#L135) + + ```solidity + function setEnforcedOptions(EnforcedOptionParam[] calldata _enforcedOptions) public virtual onlyElevatedAccess { + ``` + +- Found in contracts/templegold/TempleGoldStaking.sol [Line: 333](../tests/2024-07-templegold/protocol/contracts/templegold/TempleGoldStaking.sol#L333) + + ```solidity + function balanceOf(address account) public override view returns (uint256) { + ``` + +- Found in contracts/v2/TempleDebtToken.sol [Line: 468](../tests/2024-07-templegold/protocol/contracts/v2/TempleDebtToken.sol#L468) + + ```solidity + function balanceOf(address _debtor) public override view returns (uint256) { + ``` + +- Found in contracts/v2/TempleDebtToken.sol [Line: 543](../tests/2024-07-templegold/protocol/contracts/v2/TempleDebtToken.sol#L543) + + ```solidity + function totalSupply() public override view returns (uint256) { + ``` + +- Found in contracts/v2/strategies/DsrBaseStrategy.sol [Line: 159](../tests/2024-07-templegold/protocol/contracts/v2/strategies/DsrBaseStrategy.sol#L159) + + ```solidity + function latestAssetBalances() public override(AbstractStrategy, ITempleBaseStrategy) view returns ( + ``` + +- Found in contracts/v2/strategies/GnosisStrategy.sol [Line: 155](../tests/2024-07-templegold/protocol/contracts/v2/strategies/GnosisStrategy.sol#L155) + + ```solidity + function latestAssetBalances() public override view returns ( + ``` + +- Found in contracts/v2/strategies/RamosStrategy.sol [Line: 144](../tests/2024-07-templegold/protocol/contracts/v2/strategies/RamosStrategy.sol#L144) + + ```solidity + function latestAssetBalances() public override view returns ( + ``` + +- Found in contracts/v2/strategies/TempleTokenBaseStrategy.sol [Line: 75](../tests/2024-07-templegold/protocol/contracts/v2/strategies/TempleTokenBaseStrategy.sol#L75) + + ```solidity + function latestAssetBalances() public override(AbstractStrategy, ITempleBaseStrategy) view returns ( + ``` + +- Found in contracts/v2/strategies/TlcStrategy.sol [Line: 67](../tests/2024-07-templegold/protocol/contracts/v2/strategies/TlcStrategy.sol#L67) + + ```solidity + function latestAssetBalances() public override(AbstractStrategy, ITempleStrategy) view returns ( + ``` + +
+ + + +## L-7: Define and use `constant` variables instead of using literals + +If the same constant literal value is used multiple times, create a constant state variable and reference it throughout the contract. + +
712 Found Instances + + +- Found in contracts/amm/TempleUniswapV2Pair.sol [Line: 163](../tests/2024-07-templegold/protocol/contracts/amm/TempleUniswapV2Pair.sol#L163) + + ```solidity + uint balance0Adjusted = balance0.mul(1000).sub(amount0In.mul(3)); + ``` + +- Found in contracts/amm/TempleUniswapV2Pair.sol [Line: 164](../tests/2024-07-templegold/protocol/contracts/amm/TempleUniswapV2Pair.sol#L164) + + ```solidity + uint balance1Adjusted = balance1.mul(1000).sub(amount1In.mul(3)); + ``` + +- Found in contracts/amm/TempleUniswapV2Pair.sol [Line: 165](../tests/2024-07-templegold/protocol/contracts/amm/TempleUniswapV2Pair.sol#L165) + + ```solidity + require(balance0Adjusted.mul(balance1Adjusted) >= uint(_reserve0).mul(_reserve1).mul(1000**2), 'UniswapV2: K'); + ``` + +- Found in contracts/deprecated/TempleStaking.sol [Line: 52](../tests/2024-07-templegold/protocol/contracts/deprecated/TempleStaking.sol#L52) + + ```solidity + require(_startTimestamp > (block.timestamp - (24 * 2 * 60 * 60)), "Start timestamp can't be more than 2 days in the past"); + ``` + +- Found in contracts/deprecated/TempleStaking.sol [Line: 100](../tests/2024-07-templegold/protocol/contracts/deprecated/TempleStaking.sol#L100) + + ```solidity + ABDKMath64x64.divu(amountOgTemple, 1e18).mul(_accumulationFactorAt(currentEpoch())) + ``` + +- Found in contracts/deprecated/TempleStaking.sol [Line: 129](../tests/2024-07-templegold/protocol/contracts/deprecated/TempleStaking.sol#L129) + + ```solidity + amountOgTemple = _overflowSafeMul1e18(ABDKMath64x64.divu(_amountTemple, 1e18).div(accumulationFactor)); + ``` + +- Found in contracts/deprecated/TempleStaking.sol [Line: 159](../tests/2024-07-templegold/protocol/contracts/deprecated/TempleStaking.sol#L159) + + ```solidity + uint256 fractionalDigits = amountFixedPoint.sub(ABDKMath64x64.fromUInt(integralDigits)).mul(ABDKMath64x64.fromUInt(1e18)).toUInt(); + ``` + +- Found in contracts/deprecated/TempleStaking.sol [Line: 160](../tests/2024-07-templegold/protocol/contracts/deprecated/TempleStaking.sol#L160) + + ```solidity + return (integralDigits * 1e18) + fractionalDigits; + ``` + +- Found in contracts/fakes/templegold/TempleGoldStakingMock.sol [Line: 537](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleGoldStakingMock.sol#L537) + + ```solidity + vestingRate = 1e18; + ``` + +- Found in contracts/fakes/templegold/TempleGoldStakingMock.sol [Line: 539](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleGoldStakingMock.sol#L539) + + ```solidity + vestingRate = (block.timestamp - _stakeInfo.stakeTime) * 1e18 / vestingPeriod; + ``` + +- Found in contracts/fakes/templegold/TempleGoldStakingMock.sol [Line: 542](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleGoldStakingMock.sol#L542) + + ```solidity + if (vestingRate == 1e18) { + ``` + +- Found in contracts/fakes/templegold/TempleGoldStakingMock.sol [Line: 545](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleGoldStakingMock.sol#L545) + + ```solidity + _perTokenReward = _rewardPerToken() * vestingRate / 1e18; + ``` + +- Found in contracts/fakes/templegold/TempleGoldStakingMock.sol [Line: 549](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleGoldStakingMock.sol#L549) + + ```solidity + (_balance * (_perTokenReward - userRewardPerTokenPaid[_account][_index])) / 1e18 + + ``` + +- Found in contracts/fakes/templegold/TempleGoldStakingMock.sol [Line: 558](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleGoldStakingMock.sol#L558) + + ```solidity + vestingRate = 1e18; + ``` + +- Found in contracts/fakes/templegold/TempleGoldStakingMock.sol [Line: 560](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleGoldStakingMock.sol#L560) + + ```solidity + vestingRate = (block.timestamp - _stakeInfo.stakeTime) * 1e18 / vestingPeriod; + ``` + +- Found in contracts/fakes/templegold/TempleGoldStakingMock.sol [Line: 580](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleGoldStakingMock.sol#L580) + + ```solidity + rewardData.rewardRate * 1e18) + ``` + +- Found in contracts/fakes/templegold/TempleGoldStakingMock.sol [Line: 680](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleGoldStakingMock.sol#L680) + + ```solidity + userRewardPerTokenPaid[_account][_index] = vestingRate * uint256(rewardData.rewardPerTokenStored) / 1e18; + ``` + +- Found in contracts/fakes/v2/strategies/DsrBaseStrategyTestnet.sol [Line: 76](../tests/2024-07-templegold/protocol/contracts/fakes/v2/strategies/DsrBaseStrategyTestnet.sol#L76) + + ```solidity + return existingBalance * (1e18 + (daiSavingsRate * elapsed / 365 days)) / 1e18; + ``` + +- Found in contracts/templegold/TempleGoldStaking.sol [Line: 473](../tests/2024-07-templegold/protocol/contracts/templegold/TempleGoldStaking.sol#L473) + + ```solidity + if (vestingRate == 1e18) { + ``` + +- Found in contracts/templegold/TempleGoldStaking.sol [Line: 476](../tests/2024-07-templegold/protocol/contracts/templegold/TempleGoldStaking.sol#L476) + + ```solidity + _perTokenReward = _rewardPerToken() * vestingRate / 1e18; + ``` + +- Found in contracts/templegold/TempleGoldStaking.sol [Line: 480](../tests/2024-07-templegold/protocol/contracts/templegold/TempleGoldStaking.sol#L480) + + ```solidity + (_stakeInfo.amount * (_perTokenReward - userRewardPerTokenPaid[_account][_index])) / 1e18 + + ``` + +- Found in contracts/templegold/TempleGoldStaking.sol [Line: 489](../tests/2024-07-templegold/protocol/contracts/templegold/TempleGoldStaking.sol#L489) + + ```solidity + vestingRate = 1e18; + ``` + +- Found in contracts/templegold/TempleGoldStaking.sol [Line: 491](../tests/2024-07-templegold/protocol/contracts/templegold/TempleGoldStaking.sol#L491) + + ```solidity + vestingRate = (block.timestamp - _stakeInfo.stakeTime) * 1e18 / vestingPeriod; + ``` + +- Found in contracts/templegold/TempleGoldStaking.sol [Line: 511](../tests/2024-07-templegold/protocol/contracts/templegold/TempleGoldStaking.sol#L511) + + ```solidity + rewardData.rewardRate * 1e18) + ``` + +- Found in contracts/templegold/TempleGoldStaking.sol [Line: 598](../tests/2024-07-templegold/protocol/contracts/templegold/TempleGoldStaking.sol#L598) + + ```solidity + userRewardPerTokenPaid[_account][_index] = vestingRate * uint256(rewardData.rewardPerTokenStored) / 1e18; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 36](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L36) + + ```solidity + require (x >= -0x8000000000000000 && x <= 0x7FFFFFFFFFFFFFFF); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 37](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L37) + + ```solidity + return int128 (x << 64); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 50](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L50) + + ```solidity + return int64 (x >> 64); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 63](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L63) + + ```solidity + require (x <= 0x7FFFFFFFFFFFFFFF); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 64](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L64) + + ```solidity + return int128 (int256 (x << 64)); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 78](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L78) + + ```solidity + return uint64 (uint128 (x >> 64)); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 91](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L91) + + ```solidity + int256 result = x >> 64; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 106](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L106) + + ```solidity + return int256 (x) << 64; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 149](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L149) + + ```solidity + int256 result = int256(x) * y >> 64; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 166](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L166) + + ```solidity + require (y >= -0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF && + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 168](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L168) + + ```solidity + return -y << 63; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 207](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L207) + + ```solidity + uint256 lo = (uint256 (int256 (x)) * (y & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)) >> 64; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 208](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L208) + + ```solidity + uint256 hi = uint256 (int256 (x)) * (y >> 128); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 210](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L210) + + ```solidity + require (hi <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 211](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L211) + + ```solidity + hi <<= 64; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 230](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L230) + + ```solidity + int256 result = (int256 (x) << 64) / y; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 259](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L259) + + ```solidity + require (absoluteResult <= 0x80000000000000000000000000000000); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 321](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L321) + + ```solidity + int256 result = int256 (0x100000000000000000000000000000000) / x; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 372](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L372) + + ```solidity + absResult = 0x100000000000000000000000000000000; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 374](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L374) + + ```solidity + if (absX <= 0x10000000000000000) { + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 375](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L375) + + ```solidity + absX <<= 63; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 377](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L377) + + ```solidity + if (y & 0x1 != 0) { + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 378](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L378) + + ```solidity + absResult = absResult * absX >> 127; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 380](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L380) + + ```solidity + absX = absX * absX >> 127; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 382](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L382) + + ```solidity + if (y & 0x2 != 0) { + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 383](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L383) + + ```solidity + absResult = absResult * absX >> 127; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 385](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L385) + + ```solidity + absX = absX * absX >> 127; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 387](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L387) + + ```solidity + if (y & 0x4 != 0) { + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 388](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L388) + + ```solidity + absResult = absResult * absX >> 127; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 390](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L390) + + ```solidity + absX = absX * absX >> 127; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 392](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L392) + + ```solidity + if (y & 0x8 != 0) { + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 393](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L393) + + ```solidity + absResult = absResult * absX >> 127; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 395](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L395) + + ```solidity + absX = absX * absX >> 127; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 397](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L397) + + ```solidity + y >>= 4; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 400](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L400) + + ```solidity + absResult >>= 64; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 402](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L402) + + ```solidity + uint256 absXShift = 63; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 403](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L403) + + ```solidity + if (absX < 0x1000000000000000000000000) { absX <<= 32; absXShift -= 32; } + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 404](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L404) + + ```solidity + if (absX < 0x10000000000000000000000000000) { absX <<= 16; absXShift -= 16; } + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 405](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L405) + + ```solidity + if (absX < 0x1000000000000000000000000000000) { absX <<= 8; absXShift -= 8; } + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 406](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L406) + + ```solidity + if (absX < 0x10000000000000000000000000000000) { absX <<= 4; absXShift -= 4; } + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 408](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L408) + + ```solidity + if (absX < 0x80000000000000000000000000000000) { absX <<= 1; absXShift -= 1; } + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 412](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L412) + + ```solidity + require (absXShift < 64); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 414](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L414) + + ```solidity + if (y & 0x1 != 0) { + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 415](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L415) + + ```solidity + absResult = absResult * absX >> 127; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 417](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L417) + + ```solidity + if (absResult > 0x100000000000000000000000000000000) { + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 422](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L422) + + ```solidity + absX = absX * absX >> 127; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 424](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L424) + + ```solidity + if (absX >= 0x100000000000000000000000000000000) { + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 432](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L432) + + ```solidity + require (resultShift < 64); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 433](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L433) + + ```solidity + absResult >>= 64 - resultShift; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 450](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L450) + + ```solidity + return int128 (sqrtu (uint256 (int256 (x)) << 64)); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 466](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L466) + + ```solidity + if (xc >= 0x10000000000000000) { xc >>= 64; msb += 64; } + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 467](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L467) + + ```solidity + if (xc >= 0x100000000) { xc >>= 32; msb += 32; } + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 468](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L468) + + ```solidity + if (xc >= 0x10000) { xc >>= 16; msb += 16; } + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 469](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L469) + + ```solidity + if (xc >= 0x100) { xc >>= 8; msb += 8; } + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 470](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L470) + + ```solidity + if (xc >= 0x10) { xc >>= 4; msb += 4; } + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 471](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L471) + + ```solidity + if (xc >= 0x4) { xc >>= 2; msb += 2; } + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 472](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L472) + + ```solidity + if (xc >= 0x2) msb += 1; // No need to shift xc anymore + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 474](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L474) + + ```solidity + int256 result = msb - 64 << 64; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 475](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L475) + + ```solidity + uint256 ux = uint256 (int256 (x)) << uint256 (127 - msb); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 476](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L476) + + ```solidity + for (int256 bit = 0x8000000000000000; bit > 0; bit >>= 1) { + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 478](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L478) + + ```solidity + uint256 b = ux >> 255; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 479](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L479) + + ```solidity + ux >>= 127 + b; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 498](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L498) + + ```solidity + uint256 (int256 (log_2 (x))) * 0xB17217F7D1CF79ABC9E3B39803F2F6AF >> 128)); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 510](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L510) + + ```solidity + require (x < 0x400000000000000000); // Overflow + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 512](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L512) + + ```solidity + if (x < -0x400000000000000000) return 0; // Underflow + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 514](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L514) + + ```solidity + uint256 result = 0x80000000000000000000000000000000; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 516](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L516) + + ```solidity + if (x & 0x8000000000000000 > 0) + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 517](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L517) + + ```solidity + result = result * 0x16A09E667F3BCC908B2FB1366EA957D3E >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 519](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L519) + + ```solidity + result = result * 0x1306FE0A31B7152DE8D5A46305C85EDEC >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 521](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L521) + + ```solidity + result = result * 0x1172B83C7D517ADCDF7C8C50EB14A791F >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 523](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L523) + + ```solidity + result = result * 0x10B5586CF9890F6298B92B71842A98363 >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 525](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L525) + + ```solidity + result = result * 0x1059B0D31585743AE7C548EB68CA417FD >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 527](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L527) + + ```solidity + result = result * 0x102C9A3E778060EE6F7CACA4F7A29BDE8 >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 529](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L529) + + ```solidity + result = result * 0x10163DA9FB33356D84A66AE336DCDFA3F >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 531](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L531) + + ```solidity + result = result * 0x100B1AFA5ABCBED6129AB13EC11DC9543 >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 533](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L533) + + ```solidity + result = result * 0x10058C86DA1C09EA1FF19D294CF2F679B >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 535](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L535) + + ```solidity + result = result * 0x1002C605E2E8CEC506D21BFC89A23A00F >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 537](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L537) + + ```solidity + result = result * 0x100162F3904051FA128BCA9C55C31E5DF >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 539](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L539) + + ```solidity + result = result * 0x1000B175EFFDC76BA38E31671CA939725 >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 541](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L541) + + ```solidity + result = result * 0x100058BA01FB9F96D6CACD4B180917C3D >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 543](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L543) + + ```solidity + result = result * 0x10002C5CC37DA9491D0985C348C68E7B3 >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 545](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L545) + + ```solidity + result = result * 0x1000162E525EE054754457D5995292026 >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 547](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L547) + + ```solidity + result = result * 0x10000B17255775C040618BF4A4ADE83FC >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 549](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L549) + + ```solidity + result = result * 0x1000058B91B5BC9AE2EED81E9B7D4CFAB >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 551](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L551) + + ```solidity + result = result * 0x100002C5C89D5EC6CA4D7C8ACC017B7C9 >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 553](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L553) + + ```solidity + result = result * 0x10000162E43F4F831060E02D839A9D16D >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 555](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L555) + + ```solidity + result = result * 0x100000B1721BCFC99D9F890EA06911763 >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 557](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L557) + + ```solidity + result = result * 0x10000058B90CF1E6D97F9CA14DBCC1628 >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 559](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L559) + + ```solidity + result = result * 0x1000002C5C863B73F016468F6BAC5CA2B >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 561](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L561) + + ```solidity + result = result * 0x100000162E430E5A18F6119E3C02282A5 >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 563](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L563) + + ```solidity + result = result * 0x1000000B1721835514B86E6D96EFD1BFE >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 565](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L565) + + ```solidity + result = result * 0x100000058B90C0B48C6BE5DF846C5B2EF >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 567](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L567) + + ```solidity + result = result * 0x10000002C5C8601CC6B9E94213C72737A >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 569](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L569) + + ```solidity + result = result * 0x1000000162E42FFF037DF38AA2B219F06 >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 571](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L571) + + ```solidity + result = result * 0x10000000B17217FBA9C739AA5819F44F9 >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 573](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L573) + + ```solidity + result = result * 0x1000000058B90BFCDEE5ACD3C1CEDC823 >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 575](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L575) + + ```solidity + result = result * 0x100000002C5C85FE31F35A6A30DA1BE50 >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 577](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L577) + + ```solidity + result = result * 0x10000000162E42FF0999CE3541B9FFFCF >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 578](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L578) + + ```solidity + if (x & 0x100000000 > 0) + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 579](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L579) + + ```solidity + result = result * 0x100000000B17217F80F4EF5AADDA45554 >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 581](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L581) + + ```solidity + result = result * 0x10000000058B90BFBF8479BD5A81B51AD >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 583](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L583) + + ```solidity + result = result * 0x1000000002C5C85FDF84BD62AE30A74CC >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 585](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L585) + + ```solidity + result = result * 0x100000000162E42FEFB2FED257559BDAA >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 587](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L587) + + ```solidity + result = result * 0x1000000000B17217F7D5A7716BBA4A9AE >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 589](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L589) + + ```solidity + result = result * 0x100000000058B90BFBE9DDBAC5E109CCE >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 591](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L591) + + ```solidity + result = result * 0x10000000002C5C85FDF4B15DE6F17EB0D >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 593](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L593) + + ```solidity + result = result * 0x1000000000162E42FEFA494F1478FDE05 >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 595](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L595) + + ```solidity + result = result * 0x10000000000B17217F7D20CF927C8E94C >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 597](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L597) + + ```solidity + result = result * 0x1000000000058B90BFBE8F71CB4E4B33D >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 599](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L599) + + ```solidity + result = result * 0x100000000002C5C85FDF477B662B26945 >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 601](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L601) + + ```solidity + result = result * 0x10000000000162E42FEFA3AE53369388C >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 603](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L603) + + ```solidity + result = result * 0x100000000000B17217F7D1D351A389D40 >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 605](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L605) + + ```solidity + result = result * 0x10000000000058B90BFBE8E8B2D3D4EDE >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 607](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L607) + + ```solidity + result = result * 0x1000000000002C5C85FDF4741BEA6E77E >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 609](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L609) + + ```solidity + result = result * 0x100000000000162E42FEFA39FE95583C2 >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 610](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L610) + + ```solidity + if (x & 0x10000 > 0) + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 611](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L611) + + ```solidity + result = result * 0x1000000000000B17217F7D1CFB72B45E1 >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 613](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L613) + + ```solidity + result = result * 0x100000000000058B90BFBE8E7CC35C3F0 >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 615](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L615) + + ```solidity + result = result * 0x10000000000002C5C85FDF473E242EA38 >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 617](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L617) + + ```solidity + result = result * 0x1000000000000162E42FEFA39F02B772C >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 619](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L619) + + ```solidity + result = result * 0x10000000000000B17217F7D1CF7D83C1A >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 621](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L621) + + ```solidity + result = result * 0x1000000000000058B90BFBE8E7BDCBE2E >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 623](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L623) + + ```solidity + result = result * 0x100000000000002C5C85FDF473DEA871F >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 625](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L625) + + ```solidity + result = result * 0x10000000000000162E42FEFA39EF44D91 >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 626](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L626) + + ```solidity + if (x & 0x100 > 0) + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 627](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L627) + + ```solidity + result = result * 0x100000000000000B17217F7D1CF79E949 >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 629](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L629) + + ```solidity + result = result * 0x10000000000000058B90BFBE8E7BCE544 >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 631](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L631) + + ```solidity + result = result * 0x1000000000000002C5C85FDF473DE6ECA >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 633](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L633) + + ```solidity + result = result * 0x100000000000000162E42FEFA39EF366F >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 634](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L634) + + ```solidity + if (x & 0x10 > 0) + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 635](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L635) + + ```solidity + result = result * 0x1000000000000000B17217F7D1CF79AFA >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 636](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L636) + + ```solidity + if (x & 0x8 > 0) + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 637](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L637) + + ```solidity + result = result * 0x100000000000000058B90BFBE8E7BCD6D >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 638](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L638) + + ```solidity + if (x & 0x4 > 0) + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 639](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L639) + + ```solidity + result = result * 0x10000000000000002C5C85FDF473DE6B2 >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 640](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L640) + + ```solidity + if (x & 0x2 > 0) + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 641](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L641) + + ```solidity + result = result * 0x1000000000000000162E42FEFA39EF358 >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 642](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L642) + + ```solidity + if (x & 0x1 > 0) + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 643](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L643) + + ```solidity + result = result * 0x10000000000000000B17217F7D1CF79AB >> 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 645](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L645) + + ```solidity + result >>= uint256 (int256 (63 - (x >> 64))); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 660](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L660) + + ```solidity + require (x < 0x400000000000000000); // Overflow + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 662](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L662) + + ```solidity + if (x < -0x400000000000000000) return 0; // Underflow + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 665](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L665) + + ```solidity + int128 (int256 (x) * 0x171547652B82FE1777D0FFDA0D23A7D12 >> 128)); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 683](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L683) + + ```solidity + if (x <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 684](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L684) + + ```solidity + result = (x << 64) / y; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 686](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L686) + + ```solidity + uint256 msb = 192; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 687](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L687) + + ```solidity + uint256 xc = x >> 192; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 688](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L688) + + ```solidity + if (xc >= 0x100000000) { xc >>= 32; msb += 32; } + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 689](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L689) + + ```solidity + if (xc >= 0x10000) { xc >>= 16; msb += 16; } + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 690](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L690) + + ```solidity + if (xc >= 0x100) { xc >>= 8; msb += 8; } + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 691](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L691) + + ```solidity + if (xc >= 0x10) { xc >>= 4; msb += 4; } + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 692](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L692) + + ```solidity + if (xc >= 0x4) { xc >>= 2; msb += 2; } + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 693](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L693) + + ```solidity + if (xc >= 0x2) msb += 1; // No need to shift xc anymore + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 695](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L695) + + ```solidity + result = (x << 255 - msb) / ((y - 1 >> msb - 191) + 1); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 696](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L696) + + ```solidity + require (result <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 698](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L698) + + ```solidity + uint256 hi = result * (y >> 128); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 699](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L699) + + ```solidity + uint256 lo = result * (y & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 701](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L701) + + ```solidity + uint256 xh = x >> 192; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 702](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L702) + + ```solidity + uint256 xl = x << 64; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 706](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L706) + + ```solidity + lo = hi << 128; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 710](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L710) + + ```solidity + assert (xh == hi >> 128); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 715](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L715) + + ```solidity + require (result <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 733](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L733) + + ```solidity + if (xx >= 0x100000000000000000000000000000000) { xx >>= 128; r <<= 64; } + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 734](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L734) + + ```solidity + if (xx >= 0x10000000000000000) { xx >>= 64; r <<= 32; } + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 735](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L735) + + ```solidity + if (xx >= 0x100000000) { xx >>= 32; r <<= 16; } + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 736](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L736) + + ```solidity + if (xx >= 0x10000) { xx >>= 16; r <<= 8; } + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 737](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L737) + + ```solidity + if (xx >= 0x100) { xx >>= 8; r <<= 4; } + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 738](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L738) + + ```solidity + if (xx >= 0x10) { xx >>= 4; r <<= 2; } + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 739](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L739) + + ```solidity + if (xx >= 0x8) { r <<= 1; } + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 54](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L54) + + ```solidity + if (msb < 112) result <<= 112 - msb; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 55](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L55) + + ```solidity + else if (msb > 112) result >>= msb - 112; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 57](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L57) + + ```solidity + result = result & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF | 16383 + msb << 112; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 58](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L58) + + ```solidity + if (x < 0) result |= 0x80000000000000000000000000000000; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 74](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L74) + + ```solidity + uint256 exponent = uint128 (x) >> 112 & 0x7FFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 76](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L76) + + ```solidity + require (exponent <= 16638); // Overflow + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 77](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L77) + + ```solidity + if (exponent < 16383) return 0; // Underflow + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 79](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L79) + + ```solidity + uint256 result = uint256 (uint128 (x)) & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF | + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 80](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L80) + + ```solidity + 0x10000000000000000000000000000; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 82](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L82) + + ```solidity + if (exponent < 16495) result >>= 16495 - exponent; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 83](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L83) + + ```solidity + else if (exponent > 16495) result <<= exponent - 16495; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 85](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L85) + + ```solidity + if (uint128 (x) >= 0x80000000000000000000000000000000) { // Negative + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 86](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L86) + + ```solidity + require (result <= 0x8000000000000000000000000000000000000000000000000000000000000000); + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 89](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L89) + + ```solidity + require (result <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF); + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 108](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L108) + + ```solidity + if (msb < 112) result <<= 112 - msb; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 109](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L109) + + ```solidity + else if (msb > 112) result >>= msb - 112; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 111](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L111) + + ```solidity + result = result & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF | 16383 + msb << 112; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 129](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L129) + + ```solidity + uint256 exponent = uint128 (x) >> 112 & 0x7FFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 131](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L131) + + ```solidity + if (exponent < 16383) return 0; // Underflow + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 133](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L133) + + ```solidity + require (uint128 (x) < 0x80000000000000000000000000000000); // Negative + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 135](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L135) + + ```solidity + require (exponent <= 16638); // Overflow + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 136](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L136) + + ```solidity + uint256 result = uint256 (uint128 (x)) & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF | + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 137](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L137) + + ```solidity + 0x10000000000000000000000000000; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 139](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L139) + + ```solidity + if (exponent < 16495) result >>= 16495 - exponent; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 140](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L140) + + ```solidity + else if (exponent > 16495) result <<= exponent - 16495; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 161](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L161) + + ```solidity + if (msb < 112) result <<= 112 - msb; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 162](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L162) + + ```solidity + else if (msb > 112) result >>= msb - 112; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 164](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L164) + + ```solidity + result = result & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF | 16255 + msb << 112; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 165](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L165) + + ```solidity + if (x < 0) result |= 0x80000000000000000000000000000000; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 181](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L181) + + ```solidity + uint256 exponent = uint128 (x) >> 112 & 0x7FFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 184](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L184) + + ```solidity + if (exponent < 16255) return 0; // Underflow + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 186](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L186) + + ```solidity + uint256 result = uint256 (uint128 (x)) & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF | + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 187](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L187) + + ```solidity + 0x10000000000000000000000000000; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 189](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L189) + + ```solidity + if (exponent < 16367) result >>= 16367 - exponent; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 190](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L190) + + ```solidity + else if (exponent > 16367) result <<= exponent - 16367; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 192](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L192) + + ```solidity + if (uint128 (x) >= 0x80000000000000000000000000000000) { // Negative + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 193](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L193) + + ```solidity + require (result <= 0x8000000000000000000000000000000000000000000000000000000000000000); + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 196](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L196) + + ```solidity + require (result <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF); + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 217](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L217) + + ```solidity + if (msb < 112) result <<= 112 - msb; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 218](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L218) + + ```solidity + else if (msb > 112) result >>= msb - 112; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 220](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L220) + + ```solidity + result = result & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF | 16319 + msb << 112; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 221](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L221) + + ```solidity + if (x < 0) result |= 0x80000000000000000000000000000000; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 237](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L237) + + ```solidity + uint256 exponent = uint128 (x) >> 112 & 0x7FFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 240](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L240) + + ```solidity + if (exponent < 16319) return 0; // Underflow + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 242](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L242) + + ```solidity + uint256 result = uint256 (uint128 (x)) & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF | + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 243](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L243) + + ```solidity + 0x10000000000000000000000000000; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 245](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L245) + + ```solidity + if (exponent < 16431) result >>= 16431 - exponent; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 246](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L246) + + ```solidity + else if (exponent > 16431) result <<= exponent - 16431; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 248](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L248) + + ```solidity + if (uint128 (x) >= 0x80000000000000000000000000000000) { // Negative + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 249](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L249) + + ```solidity + require (result <= 0x80000000000000000000000000000000); + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 252](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L252) + + ```solidity + require (result <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF); + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 266](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L266) + + ```solidity + bool negative = x & 0x8000000000000000000000000000000000000000000000000000000000000000 > 0; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 268](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L268) + + ```solidity + uint256 exponent = uint256 (x) >> 236 & 0x7FFFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 269](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L269) + + ```solidity + uint256 significand = uint256 (x) & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 271](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L271) + + ```solidity + if (exponent == 0x7FFFF) { + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 278](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L278) + + ```solidity + else if (exponent < 245649) + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 284](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L284) + + ```solidity + significand >>= 124; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 285](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L285) + + ```solidity + exponent -= 245760; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 288](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L288) + + ```solidity + uint128 result = uint128 (significand | exponent << 112); + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 289](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L289) + + ```solidity + if (negative) result |= 0x80000000000000000000000000000000; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 303](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L303) + + ```solidity + uint256 exponent = uint128 (x) >> 112 & 0x7FFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 305](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L305) + + ```solidity + uint256 result = uint128 (x) & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 307](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L307) + + ```solidity + if (exponent == 0x7FFF) exponent = 0x7FFFF; // Infinity or NaN + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 311](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L311) + + ```solidity + result = result << 236 - msb & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 312](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L312) + + ```solidity + exponent = 245649 + msb; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 315](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L315) + + ```solidity + result <<= 124; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 316](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L316) + + ```solidity + exponent += 245760; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 319](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L319) + + ```solidity + result |= exponent << 236; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 320](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L320) + + ```solidity + if (uint128 (x) >= 0x80000000000000000000000000000000) + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 321](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L321) + + ```solidity + result |= 0x8000000000000000000000000000000000000000000000000000000000000000; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 335](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L335) + + ```solidity + uint256 exponent = uint64 (x) >> 52 & 0x7FF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 339](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L339) + + ```solidity + if (exponent == 0x7FF) exponent = 0x7FFF; // Infinity or NaN + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 343](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L343) + + ```solidity + result = result << 112 - msb & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 344](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L344) + + ```solidity + exponent = 15309 + msb; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 347](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L347) + + ```solidity + result <<= 60; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 348](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L348) + + ```solidity + exponent += 15360; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 351](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L351) + + ```solidity + result |= exponent << 112; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 352](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L352) + + ```solidity + if (x & 0x8000000000000000 > 0) + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 353](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L353) + + ```solidity + result |= 0x80000000000000000000000000000000; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 367](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L367) + + ```solidity + bool negative = uint128 (x) >= 0x80000000000000000000000000000000; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 369](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L369) + + ```solidity + uint256 exponent = uint128 (x) >> 112 & 0x7FFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 370](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L370) + + ```solidity + uint256 significand = uint128 (x) & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 372](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L372) + + ```solidity + if (exponent == 0x7FFF) { + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 375](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L375) + + ```solidity + bytes8 (0xFFF0000000000000) : // -Infinity + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 376](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L376) + + ```solidity + bytes8 (0x7FF0000000000000); // Infinity + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 381](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L381) + + ```solidity + bytes8 (0xFFF0000000000000) : // -Infinity + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 382](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L382) + + ```solidity + bytes8 (0x7FF0000000000000); // Infinity + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 383](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L383) + + ```solidity + else if (exponent < 15309) + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 385](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L385) + + ```solidity + bytes8 (0x8000000000000000) : // -0 + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 388](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L388) + + ```solidity + significand = (significand | 0x10000000000000000000000000000) >> 15421 - exponent; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 391](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L391) + + ```solidity + significand >>= 60; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 392](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L392) + + ```solidity + exponent -= 15360; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 395](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L395) + + ```solidity + uint64 result = uint64 (significand | exponent << 52); + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 396](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L396) + + ```solidity + if (negative) result |= 0x8000000000000000; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 410](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L410) + + ```solidity + return uint128 (x) & 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF > + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 411](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L411) + + ```solidity + 0x7FFF0000000000000000000000000000; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 424](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L424) + + ```solidity + return uint128 (x) & 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF == + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 425](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L425) + + ```solidity + 0x7FFF0000000000000000000000000000; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 438](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L438) + + ```solidity + uint128 absoluteX = uint128 (x) & 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 440](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L440) + + ```solidity + require (absoluteX <= 0x7FFF0000000000000000000000000000); // Not NaN + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 443](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L443) + + ```solidity + else if (uint128 (x) >= 0x80000000000000000000000000000000) return -1; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 458](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L458) + + ```solidity + uint128 absoluteX = uint128 (x) & 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 460](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L460) + + ```solidity + require (absoluteX <= 0x7FFF0000000000000000000000000000); // Not NaN + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 462](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L462) + + ```solidity + uint128 absoluteY = uint128 (y) & 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 464](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L464) + + ```solidity + require (absoluteY <= 0x7FFF0000000000000000000000000000); // Not NaN + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 467](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L467) + + ```solidity + require (x != y || absoluteX < 0x7FFF0000000000000000000000000000); + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 471](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L471) + + ```solidity + bool negativeX = uint128 (x) >= 0x80000000000000000000000000000000; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 472](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L472) + + ```solidity + bool negativeY = uint128 (y) >= 0x80000000000000000000000000000000; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 496](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L496) + + ```solidity + return uint128 (x) & 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF < + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 497](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L497) + + ```solidity + 0x7FFF0000000000000000000000000000; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 518](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L518) + + ```solidity + uint256 xExponent = uint128 (x) >> 112 & 0x7FFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 519](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L519) + + ```solidity + uint256 yExponent = uint128 (y) >> 112 & 0x7FFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 521](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L521) + + ```solidity + if (xExponent == 0x7FFF) { + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 522](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L522) + + ```solidity + if (yExponent == 0x7FFF) { + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 526](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L526) + + ```solidity + } else if (yExponent == 0x7FFF) return y; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 528](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L528) + + ```solidity + bool xSign = uint128 (x) >= 0x80000000000000000000000000000000; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 529](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L529) + + ```solidity + uint256 xSignifier = uint128 (x) & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 531](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L531) + + ```solidity + else xSignifier |= 0x10000000000000000000000000000; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 533](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L533) + + ```solidity + bool ySign = uint128 (y) >= 0x80000000000000000000000000000000; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 534](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L534) + + ```solidity + uint256 ySignifier = uint128 (y) & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 536](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L536) + + ```solidity + else ySignifier |= 0x10000000000000000000000000000; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 544](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L544) + + ```solidity + if (delta > 112) return x; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 546](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L546) + + ```solidity + else if (delta < -112) return y; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 554](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L554) + + ```solidity + if (xSignifier >= 0x20000000000000000000000000000) { + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 559](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L559) + + ```solidity + if (xExponent == 0x7FFF) + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 562](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L562) + + ```solidity + if (xSignifier < 0x10000000000000000000000000000) xExponent = 0; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 563](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L563) + + ```solidity + else xSignifier &= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 566](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L566) + + ```solidity + (xSign ? 0x80000000000000000000000000000000 : 0) | + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 567](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L567) + + ```solidity + (xExponent << 112) | + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 579](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L579) + + ```solidity + if (delta > 112) ySignifier = 1; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 581](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L581) + + ```solidity + else if (delta < -112) xSignifier = 1; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 595](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L595) + + ```solidity + if (msb == 113) { + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 596](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L596) + + ```solidity + xSignifier = xSignifier >> 1 & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 598](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L598) + + ```solidity + } else if (msb < 112) { + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 599](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L599) + + ```solidity + uint256 shift = 112 - msb; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 601](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L601) + + ```solidity + xSignifier = xSignifier << shift & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 607](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L607) + + ```solidity + } else xSignifier &= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 609](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L609) + + ```solidity + if (xExponent == 0x7FFF) + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 612](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L612) + + ```solidity + (xSign ? 0x80000000000000000000000000000000 : 0) | + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 613](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L613) + + ```solidity + (xExponent << 112) | + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 637](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L637) + + ```solidity + return add (x, y ^ 0x80000000000000000000000000000000); + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 662](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L662) + + ```solidity + uint256 xExponent = uint128 (x) >> 112 & 0x7FFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 663](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L663) + + ```solidity + uint256 yExponent = uint128 (y) >> 112 & 0x7FFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 665](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L665) + + ```solidity + if (xExponent == 0x7FFF) { + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 666](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L666) + + ```solidity + if (yExponent == 0x7FFF) { + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 667](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L667) + + ```solidity + if (x == y) return x ^ y & 0x80000000000000000000000000000000; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 668](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L668) + + ```solidity + else if (x ^ y == 0x80000000000000000000000000000000) return x | y; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 671](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L671) + + ```solidity + if (y & 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF == 0) return NaN; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 672](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L672) + + ```solidity + else return x ^ y & 0x80000000000000000000000000000000; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 674](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L674) + + ```solidity + } else if (yExponent == 0x7FFF) { + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 675](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L675) + + ```solidity + if (x & 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF == 0) return NaN; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 676](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L676) + + ```solidity + else return y ^ x & 0x80000000000000000000000000000000; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 678](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L678) + + ```solidity + uint256 xSignifier = uint128 (x) & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 680](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L680) + + ```solidity + else xSignifier |= 0x10000000000000000000000000000; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 682](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L682) + + ```solidity + uint256 ySignifier = uint128 (y) & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 684](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L684) + + ```solidity + else ySignifier |= 0x10000000000000000000000000000; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 688](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L688) + + ```solidity + return (x ^ y) & 0x80000000000000000000000000000000 > 0 ? + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 694](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L694) + + ```solidity + xSignifier >= 0x200000000000000000000000000000000000000000000000000000000 ? 225 : + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 698](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L698) + + ```solidity + if (xExponent + msb < 16496) { // Underflow + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 702](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L702) + + ```solidity + if (xExponent < 16496) + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 703](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L703) + + ```solidity + xSignifier >>= 16496 - xExponent; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 704](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L704) + + ```solidity + else if (xExponent > 16496) + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 705](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L705) + + ```solidity + xSignifier <<= xExponent - 16496; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 708](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L708) + + ```solidity + xExponent = 0x7FFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 711](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L711) + + ```solidity + if (msb > 112) + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 712](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L712) + + ```solidity + xSignifier >>= msb - 112; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 713](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L713) + + ```solidity + else if (msb < 112) + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 714](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L714) + + ```solidity + xSignifier <<= 112 - msb; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 716](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L716) + + ```solidity + xSignifier &= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 721](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L721) + + ```solidity + return bytes16 (uint128 (uint128 ((x ^ y) & 0x80000000000000000000000000000000) | + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 722](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L722) + + ```solidity + xExponent << 112 | xSignifier)); + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 763](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L763) + + ```solidity + uint256 xExponent = uint128 (x) >> 112 & 0x7FFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 764](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L764) + + ```solidity + uint256 yExponent = uint128 (y) >> 112 & 0x7FFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 766](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L766) + + ```solidity + if (xExponent == 0x7FFF) { + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 767](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L767) + + ```solidity + if (yExponent == 0x7FFF) return NaN; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 768](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L768) + + ```solidity + else return x ^ y & 0x80000000000000000000000000000000; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 769](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L769) + + ```solidity + } else if (yExponent == 0x7FFF) { + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 771](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L771) + + ```solidity + else return POSITIVE_ZERO | (x ^ y) & 0x80000000000000000000000000000000; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 772](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L772) + + ```solidity + } else if (y & 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF == 0) { + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 773](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L773) + + ```solidity + if (x & 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF == 0) return NaN; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 774](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L774) + + ```solidity + else return POSITIVE_INFINITY | (x ^ y) & 0x80000000000000000000000000000000; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 776](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L776) + + ```solidity + uint256 ySignifier = uint128 (y) & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 778](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L778) + + ```solidity + else ySignifier |= 0x10000000000000000000000000000; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 780](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L780) + + ```solidity + uint256 xSignifier = uint128 (x) & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 783](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L783) + + ```solidity + uint shift = 226 - mostSignificantBit (xSignifier); + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 788](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L788) + + ```solidity + yExponent += shift - 114; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 792](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L792) + + ```solidity + xSignifier = (xSignifier | 0x10000000000000000000000000000) << 114; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 797](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L797) + + ```solidity + return (x ^ y) & 0x80000000000000000000000000000000 > 0 ? + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 800](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L800) + + ```solidity + assert (xSignifier >= 0x1000000000000000000000000000); + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 803](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L803) + + ```solidity + xSignifier >= 0x80000000000000000000000000000 ? mostSignificantBit (xSignifier) : + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 804](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L804) + + ```solidity + xSignifier >= 0x40000000000000000000000000000 ? 114 : + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 805](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L805) + + ```solidity + xSignifier >= 0x20000000000000000000000000000 ? 113 : 112; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 808](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L808) + + ```solidity + xExponent = 0x7FFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 810](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L810) + + ```solidity + } else if (xExponent + msb + 16380 < yExponent) { // Underflow + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 814](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L814) + + ```solidity + if (xExponent + 16380 > yExponent) + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 815](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L815) + + ```solidity + xSignifier <<= xExponent + 16380 - yExponent; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 816](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L816) + + ```solidity + else if (xExponent + 16380 < yExponent) + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 817](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L817) + + ```solidity + xSignifier >>= yExponent - xExponent - 16380; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 821](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L821) + + ```solidity + if (msb > 112) + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 822](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L822) + + ```solidity + xSignifier >>= msb - 112; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 824](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L824) + + ```solidity + xSignifier &= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 829](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L829) + + ```solidity + return bytes16 (uint128 (uint128 ((x ^ y) & 0x80000000000000000000000000000000) | + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 830](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L830) + + ```solidity + xExponent << 112 | xSignifier)); + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 843](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L843) + + ```solidity + return x ^ 0x80000000000000000000000000000000; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 855](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L855) + + ```solidity + return x & 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 867](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L867) + + ```solidity + if (uint128 (x) > 0x80000000000000000000000000000000) return NaN; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 869](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L869) + + ```solidity + uint256 xExponent = uint128 (x) >> 112 & 0x7FFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 870](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L870) + + ```solidity + if (xExponent == 0x7FFF) return x; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 872](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L872) + + ```solidity + uint256 xSignifier = uint128 (x) & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 874](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L874) + + ```solidity + else xSignifier |= 0x10000000000000000000000000000; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 879](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L879) + + ```solidity + xExponent = xExponent + 16383 >> 1; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 882](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L882) + + ```solidity + if (xSignifier >= 0x10000000000000000000000000000) + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 883](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L883) + + ```solidity + xSignifier <<= 113; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 886](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L886) + + ```solidity + uint256 shift = (226 - msb) & 0xFE; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 888](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L888) + + ```solidity + xExponent -= shift - 112 >> 1; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 891](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L891) + + ```solidity + if (xSignifier >= 0x10000000000000000000000000000) + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 892](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L892) + + ```solidity + xSignifier <<= 112; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 895](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L895) + + ```solidity + uint256 shift = (225 - msb) & 0xFE; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 897](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L897) + + ```solidity + xExponent -= shift - 112 >> 1; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 901](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L901) + + ```solidity + uint256 r = 0x10000000000000000000000000000; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 912](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L912) + + ```solidity + return bytes16 (uint128 (xExponent << 112 | r & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF)); + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 926](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L926) + + ```solidity + if (uint128 (x) > 0x80000000000000000000000000000000) return NaN; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 927](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L927) + + ```solidity + else if (x == 0x3FFF0000000000000000000000000000) return POSITIVE_ZERO; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 929](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L929) + + ```solidity + uint256 xExponent = uint128 (x) >> 112 & 0x7FFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 930](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L930) + + ```solidity + if (xExponent == 0x7FFF) return x; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 932](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L932) + + ```solidity + uint256 xSignifier = uint128 (x) & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 934](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L934) + + ```solidity + else xSignifier |= 0x10000000000000000000000000000; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 939](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L939) + + ```solidity + uint256 resultExponent = 16495; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 942](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L942) + + ```solidity + if (xExponent >= 0x3FFF) { + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 944](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L944) + + ```solidity + resultSignifier = xExponent - 0x3FFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 945](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L945) + + ```solidity + xSignifier <<= 15; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 948](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L948) + + ```solidity + if (xSignifier >= 0x10000000000000000000000000000) { + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 949](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L949) + + ```solidity + resultSignifier = 0x3FFE - xExponent; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 950](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L950) + + ```solidity + xSignifier <<= 15; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 954](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L954) + + ```solidity + xSignifier <<= 127 - msb; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 958](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L958) + + ```solidity + if (xSignifier == 0x80000000000000000000000000000000) { + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 960](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L960) + + ```solidity + uint256 shift = 112 - mostSignificantBit (resultSignifier); + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 965](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L965) + + ```solidity + while (resultSignifier < 0x10000000000000000000000000000) { + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 972](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L972) + + ```solidity + xSignifier >>= 127 + b; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 976](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L976) + + ```solidity + return bytes16 (uint128 ((resultNegative ? 0x80000000000000000000000000000000 : 0) | + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 977](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L977) + + ```solidity + resultExponent << 112 | resultSignifier & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF)); + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1003](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1003) + + ```solidity + bool xNegative = uint128 (x) > 0x80000000000000000000000000000000; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1004](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1004) + + ```solidity + uint256 xExponent = uint128 (x) >> 112 & 0x7FFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1005](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1005) + + ```solidity + uint256 xSignifier = uint128 (x) & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1007](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1007) + + ```solidity + if (xExponent == 0x7FFF && xSignifier != 0) return NaN; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1010](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1010) + + ```solidity + else if (xExponent < 16255) + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1011](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1011) + + ```solidity + return 0x3FFF0000000000000000000000000000; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1014](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1014) + + ```solidity + else xSignifier |= 0x10000000000000000000000000000; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1016](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1016) + + ```solidity + if (xExponent > 16367) + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1017](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1017) + + ```solidity + xSignifier <<= xExponent - 16367; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1018](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1018) + + ```solidity + else if (xExponent < 16367) + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1019](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1019) + + ```solidity + xSignifier >>= 16367 - xExponent; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1027](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1027) + + ```solidity + uint256 resultExponent = xSignifier >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1034](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1034) + + ```solidity + uint256 resultSignifier = 0x80000000000000000000000000000000; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1035](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1035) + + ```solidity + if (xSignifier & 0x80000000000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x16A09E667F3BCC908B2FB1366EA957D3E >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1036](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1036) + + ```solidity + if (xSignifier & 0x40000000000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x1306FE0A31B7152DE8D5A46305C85EDEC >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1037](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1037) + + ```solidity + if (xSignifier & 0x20000000000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x1172B83C7D517ADCDF7C8C50EB14A791F >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1038](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1038) + + ```solidity + if (xSignifier & 0x10000000000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x10B5586CF9890F6298B92B71842A98363 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1039](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1039) + + ```solidity + if (xSignifier & 0x8000000000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x1059B0D31585743AE7C548EB68CA417FD >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1040](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1040) + + ```solidity + if (xSignifier & 0x4000000000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x102C9A3E778060EE6F7CACA4F7A29BDE8 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1041](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1041) + + ```solidity + if (xSignifier & 0x2000000000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x10163DA9FB33356D84A66AE336DCDFA3F >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1042](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1042) + + ```solidity + if (xSignifier & 0x1000000000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x100B1AFA5ABCBED6129AB13EC11DC9543 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1043](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1043) + + ```solidity + if (xSignifier & 0x800000000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x10058C86DA1C09EA1FF19D294CF2F679B >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1044](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1044) + + ```solidity + if (xSignifier & 0x400000000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x1002C605E2E8CEC506D21BFC89A23A00F >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1045](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1045) + + ```solidity + if (xSignifier & 0x200000000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x100162F3904051FA128BCA9C55C31E5DF >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1046](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1046) + + ```solidity + if (xSignifier & 0x100000000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x1000B175EFFDC76BA38E31671CA939725 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1047](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1047) + + ```solidity + if (xSignifier & 0x80000000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x100058BA01FB9F96D6CACD4B180917C3D >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1048](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1048) + + ```solidity + if (xSignifier & 0x40000000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x10002C5CC37DA9491D0985C348C68E7B3 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1049](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1049) + + ```solidity + if (xSignifier & 0x20000000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x1000162E525EE054754457D5995292026 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1050](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1050) + + ```solidity + if (xSignifier & 0x10000000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x10000B17255775C040618BF4A4ADE83FC >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1051](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1051) + + ```solidity + if (xSignifier & 0x8000000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x1000058B91B5BC9AE2EED81E9B7D4CFAB >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1052](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1052) + + ```solidity + if (xSignifier & 0x4000000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x100002C5C89D5EC6CA4D7C8ACC017B7C9 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1053](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1053) + + ```solidity + if (xSignifier & 0x2000000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x10000162E43F4F831060E02D839A9D16D >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1054](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1054) + + ```solidity + if (xSignifier & 0x1000000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x100000B1721BCFC99D9F890EA06911763 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1055](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1055) + + ```solidity + if (xSignifier & 0x800000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x10000058B90CF1E6D97F9CA14DBCC1628 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1056](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1056) + + ```solidity + if (xSignifier & 0x400000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x1000002C5C863B73F016468F6BAC5CA2B >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1057](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1057) + + ```solidity + if (xSignifier & 0x200000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x100000162E430E5A18F6119E3C02282A5 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1058](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1058) + + ```solidity + if (xSignifier & 0x100000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x1000000B1721835514B86E6D96EFD1BFE >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1059](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1059) + + ```solidity + if (xSignifier & 0x80000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x100000058B90C0B48C6BE5DF846C5B2EF >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1060](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1060) + + ```solidity + if (xSignifier & 0x40000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x10000002C5C8601CC6B9E94213C72737A >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1061](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1061) + + ```solidity + if (xSignifier & 0x20000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x1000000162E42FFF037DF38AA2B219F06 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1062](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1062) + + ```solidity + if (xSignifier & 0x10000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x10000000B17217FBA9C739AA5819F44F9 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1063](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1063) + + ```solidity + if (xSignifier & 0x8000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x1000000058B90BFCDEE5ACD3C1CEDC823 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1064](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1064) + + ```solidity + if (xSignifier & 0x4000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x100000002C5C85FE31F35A6A30DA1BE50 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1065](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1065) + + ```solidity + if (xSignifier & 0x2000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x10000000162E42FF0999CE3541B9FFFCF >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1066](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1066) + + ```solidity + if (xSignifier & 0x1000000000000000000000000 > 0) resultSignifier = resultSignifier * 0x100000000B17217F80F4EF5AADDA45554 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1067](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1067) + + ```solidity + if (xSignifier & 0x800000000000000000000000 > 0) resultSignifier = resultSignifier * 0x10000000058B90BFBF8479BD5A81B51AD >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1068](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1068) + + ```solidity + if (xSignifier & 0x400000000000000000000000 > 0) resultSignifier = resultSignifier * 0x1000000002C5C85FDF84BD62AE30A74CC >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1069](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1069) + + ```solidity + if (xSignifier & 0x200000000000000000000000 > 0) resultSignifier = resultSignifier * 0x100000000162E42FEFB2FED257559BDAA >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1070](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1070) + + ```solidity + if (xSignifier & 0x100000000000000000000000 > 0) resultSignifier = resultSignifier * 0x1000000000B17217F7D5A7716BBA4A9AE >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1071](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1071) + + ```solidity + if (xSignifier & 0x80000000000000000000000 > 0) resultSignifier = resultSignifier * 0x100000000058B90BFBE9DDBAC5E109CCE >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1072](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1072) + + ```solidity + if (xSignifier & 0x40000000000000000000000 > 0) resultSignifier = resultSignifier * 0x10000000002C5C85FDF4B15DE6F17EB0D >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1073](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1073) + + ```solidity + if (xSignifier & 0x20000000000000000000000 > 0) resultSignifier = resultSignifier * 0x1000000000162E42FEFA494F1478FDE05 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1074](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1074) + + ```solidity + if (xSignifier & 0x10000000000000000000000 > 0) resultSignifier = resultSignifier * 0x10000000000B17217F7D20CF927C8E94C >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1075](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1075) + + ```solidity + if (xSignifier & 0x8000000000000000000000 > 0) resultSignifier = resultSignifier * 0x1000000000058B90BFBE8F71CB4E4B33D >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1076](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1076) + + ```solidity + if (xSignifier & 0x4000000000000000000000 > 0) resultSignifier = resultSignifier * 0x100000000002C5C85FDF477B662B26945 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1077](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1077) + + ```solidity + if (xSignifier & 0x2000000000000000000000 > 0) resultSignifier = resultSignifier * 0x10000000000162E42FEFA3AE53369388C >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1078](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1078) + + ```solidity + if (xSignifier & 0x1000000000000000000000 > 0) resultSignifier = resultSignifier * 0x100000000000B17217F7D1D351A389D40 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1079](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1079) + + ```solidity + if (xSignifier & 0x800000000000000000000 > 0) resultSignifier = resultSignifier * 0x10000000000058B90BFBE8E8B2D3D4EDE >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1080](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1080) + + ```solidity + if (xSignifier & 0x400000000000000000000 > 0) resultSignifier = resultSignifier * 0x1000000000002C5C85FDF4741BEA6E77E >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1081](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1081) + + ```solidity + if (xSignifier & 0x200000000000000000000 > 0) resultSignifier = resultSignifier * 0x100000000000162E42FEFA39FE95583C2 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1082](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1082) + + ```solidity + if (xSignifier & 0x100000000000000000000 > 0) resultSignifier = resultSignifier * 0x1000000000000B17217F7D1CFB72B45E1 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1083](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1083) + + ```solidity + if (xSignifier & 0x80000000000000000000 > 0) resultSignifier = resultSignifier * 0x100000000000058B90BFBE8E7CC35C3F0 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1084](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1084) + + ```solidity + if (xSignifier & 0x40000000000000000000 > 0) resultSignifier = resultSignifier * 0x10000000000002C5C85FDF473E242EA38 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1085](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1085) + + ```solidity + if (xSignifier & 0x20000000000000000000 > 0) resultSignifier = resultSignifier * 0x1000000000000162E42FEFA39F02B772C >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1086](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1086) + + ```solidity + if (xSignifier & 0x10000000000000000000 > 0) resultSignifier = resultSignifier * 0x10000000000000B17217F7D1CF7D83C1A >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1087](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1087) + + ```solidity + if (xSignifier & 0x8000000000000000000 > 0) resultSignifier = resultSignifier * 0x1000000000000058B90BFBE8E7BDCBE2E >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1088](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1088) + + ```solidity + if (xSignifier & 0x4000000000000000000 > 0) resultSignifier = resultSignifier * 0x100000000000002C5C85FDF473DEA871F >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1089](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1089) + + ```solidity + if (xSignifier & 0x2000000000000000000 > 0) resultSignifier = resultSignifier * 0x10000000000000162E42FEFA39EF44D91 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1090](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1090) + + ```solidity + if (xSignifier & 0x1000000000000000000 > 0) resultSignifier = resultSignifier * 0x100000000000000B17217F7D1CF79E949 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1091](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1091) + + ```solidity + if (xSignifier & 0x800000000000000000 > 0) resultSignifier = resultSignifier * 0x10000000000000058B90BFBE8E7BCE544 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1092](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1092) + + ```solidity + if (xSignifier & 0x400000000000000000 > 0) resultSignifier = resultSignifier * 0x1000000000000002C5C85FDF473DE6ECA >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1093](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1093) + + ```solidity + if (xSignifier & 0x200000000000000000 > 0) resultSignifier = resultSignifier * 0x100000000000000162E42FEFA39EF366F >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1094](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1094) + + ```solidity + if (xSignifier & 0x100000000000000000 > 0) resultSignifier = resultSignifier * 0x1000000000000000B17217F7D1CF79AFA >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1095](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1095) + + ```solidity + if (xSignifier & 0x80000000000000000 > 0) resultSignifier = resultSignifier * 0x100000000000000058B90BFBE8E7BCD6D >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1096](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1096) + + ```solidity + if (xSignifier & 0x40000000000000000 > 0) resultSignifier = resultSignifier * 0x10000000000000002C5C85FDF473DE6B2 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1097](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1097) + + ```solidity + if (xSignifier & 0x20000000000000000 > 0) resultSignifier = resultSignifier * 0x1000000000000000162E42FEFA39EF358 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1098](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1098) + + ```solidity + if (xSignifier & 0x10000000000000000 > 0) resultSignifier = resultSignifier * 0x10000000000000000B17217F7D1CF79AB >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1099](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1099) + + ```solidity + if (xSignifier & 0x8000000000000000 > 0) resultSignifier = resultSignifier * 0x1000000000000000058B90BFBE8E7BCD5 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1100](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1100) + + ```solidity + if (xSignifier & 0x4000000000000000 > 0) resultSignifier = resultSignifier * 0x100000000000000002C5C85FDF473DE6A >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1101](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1101) + + ```solidity + if (xSignifier & 0x2000000000000000 > 0) resultSignifier = resultSignifier * 0x10000000000000000162E42FEFA39EF34 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1102](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1102) + + ```solidity + if (xSignifier & 0x1000000000000000 > 0) resultSignifier = resultSignifier * 0x100000000000000000B17217F7D1CF799 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1103](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1103) + + ```solidity + if (xSignifier & 0x800000000000000 > 0) resultSignifier = resultSignifier * 0x10000000000000000058B90BFBE8E7BCC >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1104](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1104) + + ```solidity + if (xSignifier & 0x400000000000000 > 0) resultSignifier = resultSignifier * 0x1000000000000000002C5C85FDF473DE5 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1105](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1105) + + ```solidity + if (xSignifier & 0x200000000000000 > 0) resultSignifier = resultSignifier * 0x100000000000000000162E42FEFA39EF2 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1106](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1106) + + ```solidity + if (xSignifier & 0x100000000000000 > 0) resultSignifier = resultSignifier * 0x1000000000000000000B17217F7D1CF78 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1107](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1107) + + ```solidity + if (xSignifier & 0x80000000000000 > 0) resultSignifier = resultSignifier * 0x100000000000000000058B90BFBE8E7BB >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1108](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1108) + + ```solidity + if (xSignifier & 0x40000000000000 > 0) resultSignifier = resultSignifier * 0x10000000000000000002C5C85FDF473DD >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1109](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1109) + + ```solidity + if (xSignifier & 0x20000000000000 > 0) resultSignifier = resultSignifier * 0x1000000000000000000162E42FEFA39EE >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1110](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1110) + + ```solidity + if (xSignifier & 0x10000000000000 > 0) resultSignifier = resultSignifier * 0x10000000000000000000B17217F7D1CF6 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1111](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1111) + + ```solidity + if (xSignifier & 0x8000000000000 > 0) resultSignifier = resultSignifier * 0x1000000000000000000058B90BFBE8E7A >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1112](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1112) + + ```solidity + if (xSignifier & 0x4000000000000 > 0) resultSignifier = resultSignifier * 0x100000000000000000002C5C85FDF473C >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1113](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1113) + + ```solidity + if (xSignifier & 0x2000000000000 > 0) resultSignifier = resultSignifier * 0x10000000000000000000162E42FEFA39D >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1114](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1114) + + ```solidity + if (xSignifier & 0x1000000000000 > 0) resultSignifier = resultSignifier * 0x100000000000000000000B17217F7D1CE >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1115](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1115) + + ```solidity + if (xSignifier & 0x800000000000 > 0) resultSignifier = resultSignifier * 0x10000000000000000000058B90BFBE8E6 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1116](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1116) + + ```solidity + if (xSignifier & 0x400000000000 > 0) resultSignifier = resultSignifier * 0x1000000000000000000002C5C85FDF472 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1117](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1117) + + ```solidity + if (xSignifier & 0x200000000000 > 0) resultSignifier = resultSignifier * 0x100000000000000000000162E42FEFA38 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1118](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1118) + + ```solidity + if (xSignifier & 0x100000000000 > 0) resultSignifier = resultSignifier * 0x1000000000000000000000B17217F7D1B >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1119](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1119) + + ```solidity + if (xSignifier & 0x80000000000 > 0) resultSignifier = resultSignifier * 0x100000000000000000000058B90BFBE8D >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1120](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1120) + + ```solidity + if (xSignifier & 0x40000000000 > 0) resultSignifier = resultSignifier * 0x10000000000000000000002C5C85FDF46 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1121](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1121) + + ```solidity + if (xSignifier & 0x20000000000 > 0) resultSignifier = resultSignifier * 0x1000000000000000000000162E42FEFA2 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1122](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1122) + + ```solidity + if (xSignifier & 0x10000000000 > 0) resultSignifier = resultSignifier * 0x10000000000000000000000B17217F7D0 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1123](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1123) + + ```solidity + if (xSignifier & 0x8000000000 > 0) resultSignifier = resultSignifier * 0x1000000000000000000000058B90BFBE7 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1124](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1124) + + ```solidity + if (xSignifier & 0x4000000000 > 0) resultSignifier = resultSignifier * 0x100000000000000000000002C5C85FDF3 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1125](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1125) + + ```solidity + if (xSignifier & 0x2000000000 > 0) resultSignifier = resultSignifier * 0x10000000000000000000000162E42FEF9 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1126](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1126) + + ```solidity + if (xSignifier & 0x1000000000 > 0) resultSignifier = resultSignifier * 0x100000000000000000000000B17217F7C >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1127](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1127) + + ```solidity + if (xSignifier & 0x800000000 > 0) resultSignifier = resultSignifier * 0x10000000000000000000000058B90BFBD >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1128](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1128) + + ```solidity + if (xSignifier & 0x400000000 > 0) resultSignifier = resultSignifier * 0x1000000000000000000000002C5C85FDE >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1129](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1129) + + ```solidity + if (xSignifier & 0x200000000 > 0) resultSignifier = resultSignifier * 0x100000000000000000000000162E42FEE >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1130](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1130) + + ```solidity + if (xSignifier & 0x100000000 > 0) resultSignifier = resultSignifier * 0x1000000000000000000000000B17217F6 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1131](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1131) + + ```solidity + if (xSignifier & 0x80000000 > 0) resultSignifier = resultSignifier * 0x100000000000000000000000058B90BFA >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1132](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1132) + + ```solidity + if (xSignifier & 0x40000000 > 0) resultSignifier = resultSignifier * 0x10000000000000000000000002C5C85FC >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1133](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1133) + + ```solidity + if (xSignifier & 0x20000000 > 0) resultSignifier = resultSignifier * 0x1000000000000000000000000162E42FD >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1134](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1134) + + ```solidity + if (xSignifier & 0x10000000 > 0) resultSignifier = resultSignifier * 0x10000000000000000000000000B17217E >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1135](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1135) + + ```solidity + if (xSignifier & 0x8000000 > 0) resultSignifier = resultSignifier * 0x1000000000000000000000000058B90BE >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1136](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1136) + + ```solidity + if (xSignifier & 0x4000000 > 0) resultSignifier = resultSignifier * 0x100000000000000000000000002C5C85E >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1137](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1137) + + ```solidity + if (xSignifier & 0x2000000 > 0) resultSignifier = resultSignifier * 0x10000000000000000000000000162E42E >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1138](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1138) + + ```solidity + if (xSignifier & 0x1000000 > 0) resultSignifier = resultSignifier * 0x100000000000000000000000000B17216 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1139](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1139) + + ```solidity + if (xSignifier & 0x800000 > 0) resultSignifier = resultSignifier * 0x10000000000000000000000000058B90A >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1140](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1140) + + ```solidity + if (xSignifier & 0x400000 > 0) resultSignifier = resultSignifier * 0x1000000000000000000000000002C5C84 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1141](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1141) + + ```solidity + if (xSignifier & 0x200000 > 0) resultSignifier = resultSignifier * 0x100000000000000000000000000162E41 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1142](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1142) + + ```solidity + if (xSignifier & 0x100000 > 0) resultSignifier = resultSignifier * 0x1000000000000000000000000000B1720 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1143](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1143) + + ```solidity + if (xSignifier & 0x80000 > 0) resultSignifier = resultSignifier * 0x100000000000000000000000000058B8F >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1144](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1144) + + ```solidity + if (xSignifier & 0x40000 > 0) resultSignifier = resultSignifier * 0x10000000000000000000000000002C5C7 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1145](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1145) + + ```solidity + if (xSignifier & 0x20000 > 0) resultSignifier = resultSignifier * 0x1000000000000000000000000000162E3 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1146](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1146) + + ```solidity + if (xSignifier & 0x10000 > 0) resultSignifier = resultSignifier * 0x10000000000000000000000000000B171 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1147](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1147) + + ```solidity + if (xSignifier & 0x8000 > 0) resultSignifier = resultSignifier * 0x1000000000000000000000000000058B8 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1148](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1148) + + ```solidity + if (xSignifier & 0x4000 > 0) resultSignifier = resultSignifier * 0x100000000000000000000000000002C5B >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1149](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1149) + + ```solidity + if (xSignifier & 0x2000 > 0) resultSignifier = resultSignifier * 0x10000000000000000000000000000162D >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1150](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1150) + + ```solidity + if (xSignifier & 0x1000 > 0) resultSignifier = resultSignifier * 0x100000000000000000000000000000B16 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1151](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1151) + + ```solidity + if (xSignifier & 0x800 > 0) resultSignifier = resultSignifier * 0x10000000000000000000000000000058A >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1152](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1152) + + ```solidity + if (xSignifier & 0x400 > 0) resultSignifier = resultSignifier * 0x1000000000000000000000000000002C4 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1153](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1153) + + ```solidity + if (xSignifier & 0x200 > 0) resultSignifier = resultSignifier * 0x100000000000000000000000000000161 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1154](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1154) + + ```solidity + if (xSignifier & 0x100 > 0) resultSignifier = resultSignifier * 0x1000000000000000000000000000000B0 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1155](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1155) + + ```solidity + if (xSignifier & 0x80 > 0) resultSignifier = resultSignifier * 0x100000000000000000000000000000057 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1156](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1156) + + ```solidity + if (xSignifier & 0x40 > 0) resultSignifier = resultSignifier * 0x10000000000000000000000000000002B >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1157](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1157) + + ```solidity + if (xSignifier & 0x20 > 0) resultSignifier = resultSignifier * 0x100000000000000000000000000000015 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1158](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1158) + + ```solidity + if (xSignifier & 0x10 > 0) resultSignifier = resultSignifier * 0x10000000000000000000000000000000A >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1159](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1159) + + ```solidity + if (xSignifier & 0x8 > 0) resultSignifier = resultSignifier * 0x100000000000000000000000000000004 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1160](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1160) + + ```solidity + if (xSignifier & 0x4 > 0) resultSignifier = resultSignifier * 0x100000000000000000000000000000001 >> 128; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1163](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1163) + + ```solidity + resultSignifier = resultSignifier >> 15 & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1164](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1164) + + ```solidity + resultExponent += 0x3FFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1165](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1165) + + ```solidity + } else if (resultExponent <= 0x3FFE) { + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1166](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1166) + + ```solidity + resultSignifier = resultSignifier >> 15 & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFF; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1167](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1167) + + ```solidity + resultExponent = 0x3FFF - resultExponent; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1169](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1169) + + ```solidity + resultSignifier = resultSignifier >> resultExponent - 16367; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1173](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1173) + + ```solidity + return bytes16 (uint128 (resultExponent << 112 | resultSignifier)); + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1203](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1203) + + ```solidity + if (x >= 0x100000000000000000000000000000000) { x >>= 128; result += 128; } + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1204](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1204) + + ```solidity + if (x >= 0x10000000000000000) { x >>= 64; result += 64; } + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1205](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1205) + + ```solidity + if (x >= 0x100000000) { x >>= 32; result += 32; } + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1206](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1206) + + ```solidity + if (x >= 0x10000) { x >>= 16; result += 16; } + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1207](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1207) + + ```solidity + if (x >= 0x100) { x >>= 8; result += 8; } + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1208](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1208) + + ```solidity + if (x >= 0x10) { x >>= 4; result += 4; } + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1209](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1209) + + ```solidity + if (x >= 0x4) { x >>= 2; result += 2; } + ``` + +- Found in contracts/v2/safeGuards/SafeForked.sol [Line: 69](../tests/2024-07-templegold/protocol/contracts/v2/safeGuards/SafeForked.sol#L69) + + ```solidity + require(signatures.length >= requiredSignatures * 65, "!Dynamic Signature Threshold"); + ``` + +- Found in contracts/v2/safeGuards/SafeForked.sol [Line: 88](../tests/2024-07-templegold/protocol/contracts/v2/safeGuards/SafeForked.sol#L88) + + ```solidity + require(uint256(s) >= (requiredSignatures * 65), "GS021"); + ``` + +- Found in contracts/v2/safeGuards/SafeForked.sol [Line: 91](../tests/2024-07-templegold/protocol/contracts/v2/safeGuards/SafeForked.sol#L91) + + ```solidity + require((uint256(s) + 32) <= signatures.length, "GS022"); + ``` + +- Found in contracts/v2/safeGuards/SafeForked.sol [Line: 100](../tests/2024-07-templegold/protocol/contracts/v2/safeGuards/SafeForked.sol#L100) + + ```solidity + require((uint256(s) + 32 + contractSignatureLen) <= signatures.length, "GS023"); + ``` + +
+ + + +## L-8: Event is missing `indexed` fields + +Index event fields make the field more quickly accessible to off-chain tools that parse events. However, note that each index field costs extra gas during emission, so it's not necessarily best to index the maximum allowed per event (three fields). Each event should use three indexed fields if there are three or more fields, and gas usage is not particularly of concern for the events in question. If there are fewer than three fields, all of the fields should be indexed. + +
162 Found Instances + + +- Found in contracts/admin/TempleTeamPayments.sol [Line: 16](../tests/2024-07-templegold/protocol/contracts/admin/TempleTeamPayments.sol#L16) + + ```solidity + event Claimed(address indexed member, uint256 amount); + ``` + +- Found in contracts/admin/TempleTeamPaymentsFactory.sol [Line: 38](../tests/2024-07-templegold/protocol/contracts/admin/TempleTeamPaymentsFactory.sol#L38) + + ```solidity + event TokenRecovered(address indexed token, uint256 amount); + ``` + +- Found in contracts/admin/TempleTeamPaymentsV2.sol [Line: 20](../tests/2024-07-templegold/protocol/contracts/admin/TempleTeamPaymentsV2.sol#L20) + + ```solidity + event Claimed(address indexed member, uint256 amount); + ``` + +- Found in contracts/admin/TempleTeamPaymentsV2.sol [Line: 21](../tests/2024-07-templegold/protocol/contracts/admin/TempleTeamPaymentsV2.sol#L21) + + ```solidity + event TokenRecovered(address indexed token, uint256 amount); + ``` + +- Found in contracts/admin/TempleTeamPaymentsV2.sol [Line: 22](../tests/2024-07-templegold/protocol/contracts/admin/TempleTeamPaymentsV2.sol#L22) + + ```solidity + event MemberToggled(address indexed member, bool status); + ``` + +- Found in contracts/admin/TempleTeamPaymentsV2.sol [Line: 23](../tests/2024-07-templegold/protocol/contracts/admin/TempleTeamPaymentsV2.sol#L23) + + ```solidity + event AllocationSet(address indexed member, uint256 allocation); + ``` + +- Found in contracts/amm/TempleUniswapV2Pair.sol [Line: 54](../tests/2024-07-templegold/protocol/contracts/amm/TempleUniswapV2Pair.sol#L54) + + ```solidity + event Mint(address indexed sender, uint amount0, uint amount1); + ``` + +- Found in contracts/amm/TempleUniswapV2Pair.sol [Line: 55](../tests/2024-07-templegold/protocol/contracts/amm/TempleUniswapV2Pair.sol#L55) + + ```solidity + event Burn(address indexed sender, uint amount0, uint amount1, address indexed to); + ``` + +- Found in contracts/amm/TempleUniswapV2Pair.sol [Line: 56](../tests/2024-07-templegold/protocol/contracts/amm/TempleUniswapV2Pair.sol#L56) + + ```solidity + event Swap( + ``` + +- Found in contracts/amm/TempleUniswapV2Pair.sol [Line: 64](../tests/2024-07-templegold/protocol/contracts/amm/TempleUniswapV2Pair.sol#L64) + + ```solidity + event Sync(uint112 reserve0, uint112 reserve1); + ``` + +- Found in contracts/common/CommonEventsAndErrors.sol [Line: 14](../tests/2024-07-templegold/protocol/contracts/common/CommonEventsAndErrors.sol#L14) + + ```solidity + event TokenRecovered(address indexed to, address indexed token, uint256 amount); + ``` + +- Found in contracts/core/Exposure.sol [Line: 138](../tests/2024-07-templegold/protocol/contracts/core/Exposure.sol#L138) + + ```solidity + event IncreaseReval(uint256 oldVal, uint256 newVal); + ``` + +- Found in contracts/core/Exposure.sol [Line: 139](../tests/2024-07-templegold/protocol/contracts/core/Exposure.sol#L139) + + ```solidity + event DecreaseReval(uint256 oldVal, uint256 newVal); + ``` + +- Found in contracts/core/Exposure.sol [Line: 140](../tests/2024-07-templegold/protocol/contracts/core/Exposure.sol#L140) + + ```solidity + event SetLiquidator(address liquidator); + ``` + +- Found in contracts/core/Exposure.sol [Line: 141](../tests/2024-07-templegold/protocol/contracts/core/Exposure.sol#L141) + + ```solidity + event SetMinterState(address account, bool state); + ``` + +- Found in contracts/core/Exposure.sol [Line: 142](../tests/2024-07-templegold/protocol/contracts/core/Exposure.sol#L142) + + ```solidity + event Redeem(address revalToken, address caller, address to, uint256 amount); + ``` + +- Found in contracts/core/JoiningFee.sol [Line: 51](../tests/2024-07-templegold/protocol/contracts/core/JoiningFee.sol#L51) + + ```solidity + event SetJoiningFee(address vault, uint256 amount); + ``` + +- Found in contracts/core/OpsManager.sol [Line: 182](../tests/2024-07-templegold/protocol/contracts/core/OpsManager.sol#L182) + + ```solidity + event CreateVaultInstance(address vault); + ``` + +- Found in contracts/core/OpsManager.sol [Line: 183](../tests/2024-07-templegold/protocol/contracts/core/OpsManager.sol#L183) + + ```solidity + event CreateExposure(address exposure, address primaryRevenue); + ``` + +- Found in contracts/core/OtcOffer.sol [Line: 62](../tests/2024-07-templegold/protocol/contracts/core/OtcOffer.sol#L62) + + ```solidity + event OfferPriceSet(uint256 _offerPrice); + ``` + +- Found in contracts/core/OtcOffer.sol [Line: 63](../tests/2024-07-templegold/protocol/contracts/core/OtcOffer.sol#L63) + + ```solidity + event OfferPriceRangeSet(uint128 minValidOfferPrice, uint128 maxValidOfferPrice); + ``` + +- Found in contracts/core/OtcOffer.sol [Line: 64](../tests/2024-07-templegold/protocol/contracts/core/OtcOffer.sol#L64) + + ```solidity + event Swap(address indexed account, address indexed fundsOwner, uint256 userSellTokenAmount, uint256 userBuyTokenAmount); + ``` + +- Found in contracts/core/TreasuryFarmingRevenue.sol [Line: 95](../tests/2024-07-templegold/protocol/contracts/core/TreasuryFarmingRevenue.sol#L95) + + ```solidity + event IncreaseShares(address account, uint256 amount); + ``` + +- Found in contracts/core/TreasuryFarmingRevenue.sol [Line: 96](../tests/2024-07-templegold/protocol/contracts/core/TreasuryFarmingRevenue.sol#L96) + + ```solidity + event DecreaseShares(address account, uint256 amount); + ``` + +- Found in contracts/core/TreasuryFarmingRevenue.sol [Line: 97](../tests/2024-07-templegold/protocol/contracts/core/TreasuryFarmingRevenue.sol#L97) + + ```solidity + event RevenueEarned(uint256 revenueEarned, uint256 lifetimeAccRevenueScaledByShare); + ``` + +- Found in contracts/core/TreasuryFarmingRevenue.sol [Line: 98](../tests/2024-07-templegold/protocol/contracts/core/TreasuryFarmingRevenue.sol#L98) + + ```solidity + event RevenueClaimed(address account, uint256 revenueClaimed); + ``` + +- Found in contracts/core/Vault.sol [Line: 211](../tests/2024-07-templegold/protocol/contracts/core/Vault.sol#L211) + + ```solidity + event Deposit(address account, uint256 amount, uint256 amountStaked); + ``` + +- Found in contracts/core/Vault.sol [Line: 212](../tests/2024-07-templegold/protocol/contracts/core/Vault.sol#L212) + + ```solidity + event Withdraw(address account, uint256 amount); + ``` + +- Found in contracts/core/VaultEarlyWithdraw.sol [Line: 24](../tests/2024-07-templegold/protocol/contracts/core/VaultEarlyWithdraw.sol#L24) + + ```solidity + event TokenRecovered(address indexed token, address indexed to, uint256 amount); + ``` + +- Found in contracts/core/VaultEarlyWithdraw.sol [Line: 25](../tests/2024-07-templegold/protocol/contracts/core/VaultEarlyWithdraw.sol#L25) + + ```solidity + event EarlyWithdraw(address indexed addr, uint256 amount); + ``` + +- Found in contracts/core/VaultEarlyWithdraw.sol [Line: 26](../tests/2024-07-templegold/protocol/contracts/core/VaultEarlyWithdraw.sol#L26) + + ```solidity + event MinWithdrawAmountSet(uint256 amount); + ``` + +- Found in contracts/deprecated/Faith.sol [Line: 19](../tests/2024-07-templegold/protocol/contracts/deprecated/Faith.sol#L19) + + ```solidity + event Gain(address account, uint256 amount); + ``` + +- Found in contracts/deprecated/Faith.sol [Line: 20](../tests/2024-07-templegold/protocol/contracts/deprecated/Faith.sol#L20) + + ```solidity + event Loose(address account, uint256 amount); + ``` + +- Found in contracts/deprecated/LockedOGTemple.sol [Line: 23](../tests/2024-07-templegold/protocol/contracts/deprecated/LockedOGTemple.sol#L23) + + ```solidity + event OGTempleLocked(address _staker, uint256 _amount, uint256 _lockedUntil); + ``` + +- Found in contracts/deprecated/LockedOGTemple.sol [Line: 24](../tests/2024-07-templegold/protocol/contracts/deprecated/LockedOGTemple.sol#L24) + + ```solidity + event OGTempleWithdraw(address _staker, uint256 _amount); + ``` + +- Found in contracts/deprecated/TempleStaking.sol [Line: 41](../tests/2024-07-templegold/protocol/contracts/deprecated/TempleStaking.sol#L41) + + ```solidity + event StakeCompleted(address _staker, uint256 _amount, uint256 _lockedUntil); + ``` + +- Found in contracts/deprecated/TempleStaking.sol [Line: 42](../tests/2024-07-templegold/protocol/contracts/deprecated/TempleStaking.sol#L42) + + ```solidity + event AccumulationFactorUpdated(uint256 _epochsProcessed, uint256 _currentEpoch, uint256 _accumulationFactor); + ``` + +- Found in contracts/deprecated/TempleStaking.sol [Line: 43](../tests/2024-07-templegold/protocol/contracts/deprecated/TempleStaking.sol#L43) + + ```solidity + event UnstakeCompleted(address _staker, uint256 _amount); + ``` + +- Found in contracts/fakes/templegold/TempleGoldMock.sol [Line: 43](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleGoldMock.sol#L43) + + ```solidity + event ContractAuthorizationSet(address _contract, bool _whitelist); + ``` + +- Found in contracts/fakes/templegold/TempleGoldStakingMock.sol [Line: 91](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleGoldStakingMock.sol#L91) + + ```solidity + event GoldDistributionNotified(uint256 amount, uint256 timestamp); + ``` + +- Found in contracts/fakes/templegold/TempleGoldStakingMock.sol [Line: 92](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleGoldStakingMock.sol#L92) + + ```solidity + event Staked(address indexed staker, uint256 amount); + ``` + +- Found in contracts/fakes/templegold/TempleGoldStakingMock.sol [Line: 93](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleGoldStakingMock.sol#L93) + + ```solidity + event RewardPaid(address indexed staker, address toAddress, uint256 reward); + ``` + +- Found in contracts/fakes/templegold/TempleGoldStakingMock.sol [Line: 94](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleGoldStakingMock.sol#L94) + + ```solidity + event MigratorSet(address migrator); + ``` + +- Found in contracts/fakes/templegold/TempleGoldStakingMock.sol [Line: 95](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleGoldStakingMock.sol#L95) + + ```solidity + event Withdrawn(address indexed staker, address to, uint256 stakeIndex, uint256 amount); + ``` + +- Found in contracts/fakes/templegold/TempleGoldStakingMock.sol [Line: 96](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleGoldStakingMock.sol#L96) + + ```solidity + event RewardDistributionCoolDownSet(uint160 cooldown); + ``` + +- Found in contracts/fakes/templegold/TempleGoldStakingMock.sol [Line: 98](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleGoldStakingMock.sol#L98) + + ```solidity + event HalfTimeSet(uint256 halfTime); + ``` + +- Found in contracts/fakes/templegold/TempleGoldStakingMock.sol [Line: 99](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleGoldStakingMock.sol#L99) + + ```solidity + event VoteDelegateSet(address _delegate, bool _approved); + ``` + +- Found in contracts/fakes/templegold/TempleGoldStakingMock.sol [Line: 100](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleGoldStakingMock.sol#L100) + + ```solidity + event UserDelegateSet(address indexed user, address _delegate); + ``` + +- Found in contracts/fakes/templegold/TempleGoldStakingMock.sol [Line: 101](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleGoldStakingMock.sol#L101) + + ```solidity + event DelegationPeriodSet(uint32 _minimumPeriod); + ``` + +- Found in contracts/fakes/templegold/TempleGoldStakingMock.sol [Line: 102](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleGoldStakingMock.sol#L102) + + ```solidity + event VestingPeriodSet(uint32 _period); + ``` + +- Found in contracts/fakes/templegold/TempleGoldStakingMock.sol [Line: 104](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleGoldStakingMock.sol#L104) + + ```solidity + event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance); + ``` + +- Found in contracts/fakes/templegold/TempleGoldStakingMock.sol [Line: 105](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleGoldStakingMock.sol#L105) + + ```solidity + event RewardPaidIndex(address indexed staker, address toAddress, uint256 index, uint256 reward); + ``` + +- Found in contracts/fakes/templegold/TempleGoldStakingMock.sol [Line: 106](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleGoldStakingMock.sol#L106) + + ```solidity + event RewardDurationSet(uint256 duration); + ``` + +- Found in contracts/fakes/v2/strategies/DsrBaseStrategyTestnet.sol [Line: 26](../tests/2024-07-templegold/protocol/contracts/fakes/v2/strategies/DsrBaseStrategyTestnet.sol#L26) + + ```solidity + event DaiDeposited(uint256 amount); + ``` + +- Found in contracts/fakes/v2/strategies/DsrBaseStrategyTestnet.sol [Line: 27](../tests/2024-07-templegold/protocol/contracts/fakes/v2/strategies/DsrBaseStrategyTestnet.sol#L27) + + ```solidity + event DaiWithdrawn(uint256 amount); + ``` + +- Found in contracts/fakes/v2/strategies/DsrBaseStrategyTestnet.sol [Line: 28](../tests/2024-07-templegold/protocol/contracts/fakes/v2/strategies/DsrBaseStrategyTestnet.sol#L28) + + ```solidity + event DsrSet(uint256 rate); + ``` + +- Found in contracts/governance/ElderElection.sol [Line: 46](../tests/2024-07-templegold/protocol/contracts/governance/ElderElection.sol#L46) + + ```solidity + event UpdateNomination(uint256 indexed discordId, bool isNominated); + ``` + +- Found in contracts/governance/ElderElection.sol [Line: 47](../tests/2024-07-templegold/protocol/contracts/governance/ElderElection.sol#L47) + + ```solidity + event UpdateEndorsements(address indexed account, uint256[] discordIds); + ``` + +- Found in contracts/governance/Templar.sol [Line: 80](../tests/2024-07-templegold/protocol/contracts/governance/Templar.sol#L80) + + ```solidity + event BaseUriUpdated(string baseUri); + ``` + +- Found in contracts/governance/TemplarMetadata.sol [Line: 40](../tests/2024-07-templegold/protocol/contracts/governance/TemplarMetadata.sol#L40) + + ```solidity + event UpdateTempleRole(uint256 indexed discordId, string templeRole); + ``` + +- Found in contracts/interfaces/amo/IAuraStaking.sol [Line: 20](../tests/2024-07-templegold/protocol/contracts/interfaces/amo/IAuraStaking.sol#L20) + + ```solidity + event SetAuraPoolInfo(uint32 indexed pId, address token, address rewards); + ``` + +- Found in contracts/interfaces/amo/IAuraStaking.sol [Line: 21](../tests/2024-07-templegold/protocol/contracts/interfaces/amo/IAuraStaking.sol#L21) + + ```solidity + event RecoveredToken(address token, address to, uint256 amount); + ``` + +- Found in contracts/interfaces/amo/IAuraStaking.sol [Line: 22](../tests/2024-07-templegold/protocol/contracts/interfaces/amo/IAuraStaking.sol#L22) + + ```solidity + event SetRewardsRecipient(address recipient); + ``` + +- Found in contracts/interfaces/amo/IAuraStaking.sol [Line: 23](../tests/2024-07-templegold/protocol/contracts/interfaces/amo/IAuraStaking.sol#L23) + + ```solidity + event RewardTokensSet(address[] rewardTokens); + ``` + +- Found in contracts/interfaces/amo/IRamos.sol [Line: 41](../tests/2024-07-templegold/protocol/contracts/interfaces/amo/IRamos.sol#L41) + + ```solidity + event RecoveredToken(address token, address to, uint256 amount); + ``` + +- Found in contracts/interfaces/amo/IRamos.sol [Line: 42](../tests/2024-07-templegold/protocol/contracts/interfaces/amo/IRamos.sol#L42) + + ```solidity + event SetPostRebalanceDelta(uint64 deltaBps); + ``` + +- Found in contracts/interfaces/amo/IRamos.sol [Line: 43](../tests/2024-07-templegold/protocol/contracts/interfaces/amo/IRamos.sol#L43) + + ```solidity + event SetCooldown(uint64 cooldownSecs); + ``` + +- Found in contracts/interfaces/amo/IRamos.sol [Line: 44](../tests/2024-07-templegold/protocol/contracts/interfaces/amo/IRamos.sol#L44) + + ```solidity + event SetRebalancePercentageBounds(uint64 belowTpi, uint64 aboveTpi); + ``` + +- Found in contracts/interfaces/amo/IRamos.sol [Line: 47](../tests/2024-07-templegold/protocol/contracts/interfaces/amo/IRamos.sol#L47) + + ```solidity + event SetPoolHelper(address poolHelper); + ``` + +- Found in contracts/interfaces/amo/IRamos.sol [Line: 48](../tests/2024-07-templegold/protocol/contracts/interfaces/amo/IRamos.sol#L48) + + ```solidity + event SetMaxRebalanceAmounts(uint256 bptMaxAmount, uint256 quoteTokenMaxAmount, uint256 protocolTokenMaxAmount); + ``` + +- Found in contracts/interfaces/amo/IRamos.sol [Line: 49](../tests/2024-07-templegold/protocol/contracts/interfaces/amo/IRamos.sol#L49) + + ```solidity + event RebalanceFeesSet(uint256 rebalanceJoinFeeBps, uint256 rebalanceExitFeeBps); + ``` + +- Found in contracts/interfaces/amo/IRamos.sol [Line: 53](../tests/2024-07-templegold/protocol/contracts/interfaces/amo/IRamos.sol#L53) + + ```solidity + event RebalanceUpExit(uint256 bptAmountIn, uint256 protocolTokenRepaid, uint256 protocolTokenFee); + ``` + +- Found in contracts/interfaces/amo/IRamos.sol [Line: 54](../tests/2024-07-templegold/protocol/contracts/interfaces/amo/IRamos.sol#L54) + + ```solidity + event RebalanceDownExit(uint256 bptAmountIn, uint256 quoteTokenRepaid, uint256 quoteTokenFee); + ``` + +- Found in contracts/interfaces/amo/IRamos.sol [Line: 55](../tests/2024-07-templegold/protocol/contracts/interfaces/amo/IRamos.sol#L55) + + ```solidity + event RebalanceUpJoin(uint256 quoteTokenAmountIn, uint256 bptTokensStaked, uint256 quoteTokenFee); + ``` + +- Found in contracts/interfaces/amo/IRamos.sol [Line: 56](../tests/2024-07-templegold/protocol/contracts/interfaces/amo/IRamos.sol#L56) + + ```solidity + event RebalanceDownJoin(uint256 protocolTokenAmountIn, uint256 bptTokensStaked, uint256 protocolTokenFee); + ``` + +- Found in contracts/interfaces/amo/IRamos.sol [Line: 59](../tests/2024-07-templegold/protocol/contracts/interfaces/amo/IRamos.sol#L59) + + ```solidity + event LiquidityAdded(uint256 quoteTokenAdded, uint256 protocolTokenAdded, uint256 bptReceived); + ``` + +- Found in contracts/interfaces/amo/IRamos.sol [Line: 60](../tests/2024-07-templegold/protocol/contracts/interfaces/amo/IRamos.sol#L60) + + ```solidity + event LiquidityRemoved(uint256 quoteTokenReceived, uint256 protocolTokenReceived, uint256 bptRemoved); + ``` + +- Found in contracts/interfaces/amo/IRamos.sol [Line: 61](../tests/2024-07-templegold/protocol/contracts/interfaces/amo/IRamos.sol#L61) + + ```solidity + event DepositAndStakeBptTokens(uint256 bptAmount); + ``` + +- Found in contracts/interfaces/core/IMultiOtcOffer.sol [Line: 29](../tests/2024-07-templegold/protocol/contracts/interfaces/core/IMultiOtcOffer.sol#L29) + + ```solidity + event OfferPriceSet(bytes32 marketId, uint256 _offerPrice); + ``` + +- Found in contracts/interfaces/core/IMultiOtcOffer.sol [Line: 30](../tests/2024-07-templegold/protocol/contracts/interfaces/core/IMultiOtcOffer.sol#L30) + + ```solidity + event OfferPriceRangeSet(bytes32 marketId, uint128 minValidOfferPrice, uint128 maxValidOfferPrice); + ``` + +- Found in contracts/interfaces/core/IMultiOtcOffer.sol [Line: 31](../tests/2024-07-templegold/protocol/contracts/interfaces/core/IMultiOtcOffer.sol#L31) + + ```solidity + event Swap(address indexed account, address indexed fundsOwner, bytes32 marketId, uint256 userSellTokenAmount, uint256 userBuyTokenAmount); + ``` + +- Found in contracts/interfaces/core/IMultiOtcOffer.sol [Line: 32](../tests/2024-07-templegold/protocol/contracts/interfaces/core/IMultiOtcOffer.sol#L32) + + ```solidity + event FundsOwnerSet(bytes32 marketId, address indexed fundsOwner); + ``` + +- Found in contracts/interfaces/core/IMultiOtcOffer.sol [Line: 33](../tests/2024-07-templegold/protocol/contracts/interfaces/core/IMultiOtcOffer.sol#L33) + + ```solidity + event OtcMarketAdded(bytes32 marketId, address userBuyToken, address userSellToken); + ``` + +- Found in contracts/interfaces/core/IMultiOtcOffer.sol [Line: 34](../tests/2024-07-templegold/protocol/contracts/interfaces/core/IMultiOtcOffer.sol#L34) + + ```solidity + event OtcMarketRemoved(bytes32 marketId, address userBuyToken, address userSellToken); + ``` + +- Found in contracts/interfaces/external/aura/IAuraBooster.sol [Line: 25](../tests/2024-07-templegold/protocol/contracts/interfaces/external/aura/IAuraBooster.sol#L25) + + ```solidity + event Deposited(address indexed user, uint256 indexed poolid, uint256 amount); + ``` + +- Found in contracts/interfaces/external/aura/IAuraBooster.sol [Line: 26](../tests/2024-07-templegold/protocol/contracts/interfaces/external/aura/IAuraBooster.sol#L26) + + ```solidity + event Withdrawn(address indexed user, uint256 indexed poolid, uint256 amount); + ``` + +- Found in contracts/interfaces/templegold/IAuctionBase.sol [Line: 7](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/IAuctionBase.sol#L7) + + ```solidity + event Deposit(address indexed depositor, uint256 epochId, uint256 amount); + ``` + +- Found in contracts/interfaces/templegold/IAuctionBase.sol [Line: 8](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/IAuctionBase.sol#L8) + + ```solidity + event Claim(address indexed user, uint256 epochId, uint256 bidTokenAmount, uint256 auctionTokenAmount); + ``` + +- Found in contracts/interfaces/templegold/IAuctionBase.sol [Line: 9](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/IAuctionBase.sol#L9) + + ```solidity + event AuctionStarted(uint256 epochId, address indexed starter, uint128 startTime, uint128 endTime, uint256 auctionTokenAmount); + ``` + +- Found in contracts/interfaces/templegold/IDaiGoldAuction.sol [Line: 9](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/IDaiGoldAuction.sol#L9) + + ```solidity + event BidTokenSet(address bidToken); + ``` + +- Found in contracts/interfaces/templegold/IDaiGoldAuction.sol [Line: 10](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/IDaiGoldAuction.sol#L10) + + ```solidity + event GoldDistributionNotified(uint256 amount, uint256 timestamp); + ``` + +- Found in contracts/interfaces/templegold/IDaiGoldAuction.sol [Line: 11](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/IDaiGoldAuction.sol#L11) + + ```solidity + event AuctionConfigSet(uint256 epochId, AuctionConfig config); + ``` + +- Found in contracts/interfaces/templegold/ISpiceAuction.sol [Line: 7](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ISpiceAuction.sol#L7) + + ```solidity + event AuctionConfigSet(uint256 epoch, SpiceAuctionConfig config); + ``` + +- Found in contracts/interfaces/templegold/ISpiceAuction.sol [Line: 8](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ISpiceAuction.sol#L8) + + ```solidity + event DaoExecutorSet(address daoExecutor); + ``` + +- Found in contracts/interfaces/templegold/ISpiceAuction.sol [Line: 9](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ISpiceAuction.sol#L9) + + ```solidity + event AuctionConfigRemoved(uint256 configId, uint256 epochId); + ``` + +- Found in contracts/interfaces/templegold/ISpiceAuctionFactory.sol [Line: 6](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ISpiceAuctionFactory.sol#L6) + + ```solidity + event AuctionCreated(bytes32 id, address auction); + ``` + +- Found in contracts/interfaces/templegold/ITempleGold.sol [Line: 39](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ITempleGold.sol#L39) + + ```solidity + event ContractAuthorizationSet(address indexed _contract, bool _whitelisted); + ``` + +- Found in contracts/interfaces/templegold/ITempleGold.sol [Line: 40](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ITempleGold.sol#L40) + + ```solidity + event VestingFactorSet(uint128 numerator, uint128 denominator); + ``` + +- Found in contracts/interfaces/templegold/ITempleGold.sol [Line: 41](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ITempleGold.sol#L41) + + ```solidity + event DistributionParamsSet(uint256 staking, uint256 escrow, uint256 gnosis); + ``` + +- Found in contracts/interfaces/templegold/ITempleGold.sol [Line: 42](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ITempleGold.sol#L42) + + ```solidity + event Distributed(uint256 stakingAmount, uint256 escrowAmount, uint256 gnosisAmount, uint256 timestamp); + ``` + +- Found in contracts/interfaces/templegold/ITempleGold.sol [Line: 43](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ITempleGold.sol#L43) + + ```solidity + event StakingSet(address staking); + ``` + +- Found in contracts/interfaces/templegold/ITempleGold.sol [Line: 44](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ITempleGold.sol#L44) + + ```solidity + event EscrowSet(address escrow); + ``` + +- Found in contracts/interfaces/templegold/ITempleGold.sol [Line: 45](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ITempleGold.sol#L45) + + ```solidity + event TeamGnosisSet(address gnosis); + ``` + +- Found in contracts/interfaces/templegold/ITempleGoldStaking.sol [Line: 8](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ITempleGoldStaking.sol#L8) + + ```solidity + event GoldDistributionNotified(uint256 amount, uint256 timestamp); + ``` + +- Found in contracts/interfaces/templegold/ITempleGoldStaking.sol [Line: 9](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ITempleGoldStaking.sol#L9) + + ```solidity + event Staked(address indexed staker, uint256 amount); + ``` + +- Found in contracts/interfaces/templegold/ITempleGoldStaking.sol [Line: 10](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ITempleGoldStaking.sol#L10) + + ```solidity + event MigratorSet(address migrator); + ``` + +- Found in contracts/interfaces/templegold/ITempleGoldStaking.sol [Line: 11](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ITempleGoldStaking.sol#L11) + + ```solidity + event Withdrawn(address indexed staker, address to, uint256 stakeIndex, uint256 amount); + ``` + +- Found in contracts/interfaces/templegold/ITempleGoldStaking.sol [Line: 12](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ITempleGoldStaking.sol#L12) + + ```solidity + event RewardDistributionCoolDownSet(uint160 cooldown); + ``` + +- Found in contracts/interfaces/templegold/ITempleGoldStaking.sol [Line: 14](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ITempleGoldStaking.sol#L14) + + ```solidity + event VestingPeriodSet(uint32 _period); + ``` + +- Found in contracts/interfaces/templegold/ITempleGoldStaking.sol [Line: 16](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ITempleGoldStaking.sol#L16) + + ```solidity + event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance); + ``` + +- Found in contracts/interfaces/templegold/ITempleGoldStaking.sol [Line: 17](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ITempleGoldStaking.sol#L17) + + ```solidity + event RewardPaid(address indexed staker, address toAddress, uint256 index, uint256 reward); + ``` + +- Found in contracts/interfaces/templegold/ITempleGoldStaking.sol [Line: 18](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ITempleGoldStaking.sol#L18) + + ```solidity + event RewardDurationSet(uint256 duration); + ``` + +- Found in contracts/interfaces/templegold/ITempleTeleporter.sol [Line: 9](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ITempleTeleporter.sol#L9) + + ```solidity + event TempleTeleported(uint32 dstEid, address indexed sender, address indexed recipient, uint256 amount); + ``` + +- Found in contracts/interfaces/v2/ITempleDebtToken.sol [Line: 12](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/ITempleDebtToken.sol#L12) + + ```solidity + event BaseInterestRateSet(uint96 rate); + ``` + +- Found in contracts/interfaces/v2/ITempleDebtToken.sol [Line: 13](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/ITempleDebtToken.sol#L13) + + ```solidity + event RiskPremiumInterestRateSet(address indexed debtor, uint96 rate); + ``` + +- Found in contracts/interfaces/v2/ITempleDebtToken.sol [Line: 16](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/ITempleDebtToken.sol#L16) + + ```solidity + event DebtorBalance(address indexed debtor, uint128 principal, uint128 baseInterest, uint128 riskPremiumInterest); + ``` + +- Found in contracts/interfaces/v2/ITreasuryPriceIndexOracle.sol [Line: 14](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/ITreasuryPriceIndexOracle.sol#L14) + + ```solidity + event TreasuryPriceIndexSet(uint96 oldTpi, uint96 newTpi); + ``` + +- Found in contracts/interfaces/v2/ITreasuryPriceIndexOracle.sol [Line: 15](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/ITreasuryPriceIndexOracle.sol#L15) + + ```solidity + event TpiCooldownSet(uint32 cooldownSecs); + ``` + +- Found in contracts/interfaces/v2/ITreasuryPriceIndexOracle.sol [Line: 16](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/ITreasuryPriceIndexOracle.sol#L16) + + ```solidity + event MaxTreasuryPriceIndexDeltaSet(uint256 maxDelta); + ``` + +- Found in contracts/interfaces/v2/ITreasuryReservesVault.sol [Line: 43](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/ITreasuryReservesVault.sol#L43) + + ```solidity + event GlobalPausedSet(bool borrow, bool repay); + ``` + +- Found in contracts/interfaces/v2/ITreasuryReservesVault.sol [Line: 44](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/ITreasuryReservesVault.sol#L44) + + ```solidity + event StrategyPausedSet(address indexed strategy, bool borrow, bool repay); + ``` + +- Found in contracts/interfaces/v2/ITreasuryReservesVault.sol [Line: 46](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/ITreasuryReservesVault.sol#L46) + + ```solidity + event StrategyAdded(address indexed strategy, int256 underperformingEquityThreshold); + ``` + +- Found in contracts/interfaces/v2/ITreasuryReservesVault.sol [Line: 48](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/ITreasuryReservesVault.sol#L48) + + ```solidity + event DebtCeilingUpdated(address indexed strategy, address indexed token, uint256 oldDebtCeiling, uint256 newDebtCeiling); + ``` + +- Found in contracts/interfaces/v2/ITreasuryReservesVault.sol [Line: 49](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/ITreasuryReservesVault.sol#L49) + + ```solidity + event UnderperformingEquityThresholdUpdated(address indexed strategy, int256 oldThreshold, int256 newThreshold); + ``` + +- Found in contracts/interfaces/v2/ITreasuryReservesVault.sol [Line: 50](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/ITreasuryReservesVault.sol#L50) + + ```solidity + event StrategyIsShuttingDownSet(address indexed strategy, bool isShuttingDown); + ``` + +- Found in contracts/interfaces/v2/ITreasuryReservesVault.sol [Line: 51](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/ITreasuryReservesVault.sol#L51) + + ```solidity + event StrategyShutdownCreditAndDebt(address indexed strategy, address indexed token, uint256 outstandingCredit, uint256 outstandingDebt); + ``` + +- Found in contracts/interfaces/v2/ITreasuryReservesVault.sol [Line: 52](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/ITreasuryReservesVault.sol#L52) + + ```solidity + event StrategyCreditAndDebtBalance(address indexed strategy, address indexed token, uint256 credit, uint256 debt); + ``` + +- Found in contracts/interfaces/v2/ITreasuryReservesVault.sol [Line: 54](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/ITreasuryReservesVault.sol#L54) + + ```solidity + event BorrowTokenSet(address indexed token, address baseStrategy, uint256 baseStrategyWithdrawalBuffer, uint256 baseStrategyDepositThreshold, address dToken); + ``` + +- Found in contracts/interfaces/v2/circuitBreaker/ITempleCircuitBreakerProxy.sol [Line: 15](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/circuitBreaker/ITempleCircuitBreakerProxy.sol#L15) + + ```solidity + event CircuitBreakerSet(bytes32 indexed identifier, address indexed token, address circuitBreaker); + ``` + +- Found in contracts/interfaces/v2/circuitBreaker/ITempleCircuitBreakerProxy.sol [Line: 16](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/circuitBreaker/ITempleCircuitBreakerProxy.sol#L16) + + ```solidity + event IdentifierForCallerSet(address indexed caller, string identifierString, bytes32 identifier); + ``` + +- Found in contracts/interfaces/v2/safeGuards/IThresholdSafeGuard.sol [Line: 8](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/safeGuards/IThresholdSafeGuard.sol#L8) + + ```solidity + event DisableGuardChecksSet(bool value); + ``` + +- Found in contracts/interfaces/v2/safeGuards/IThresholdSafeGuard.sol [Line: 9](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/safeGuards/IThresholdSafeGuard.sol#L9) + + ```solidity + event DefaultSignaturesThresholdSet(uint256 threshold); + ``` + +- Found in contracts/interfaces/v2/safeGuards/IThresholdSafeGuard.sol [Line: 10](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/safeGuards/IThresholdSafeGuard.sol#L10) + + ```solidity + event FunctionThresholdSet(address indexed contractAddr, bytes4 indexed functionSignature, uint256 threshold); + ``` + +- Found in contracts/interfaces/v2/safeGuards/IThresholdSafeGuard.sol [Line: 11](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/safeGuards/IThresholdSafeGuard.sol#L11) + + ```solidity + event EthTransferThresholdSet(address indexed contractAddr, uint256 threshold); + ``` + +- Found in contracts/interfaces/v2/strategies/ITempleStrategy.sol [Line: 42](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/strategies/ITempleStrategy.sol#L42) + + ```solidity + event AssetBalancesCheckpoint(AssetBalance[] assetBalances); + ``` + +- Found in contracts/interfaces/v2/strategies/ITempleStrategy.sol [Line: 43](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/strategies/ITempleStrategy.sol#L43) + + ```solidity + event ManualAdjustmentsSet(AssetBalanceDelta[] adjustments); + ``` + +- Found in contracts/interfaces/v2/strategies/ITempleStrategy.sol [Line: 44](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/strategies/ITempleStrategy.sol#L44) + + ```solidity + event TokenAllowanceSet(address token, address spender, uint256 amount); + ``` + +- Found in contracts/interfaces/v2/templeLineOfCredit/ITlcEventsAndErrors.sol [Line: 13](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/templeLineOfCredit/ITlcEventsAndErrors.sol#L13) + + ```solidity + event MaxLtvRatioSet(uint256 maxLtvRatio); + ``` + +- Found in contracts/interfaces/v2/templeLineOfCredit/ITlcEventsAndErrors.sol [Line: 14](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/templeLineOfCredit/ITlcEventsAndErrors.sol#L14) + + ```solidity + event CollateralAdded(address indexed fundedBy, address indexed onBehalfOf, uint128 collateralAmount); + ``` + +- Found in contracts/interfaces/v2/templeLineOfCredit/ITlcEventsAndErrors.sol [Line: 15](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/templeLineOfCredit/ITlcEventsAndErrors.sol#L15) + + ```solidity + event CollateralRemoved(address indexed account, address indexed recipient, uint128 collateralAmount); + ``` + +- Found in contracts/interfaces/v2/templeLineOfCredit/ITlcEventsAndErrors.sol [Line: 16](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/templeLineOfCredit/ITlcEventsAndErrors.sol#L16) + + ```solidity + event Borrow(address indexed account, address indexed recipient, uint128 amount); + ``` + +- Found in contracts/interfaces/v2/templeLineOfCredit/ITlcEventsAndErrors.sol [Line: 17](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/templeLineOfCredit/ITlcEventsAndErrors.sol#L17) + + ```solidity + event Repay(address indexed fundedBy, address indexed onBehalfOf, uint128 repayAmount); + ``` + +- Found in contracts/interfaces/v2/templeLineOfCredit/ITlcEventsAndErrors.sol [Line: 18](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/templeLineOfCredit/ITlcEventsAndErrors.sol#L18) + + ```solidity + event Liquidated(address indexed account, uint128 collateralSeized, uint256 collateralValue, uint128 daiDebtWiped); + ``` + +- Found in contracts/interfaces/v2/templeLineOfCredit/ITlcEventsAndErrors.sol [Line: 19](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/templeLineOfCredit/ITlcEventsAndErrors.sol#L19) + + ```solidity + event InterestRateUpdate(uint96 newInterestRate); + ``` + +- Found in contracts/interfaces/v2/templeLineOfCredit/ITlcEventsAndErrors.sol [Line: 20](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/templeLineOfCredit/ITlcEventsAndErrors.sol#L20) + + ```solidity + event BorrowPausedSet(bool isPaused); + ``` + +- Found in contracts/interfaces/v2/templeLineOfCredit/ITlcEventsAndErrors.sol [Line: 21](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/templeLineOfCredit/ITlcEventsAndErrors.sol#L21) + + ```solidity + event LiquidationsPausedSet(bool isPaused); + ``` + +- Found in contracts/interfaces/v2/templeLineOfCredit/ITlcEventsAndErrors.sol [Line: 22](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/templeLineOfCredit/ITlcEventsAndErrors.sol#L22) + + ```solidity + event MinBorrowAmountSet(uint128 amount); + ``` + +- Found in contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol [Line: 72](../tests/2024-07-templegold/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#L72) + + ```solidity + event ConfigSet(uint32 periodDuration, uint32 nBuckets, uint128 cap); + ``` + +- Found in contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol [Line: 73](../tests/2024-07-templegold/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#L73) + + ```solidity + event CapSet(uint128 cap); + ``` + +- Found in contracts/v2/interestRate/LinearWithKinkInterestRateModel.sol [Line: 34](../tests/2024-07-templegold/protocol/contracts/v2/interestRate/LinearWithKinkInterestRateModel.sol#L34) + + ```solidity + event InterestRateParamsSet( + ``` + +- Found in contracts/v2/strategies/DsrBaseStrategy.sol [Line: 42](../tests/2024-07-templegold/protocol/contracts/v2/strategies/DsrBaseStrategy.sol#L42) + + ```solidity + event DaiDeposited(uint256 amount); + ``` + +- Found in contracts/v2/strategies/DsrBaseStrategy.sol [Line: 43](../tests/2024-07-templegold/protocol/contracts/v2/strategies/DsrBaseStrategy.sol#L43) + + ```solidity + event DaiWithdrawn(uint256 amount); + ``` + +- Found in contracts/v2/strategies/GnosisStrategy.sol [Line: 32](../tests/2024-07-templegold/protocol/contracts/v2/strategies/GnosisStrategy.sol#L32) + + ```solidity + event AssetsSet(address[] _assets); + ``` + +- Found in contracts/v2/strategies/GnosisStrategy.sol [Line: 33](../tests/2024-07-templegold/protocol/contracts/v2/strategies/GnosisStrategy.sol#L33) + + ```solidity + event Borrow(address indexed token, uint256 amount); + ``` + +- Found in contracts/v2/strategies/GnosisStrategy.sol [Line: 34](../tests/2024-07-templegold/protocol/contracts/v2/strategies/GnosisStrategy.sol#L34) + + ```solidity + event Repay(address indexed token, uint256 amount); + ``` + +- Found in contracts/v2/strategies/RamosStrategy.sol [Line: 49](../tests/2024-07-templegold/protocol/contracts/v2/strategies/RamosStrategy.sol#L49) + + ```solidity + event AddLiquidity(uint256 quoteTokenAmount, uint256 protocolTokenAmount, uint256 bptTokensStaked); + ``` + +- Found in contracts/v2/strategies/RamosStrategy.sol [Line: 50](../tests/2024-07-templegold/protocol/contracts/v2/strategies/RamosStrategy.sol#L50) + + ```solidity + event RemoveLiquidity(uint256 quoteTokenAmount, uint256 protocolTokenAmount, uint256 bptIn); + ``` + +- Found in contracts/v2/strategies/RamosStrategy.sol [Line: 51](../tests/2024-07-templegold/protocol/contracts/v2/strategies/RamosStrategy.sol#L51) + + ```solidity + event BorrowToken(address indexed token, uint256 amount); + ``` + +- Found in contracts/v2/strategies/RamosStrategy.sol [Line: 52](../tests/2024-07-templegold/protocol/contracts/v2/strategies/RamosStrategy.sol#L52) + + ```solidity + event RepayToken(address indexed token, uint256 amount); + ``` + +- Found in contracts/v2/strategies/TempleTokenBaseStrategy.sol [Line: 26](../tests/2024-07-templegold/protocol/contracts/v2/strategies/TempleTokenBaseStrategy.sol#L26) + + ```solidity + event TempleMinted(uint256 amount); + ``` + +- Found in contracts/v2/strategies/TempleTokenBaseStrategy.sol [Line: 27](../tests/2024-07-templegold/protocol/contracts/v2/strategies/TempleTokenBaseStrategy.sol#L27) + + ```solidity + event TempleBurned(uint256 amount); + ``` + +- Found in contracts/v2/strategies/TlcStrategy.sol [Line: 26](../tests/2024-07-templegold/protocol/contracts/v2/strategies/TlcStrategy.sol#L26) + + ```solidity + event Borrow(uint256 amount, address recipient); + ``` + +
+ + + +## L-9: Empty `require()` / `revert()` statements + +Use descriptive reason strings or custom errors for revert paths. + +
55 Found Instances + + +- Found in contracts/core/OpsManager.sol [Line: 50](../tests/2024-07-templegold/protocol/contracts/core/OpsManager.sol#L50) + + ```solidity + require(address(pools[revalToken]) == address(0)); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 36](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L36) + + ```solidity + require (x >= -0x8000000000000000 && x <= 0x7FFFFFFFFFFFFFFF); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 63](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L63) + + ```solidity + require (x <= 0x7FFFFFFFFFFFFFFF); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 77](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L77) + + ```solidity + require (x >= 0); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 92](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L92) + + ```solidity + require (result >= MIN_64x64 && result <= MAX_64x64); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 120](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L120) + + ```solidity + require (result >= MIN_64x64 && result <= MAX_64x64); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 135](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L135) + + ```solidity + require (result >= MIN_64x64 && result <= MAX_64x64); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 150](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L150) + + ```solidity + require (result >= MIN_64x64 && result <= MAX_64x64); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 166](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L166) + + ```solidity + require (y >= -0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF && + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 181](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L181) + + ```solidity + require (absoluteResult <= + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 185](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L185) + + ```solidity + require (absoluteResult <= + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 205](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L205) + + ```solidity + require (x >= 0); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 210](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L210) + + ```solidity + require (hi <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 213](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L213) + + ```solidity + require (hi <= + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 229](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L229) + + ```solidity + require (y != 0); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 231](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L231) + + ```solidity + require (result >= MIN_64x64 && result <= MAX_64x64); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 246](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L246) + + ```solidity + require (y != 0); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 259](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L259) + + ```solidity + require (absoluteResult <= 0x80000000000000000000000000000000); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 262](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L262) + + ```solidity + require (absoluteResult <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 278](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L278) + + ```solidity + require (y != 0); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 280](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L280) + + ```solidity + require (result <= uint128 (MAX_64x64)); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 293](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L293) + + ```solidity + require (x != MIN_64x64); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 306](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L306) + + ```solidity + require (x != MIN_64x64); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 320](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L320) + + ```solidity + require (x != 0); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 322](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L322) + + ```solidity + require (result >= MIN_64x64 && result <= MAX_64x64); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 351](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L351) + + ```solidity + require (m >= 0); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 352](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L352) + + ```solidity + require (m < + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 412](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L412) + + ```solidity + require (absXShift < 64); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 432](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L432) + + ```solidity + require (resultShift < 64); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 436](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L436) + + ```solidity + require (result >= MIN_64x64 && result <= MAX_64x64); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 449](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L449) + + ```solidity + require (x >= 0); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 462](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L462) + + ```solidity + require (x > 0); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 495](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L495) + + ```solidity + require (x > 0); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 510](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L510) + + ```solidity + require (x < 0x400000000000000000); // Overflow + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 646](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L646) + + ```solidity + require (result <= uint256 (int256 (MAX_64x64))); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 660](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L660) + + ```solidity + require (x < 0x400000000000000000); // Overflow + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 679](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L679) + + ```solidity + require (y != 0); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 696](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L696) + + ```solidity + require (result <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF); + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 715](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L715) + + ```solidity + require (result <= 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF); + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 76](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L76) + + ```solidity + require (exponent <= 16638); // Overflow + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 86](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L86) + + ```solidity + require (result <= 0x8000000000000000000000000000000000000000000000000000000000000000); + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 89](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L89) + + ```solidity + require (result <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF); + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 133](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L133) + + ```solidity + require (uint128 (x) < 0x80000000000000000000000000000000); // Negative + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 135](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L135) + + ```solidity + require (exponent <= 16638); // Overflow + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 183](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L183) + + ```solidity + require (exponent <= 16510); // Overflow + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 193](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L193) + + ```solidity + require (result <= 0x8000000000000000000000000000000000000000000000000000000000000000); + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 196](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L196) + + ```solidity + require (result <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF); + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 239](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L239) + + ```solidity + require (exponent <= 16446); // Overflow + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 249](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L249) + + ```solidity + require (result <= 0x80000000000000000000000000000000); + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 252](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L252) + + ```solidity + require (result <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF); + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 440](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L440) + + ```solidity + require (absoluteX <= 0x7FFF0000000000000000000000000000); // Not NaN + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 460](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L460) + + ```solidity + require (absoluteX <= 0x7FFF0000000000000000000000000000); // Not NaN + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 464](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L464) + + ```solidity + require (absoluteY <= 0x7FFF0000000000000000000000000000); // Not NaN + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 467](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L467) + + ```solidity + require (x != y || absoluteX < 0x7FFF0000000000000000000000000000); + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1199](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1199) + + ```solidity + require (x > 0); + ``` + +
+ + + +## L-10: PUSH0 is not supported by all chains + +Solc compiler version 0.8.20 switches the default target EVM version to Shanghai, which means that the generated bytecode will include PUSH0 opcodes. Be sure to select the appropriate EVM version in case you intend to deploy on a chain other than mainnet like L2 chains that may not support PUSH0, otherwise deployment of your contracts will fail. + +
127 Found Instances + + +- Found in contracts/admin/TempleTeamPayments.sol [Line: 2](../tests/2024-07-templegold/protocol/contracts/admin/TempleTeamPayments.sol#L2) + + ```solidity + pragma solidity ^0.8.0; + ``` + +- Found in contracts/admin/TempleTeamPaymentsFactory.sol [Line: 2](../tests/2024-07-templegold/protocol/contracts/admin/TempleTeamPaymentsFactory.sol#L2) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/admin/TempleTeamPaymentsV2.sol [Line: 2](../tests/2024-07-templegold/protocol/contracts/admin/TempleTeamPaymentsV2.sol#L2) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/amm/TreasuryIV.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/amm/TreasuryIV.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/amo/AuraStaking.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/amo/AuraStaking.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/amo/Ramos.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/amo/Ramos.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/amo/helpers/AMOCommon.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/amo/helpers/AMOCommon.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/amo/helpers/BalancerPoolHelper.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/amo/helpers/BalancerPoolHelper.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/amo/test/RamosTestnetAuraStaking.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/amo/test/RamosTestnetAuraStaking.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/amo/test/RamosTestnetTempleTokenVault.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/amo/test/RamosTestnetTempleTokenVault.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/amo/test/external/IAuraStakingProxy.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/amo/test/external/IAuraStakingProxy.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/amo/test/external/IAuraToken.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/amo/test/external/IAuraToken.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/amo/test/external/IBalancerAuthorizer.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/amo/test/external/IBalancerAuthorizer.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/amo/test/external/IBalancerAuthorizerAdapter.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/amo/test/external/IBalancerAuthorizerAdapter.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/amo/test/external/IBalancerHelpers.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/amo/test/external/IBalancerHelpers.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/amo/test/external/IBalancerVotingEscrow.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/amo/test/external/IBalancerVotingEscrow.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/amo/test/external/IGaugeAdder.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/amo/test/external/IGaugeAdder.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/amo/test/external/IGaugeController.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/amo/test/external/IGaugeController.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/amo/test/external/ILiquidityGaugeFactory.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/amo/test/external/ILiquidityGaugeFactory.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/amo/test/external/IPoolManagerProxy.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/amo/test/external/IPoolManagerProxy.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/amo/test/external/IPoolManagerV3.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/amo/test/external/IPoolManagerV3.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/amo/test/external/IStashRewards.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/amo/test/external/IStashRewards.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/amo/test/external/IWeightPool2Tokens.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/amo/test/external/IWeightPool2Tokens.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/amo/test/external/goerli/Goerli_ILiquidityGaugeFactory.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/amo/test/external/goerli/Goerli_ILiquidityGaugeFactory.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/common/CommonEventsAndErrors.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/common/CommonEventsAndErrors.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/common/SafeCast.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/common/SafeCast.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/common/TempleMath.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/common/TempleMath.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/core/Exposure.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/core/Exposure.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/core/JoiningFee.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/core/JoiningFee.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/core/MultiOtcOffer.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/core/MultiOtcOffer.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/core/OpsManager.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/core/OpsManager.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/core/OpsManagerLib.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/core/OpsManagerLib.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/core/OtcOffer.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/core/OtcOffer.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/core/Rational.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/core/Rational.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/core/RebasingERC20.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/core/RebasingERC20.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/core/TempleERC20Token.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/core/TempleERC20Token.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/core/TreasuryFarmingRevenue.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/core/TreasuryFarmingRevenue.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/core/Vault.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/core/Vault.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/core/VaultEarlyWithdraw.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/core/VaultEarlyWithdraw.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/core/VaultProxy.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/core/VaultProxy.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/core/VaultedTemple.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/core/VaultedTemple.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/deprecated/Faith.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/deprecated/Faith.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/deprecated/IExitQueue.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/deprecated/IExitQueue.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/deprecated/InstantExitQueue.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/deprecated/InstantExitQueue.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/deprecated/LockedOGTemple.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/deprecated/LockedOGTemple.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/deprecated/OGTemple.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/deprecated/OGTemple.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/deprecated/TempleStaking.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/deprecated/TempleStaking.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/fakes/FakeERC20.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/fakes/FakeERC20.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/fakes/FakeERC20CustomDecimals.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/fakes/FakeERC20CustomDecimals.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/fakes/NoopLiquidator.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/fakes/NoopLiquidator.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/fakes/NoopVaultedTempleLiquidator.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/fakes/NoopVaultedTempleLiquidator.sol#L1) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/fakes/governance/DummyTimelockController.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/fakes/governance/DummyTimelockController.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/fakes/templegold/TempleGoldMock.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleGoldMock.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/fakes/templegold/TempleGoldStakingMock.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleGoldStakingMock.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/fakes/templegold/TempleTokenMock.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleTokenMock.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/fakes/v2/TempleDebtTokenTestnetAdmin.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/fakes/v2/TempleDebtTokenTestnetAdmin.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/fakes/v2/strategies/DsrBaseStrategyTestnet.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/fakes/v2/strategies/DsrBaseStrategyTestnet.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/governance/ElderElection.sol [Line: 2](../tests/2024-07-templegold/protocol/contracts/governance/ElderElection.sol#L2) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/governance/Templar.sol [Line: 2](../tests/2024-07-templegold/protocol/contracts/governance/Templar.sol#L2) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/governance/TemplarMetadata.sol [Line: 2](../tests/2024-07-templegold/protocol/contracts/governance/TemplarMetadata.sol#L2) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/interfaces/amo/IAuraStaking.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/amo/IAuraStaking.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/interfaces/amo/IRamos.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/amo/IRamos.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/interfaces/amo/helpers/IBalancerPoolHelper.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/amo/helpers/IBalancerPoolHelper.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/interfaces/amo/helpers/IRamosTokenVault.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/amo/helpers/IRamosTokenVault.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/interfaces/core/IMultiOtcOffer.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/core/IMultiOtcOffer.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/interfaces/core/ITempleERC20Token.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/core/ITempleERC20Token.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/interfaces/external/aura/IAuraBaseRewardPool.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/external/aura/IAuraBaseRewardPool.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/interfaces/external/aura/IAuraBooster.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/external/aura/IAuraBooster.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/interfaces/external/balancer/IBalancerBptToken.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/external/balancer/IBalancerBptToken.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/interfaces/external/balancer/IBalancerHelpers.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/external/balancer/IBalancerHelpers.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/interfaces/external/balancer/IBalancerVault.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/external/balancer/IBalancerVault.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/interfaces/external/makerDao/IMakerDaoDaiJoinLike.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/external/makerDao/IMakerDaoDaiJoinLike.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/interfaces/external/makerDao/IMakerDaoPotLike.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/external/makerDao/IMakerDaoPotLike.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/interfaces/external/makerDao/IMakerDaoVatLike.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/external/makerDao/IMakerDaoVatLike.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/interfaces/templegold/IAuctionBase.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/IAuctionBase.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/interfaces/templegold/IDaiGoldAuction.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/IDaiGoldAuction.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/interfaces/templegold/ISpiceAuction.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ISpiceAuction.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/interfaces/templegold/ISpiceAuctionFactory.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ISpiceAuctionFactory.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/interfaces/templegold/ITempleGold.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ITempleGold.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/interfaces/templegold/ITempleGoldAdmin.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ITempleGoldAdmin.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/interfaces/templegold/ITempleGoldStaking.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ITempleGoldStaking.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/interfaces/templegold/ITempleTeleporter.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ITempleTeleporter.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/interfaces/v2/ITempleDebtToken.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/ITempleDebtToken.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/interfaces/v2/ITreasuryPriceIndexOracle.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/ITreasuryPriceIndexOracle.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/interfaces/v2/ITreasuryReservesVault.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/ITreasuryReservesVault.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/interfaces/v2/access/ITempleElevatedAccess.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/access/ITempleElevatedAccess.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/interfaces/v2/circuitBreaker/ITempleCircuitBreaker.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/circuitBreaker/ITempleCircuitBreaker.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/interfaces/v2/circuitBreaker/ITempleCircuitBreakerProxy.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/circuitBreaker/ITempleCircuitBreakerProxy.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/interfaces/v2/interestRate/IInterestRateModel.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/interestRate/IInterestRateModel.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/interfaces/v2/safeGuards/IThresholdSafeGuard.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/safeGuards/IThresholdSafeGuard.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/interfaces/v2/strategies/ITempleBaseStrategy.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/strategies/ITempleBaseStrategy.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/interfaces/v2/strategies/ITempleStrategy.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/strategies/ITempleStrategy.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/interfaces/v2/strategies/ITlcStrategy.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/strategies/ITlcStrategy.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/interfaces/v2/templeLineOfCredit/ITempleLineOfCredit.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/templeLineOfCredit/ITempleLineOfCredit.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/interfaces/v2/templeLineOfCredit/ITlcDataTypes.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/templeLineOfCredit/ITlcDataTypes.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/interfaces/v2/templeLineOfCredit/ITlcEventsAndErrors.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/templeLineOfCredit/ITlcEventsAndErrors.sol#L1) + + ```solidity + pragma solidity 0.8.20; + ``` + +- Found in contracts/templegold//AuctionBase.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/templegold/AuctionBase.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/templegold/AuctionBase.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/templegold/AuctionBase.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/templegold/DaiGoldAuction.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/templegold/DaiGoldAuction.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/templegold/EpochLib.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/templegold/EpochLib.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/templegold/SpiceAuction.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/templegold/SpiceAuction.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/templegold/SpiceAuctionFactory.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/templegold/SpiceAuctionFactory.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/templegold/TempleGold.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/templegold/TempleGold.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/templegold/TempleGoldAdmin.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/templegold/TempleGoldAdmin.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/templegold/TempleGoldStaking.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/templegold/TempleGoldStaking.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/templegold/TempleTeleporter.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/templegold/TempleTeleporter.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 6](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L6) + + ```solidity + pragma solidity ^0.8.4; + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 6](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L6) + + ```solidity + pragma solidity ^0.8.0; + ``` + +- Found in contracts/v2/TempleDebtToken.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/v2/TempleDebtToken.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/v2/TreasuryPriceIndexOracle.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/v2/TreasuryPriceIndexOracle.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/v2/TreasuryReservesVault.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/v2/TreasuryReservesVault.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/v2/access/TempleElevatedAccess.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/v2/access/TempleElevatedAccess.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/v2/interestRate/BaseInterestRateModel.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/v2/interestRate/BaseInterestRateModel.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/v2/interestRate/CompoundedInterest.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/v2/interestRate/CompoundedInterest.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/v2/interestRate/LinearWithKinkInterestRateModel.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/v2/interestRate/LinearWithKinkInterestRateModel.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/v2/safeGuards/SafeForked.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/v2/safeGuards/SafeForked.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/v2/safeGuards/ThresholdSafeGuard.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/v2/safeGuards/ThresholdSafeGuard.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/v2/strategies/AbstractStrategy.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/v2/strategies/AbstractStrategy.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/v2/strategies/DsrBaseStrategy.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/v2/strategies/DsrBaseStrategy.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/v2/strategies/GnosisStrategy.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/v2/strategies/GnosisStrategy.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/v2/strategies/RamosStrategy.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/v2/strategies/RamosStrategy.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/v2/strategies/TempleTokenBaseStrategy.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/v2/strategies/TempleTokenBaseStrategy.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/v2/strategies/TlcStrategy.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/v2/strategies/TlcStrategy.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +- Found in contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol [Line: 1](../tests/2024-07-templegold/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L1) + + ```solidity + pragma solidity ^0.8.20; + ``` + +
+ + + +## L-11: Modifiers invoked only once can be shoe-horned into the function + + + +
5 Found Instances + + +- Found in contracts/core/Exposure.sol [Line: 133](../tests/2024-07-templegold/protocol/contracts/core/Exposure.sol#L133) + + ```solidity + modifier onlyMinter() { + ``` + +- Found in contracts/templegold/DaiGoldAuction.sol [Line: 308](../tests/2024-07-templegold/protocol/contracts/templegold/DaiGoldAuction.sol#L308) + + ```solidity + modifier onlyWhenLive() { + ``` + +- Found in contracts/templegold/TempleGold.sol [Line: 343](../tests/2024-07-templegold/protocol/contracts/templegold/TempleGold.sol#L343) + + ```solidity + modifier onlyArbitrum() { + ``` + +- Found in contracts/templegold/TempleGoldStaking.sol [Line: 604](../tests/2024-07-templegold/protocol/contracts/templegold/TempleGoldStaking.sol#L604) + + ```solidity + modifier onlyMigrator() { + ``` + +- Found in contracts/v2/access/TempleElevatedAccess.sol [Line: 146](../tests/2024-07-templegold/protocol/contracts/v2/access/TempleElevatedAccess.sol#L146) + + ```solidity + modifier onlyInRescueMode() { + ``` + +
+ + + +## L-12: Empty Block + +Consider removing empty blocks. + +
7 Found Instances + + +- Found in contracts/amo/test/RamosTestnetAuraStaking.sol [Line: 70](../tests/2024-07-templegold/protocol/contracts/amo/test/RamosTestnetAuraStaking.sol#L70) + + ```solidity + function depositAndStake(uint256 /*amount*/) external override { + ``` + +- Found in contracts/v2/safeGuards/ThresholdSafeGuard.sol [Line: 247](../tests/2024-07-templegold/protocol/contracts/v2/safeGuards/ThresholdSafeGuard.sol#L247) + + ```solidity + function checkAfterExecution(bytes32, bool) external view {} + ``` + +- Found in contracts/v2/strategies/AbstractStrategy.sol [Line: 146](../tests/2024-07-templegold/protocol/contracts/v2/strategies/AbstractStrategy.sol#L146) + + ```solidity + function populateShutdownData( + ``` + +- Found in contracts/v2/strategies/AbstractStrategy.sol [Line: 228](../tests/2024-07-templegold/protocol/contracts/v2/strategies/AbstractStrategy.sol#L228) + + ```solidity + function _debtCeilingUpdated(IERC20 /*token*/, uint256 /*newDebtCeiling*/) internal virtual {} + ``` + +- Found in contracts/v2/strategies/GnosisStrategy.sol [Line: 51](../tests/2024-07-templegold/protocol/contracts/v2/strategies/GnosisStrategy.sol#L51) + + ```solidity + function _updateTrvApprovals( + ``` + +- Found in contracts/v2/strategies/TempleTokenBaseStrategy.sol [Line: 42](../tests/2024-07-templegold/protocol/contracts/v2/strategies/TempleTokenBaseStrategy.sol#L42) + + ```solidity + function _updateTrvApprovals( + ``` + +- Found in contracts/v2/strategies/TlcStrategy.sol [Line: 43](../tests/2024-07-templegold/protocol/contracts/v2/strategies/TlcStrategy.sol#L43) + + ```solidity + function _updateTrvApprovals( + ``` + +
+ + + +## L-13: Large literal values multiples of 10000 can be replaced with scientific notation + +Use `e` notation, for example: `1e18`, instead of its full numeric value. + +
6 Found Instances + + +- Found in contracts/amo/Ramos.sol [Line: 72](../tests/2024-07-templegold/protocol/contracts/amo/Ramos.sol#L72) + + ```solidity + uint256 public constant override BPS_PRECISION = 10_000; + ``` + +- Found in contracts/amo/helpers/BalancerPoolHelper.sol [Line: 27](../tests/2024-07-templegold/protocol/contracts/amo/helpers/BalancerPoolHelper.sol#L27) + + ```solidity + uint256 public constant override BPS_PRECISION = 10_000; + ``` + +- Found in contracts/deprecated/TempleStaking.sol [Line: 119](../tests/2024-07-templegold/protocol/contracts/deprecated/TempleStaking.sol#L119) + + ```solidity + emit AccumulationFactorUpdated(_nUnupdatedEpochs, _currentEpoch, accumulationFactor.mul(10000).toUInt()); + ``` + +- Found in contracts/fakes/templegold/TempleGoldMock.sol [Line: 36](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleGoldMock.sol#L36) + + ```solidity + uint256 public constant MAX_SUPPLY = 1_000_000_000 ether; // 1B + ``` + +- Found in contracts/templegold/TempleGold.sol [Line: 47](../tests/2024-07-templegold/protocol/contracts/templegold/TempleGold.sol#L47) + + ```solidity + uint256 public constant MAX_SUPPLY = 1_000_000_000 ether; // 1B + ``` + +- Found in contracts/templegold/TempleGold.sol [Line: 49](../tests/2024-07-templegold/protocol/contracts/templegold/TempleGold.sol#L49) + + ```solidity + uint256 public constant MINIMUM_MINT = 10_000 ether; + ``` + +
+ + + +## L-14: Internal functions called only once can be inlined + +Instead of separating the logic into a separate function, consider inlining the logic into the calling function. This can reduce the number of function calls and improve readability. + +
17 Found Instances + + +- Found in contracts/amo/helpers/BalancerPoolHelper.sol [Line: 172](../tests/2024-07-templegold/protocol/contracts/amo/helpers/BalancerPoolHelper.sol#L172) + + ```solidity + function createPoolExitRequest( + ``` + +- Found in contracts/amo/helpers/BalancerPoolHelper.sol [Line: 190](../tests/2024-07-templegold/protocol/contracts/amo/helpers/BalancerPoolHelper.sol#L190) + + ```solidity + function createPoolJoinRequest( + ``` + +- Found in contracts/amo/helpers/BalancerPoolHelper.sol [Line: 283](../tests/2024-07-templegold/protocol/contracts/amo/helpers/BalancerPoolHelper.sol#L283) + + ```solidity + function validateProtocolTokenJoin( + ``` + +- Found in contracts/amo/helpers/BalancerPoolHelper.sol [Line: 298](../tests/2024-07-templegold/protocol/contracts/amo/helpers/BalancerPoolHelper.sol#L298) + + ```solidity + function validateProtocolTokenExit( + ``` + +- Found in contracts/amo/helpers/BalancerPoolHelper.sol [Line: 316](../tests/2024-07-templegold/protocol/contracts/amo/helpers/BalancerPoolHelper.sol#L316) + + ```solidity + function validateQuoteTokenJoin( + ``` + +- Found in contracts/amo/helpers/BalancerPoolHelper.sol [Line: 331](../tests/2024-07-templegold/protocol/contracts/amo/helpers/BalancerPoolHelper.sol#L331) + + ```solidity + function validateQuoteTokenExit( + ``` + +- Found in contracts/governance/ElderElection.sol [Line: 139](../tests/2024-07-templegold/protocol/contracts/governance/ElderElection.sol#L139) + + ```solidity + function hash(EIP712Domain memory _input) internal pure returns (bytes32) { + ``` + +- Found in contracts/governance/ElderElection.sol [Line: 157](../tests/2024-07-templegold/protocol/contracts/governance/ElderElection.sol#L157) + + ```solidity + function hash(EndorsementReq memory _input) internal pure returns (bytes32) { + ``` + +- Found in contracts/governance/ElderElection.sol [Line: 167](../tests/2024-07-templegold/protocol/contracts/governance/ElderElection.sol#L167) + + ```solidity + function hash(uint256[] memory _input) internal pure returns (bytes32) { + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 201](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L201) + + ```solidity + function mulu (int128 x, uint256 y) internal pure returns (uint256) { + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 460](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L460) + + ```solidity + function log_2 (int128 x) internal pure returns (int128) { + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 508](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L508) + + ```solidity + function exp_2 (int128 x) internal pure returns (int128) { + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 516](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L516) + + ```solidity + function add (bytes16 x, bytes16 y) internal pure returns (bytes16) { + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 924](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L924) + + ```solidity + function log_2 (bytes16 x) internal pure returns (bytes16) { + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 1001](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L1001) + + ```solidity + function pow_2 (bytes16 x) internal pure returns (bytes16) { + ``` + +- Found in contracts/v2/interestRate/BaseInterestRateModel.sol [Line: 19](../tests/2024-07-templegold/protocol/contracts/v2/interestRate/BaseInterestRateModel.sol#L19) + + ```solidity + function computeInterestRateImpl(uint256) internal virtual view returns (uint96); + ``` + +- Found in contracts/v2/safeGuards/SafeForked.sol [Line: 22](../tests/2024-07-templegold/protocol/contracts/v2/safeGuards/SafeForked.sol#L22) + + ```solidity + function signatureSplit(bytes memory signatures, uint256 pos) + ``` + +
+ + + +## L-15: Inconsistency in declaring uint256/uint (or) int256/int variables within a contract. Use explicit size declarations (uint256 or int256). + +Consider keeping the naming convention consistent in a given contract. Explicit size declarations are preferred (uint256, int256) over implicit ones (uint, int) to avoid confusion. + +
58 Found Instances + + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 32](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L32) + + ```solidity + modifier ensure(uint deadline) { + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 62](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L62) + + ```solidity + uint amountADesired, + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 63](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L63) + + ```solidity + uint amountBDesired, + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 64](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L64) + + ```solidity + uint amountAMin, + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 65](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L65) + + ```solidity + uint amountBMin, + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 67](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L67) + + ```solidity + ) internal virtual returns (uint amountA, uint amountB) { + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 68](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L68) + + ```solidity + (uint reserveA, uint reserveB,) = pair.getReserves(); + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 72](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L72) + + ```solidity + uint amountBOptimal = quote(amountADesired, reserveA, reserveB); + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 77](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L77) + + ```solidity + uint amountAOptimal = quote(amountBDesired, reserveB, reserveA); + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 86](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L86) + + ```solidity + uint amountADesired, + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 87](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L87) + + ```solidity + uint amountBDesired, + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 88](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L88) + + ```solidity + uint amountAMin, + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 89](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L89) + + ```solidity + uint amountBMin, + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 92](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L92) + + ```solidity + uint deadline + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 93](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L93) + + ```solidity + ) external virtual ensure(deadline) returns (uint amountA, uint amountB, uint liquidity) { + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 106](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L106) + + ```solidity + uint liquidity, + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 107](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L107) + + ```solidity + uint amountAMin, + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 108](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L108) + + ```solidity + uint amountBMin, + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 111](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L111) + + ```solidity + uint deadline + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 112](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L112) + + ```solidity + ) public virtual ensure(deadline) returns (uint amountA, uint amountB) { + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 123](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L123) + + ```solidity + uint amountIn, + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 124](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L124) + + ```solidity + uint amountOutMin, + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 127](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L127) + + ```solidity + uint deadline + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 128](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L128) + + ```solidity + ) external virtual ensure(deadline) returns (uint amountOut) { + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 133](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L133) + + ```solidity + uint amountOut = swapExactStableForTempleQuote(pair, amountIn); + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 143](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L143) + + ```solidity + uint amountIn, + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 144](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L144) + + ```solidity + uint amountOutMin, + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 147](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L147) + + ```solidity + uint deadline + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 148](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L148) + + ```solidity + ) external virtual ensure(deadline) returns (uint) { + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 154](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L154) + + ```solidity + (bool priceBelowIV, uint amountOut) = swapExactTempleForStableQuote(pair, amountIn); + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 177](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L177) + + ```solidity + function quote(uint amountA, uint reserveA, uint reserveB) public pure returns (uint amountB) { + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 189](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L189) + + ```solidity + function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 192](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L192) + + ```solidity + returns (uint amountOut) + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 196](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L196) + + ```solidity + uint amountInWithFee = amountIn * 995; + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 197](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L197) + + ```solidity + uint numerator = amountInWithFee * reserveOut; + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 198](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L198) + + ```solidity + uint denominator = (reserveIn * 1000) + amountInWithFee; + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 202](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L202) + + ```solidity + function swapExactStableForTempleQuote(address pair, uint amountIn) public view returns (uint amountOut ) { + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 203](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L203) + + ```solidity + (uint reserveTemple, uint reserveFrax,) = IUniswapV2Pair(pair).getReserves(); + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 207](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L207) + + ```solidity + function swapExactTempleForStableQuote(address pair, uint amountIn) public view returns (bool priceBelowIV, uint amountOut) { + ``` + +- Found in contracts/amm/TempleStableAMMRouter.sol [Line: 208](../tests/2024-07-templegold/protocol/contracts/amm/TempleStableAMMRouter.sol#L208) + + ```solidity + (uint reserveTemple, uint reserveFrax,) = IUniswapV2Pair(pair).getReserves(); + ``` + +- Found in contracts/amo/AuraStaking.sol [Line: 116](../tests/2024-07-templegold/protocol/contracts/amo/AuraStaking.sol#L116) + + ```solidity + for (uint i; i < length; ++i) { + ``` + +- Found in contracts/core/RebasingERC20.sol [Line: 84](../tests/2024-07-templegold/protocol/contracts/core/RebasingERC20.sol#L84) + + ```solidity + function toTokenAmount(uint sharesAmount) public view returns (uint256 tokenAmount) { + ``` + +- Found in contracts/core/RebasingERC20.sol [Line: 89](../tests/2024-07-templegold/protocol/contracts/core/RebasingERC20.sol#L89) + + ```solidity + function toSharesAmount(uint tokenAmount) public view returns (uint256 sharesAmount) { + ``` + +- Found in contracts/util/ABDKMathQuad.sol [Line: 783](../tests/2024-07-templegold/protocol/contracts/util/ABDKMathQuad.sol#L783) + + ```solidity + uint shift = 226 - mostSignificantBit (xSignifier); + ``` + +
+ + + +## L-16: Unused Custom Error + +it is recommended that the definition be removed when custom error is unused + +
25 Found Instances + + +- Found in contracts/amo/helpers/AMOCommon.sol [Line: 6](../tests/2024-07-templegold/protocol/contracts/amo/helpers/AMOCommon.sol#L6) + + ```solidity + error NotOperator(); + ``` + +- Found in contracts/amo/helpers/AMOCommon.sol [Line: 7](../tests/2024-07-templegold/protocol/contracts/amo/helpers/AMOCommon.sol#L7) + + ```solidity + error NotOperatorOrOwner(); + ``` + +- Found in contracts/amo/helpers/AMOCommon.sol [Line: 11](../tests/2024-07-templegold/protocol/contracts/amo/helpers/AMOCommon.sol#L11) + + ```solidity + error InsufficientBPTAmount(uint256 amount); + ``` + +- Found in contracts/amo/helpers/AMOCommon.sol [Line: 19](../tests/2024-07-templegold/protocol/contracts/amo/helpers/AMOCommon.sol#L19) + + ```solidity + error Paused(); + ``` + +- Found in contracts/common/CommonEventsAndErrors.sol [Line: 7](../tests/2024-07-templegold/protocol/contracts/common/CommonEventsAndErrors.sol#L7) + + ```solidity + error InsufficientBalance(address token, uint256 required, uint256 balance); + ``` + +- Found in contracts/common/CommonEventsAndErrors.sol [Line: 11](../tests/2024-07-templegold/protocol/contracts/common/CommonEventsAndErrors.sol#L11) + + ```solidity + error InvalidAmount(address token, uint256 amount); + ``` + +- Found in contracts/common/CommonEventsAndErrors.sol [Line: 13](../tests/2024-07-templegold/protocol/contracts/common/CommonEventsAndErrors.sol#L13) + + ```solidity + error Unimplemented(); + ``` + +- Found in contracts/core/VaultEarlyWithdraw.sol [Line: 31](../tests/2024-07-templegold/protocol/contracts/core/VaultEarlyWithdraw.sol#L31) + + ```solidity + error SendFailed(); + ``` + +- Found in contracts/fakes/templegold/TempleGoldStakingMock.sol [Line: 108](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleGoldStakingMock.sol#L108) + + ```solidity + error InvalidDelegate(); + ``` + +- Found in contracts/fakes/templegold/TempleGoldStakingMock.sol [Line: 111](../tests/2024-07-templegold/protocol/contracts/fakes/templegold/TempleGoldStakingMock.sol#L111) + + ```solidity + error MinimumStakePeriod(); + ``` + +- Found in contracts/governance/ElderElection.sol [Line: 49](../tests/2024-07-templegold/protocol/contracts/governance/ElderElection.sol#L49) + + ```solidity + error NotFromTemplar(address account, uint256 discordId); + ``` + +- Found in contracts/governance/ElderElection.sol [Line: 50](../tests/2024-07-templegold/protocol/contracts/governance/ElderElection.sol#L50) + + ```solidity + error NotCandidate(uint256 discordId); + ``` + +- Found in contracts/interfaces/templegold/IDaiGoldAuction.sol [Line: 14](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/IDaiGoldAuction.sol#L14) + + ```solidity + error LowGoldDistributed(uint256 epochGoldAmount); + ``` + +- Found in contracts/interfaces/templegold/ISpiceAuction.sol [Line: 14](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ISpiceAuction.sol#L14) + + ```solidity + error NoConfig(); + ``` + +- Found in contracts/interfaces/templegold/ITempleGold.sol [Line: 47](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ITempleGold.sol#L47) + + ```solidity + error InvalidTotalShare(); + ``` + +- Found in contracts/interfaces/templegold/ITempleGold.sol [Line: 48](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ITempleGold.sol#L48) + + ```solidity + error MissingParameter(); + ``` + +- Found in contracts/interfaces/templegold/ITempleGold.sol [Line: 49](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ITempleGold.sol#L49) + + ```solidity + error NonTransferrable(address from, address to); + ``` + +- Found in contracts/interfaces/templegold/ITempleGold.sol [Line: 50](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ITempleGold.sol#L50) + + ```solidity + error WrongChain(); + ``` + +- Found in contracts/interfaces/templegold/ITempleGold.sol [Line: 51](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ITempleGold.sol#L51) + + ```solidity + error CannotCompose(); + ``` + +- Found in contracts/interfaces/templegold/ITempleGoldStaking.sol [Line: 20](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ITempleGoldStaking.sol#L20) + + ```solidity + error CannotDistribute(); + ``` + +- Found in contracts/interfaces/templegold/ITempleGoldStaking.sol [Line: 21](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ITempleGoldStaking.sol#L21) + + ```solidity + error CannotDelegate(); + ``` + +- Found in contracts/interfaces/templegold/ITempleGoldStaking.sol [Line: 22](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ITempleGoldStaking.sol#L22) + + ```solidity + error InvalidOperation(); + ``` + +- Found in contracts/interfaces/templegold/ITempleGoldStaking.sol [Line: 23](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ITempleGoldStaking.sol#L23) + + ```solidity + error InvalidBlockNumber(); + ``` + +- Found in contracts/interfaces/templegold/ITempleGoldStaking.sol [Line: 24](../tests/2024-07-templegold/protocol/contracts/interfaces/templegold/ITempleGoldStaking.sol#L24) + + ```solidity + error NoStaker(); + ``` + +- Found in contracts/interfaces/v2/safeGuards/IThresholdSafeGuard.sol [Line: 16](../tests/2024-07-templegold/protocol/contracts/interfaces/v2/safeGuards/IThresholdSafeGuard.sol#L16) + + ```solidity + error DynamicSignatureThresholdNotMet(uint256 required, uint256 found); + ``` + +
+ + + +## L-17: Loop contains `require`/`revert` statements + +Avoid `require` / `revert` statements in a loop because a single bad item can cause the whole transaction to fail. It's better to forgive on fail and return failed elements post processing of the loop + +
6 Found Instances + + +- Found in contracts/admin/TempleTeamPayments.sol [Line: 38](../tests/2024-07-templegold/protocol/contracts/admin/TempleTeamPayments.sol#L38) + + ```solidity + for (uint256 i = 0; i < _addresses.length; i++) { + ``` + +- Found in contracts/core/OpsManager.sol [Line: 97](../tests/2024-07-templegold/protocol/contracts/core/OpsManager.sol#L97) + + ```solidity + for (uint256 i = 0; i < vaults.length; i++) { + ``` + +- Found in contracts/core/OpsManager.sol [Line: 133](../tests/2024-07-templegold/protocol/contracts/core/OpsManager.sol#L133) + + ```solidity + for (uint256 i = 0; i < vaults.length; i++) { + ``` + +- Found in contracts/core/OpsManager.sol [Line: 151](../tests/2024-07-templegold/protocol/contracts/core/OpsManager.sol#L151) + + ```solidity + for (uint256 i = 0; i < vaults.length; i++) { + ``` + +- Found in contracts/util/ABDKMath64x64.sol [Line: 411](../tests/2024-07-templegold/protocol/contracts/util/ABDKMath64x64.sol#L411) + + ```solidity + while (y != 0) { + ``` + +- Found in contracts/v2/safeGuards/SafeForked.sol [Line: 78](../tests/2024-07-templegold/protocol/contracts/v2/safeGuards/SafeForked.sol#L78) + + ```solidity + for (i = 0; i < requiredSignatures; i++) { + ``` + +
+ + + +## L-18: Incorrect Order of Division and Multiplication + +Division operations followed directly by multiplication operations can lead to precision loss due to the way integer arithmetic is handled in Solidity. + +
1 Found Instances + + +- Found in contracts/core/JoiningFee.sol [Line: 38](../tests/2024-07-templegold/protocol/contracts/core/JoiningFee.sol#L38) + + ```solidity + return (block.timestamp - (numCycles * periodDuration) - firstPeriodStartTimestamp) / 3600 * feePerHour; + ``` + +
+ + + diff --git a/tests/2024-07-templegold b/tests/2024-07-templegold new file mode 160000 index 000000000..57a3e597e --- /dev/null +++ b/tests/2024-07-templegold @@ -0,0 +1 @@ +Subproject commit 57a3e597e9199f9e9e0c26aab2123332eb19cc28