diff --git a/.github/workflows/protocol-tests.yaml b/.github/workflows/protocol-tests.yaml index a3bc38df1..8cf542bda 100644 --- a/.github/workflows/protocol-tests.yaml +++ b/.github/workflows/protocol-tests.yaml @@ -5,55 +5,149 @@ on: paths: - 'protocol/**' +concurrency: + group: ${{github.workflow}}-${{github.ref}} + cancel-in-progress: true + jobs: - e2eTest: + hardhatTests: name: Hardhat Tests - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + permissions: + # required for all workflows + security-events: write + # only required for workflows in private repositories + actions: read + contents: read + strategy: + matrix: + os: + - ubuntu-latest + node_version: + - 18 + steps: - - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v4 - - uses: actions/setup-node@v3 + - name: Use Node.js ${{ matrix.node_version }} + uses: actions/setup-node@v4 with: - node-version: '18.x' + node-version: ${{ matrix.node_version }} cache: 'yarn' cache-dependency-path: protocol/yarn.lock - - run: yarn install + - name: Install yarn project + run: yarn install working-directory: protocol - - run: yarn compile + - name: Hardhat Compile + run: yarn compile working-directory: protocol - - run: yarn test + - name: Hardhat Test + run: yarn test working-directory: protocol env: TESTS_MAINNET_RPC_URL: ${{ secrets.TESTS_MAINNET_RPC_URL }} - fuzzTest: + foundryTests: name: Foundry Tests - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + permissions: + # required for all workflows + security-events: write + # only required for workflows in private repositories + actions: read + contents: read + strategy: + matrix: + os: + - ubuntu-latest + node_version: + - 18 + steps: - - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v4 with: submodules: recursive - - uses: actions/setup-node@v3 + - name: Use Node.js ${{ matrix.node_version }} + uses: actions/setup-node@v4 with: - node-version: '18.x' + node-version: ${{ matrix.node_version }} cache: 'yarn' cache-dependency-path: protocol/yarn.lock - - run: yarn install + - name: Install yarn project + run: yarn install working-directory: protocol - name: Install Foundry - uses: foundry-rs/foundry-toolchain@v1.0.10 + uses: foundry-rs/foundry-toolchain@v1 with: - version: nightly-ca67d15f4abd46394b324c50e21e66f306a1162d + version: nightly + # version: nightly-ca67d15f4abd46394b324c50e21e66f306a1162d + cache: true - - run: forge --version + - name: Show the Foundry CI config + run: forge config + env: + FOUNDRY_PROFILE: ci + + - name: Show the Foundry version + run: forge --version working-directory: protocol - - name: Run tests - run: FOUNDRY_PROFILE=ci forge test --gas-report + - name: Foundry tests + run: forge test --gas-report working-directory: protocol + env: + FOUNDRY_PROFILE: ci + MAINNET_RPC_URL: ${{ secrets.TESTS_MAINNET_RPC_URL }} + + slither: + name: Slither + runs-on: ${{ matrix.os }} + permissions: + # only required for workflows in private repositories + actions: read + contents: read + strategy: + matrix: + os: + - ubuntu-latest + node_version: + - 18 + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Use Node.js ${{ matrix.node_version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node_version }} + cache: 'yarn' + cache-dependency-path: protocol/yarn.lock + + - name: Install yarn project + run: yarn install + working-directory: protocol + + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + with: + version: nightly + # version: nightly-ca67d15f4abd46394b324c50e21e66f306a1162d + cache: false + + - name: install slither + run: cd protocol && pip install -r slither.requirements.txt + + # Can't output to SARIF for private repos without paying for Advanced Security + - name: run slither + run: cd protocol && yarn slither-check diff --git a/.github/workflows/slither.yaml b/.github/workflows/slither.yaml deleted file mode 100644 index 0f4a3bb7e..000000000 --- a/.github/workflows/slither.yaml +++ /dev/null @@ -1,42 +0,0 @@ -# We manually setup and run slither here, as the prebaked github action -# (at https://github.com/crytic/slither-action) -# fails with permission errors inside the docker container for this project - -name: Slither Analysis -on: - push: - paths: - - "protocol/**" - - ".github/workflows/slither.yaml" -jobs: - analyze: - # if: ${{ false }} # Slither has an issue with prb math, and is super slow... - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - submodules: recursive - - - name: install foundry - uses: foundry-rs/foundry-toolchain@v1.0.9 - - - uses: actions/setup-python@v4 - with: - python-version: 3.9 - cache: 'pip' - cache-dependency-path: protocol/slither.requirements.txt - - - uses: actions/setup-node@v3 - with: - node-version: 18 - cache: 'yarn' - cache-dependency-path: protocol/yarn.lock - - - name: install slither - run: cd protocol && pip install -r slither.requirements.txt - - - name: install node packages - run: cd protocol && yarn - - - name: run slither - run: cd protocol && yarn slither-check diff --git a/protocol/contracts/common/CommonEventsAndErrors.sol b/protocol/contracts/common/CommonEventsAndErrors.sol index ce1b10bfc..b859389d1 100644 --- a/protocol/contracts/common/CommonEventsAndErrors.sol +++ b/protocol/contracts/common/CommonEventsAndErrors.sol @@ -12,4 +12,5 @@ library CommonEventsAndErrors { error ExpectedNonZero(); error Unimplemented(); event TokenRecovered(address indexed to, address indexed token, uint256 amount); + error AccountBlacklisted(address account); } diff --git a/protocol/contracts/interfaces/nexus/IBaseSacrifice.sol b/protocol/contracts/interfaces/nexus/IBaseSacrifice.sol new file mode 100644 index 000000000..924e6091a --- /dev/null +++ b/protocol/contracts/interfaces/nexus/IBaseSacrifice.sol @@ -0,0 +1,90 @@ +pragma solidity 0.8.19; +// SPDX-License-Identifier: AGPL-3.0-or-later +// Temple (interfaces/nexus/IBaseSacrifice.sol) + + +import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; + +interface ISacrifice { + event TokenSacrificed(address indexed fromAccount, address indexed token, uint256 amount); + event PartnerZeroSacrificed(address indexed to, uint256 relicId, uint256 enclaveId); + event OriginTimeSet(uint64 originTime); + event RelicMintCapSet(uint256 cap); + + error FutureOriginTime(uint64 originTime); + error MintCapExceeded(uint256 newTotal); + + /* + * @notice Get amount of tokens to mint a Relic + * @return Relic price + */ + function getPrice() external view returns (uint256); + + /* + * @notice Set origin time. + * Origin time is the start of the linear ascending price to params.priceMaxPeriod + * @param _originTime Origin time + */ + function setOriginTime(uint64 _originTime) external; + + /* + * @notice Sacrifice tokens to mint a Relic + * Caller must approve contract to spend tokens. + * @param enclaveId Enclave ID + * @param to Destination address + */ + function sacrifice(uint256 enclaveId, address to) external returns (uint256 relicId); +} + +interface IPartnerSacrifice is ISacrifice { + /* + * @notice Get mint cap for partner + * @return Mint Cap + */ + function mintCap() external view returns (uint256); + + /* + * @notice Get total Relics minted by partner + * @return Total minted Relics + */ + function totalMinted() external view returns (uint256); + + /* + * @notice set mint cap for partner + * @param cap Cap to set + */ + function setMintCap(uint256 cap) external; +} + +interface IBaseSacrifice is ISacrifice { + + event CustomPriceSet(uint256 price); + event PriceParamsSet(PriceParam params); + event TokenRecipientSet(address recipient); + + struct PriceParam { + uint64 priceMaxPeriod; + uint128 minimumPrice; + uint128 maximumPrice; + } + + /* + * @notice Set price parameters. + * @param _priceParams Price parameters to set + */ + function setPriceParams(PriceParam calldata _priceParams) external; + + /* + * @notice Set custom price + * owner can reset price with 0 _price value. Custom price can be set anytime during or after params.priceMaxPeriod on + * a flash sale or at a discounted price. + * @param _price Custom price + */ + function setCustomPrice(uint256 _price) external; + + /* + * @notice Sacrifice Token address + * @return Sacrifice Token address + */ + function sacrificeToken() external view returns (IERC20); +} \ No newline at end of file diff --git a/protocol/contracts/interfaces/nexus/IERC721A.sol b/protocol/contracts/interfaces/nexus/IERC721A.sol new file mode 100644 index 000000000..ce29e0966 --- /dev/null +++ b/protocol/contracts/interfaces/nexus/IERC721A.sol @@ -0,0 +1,282 @@ +// SPDX-License-Identifier: MIT +// ERC721A Contracts v4.2.3 +// Creator: Chiru Labs + +pragma solidity 0.8.19; + +/** + * @dev Interface of ERC721A. + */ +interface IERC721A { + /** + * The caller must own the token or be an approved operator. + */ + error ApprovalCallerNotOwnerNorApproved(); + + /** + * The token does not exist. + */ + error ApprovalQueryForNonexistentToken(); + + /** + * Cannot query the balance for the zero address. + */ + error BalanceQueryForZeroAddress(); + + /** + * Cannot mint to the zero address. + */ + error MintToZeroAddress(); + + /** + * The quantity of tokens minted must be more than zero. + */ + error MintZeroQuantity(); + + /** + * The token does not exist. + */ + error OwnerQueryForNonexistentToken(); + + /** + * The caller must own the token or be an approved operator. + */ + error TransferCallerNotOwnerNorApproved(); + + /** + * The token must be owned by `from`. + */ + error TransferFromIncorrectOwner(); + + /** + * Cannot safely transfer to a contract that does not implement the + * ERC721Receiver interface. + */ + error TransferToNonERC721ReceiverImplementer(); + + /** + * Cannot transfer to the zero address. + */ + error TransferToZeroAddress(); + + /** + * The token does not exist. + */ + error URIQueryForNonexistentToken(); + + /** + * The `quantity` minted with ERC2309 exceeds the safety limit. + */ + error MintERC2309QuantityExceedsLimit(); + + /** + * The `extraData` cannot be set on an unintialized ownership slot. + */ + error OwnershipNotInitializedForExtraData(); + + // ============================================================= + // STRUCTS + // ============================================================= + + struct TokenOwnership { + // The address of the owner. + address addr; + // Stores the start time of ownership with minimal overhead for tokenomics. + uint64 startTimestamp; + // Whether the token has been burned. + bool burned; + // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}. + uint24 extraData; + } + + // ============================================================= + // TOKEN COUNTERS + // ============================================================= + + /** + * @dev Returns the total number of tokens in existence. + * Burned tokens will reduce the count. + * To get the total number of tokens minted, please see {_totalMinted}. + */ + function totalSupply() external view returns (uint256); + + // ============================================================= + // IERC165 + // ============================================================= + + /** + * @dev Returns true if this contract implements the interface defined by + * `interfaceId`. See the corresponding + * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) + * to learn more about how these ids are created. + * + * This function call must use less than 30000 gas. + */ + function supportsInterface(bytes4 interfaceId) external view returns (bool); + + // ============================================================= + // IERC721 + // ============================================================= + + /** + * @dev Emitted when `tokenId` token is transferred from `from` to `to`. + */ + event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); + + /** + * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. + */ + event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); + + /** + * @dev Emitted when `owner` enables or disables + * (`approved`) `operator` to manage all of its assets. + */ + event ApprovalForAll(address indexed owner, address indexed operator, bool approved); + + /** + * @dev Returns the number of tokens in `owner`'s account. + */ + function balanceOf(address owner) external view returns (uint256 balance); + + /** + * @dev Returns the owner of the `tokenId` token. + * + * Requirements: + * + * - `tokenId` must exist. + */ + function ownerOf(uint256 tokenId) external view returns (address owner); + + /** + * @dev Safely transfers `tokenId` token from `from` to `to`, + * checking first that contract recipients are aware of the ERC721 protocol + * to prevent tokens from being forever locked. + * + * Requirements: + * + * - `from` cannot be the zero address. + * - `to` cannot be the zero address. + * - `tokenId` token must exist and be owned by `from`. + * - If the caller is not `from`, it must be have been allowed to move + * this token by either {approve} or {setApprovalForAll}. + * - If `to` refers to a smart contract, it must implement + * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. + * + * Emits a {Transfer} event. + */ + function safeTransferFrom( + address from, + address to, + uint256 tokenId, + bytes calldata data + ) external payable; + + /** + * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`. + */ + function safeTransferFrom( + address from, + address to, + uint256 tokenId + ) external payable; + + /** + * @dev Transfers `tokenId` from `from` to `to`. + * + * WARNING: Usage of this method is discouraged, use {safeTransferFrom} + * whenever possible. + * + * Requirements: + * + * - `from` cannot be the zero address. + * - `to` cannot be the zero address. + * - `tokenId` token must be owned by `from`. + * - If the caller is not `from`, it must be approved to move this token + * by either {approve} or {setApprovalForAll}. + * + * Emits a {Transfer} event. + */ + function transferFrom( + address from, + address to, + uint256 tokenId + ) external payable; + + /** + * @dev Gives permission to `to` to transfer `tokenId` token to another account. + * The approval is cleared when the token is transferred. + * + * Only a single account can be approved at a time, so approving the + * zero address clears previous approvals. + * + * Requirements: + * + * - The caller must own the token or be an approved operator. + * - `tokenId` must exist. + * + * Emits an {Approval} event. + */ + function approve(address to, uint256 tokenId) external payable; + + /** + * @dev Approve or remove `operator` as an operator for the caller. + * Operators can call {transferFrom} or {safeTransferFrom} + * for any token owned by the caller. + * + * Requirements: + * + * - The `operator` cannot be the caller. + * + * Emits an {ApprovalForAll} event. + */ + function setApprovalForAll(address operator, bool _approved) external; + + /** + * @dev Returns the account approved for `tokenId` token. + * + * Requirements: + * + * - `tokenId` must exist. + */ + function getApproved(uint256 tokenId) external view returns (address operator); + + /** + * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. + * + * See {setApprovalForAll}. + */ + function isApprovedForAll(address owner, address operator) external view returns (bool); + + // ============================================================= + // IERC721Metadata + // ============================================================= + + /** + * @dev Returns the token collection name. + */ + function name() external view returns (string memory); + + /** + * @dev Returns the token collection symbol. + */ + function symbol() external view returns (string memory); + + /** + * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. + */ + function tokenURI(uint256 tokenId) external view returns (string memory); + + // ============================================================= + // IERC2309 + // ============================================================= + + /** + * @dev Emitted when tokens in `fromTokenId` to `toTokenId` + * (inclusive) is transferred from `from` to `to`, as defined in the + * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard. + * + * See {_mintERC2309} for more details. + */ + event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to); +} \ No newline at end of file diff --git a/protocol/contracts/interfaces/nexus/INexusCommon.sol b/protocol/contracts/interfaces/nexus/INexusCommon.sol new file mode 100644 index 000000000..fe61ea9a0 --- /dev/null +++ b/protocol/contracts/interfaces/nexus/INexusCommon.sol @@ -0,0 +1,63 @@ +pragma solidity 0.8.19; +// SPDX-License-Identifier: AGPL-3.0-or-later +// Temple (interfaces/nexus/INexusCommon.sol) + +interface INexusCommon { + event ShardEnclaveSet(uint256 enclaveId, uint256 indexed shardId); + event EnclaveNameSet(uint256 id, string name); + event ShardSet(address indexed shard); + + /* + * @notice Set shard contract + * @param _shard Shard contract + */ + function setShard(address _shard) external; + + /* + * @notice Set enclave ID to name mapping + * @param id enclave ID + * @param name Name of Enclave + */ + function setEnclaveName(uint256 id, string memory name) external; + + /* + * @notice Set shard enclave + * @param enclaveId Enclave ID + * @param shardId Shard ID + */ + function setShardEnclave(uint256 enclaveId, uint256 shardId) external; + + /* + * @notice Get shard IDs of an enclave + * @param enclaveId The Enclave ID + * @return Shard IDs of Enclave + */ + function getEnclaveShards(uint256 enclaveId) external view returns (uint256[] memory); + + /* + * @notice Get all enclave Ids + * @return Enclave Ids + */ + function getAllEnclaveIds() external view returns (uint256[] memory ids); + + /* + * @notice Check if enclave Id is valid + * @param enclaveId Id of enclave + * @return Bool + */ + function isValidEnclaveId(uint256 enclaveId) external view returns (bool); + + /* + * @notice Shard Id to Enclave Id. Reverse mapping a shard to its enclave + * @param shardId Shard Id + * @return Enclave Id + */ + function shardToEnclave(uint256 shardId) external returns (uint256); + + /* + * @notice Get enclave name from Shard Id + * @param enclaveId Id of enclave + * @return Enclave name + */ + function enclaveNames(uint256 enclaveId) external returns (string memory); +} \ No newline at end of file diff --git a/protocol/contracts/interfaces/nexus/IRelic.sol b/protocol/contracts/interfaces/nexus/IRelic.sol new file mode 100644 index 000000000..df8db5593 --- /dev/null +++ b/protocol/contracts/interfaces/nexus/IRelic.sol @@ -0,0 +1,301 @@ +pragma solidity 0.8.19; +// SPDX-License-Identifier: AGPL-3.0-or-later +// Temple (interfaces/nexus/IRelic.sol) + +import { IERC721A } from "./IERC721A.sol"; + +interface IRelic is IERC721A { + enum Rarity { + Common, + Uncommon, + Rare, + Epic, + Legendary + } + + struct RelicInfoView { + uint256 enclaveId; + Rarity rarity; + uint128 xp; + uint256[] shards; + } + + event RarityXPThresholdSet(Rarity rarity, uint256 threshold); + event RarityBaseUriSet(Rarity rarity, string uri); + event RelicMinted(address indexed to, uint256 relicId, uint256 enclaveId); + event ShardSet(address indexed shard); + event RelicXPSet(uint256 indexed relicId, uint256 xp); + event ShardsEquipped(address indexed caller, uint256 indexed relicId, uint256[] shardIds, uint256[] amounts); + event ShardsUnequipped(address indexed recipient, uint256 indexed relicId, uint256[] shardIds, uint256[] amounts); + event AccountBlacklistSet(address indexed account, bool blacklist, uint256[] shardIds, uint256[] amounts); + event AccountBlacklisted(address indexed account, bool blacklist); + event EnclaveNameSet(uint256 id, string name); + event NexusCommonSet(address indexed nexusCommon); + event ShardBlacklistUpdated(uint256 relicId, uint256 shardId, uint256 amount); + event RelicMinterEnclaveSet(address indexed minter, uint256 enclaveId, bool allowed); + + error InvalidParamLength(); + error CallerCannotMint(address msgSender); + error InvalidRelic(uint256 relicId); + error InsufficientShardBalance(uint256 actualBalance, uint256 requestedBalance); + error NotEnoughShardBalance(uint256 equippedBalance, uint256 amount); + error CannotWhitelist(uint256 relicId); + + /* + * @notice Set shard contract + * @param _shard Shard contract + */ + function setShard(address _shard) external; + + /* + * @notice Set relic minter's enclave Ids to mint + * @param minter Address to mint relics + * @param enclaveIds "enclave" Ids to mint. Could be a special non-enclave id. + * @param allow If minter is allowed to mint enclave Id + */ + function setRelicMinterEnclaveIds(address minter, uint256[] memory enclaveIds, bool[] memory allow) external; + + /* + * @notice Set XP threshold for rarities + * @param rarities Rarity array + * @param thresholds Thresholds for XP + */ + function setXPRarityThresholds( + Rarity[] calldata rarities, + uint256[] calldata thresholds + ) external; + + /* + * @notice Set base URI for relic rarity + * @param rarity Rarity + * @param uri URI for relic rarity + */ + function setBaseUriRarity(Rarity rarity, string memory uri) external; + + /* + * @notice Set blacklist for an account's Relic's Shards. Validation checks for account's Relic ownership. + * Function checks and validates equipped shards before blacklisting. + * @param account Account to blacklist + * @param relicId Id of Relic + * @param shardIds An array of Shard Ids + * @param amounts An array of balances for each Shard Id to blacklist + */ + function setBlacklistedShards( + address account, + uint256 relicId, + uint256[] calldata shardIds, + uint256[] calldata amounts + ) external; + + /* + * @notice Whitelist for an account's Relic's Shards + * Function checks there are no Shards blacklisted before whitelisting. + * @param account Account to blacklist + * @param relicId Id of Relic + * @param blacklist If to blacklist account + */ + function unsetBlacklistedShards( + address account, + uint256 relicId, + uint256[] calldata shardIds, + uint256[] calldata amounts + ) external; + + /* + * @notice Set blacklist for an account's Relic. Validation checks Relic is owned by account + * Set blacklist to false for whitelisting. Function checks there are no Shards blacklisted before whitelisting. + * @param account Account to blacklist + * @param relicId Id of Relic + * @param blacklist If to blacklist account + */ + function setBlacklistAccount( + address account, + uint256 relicId, + bool blacklist + ) external; + + /* + * @notice Set XP for a relic + * @param relicId ID of relic + * @param xp XP to set + */ + function setRelicXP(uint256 relicId, uint256 xp) external; + + /* + * @notice Get relics owned by owner + * @param owner Address to check for ownership + * @return _ownerRelics Array of relics + */ + function relicsOfOwner(address _owner) external view returns (uint256[] memory ownerRelics); + + /* + * @notice Get balances of shards equipped by relic + * @param relicId ID of relic + * @param shardIds Shard IDs + * @return balances Balances of shards equipped in relic + */ + function getEquippedShards( + uint256 relicId, + uint256[] memory shardIds + ) external view returns(uint256[] memory balances); + + /* + * @notice Mint Relic. Function checks if recipient address is blacklisted + * @param to Address of recipient + * @param enclaveId Enclave ID + */ + function mintRelic(address to, uint256 enclaveId) external returns (uint256 tokenId); + + /* + * @notice Batch equip shards to a relic + * @param relicId ID of relic + * @param shardIds Shard IDs + * @return amounts Balances of shards to equip + */ + function batchEquipShards( + uint256 relicId, + uint256[] memory shardIds, + uint256[] memory amounts + ) external; + + /* + * @notice Batch unequip shards from relic + * @param relicId ID of relic + * @param shardIds Shard IDs + * @return amounts Balances of shards to unequip + */ + function batchUnequipShards( + uint256 relicId, + uint256[] memory shardIds, + uint256[] memory amounts + ) external; + + /* + * @notice Get total relics minted + * @return uint256 Amount of relics minted + */ + function totalMinted() external view returns (uint256); + + /* + * @notice Recover tokem sent to contract by error + * @param token Address of token + * @param to Recipient of token amount + * @return amount Amount of token to recover + */ + function recoverToken(address token, address to, uint256 amount) external; + + /* + * @notice Burn blacklisted Relic Shards. + * Shard IDs may not be empty. + * @param account Address of account + * @param relicId Relic Id + * @param shardIds Shard Ids + * @param amounts Amounts of shards + */ + function burnBlacklistedRelicShards( + address account, + uint256 relicId, + uint256[] calldata shardIds, + uint256[] calldata amounts + ) external; + + /* + * @notice Get URI of rarity + * @param rarity Rarity type + * @return uri URI + */ + + function getRarityBaseUri(Rarity rarity) external view returns(string memory uri); + /** + * @dev Returns true if this contract implements the interface defined by + * `interfaceId`. See the corresponding + * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) + * to learn more about how these ids are created. + * + * This function call must use less than 30000 gas. + */ + + function supportsInterface(bytes4 interfaceId) external view returns (bool); + /* + * @notice Check if an account is blacklisted + * @param account Account + * @return Boolean if account is blacklisted + */ + + function blacklistedAccounts(address account) external view returns (bool); + /** + * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. + */ + + function tokenURI(uint256 tokenId) external view returns (string memory); + + /* + * @notice Checkpoint the rarity of a relic. This function is open to external calls. + * @param relicId ID of relic + */ + function checkpointRelicRarity(uint256 relicId) external; + + /* + * @notice Get next token Id + * @return uint256 Next token Id + */ + function nextTokenId() external view returns (uint256); + + /* + * @notice Get Relic Info view + * @param relicId Id of Relic + * @return RelicInfoView + */ + function getRelicInfo(uint256 relicId) external view returns (RelicInfoView memory info); + + /* + * @notice Get equipped Shard IDs in a Relic + * @param relicId ID of relic + * @return Array of shards equipped in Relic + */ + function getEquippedShardIds(uint256 relicId) external view returns (uint256[] memory); + + /* + * @notice Set Nexus Common contract + * @param _contract Address of Nexus Common + */ + function setNexusCommon(address _contract) external; + + /* + * @notice Get blacklisted Shards of Relic. + * This is used to keep track of blacklisted relics and blacklisted shard balances + * @param relicId Relic Id + * @param shardId Shard Id + * @return Count of ShardId blacklisted for Relic + */ + function blacklistedRelicShards(uint256 relicId, uint256 shardId) external returns (uint256); + + /* + * @notice Get count of shards blacklisted for Relic + * @param shardId Shard Id + * @return Count of blacklisted Shards + */ + function blacklistedShardsCount(uint256 relicId) external returns (uint256); + + /* + * @notice Get Relic minter enclave Ids + * @param minter Address to check + * @return Enclave Ids + */ + function getRelicMinterEnclaveIds(address minter) external view returns (uint256[] memory); + + /* + * @notice Get XP thresholds for Relic rarity + * @param rarity Rarity + * @return Threshold value for rarity + */ + function rarityXPThresholds(Rarity rarity) external returns (uint256); + + /* + * @notice Get status of address minting Relic with enclaveId + * @param minter Address of mitner + * @param enclaveId Id of enclave + * @return True or False + */ + function isRelicMinter(address minter, uint256 enclaveId) external view returns (bool); +} \ No newline at end of file diff --git a/protocol/contracts/interfaces/nexus/IShard.sol b/protocol/contracts/interfaces/nexus/IShard.sol new file mode 100644 index 000000000..a66e70f28 --- /dev/null +++ b/protocol/contracts/interfaces/nexus/IShard.sol @@ -0,0 +1,199 @@ +pragma solidity 0.8.19; +// SPDX-License-Identifier: AGPL-3.0-or-later +// Temple (interfaces/nexus/IShard.sol) + +import { IERC1155 } from "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; + +interface IShard is IERC1155 { + /* + * struct for partner mint information + */ + struct MintInfo { + uint256 shardId; + uint256 cap; + uint256 balance; + } + + struct Recipe { + uint256[] inputShardIds; + uint256[] inputShardAmounts; + uint256[] outputShardIds; + uint256[] outputShardAmounts; + } + + event Transmuted(address indexed caller, uint256 recipeId); + event ShardUriSet(uint256 indexed shardId, string uri); + event RecipeSet(uint256 recipeId, Recipe recipe); + event RecipeDeleted(uint256 recipeId); + event MinterAllowedShardIdSet(address indexed partner, uint256 indexed shardId, bool allow); + event MinterAllowedShardCapSet(address indexed minter, uint256 indexed shardId, uint256 cap); + event NexusCommonSet(address nexusCommon); + + error CannotMint(uint256 shardId); + error MintCapExceeded(uint256 cap, uint256 amount); + error InvalidRecipe(uint256 recipeId); + error InvalidParamLength(); + error ERC1155MissingApprovalForAll(address msgSender, address account); + + /* + * @notice Enable minters to mint new shards, one after the next. If there are two minters and next shard ID + * is 3, minter 1 and minter 2 can mint shard IDs 3 and 4 respectively + * @param minters Minters to enable for new shards + */ + function setNewMinterShards( + address[] calldata minters + ) external returns (uint256[] memory shards); + + /* + * @notice Set the caps for shards minters can mint + * cap is 0 by default which means unlimited + * @param minter Address of the partner + * @param shardIds Shard IDs + * @param caps The maximum amount partner can mint for each shard + */ + function setAllowedShardCaps( + address minter, + uint256[] calldata shardIds, + uint256[] calldata caps + ) external; + + /* + * @notice Set multiple shard IDs that minter can mint. This is an explicit setting. + * Shard ID must exist. To enable minter for a new shard, use functions setNewMinterShard and setNewMinterShards + * @param minter Address of the minter + * @param shardIds Shard IDs + * @param flags Booleans for if the partner can mint shards + */ + function setMinterAllowedShardIds( + address minter, + uint256[] calldata shardIds, + bool[] calldata flags + ) external; + + /* + * @notice Burn batch shards. Overriden from base contract. + * Modified to allow Relic contract to burn blacklisted account shards. + * @param account The account owning the shard + * @param ids The shard IDs + * @param values The amounts of each shard to burn + */ + function burnBatch(address account, uint256[] memory ids, uint256[] memory values) external; + + /* + * @notice Add a recipe for transmutation + * @param recipe The recipe + */ + function addRecipe(Recipe calldata recipe) external; + + /* + * @notice Delete recipe + * @param recipeId The recipe ID + */ + function deleteRecipe(uint256 recipeId) external; + + /* + * @notice Set uri string of shard ID + * @param shardId The shard ID + * @param uri The uri string + * @return String uri of the shard ID + */ + function setShardUri(uint256 shardId, string memory _uri) external; + + /* + * @notice Get uri string of shard ID + * @param shardId The shard ID + * @return String uri of the shard ID + */ + function uri(uint256 shardId) external view returns (string memory); + + /* + * @notice Transmute caller shards to create a new shard using a recipe + * Caller shards are burned and new shard(s) are minted to caller. + * @param recipeId The ID of the recipe + */ + function transmute(uint256 recipeId) external; + + /* + * @notice Mint shards in batch for allowed minters. + * This is a guarded function which only allowed contracts/addresses can mint. + * Function checks if receiving mint address is blacklisted by Relic contract. + * @param to The address to mint to + * @param shardIds The shard IDs + * @param amounts The amount of each shard ID to mint + */ + function mintBatch( + address to, + uint256[] memory shardIds, + uint256[] memory amounts + ) external; + + /* + * @notice Get shard IDs a minter is allowed to mint + * @param minter The minter with perms + * @return Shard IDs array + */ + function getMinterAllowedShardIds(address minter) external view returns (uint256[] memory); + + /* + * @notice Get next Shard Id + * @return ID + */ + function nextTokenId() external view returns (uint256); + + /* + * @notice Check if given ID is a valid shard ID + * @param id The ID to check + * @return If ID is a valid shard + */ + function isShardId(uint256 id) external view returns (bool); + + /* + * @notice Get information about a recipe + * @param recipeId The ID of the recipe + * @return Recipe information struct. see above + */ + function getRecipeInfo(uint256 recipeId) external view returns (Recipe memory info); + + /* + * @notice Get next Recipe Id + * @return ID of Recipe + */ + function nextRecipeId() external view returns (uint256); + + /* + * @notice Get the information of a minter. + * Fucntion is not validating minter and reverting. Caller should check and handle zero values + * @param minter The minter + * @return MintInfo struct information of minter + */ + function getMintInfo(address minter) external view returns (MintInfo[] memory info); + + /* + * @notice Set Nexus Common contract + * @param _contract Address of Nexus Common + */ + function setNexusCommon(address _contract) external; + + /* + * @notice Get cap value a partner can mint for Shard + * @param minter Partner + * @param shardId Shard Id + * @return Cap + */ + function allowedShardCaps(address minter, uint256 shardId) external returns (uint256); + + /* + * @notice Get mint balances minted by partner address + * @param minter Partner + * @param shardId Shard Id + * @return Balance + */ + function mintBalances(address minter, uint256 shardId) external returns (uint256); + + /* + * @notice Get total mint balances for Shard + * @param shardId ShardId + * @return Total Shards + */ + function totalShardMints(uint256 shardId) external returns (uint256); +} \ No newline at end of file diff --git a/protocol/contracts/interfaces/nexus/ITempleSacrifice.sol b/protocol/contracts/interfaces/nexus/ITempleSacrifice.sol new file mode 100644 index 000000000..c859a1142 --- /dev/null +++ b/protocol/contracts/interfaces/nexus/ITempleSacrifice.sol @@ -0,0 +1,13 @@ +pragma solidity 0.8.19; +// SPDX-License-Identifier: AGPL-3.0-or-later +// Temple (interfaces/nexus/ITempleSacrifice.sol) + + +interface ITempleSacrifice { + + /* + * @notice Set sacrificed temple recipient. + * @param recipient Recipient + */ + function setSacrificedTokenRecipient(address recipient) external; +} \ No newline at end of file diff --git a/protocol/contracts/interfaces/nexus/access/IElevatedAccess.sol b/protocol/contracts/interfaces/nexus/access/IElevatedAccess.sol new file mode 100644 index 000000000..4975d10d8 --- /dev/null +++ b/protocol/contracts/interfaces/nexus/access/IElevatedAccess.sol @@ -0,0 +1,47 @@ +pragma solidity 0.8.19; +// SPDX-License-Identifier: AGPL-3.0-or-later +// Temple (interfaces/nexus/access/IElevatedAccess.sol) + +/** + * @notice Inherit to add Executor role for DAO elevated access. + */ +interface IElevatedAccess { + event ExplicitAccessSet(address indexed account, bytes4 indexed fnSelector, bool indexed value); + + event NewExecutorProposed(address indexed oldExecutor, address indexed oldProposedExecutor, address indexed newProposedExecutor); + event NewExecutorAccepted(address indexed oldExecutor, address indexed newExecutor); + + struct ExplicitAccess { + bytes4 fnSelector; + bool allowed; + } + + /** + * @notice A set of addresses which are approved to execute normal operations on behalf of the DAO. + */ + function executor() external returns (address); + + /** + * @notice Explicit approval for an address to execute a function. + * allowedCaller => function selector => true/false + */ + function explicitFunctionAccess(address contractAddr, bytes4 functionSelector) external returns (bool); + + /** + * @notice Proposes a new Executor. + * Can only be called by the current executor or resucer (if in resuce mode) + */ + function proposeNewExecutor(address account) external; + + /** + * @notice Caller accepts the role as new Executor. + * Can only be called by the proposed executor + */ + function acceptExecutor() external; + + /** + * @notice Grant `allowedCaller` the rights to call the function selectors in the access list. + * @dev fnSelector == bytes4(keccak256("fn(argType1,argType2,...)")) + */ + function setExplicitAccess(address allowedCaller, ExplicitAccess[] calldata access) external; +} diff --git a/protocol/contracts/nexus/BaseSacrifice.sol b/protocol/contracts/nexus/BaseSacrifice.sol new file mode 100644 index 000000000..3bc767243 --- /dev/null +++ b/protocol/contracts/nexus/BaseSacrifice.sol @@ -0,0 +1,99 @@ +pragma solidity 0.8.19; +// SPDX-License-Identifier: AGPL-3.0-or-later +// Temple (nexus/BaseSacrifice.sol) + + +import { IBaseSacrifice } from "../interfaces/nexus/IBaseSacrifice.sol"; +import { ElevatedAccess } from "./access/ElevatedAccess.sol"; +import { CommonEventsAndErrors } from "../common/CommonEventsAndErrors.sol"; +import { mulDiv } from "@prb/math/src/Common.sol"; + +abstract contract BaseSacrifice is IBaseSacrifice, ElevatedAccess { + /// @notice start time from which price increases + uint64 public originTime; + /// @notice custom price set by governance + uint256 public customPrice; + + uint256 private constant MINIMUM_CUSTOM_PRICE = 30 ether; + uint256 private constant ONE_ETHER = 1 ether; + + /// @notice Price parameters + PriceParam public priceParams; + + /* + * @notice Set origin time. + * Origin time is the start of the linear ascending price to params.priceMaxPeriod + * @param _originTime Origin time + */ + function setOriginTime(uint64 _originTime) external override onlyElevatedAccess { + if (_originTime < block.timestamp) { revert CommonEventsAndErrors.InvalidParam(); } + originTime = _originTime; + emit OriginTimeSet(originTime); + } + + /* + * @notice Set price parameters. + * @param _priceParams Price parameters to set + */ + function setPriceParams(PriceParam calldata _priceParams) external override onlyElevatedAccess { + if (_priceParams.minimumPrice > _priceParams.maximumPrice) { revert CommonEventsAndErrors.InvalidParam(); } + if (_priceParams.minimumPrice < MINIMUM_CUSTOM_PRICE) { revert CommonEventsAndErrors.InvalidParam(); } + if (_priceParams.priceMaxPeriod == 0) { revert CommonEventsAndErrors.InvalidParam(); } + priceParams.priceMaxPeriod = _priceParams.priceMaxPeriod; + priceParams.minimumPrice = _priceParams.minimumPrice; + priceParams.maximumPrice = _priceParams.maximumPrice; + + emit PriceParamsSet(_priceParams); + } + + /* + * @notice Set custom price + * owner can reset price with 0 _price value. Custom price can be set anytime during or after params.priceMaxPeriod on + * a flash sale or at a discounted price. + * @param _price Custom price + */ + function setCustomPrice(uint256 _price) external virtual onlyElevatedAccess { + if (_price != 0 && _price < MINIMUM_CUSTOM_PRICE) { revert CommonEventsAndErrors.InvalidParam(); } + customPrice = _price; + emit CustomPriceSet(customPrice); + } + + /* + * @notice Get amount of tokens to mint a Relic + * @return Relic price + */ + function getPrice() external virtual view returns (uint256) { + if (block.timestamp < originTime && customPrice == 0) { + return type(uint256).max; + } + return _getPrice(customPrice, originTime); + } + + function _getPrice(uint256 _customPrice, uint256 _originTime) internal view returns (uint256) { + if (_customPrice > 0) { + return _customPrice; + } + /// @dev starts from params.minimumPrice and tops at params.maximumPrice over params.priceMaxPeriod. + /// Rounded up. price unit in TEMPLE + uint256 timeDifference; + unchecked { + /// @dev safe because timestamp is checked in parent function. + timeDifference = block.timestamp - _originTime; + } + PriceParam memory paramsCache = priceParams; + uint256 price = paramsCache.minimumPrice + + _muldivRoundUp(paramsCache.maximumPrice, timeDifference, paramsCache.priceMaxPeriod); + if (price > paramsCache.maximumPrice) { + price = paramsCache.maximumPrice; + } + return price; + } + + function _muldivRoundUp(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { + result = mulDiv(x, y, denominator); + // See OZ Math.sol for the equivalent mulDiv() with rounding. + if (mulmod(x, y, denominator) > 0) { + result += 1; + } + } +} \ No newline at end of file diff --git a/protocol/contracts/nexus/ERC721ACustom.sol b/protocol/contracts/nexus/ERC721ACustom.sol new file mode 100644 index 000000000..326c7a388 --- /dev/null +++ b/protocol/contracts/nexus/ERC721ACustom.sol @@ -0,0 +1,1154 @@ +// SPDX-License-Identifier: MIT +// ERC721A Contracts v4.2.3 +// Creator: Chiru Labs + +pragma solidity 0.8.19; +// Temple (nexus/ERC721ACustom.sol) + +import "../interfaces/nexus/IERC721A.sol"; + +/** + * @dev Interface of ERC721 token receiver. + */ +interface ERC721A__IERC721Receiver { + function onERC721Received( + address operator, + address from, + uint256 tokenId, + bytes calldata data + ) external returns (bytes4); +} + +/** + * @title ERC721ACustom + * This contract is a fork of https://github.com/chiru-labs/ERC721A/blob/main/contracts/ERC721A.sol + * Modifications: + * 1/ Function tokenURI(uint256 tokenId) has been modified to use the overriden version of _baseURI(uint256 tokenId). + * Our implementation requires using tokenId to get the right base uri. Different token Ids have different base URIs. + * + * @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721) + * Non-Fungible Token Standard, including the Metadata extension. + * Optimized for lower gas during batch mints. + * + * Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...) + * starting from `_startTokenId()`. + * + * Assumptions: + * + * - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply. + * - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256). + */ +abstract contract ERC721ACustom is IERC721A { + // Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364). + struct TokenApprovalRef { + address value; + } + + // ============================================================= + // CONSTANTS + // ============================================================= + + // Mask of an entry in packed address data. + uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1; + + // The bit position of `numberMinted` in packed address data. + uint256 private constant _BITPOS_NUMBER_MINTED = 64; + + // The bit position of `numberBurned` in packed address data. + uint256 private constant _BITPOS_NUMBER_BURNED = 128; + + // The bit position of `aux` in packed address data. + uint256 private constant _BITPOS_AUX = 192; + + // Mask of all 256 bits in packed address data except the 64 bits for `aux`. + uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1; + + // The bit position of `startTimestamp` in packed ownership. + uint256 private constant _BITPOS_START_TIMESTAMP = 160; + + // The bit mask of the `burned` bit in packed ownership. + uint256 private constant _BITMASK_BURNED = 1 << 224; + + // The bit position of the `nextInitialized` bit in packed ownership. + uint256 private constant _BITPOS_NEXT_INITIALIZED = 225; + + // The bit mask of the `nextInitialized` bit in packed ownership. + uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225; + + // The bit position of `extraData` in packed ownership. + uint256 private constant _BITPOS_EXTRA_DATA = 232; + + // Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`. + uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1; + + // The mask of the lower 160 bits for addresses. + uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1; + + // The maximum `quantity` that can be minted with {_mintERC2309}. + // This limit is to prevent overflows on the address data entries. + // For a limit of 5000, a total of 3.689e15 calls to {_mintERC2309} + // is required to cause an overflow, which is unrealistic. + uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000; + + // The `Transfer` event signature is given by: + // `keccak256(bytes("Transfer(address,address,uint256)"))`. + bytes32 private constant _TRANSFER_EVENT_SIGNATURE = + 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef; + + // ============================================================= + // STORAGE + // ============================================================= + + // The next token ID to be minted. + uint256 private _currentIndex; + + // The number of tokens burned. + uint256 private _burnCounter; + + // Token name + string private _name; + + // Token symbol + string private _symbol; + + // Mapping from token ID to ownership details + // An empty struct value does not necessarily mean the token is unowned. + // See {_packedOwnershipOf} implementation for details. + // + // Bits Layout: + // - [0..159] `addr` + // - [160..223] `startTimestamp` + // - [224] `burned` + // - [225] `nextInitialized` + // - [232..255] `extraData` + mapping(uint256 => uint256) private _packedOwnerships; + + // Mapping owner address to address data. + // + // Bits Layout: + // - [0..63] `balance` + // - [64..127] `numberMinted` + // - [128..191] `numberBurned` + // - [192..255] `aux` + mapping(address => uint256) private _packedAddressData; + + // Mapping from token ID to approved address. + mapping(uint256 => TokenApprovalRef) private _tokenApprovals; + + // Mapping from owner to operator approvals + mapping(address => mapping(address => bool)) private _operatorApprovals; + + // ============================================================= + // CONSTRUCTOR + // ============================================================= + + constructor(string memory name_, string memory symbol_) { + _name = name_; + _symbol = symbol_; + _currentIndex = _startTokenId(); + } + + // ============================================================= + // TOKEN COUNTING OPERATIONS + // ============================================================= + + /** + * @dev Returns the starting token ID. + * To change the starting token ID, please override this function. + */ + function _startTokenId() internal view virtual returns (uint256) { + return 0; + } + + /** + * @dev Returns the next token ID to be minted. + */ + function _nextTokenId() internal view virtual returns (uint256) { + return _currentIndex; + } + + /** + * @dev Returns the total number of tokens in existence. + * Burned tokens will reduce the count. + * To get the total number of tokens minted, please see {_totalMinted}. + */ + function totalSupply() public view virtual override returns (uint256) { + // Counter underflow is impossible as _burnCounter cannot be incremented + // more than `_currentIndex - _startTokenId()` times. + unchecked { + return _currentIndex - _burnCounter - _startTokenId(); + } + } + + /** + * @dev Returns the total amount of tokens minted in the contract. + */ + function _totalMinted() internal view virtual returns (uint256) { + // Counter underflow is impossible as `_currentIndex` does not decrement, + // and it is initialized to `_startTokenId()`. + unchecked { + return _currentIndex - _startTokenId(); + } + } + + /** + * @dev Returns the total number of tokens burned. + */ + function _totalBurned() internal view virtual returns (uint256) { + return _burnCounter; + } + + // ============================================================= + // ADDRESS DATA OPERATIONS + // ============================================================= + + /** + * @dev Returns the number of tokens in `owner`'s account. + */ + function balanceOf(address owner) public view virtual override returns (uint256) { + if (owner == address(0)) _revert(BalanceQueryForZeroAddress.selector); + return _packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY; + } + + /** + * Returns the number of tokens minted by `owner`. + */ + function _numberMinted(address owner) internal view returns (uint256) { + return (_packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY; + } + + /** + * Returns the number of tokens burned by or on behalf of `owner`. + */ + function _numberBurned(address owner) internal view returns (uint256) { + return (_packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) & _BITMASK_ADDRESS_DATA_ENTRY; + } + + /** + * Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). + */ + function _getAux(address owner) internal view returns (uint64) { + return uint64(_packedAddressData[owner] >> _BITPOS_AUX); + } + + /** + * Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used). + * If there are multiple variables, please pack them into a uint64. + */ + function _setAux(address owner, uint64 aux) internal virtual { + uint256 packed = _packedAddressData[owner]; + uint256 auxCasted; + // Cast `aux` with assembly to avoid redundant masking. + assembly { + auxCasted := aux + } + packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX); + _packedAddressData[owner] = packed; + } + + // ============================================================= + // IERC165 + // ============================================================= + + /** + * @dev Returns true if this contract implements the interface defined by + * `interfaceId`. See the corresponding + * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) + * to learn more about how these ids are created. + * + * This function call must use less than 30000 gas. + */ + // function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { + // // The interface IDs are constants representing the first 4 bytes + // // of the XOR of all function selectors in the interface. + // // See: [ERC165](https://eips.ethereum.org/EIPS/eip-165) + // // (e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`) + // return + // interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165. + // interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721. + // interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata. + // } + + // ============================================================= + // IERC721Metadata + // ============================================================= + + /** + * @dev Returns the token collection name. + */ + function name() public view virtual override returns (string memory) { + return _name; + } + + /** + * @dev Returns the token collection symbol. + */ + function symbol() public view virtual override returns (string memory) { + return _symbol; + } + + /** + * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. + */ + function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { + if (!_exists(tokenId)) _revert(URIQueryForNonexistentToken.selector); + + string memory baseURI = _baseURI(tokenId); + return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId))) : ''; + } + + /** + * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each + * token will be the concatenation of the `baseURI` and the `tokenId`. Empty + * by default, it can be overridden in child contracts. + */ + function _baseURI(uint256 /*tokenId*/) internal view virtual returns (string memory) { + return ''; + } + + // ============================================================= + // OWNERSHIPS OPERATIONS + // ============================================================= + + /** + * @dev Returns the owner of the `tokenId` token. + * + * Requirements: + * + * - `tokenId` must exist. + */ + function ownerOf(uint256 tokenId) public view virtual override returns (address) { + return address(uint160(_packedOwnershipOf(tokenId))); + } + + /** + * @dev Gas spent here starts off proportional to the maximum mint batch size. + * It gradually moves to O(1) as tokens get transferred around over time. + */ + function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) { + return _unpackedOwnership(_packedOwnershipOf(tokenId)); + } + + /** + * @dev Returns the unpacked `TokenOwnership` struct at `index`. + */ + function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) { + return _unpackedOwnership(_packedOwnerships[index]); + } + + /** + * @dev Returns whether the ownership slot at `index` is initialized. + * An uninitialized slot does not necessarily mean that the slot has no owner. + */ + function _ownershipIsInitialized(uint256 index) internal view virtual returns (bool) { + return _packedOwnerships[index] != 0; + } + + /** + * @dev Initializes the ownership slot minted at `index` for efficiency purposes. + */ + function _initializeOwnershipAt(uint256 index) internal virtual { + if (_packedOwnerships[index] == 0) { + _packedOwnerships[index] = _packedOwnershipOf(index); + } + } + + /** + * Returns the packed ownership data of `tokenId`. + */ + function _packedOwnershipOf(uint256 tokenId) private view returns (uint256 packed) { + if (_startTokenId() <= tokenId) { + packed = _packedOwnerships[tokenId]; + // If the data at the starting slot does not exist, start the scan. + if (packed == 0) { + if (tokenId >= _currentIndex) _revert(OwnerQueryForNonexistentToken.selector); + // Invariant: + // There will always be an initialized ownership slot + // (i.e. `ownership.addr != address(0) && ownership.burned == false`) + // before an unintialized ownership slot + // (i.e. `ownership.addr == address(0) && ownership.burned == false`) + // Hence, `tokenId` will not underflow. + // + // We can directly compare the packed value. + // If the address is zero, packed will be zero. + for (;;) { + unchecked { + packed = _packedOwnerships[--tokenId]; + } + if (packed == 0) continue; + if (packed & _BITMASK_BURNED == 0) return packed; + // Otherwise, the token is burned, and we must revert. + // This handles the case of batch burned tokens, where only the burned bit + // of the starting slot is set, and remaining slots are left uninitialized. + _revert(OwnerQueryForNonexistentToken.selector); + } + } + // Otherwise, the data exists and we can skip the scan. + // This is possible because we have already achieved the target condition. + // This saves 2143 gas on transfers of initialized tokens. + // If the token is not burned, return `packed`. Otherwise, revert. + if (packed & _BITMASK_BURNED == 0) return packed; + } + _revert(OwnerQueryForNonexistentToken.selector); + } + + /** + * @dev Returns the unpacked `TokenOwnership` struct from `packed`. + */ + function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) { + ownership.addr = address(uint160(packed)); + ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP); + ownership.burned = packed & _BITMASK_BURNED != 0; + ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA); + } + + /** + * @dev Packs ownership data into a single uint256. + */ + function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) { + assembly { + // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. + owner := and(owner, _BITMASK_ADDRESS) + // `owner | (block.timestamp << _BITPOS_START_TIMESTAMP) | flags`. + result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags)) + } + } + + /** + * @dev Returns the `nextInitialized` flag set if `quantity` equals 1. + */ + function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) { + // For branchless setting of the `nextInitialized` flag. + assembly { + // `(quantity == 1) << _BITPOS_NEXT_INITIALIZED`. + result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1)) + } + } + + // ============================================================= + // APPROVAL OPERATIONS + // ============================================================= + + /** + * @dev Gives permission to `to` to transfer `tokenId` token to another account. See {ERC721A-_approve}. + * + * Requirements: + * + * - The caller must own the token or be an approved operator. + */ + function approve(address to, uint256 tokenId) public payable virtual override { + _approve(to, tokenId, true); + } + + /** + * @dev Returns the account approved for `tokenId` token. + * + * Requirements: + * + * - `tokenId` must exist. + */ + function getApproved(uint256 tokenId) public view virtual override returns (address) { + if (!_exists(tokenId)) _revert(ApprovalQueryForNonexistentToken.selector); + + return _tokenApprovals[tokenId].value; + } + + /** + * @dev Approve or remove `operator` as an operator for the caller. + * Operators can call {transferFrom} or {safeTransferFrom} + * for any token owned by the caller. + * + * Requirements: + * + * - The `operator` cannot be the caller. + * + * Emits an {ApprovalForAll} event. + */ + function setApprovalForAll(address operator, bool approved) public virtual override { + _operatorApprovals[_msgSenderERC721A()][operator] = approved; + emit ApprovalForAll(_msgSenderERC721A(), operator, approved); + } + + /** + * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. + * + * See {setApprovalForAll}. + */ + function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { + return _operatorApprovals[owner][operator]; + } + + /** + * @dev Returns whether `tokenId` exists. + * + * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. + * + * Tokens start existing when they are minted. See {_mint}. + */ + function _exists(uint256 tokenId) internal view virtual returns (bool result) { + if (_startTokenId() <= tokenId) { + if (tokenId < _currentIndex) { + uint256 packed; + while ((packed = _packedOwnerships[tokenId]) == 0) --tokenId; + result = packed & _BITMASK_BURNED == 0; + } + } + } + + /** + * @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`. + */ + function _isSenderApprovedOrOwner( + address approvedAddress, + address owner, + address msgSender + ) private pure returns (bool result) { + assembly { + // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean. + owner := and(owner, _BITMASK_ADDRESS) + // Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean. + msgSender := and(msgSender, _BITMASK_ADDRESS) + // `msgSender == owner || msgSender == approvedAddress`. + result := or(eq(msgSender, owner), eq(msgSender, approvedAddress)) + } + } + + /** + * @dev Returns the storage slot and value for the approved address of `tokenId`. + */ + function _getApprovedSlotAndAddress(uint256 tokenId) + private + view + returns (uint256 approvedAddressSlot, address approvedAddress) + { + TokenApprovalRef storage tokenApproval = _tokenApprovals[tokenId]; + // The following is equivalent to `approvedAddress = _tokenApprovals[tokenId].value`. + assembly { + approvedAddressSlot := tokenApproval.slot + approvedAddress := sload(approvedAddressSlot) + } + } + + // ============================================================= + // TRANSFER OPERATIONS + // ============================================================= + + /** + * @dev Transfers `tokenId` from `from` to `to`. + * + * Requirements: + * + * - `from` cannot be the zero address. + * - `to` cannot be the zero address. + * - `tokenId` token must be owned by `from`. + * - If the caller is not `from`, it must be approved to move this token + * by either {approve} or {setApprovalForAll}. + * + * Emits a {Transfer} event. + */ + function transferFrom( + address from, + address to, + uint256 tokenId + ) public payable virtual override { + uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); + + // Mask `from` to the lower 160 bits, in case the upper bits somehow aren't clean. + from = address(uint160(uint256(uint160(from)) & _BITMASK_ADDRESS)); + + if (address(uint160(prevOwnershipPacked)) != from) _revert(TransferFromIncorrectOwner.selector); + + (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId); + + // The nested ifs save around 20+ gas over a compound boolean condition. + if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A())) + if (!isApprovedForAll(from, _msgSenderERC721A())) _revert(TransferCallerNotOwnerNorApproved.selector); + + _beforeTokenTransfers(from, to, tokenId, 1); + + // Clear approvals from the previous owner. + assembly { + if approvedAddress { + // This is equivalent to `delete _tokenApprovals[tokenId]`. + sstore(approvedAddressSlot, 0) + } + } + + // Underflow of the sender's balance is impossible because we check for + // ownership above and the recipient's balance can't realistically overflow. + // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256. + unchecked { + // We can directly increment and decrement the balances. + --_packedAddressData[from]; // Updates: `balance -= 1`. + ++_packedAddressData[to]; // Updates: `balance += 1`. + + // Updates: + // - `address` to the next owner. + // - `startTimestamp` to the timestamp of transfering. + // - `burned` to `false`. + // - `nextInitialized` to `true`. + _packedOwnerships[tokenId] = _packOwnershipData( + to, + _BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked) + ); + + // If the next slot may not have been initialized (i.e. `nextInitialized == false`) . + if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) { + uint256 nextTokenId = tokenId + 1; + // If the next slot's address is zero and not burned (i.e. packed value is zero). + if (_packedOwnerships[nextTokenId] == 0) { + // If the next slot is within bounds. + if (nextTokenId != _currentIndex) { + // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. + _packedOwnerships[nextTokenId] = prevOwnershipPacked; + } + } + } + } + + // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean. + uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS; + assembly { + // Emit the `Transfer` event. + log4( + 0, // Start of data (0, since no data). + 0, // End of data (0, since no data). + _TRANSFER_EVENT_SIGNATURE, // Signature. + from, // `from`. + toMasked, // `to`. + tokenId // `tokenId`. + ) + } + if (toMasked == 0) _revert(TransferToZeroAddress.selector); + + _afterTokenTransfers(from, to, tokenId, 1); + } + + /** + * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`. + */ + function safeTransferFrom( + address from, + address to, + uint256 tokenId + ) public payable virtual override { + safeTransferFrom(from, to, tokenId, ''); + } + + /** + * @dev Safely transfers `tokenId` token from `from` to `to`. + * + * Requirements: + * + * - `from` cannot be the zero address. + * - `to` cannot be the zero address. + * - `tokenId` token must exist and be owned by `from`. + * - If the caller is not `from`, it must be approved to move this token + * by either {approve} or {setApprovalForAll}. + * - If `to` refers to a smart contract, it must implement + * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. + * + * Emits a {Transfer} event. + */ + function safeTransferFrom( + address from, + address to, + uint256 tokenId, + bytes memory _data + ) public payable virtual override { + transferFrom(from, to, tokenId); + if (to.code.length != 0) + if (!_checkContractOnERC721Received(from, to, tokenId, _data)) { + _revert(TransferToNonERC721ReceiverImplementer.selector); + } + } + + /** + * @dev Hook that is called before a set of serially-ordered token IDs + * are about to be transferred. This includes minting. + * And also called before burning one token. + * + * `startTokenId` - the first token ID to be transferred. + * `quantity` - the amount to be transferred. + * + * Calling conditions: + * + * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be + * transferred to `to`. + * - When `from` is zero, `tokenId` will be minted for `to`. + * - When `to` is zero, `tokenId` will be burned by `from`. + * - `from` and `to` are never both zero. + */ + function _beforeTokenTransfers( + address from, + address to, + uint256 startTokenId, + uint256 quantity + ) internal virtual {} + + /** + * @dev Hook that is called after a set of serially-ordered token IDs + * have been transferred. This includes minting. + * And also called after one token has been burned. + * + * `startTokenId` - the first token ID to be transferred. + * `quantity` - the amount to be transferred. + * + * Calling conditions: + * + * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been + * transferred to `to`. + * - When `from` is zero, `tokenId` has been minted for `to`. + * - When `to` is zero, `tokenId` has been burned by `from`. + * - `from` and `to` are never both zero. + */ + function _afterTokenTransfers( + address from, + address to, + uint256 startTokenId, + uint256 quantity + ) internal virtual {} + + /** + * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target contract. + * + * `from` - Previous owner of the given token ID. + * `to` - Target address that will receive the token. + * `tokenId` - Token ID to be transferred. + * `_data` - Optional data to send along with the call. + * + * Returns whether the call correctly returned the expected magic value. + */ + function _checkContractOnERC721Received( + address from, + address to, + uint256 tokenId, + bytes memory _data + ) private returns (bool) { + try ERC721A__IERC721Receiver(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns ( + bytes4 retval + ) { + return retval == ERC721A__IERC721Receiver(to).onERC721Received.selector; + } catch (bytes memory reason) { + if (reason.length == 0) { + _revert(TransferToNonERC721ReceiverImplementer.selector); + } + assembly { + revert(add(32, reason), mload(reason)) + } + } + } + + // ============================================================= + // MINT OPERATIONS + // ============================================================= + + /** + * @dev Mints `quantity` tokens and transfers them to `to`. + * + * Requirements: + * + * - `to` cannot be the zero address. + * - `quantity` must be greater than 0. + * + * Emits a {Transfer} event for each mint. + */ + function _mint(address to, uint256 quantity) internal virtual { + uint256 startTokenId = _currentIndex; + if (quantity == 0) _revert(MintZeroQuantity.selector); + + _beforeTokenTransfers(address(0), to, startTokenId, quantity); + + // Overflows are incredibly unrealistic. + // `balance` and `numberMinted` have a maximum limit of 2**64. + // `tokenId` has a maximum limit of 2**256. + unchecked { + // Updates: + // - `address` to the owner. + // - `startTimestamp` to the timestamp of minting. + // - `burned` to `false`. + // - `nextInitialized` to `quantity == 1`. + _packedOwnerships[startTokenId] = _packOwnershipData( + to, + _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0) + ); + + // Updates: + // - `balance += quantity`. + // - `numberMinted += quantity`. + // + // We can directly add to the `balance` and `numberMinted`. + _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1); + + // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean. + uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS; + + if (toMasked == 0) _revert(MintToZeroAddress.selector); + + uint256 end = startTokenId + quantity; + uint256 tokenId = startTokenId; + + do { + assembly { + // Emit the `Transfer` event. + log4( + 0, // Start of data (0, since no data). + 0, // End of data (0, since no data). + _TRANSFER_EVENT_SIGNATURE, // Signature. + 0, // `address(0)`. + toMasked, // `to`. + tokenId // `tokenId`. + ) + } + // The `!=` check ensures that large values of `quantity` + // that overflows uint256 will make the loop run out of gas. + } while (++tokenId != end); + + _currentIndex = end; + } + _afterTokenTransfers(address(0), to, startTokenId, quantity); + } + + /** + * @dev Mints `quantity` tokens and transfers them to `to`. + * + * This function is intended for efficient minting only during contract creation. + * + * It emits only one {ConsecutiveTransfer} as defined in + * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309), + * instead of a sequence of {Transfer} event(s). + * + * Calling this function outside of contract creation WILL make your contract + * non-compliant with the ERC721 standard. + * For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309 + * {ConsecutiveTransfer} event is only permissible during contract creation. + * + * Requirements: + * + * - `to` cannot be the zero address. + * - `quantity` must be greater than 0. + * + * Emits a {ConsecutiveTransfer} event. + */ + function _mintERC2309(address to, uint256 quantity) internal virtual { + uint256 startTokenId = _currentIndex; + if (to == address(0)) _revert(MintToZeroAddress.selector); + if (quantity == 0) _revert(MintZeroQuantity.selector); + if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) _revert(MintERC2309QuantityExceedsLimit.selector); + + _beforeTokenTransfers(address(0), to, startTokenId, quantity); + + // Overflows are unrealistic due to the above check for `quantity` to be below the limit. + unchecked { + // Updates: + // - `balance += quantity`. + // - `numberMinted += quantity`. + // + // We can directly add to the `balance` and `numberMinted`. + _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1); + + // Updates: + // - `address` to the owner. + // - `startTimestamp` to the timestamp of minting. + // - `burned` to `false`. + // - `nextInitialized` to `quantity == 1`. + _packedOwnerships[startTokenId] = _packOwnershipData( + to, + _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0) + ); + + emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to); + + _currentIndex = startTokenId + quantity; + } + _afterTokenTransfers(address(0), to, startTokenId, quantity); + } + + /** + * @dev Safely mints `quantity` tokens and transfers them to `to`. + * + * Requirements: + * + * - If `to` refers to a smart contract, it must implement + * {IERC721Receiver-onERC721Received}, which is called for each safe transfer. + * - `quantity` must be greater than 0. + * + * See {_mint}. + * + * Emits a {Transfer} event for each mint. + */ + function _safeMint( + address to, + uint256 quantity, + bytes memory _data + ) internal virtual { + _mint(to, quantity); + + unchecked { + if (to.code.length != 0) { + uint256 end = _currentIndex; + uint256 index = end - quantity; + do { + if (!_checkContractOnERC721Received(address(0), to, index++, _data)) { + _revert(TransferToNonERC721ReceiverImplementer.selector); + } + } while (index < end); + // Reentrancy protection. + if (_currentIndex != end) _revert(bytes4(0)); + } + } + } + + /** + * @dev Equivalent to `_safeMint(to, quantity, '')`. + */ + function _safeMint(address to, uint256 quantity) internal virtual { + _safeMint(to, quantity, ''); + } + + // ============================================================= + // APPROVAL OPERATIONS + // ============================================================= + + /** + * @dev Equivalent to `_approve(to, tokenId, false)`. + */ + function _approve(address to, uint256 tokenId) internal virtual { + _approve(to, tokenId, false); + } + + /** + * @dev Gives permission to `to` to transfer `tokenId` token to another account. + * The approval is cleared when the token is transferred. + * + * Only a single account can be approved at a time, so approving the + * zero address clears previous approvals. + * + * Requirements: + * + * - `tokenId` must exist. + * + * Emits an {Approval} event. + */ + function _approve( + address to, + uint256 tokenId, + bool approvalCheck + ) internal virtual { + address owner = ownerOf(tokenId); + + if (approvalCheck && _msgSenderERC721A() != owner) + if (!isApprovedForAll(owner, _msgSenderERC721A())) { + _revert(ApprovalCallerNotOwnerNorApproved.selector); + } + + _tokenApprovals[tokenId].value = to; + emit Approval(owner, to, tokenId); + } + + // ============================================================= + // BURN OPERATIONS + // ============================================================= + + /** + * @dev Equivalent to `_burn(tokenId, false)`. + */ + function _burn(uint256 tokenId) internal virtual { + _burn(tokenId, false); + } + + /** + * @dev Destroys `tokenId`. + * The approval is cleared when the token is burned. + * + * Requirements: + * + * - `tokenId` must exist. + * + * Emits a {Transfer} event. + */ + function _burn(uint256 tokenId, bool approvalCheck) internal virtual { + uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId); + + address from = address(uint160(prevOwnershipPacked)); + + (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId); + + if (approvalCheck) { + // The nested ifs save around 20+ gas over a compound boolean condition. + if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A())) + if (!isApprovedForAll(from, _msgSenderERC721A())) _revert(TransferCallerNotOwnerNorApproved.selector); + } + + _beforeTokenTransfers(from, address(0), tokenId, 1); + + // Clear approvals from the previous owner. + assembly { + if approvedAddress { + // This is equivalent to `delete _tokenApprovals[tokenId]`. + sstore(approvedAddressSlot, 0) + } + } + + // Underflow of the sender's balance is impossible because we check for + // ownership above and the recipient's balance can't realistically overflow. + // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256. + unchecked { + // Updates: + // - `balance -= 1`. + // - `numberBurned += 1`. + // + // We can directly decrement the balance, and increment the number burned. + // This is equivalent to `packed -= 1; packed += 1 << _BITPOS_NUMBER_BURNED;`. + _packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1; + + // Updates: + // - `address` to the last owner. + // - `startTimestamp` to the timestamp of burning. + // - `burned` to `true`. + // - `nextInitialized` to `true`. + _packedOwnerships[tokenId] = _packOwnershipData( + from, + (_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked) + ); + + // If the next slot may not have been initialized (i.e. `nextInitialized == false`) . + if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) { + uint256 nextTokenId = tokenId + 1; + // If the next slot's address is zero and not burned (i.e. packed value is zero). + if (_packedOwnerships[nextTokenId] == 0) { + // If the next slot is within bounds. + if (nextTokenId != _currentIndex) { + // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`. + _packedOwnerships[nextTokenId] = prevOwnershipPacked; + } + } + } + } + + emit Transfer(from, address(0), tokenId); + _afterTokenTransfers(from, address(0), tokenId, 1); + + // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times. + unchecked { + _burnCounter++; + } + } + + // ============================================================= + // EXTRA DATA OPERATIONS + // ============================================================= + + /** + * @dev Directly sets the extra data for the ownership data `index`. + */ + function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual { + uint256 packed = _packedOwnerships[index]; + if (packed == 0) _revert(OwnershipNotInitializedForExtraData.selector); + uint256 extraDataCasted; + // Cast `extraData` with assembly to avoid redundant masking. + assembly { + extraDataCasted := extraData + } + packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << _BITPOS_EXTRA_DATA); + _packedOwnerships[index] = packed; + } + + /** + * @dev Called during each token transfer to set the 24bit `extraData` field. + * Intended to be overridden by the cosumer contract. + * + * `previousExtraData` - the value of `extraData` before transfer. + * + * Calling conditions: + * + * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be + * transferred to `to`. + * - When `from` is zero, `tokenId` will be minted for `to`. + * - When `to` is zero, `tokenId` will be burned by `from`. + * - `from` and `to` are never both zero. + */ + function _extraData( + address from, + address to, + uint24 previousExtraData + ) internal view virtual returns (uint24) {} + + /** + * @dev Returns the next extra data for the packed ownership data. + * The returned result is shifted into position. + */ + function _nextExtraData( + address from, + address to, + uint256 prevOwnershipPacked + ) private view returns (uint256) { + uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA); + return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA; + } + + // ============================================================= + // OTHER OPERATIONS + // ============================================================= + + /** + * @dev Returns the message sender (defaults to `msg.sender`). + * + * If you are writing GSN compatible contracts, you need to override this function. + */ + function _msgSenderERC721A() internal view virtual returns (address) { + return msg.sender; + } + + /** + * @dev Converts a uint256 to its ASCII string decimal representation. + */ + function _toString(uint256 value) internal pure virtual returns (string memory str) { + assembly { + // The maximum value of a uint256 contains 78 digits (1 byte per digit), but + // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned. + // We will need 1 word for the trailing zeros padding, 1 word for the length, + // and 3 words for a maximum of 78 digits. Total: 5 * 0x20 = 0xa0. + let m := add(mload(0x40), 0xa0) + // Update the free memory pointer to allocate. + mstore(0x40, m) + // Assign the `str` to the end. + str := sub(m, 0x20) + // Zeroize the slot after the string. + mstore(str, 0) + + // Cache the end of the memory to calculate the length later. + let end := str + + // We write the string from rightmost digit to leftmost digit. + // The following is essentially a do-while loop that also handles the zero case. + // prettier-ignore + for { let temp := value } 1 {} { + str := sub(str, 1) + // Write the character to the pointer. + // The ASCII index of the '0' character is 48. + mstore8(str, add(48, mod(temp, 10))) + // Keep dividing `temp` until zero. + temp := div(temp, 10) + // prettier-ignore + if iszero(temp) { break } + } + + let length := sub(end, str) + // Move the pointer 32 bytes leftwards to make room for the length. + str := sub(str, 0x20) + // Store the length. + mstore(str, length) + } + } + + /** + * @dev For more efficient reverts. + */ + function _revert(bytes4 errorSelector) internal pure { + assembly { + mstore(0x00, errorSelector) + revert(0x00, 0x04) + } + } +} \ No newline at end of file diff --git a/protocol/contracts/nexus/NexusCommon.sol b/protocol/contracts/nexus/NexusCommon.sol new file mode 100644 index 000000000..e251bf0fd --- /dev/null +++ b/protocol/contracts/nexus/NexusCommon.sol @@ -0,0 +1,95 @@ +pragma solidity 0.8.19; +// SPDX-License-Identifier: AGPL-3.0-or-later +// Temple (nexus/NexusCommon.sol) + + +import { EnumerableSet } from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; +import { CommonEventsAndErrors } from "../common/CommonEventsAndErrors.sol"; +import { ElevatedAccess } from "./access/ElevatedAccess.sol"; +import { INexusCommon } from "../interfaces/nexus/INexusCommon.sol"; +import { IShard } from "../interfaces/nexus/IShard.sol"; + +contract NexusCommon is INexusCommon, ElevatedAccess { + using EnumerableSet for EnumerableSet.UintSet; + + IShard public shard; + + /// @notice each shard belongs to exactly 1 enclave. an enclave can have many shards + mapping(uint256 => EnumerableSet.UintSet) private enclaveToShards; + /// @notice reverse mapping a shard to its enclave + mapping(uint256 => uint256) public override shardToEnclave; + /// @notice set of enclave IDs added. + EnumerableSet.UintSet private enclaveIds; + /// @notice id to enclave name + mapping(uint256 => string) public override enclaveNames; + + constructor(address _initialExecutor) ElevatedAccess(_initialExecutor) {} + + /* + * @notice Set shard contract + * @param _shard Shard contract + */ + function setShard(address _shard) external override onlyElevatedAccess { + if(_shard == address(0)) { revert CommonEventsAndErrors.InvalidAddress(); } + shard = IShard(_shard); + emit ShardSet(_shard); + } + + /* + * @notice Set enclave ID to name mapping + * @param id enclave ID + * @param name Name of Enclave + */ + function setEnclaveName(uint256 id, string memory name) external override onlyElevatedAccess { + if (id == 0) { revert CommonEventsAndErrors.InvalidParam(); } + if (bytes(name).length == 0) { revert CommonEventsAndErrors.InvalidParam(); } + enclaveNames[id] = name; + enclaveIds.add(id); + emit EnclaveNameSet(id, name); + } + + /* + * @notice Set shard enclave + * @param enclaveId Enclave ID + * @param shardId Shard ID + */ + function setShardEnclave(uint256 enclaveId, uint256 shardId) external override onlyElevatedAccess { + if (enclaveId == 0) { revert CommonEventsAndErrors.InvalidParam(); } + if(bytes(enclaveNames[enclaveId]).length == 0) { revert CommonEventsAndErrors.InvalidParam(); } + if (!shard.isShardId(shardId)) { revert CommonEventsAndErrors.InvalidParam(); } + /// remove if shard already belongs to an enclave + uint256 oldEnclaveId = shardToEnclave[shardId]; + enclaveToShards[oldEnclaveId].remove(shardId); + + // add shardId to enclave + enclaveToShards[enclaveId].add(shardId); + shardToEnclave[shardId] = enclaveId; + emit ShardEnclaveSet(enclaveId, shardId); + } + + /* + * @notice Get shard IDs of an enclave + * @param enclaveId The Enclave ID + * @return Shard IDs of Enclave + */ + function getEnclaveShards(uint256 enclaveId) external override view returns (uint256[] memory) { + return enclaveToShards[enclaveId].values(); + } + + /* + * @notice Get all enclave Ids + * @return Enclave Ids + */ + function getAllEnclaveIds() external override view returns (uint256[] memory ids) { + ids = enclaveIds.values(); + } + + /* + * @notice Check if enclave Id is valid + * @param enclaveId Id of enclave + * @return Bool + */ + function isValidEnclaveId(uint256 enclaveId) external override view returns (bool) { + return enclaveIds.contains(enclaveId); + } +} \ No newline at end of file diff --git a/protocol/contracts/nexus/PartnerZeroSacrifice.sol b/protocol/contracts/nexus/PartnerZeroSacrifice.sol new file mode 100644 index 000000000..af623c2b2 --- /dev/null +++ b/protocol/contracts/nexus/PartnerZeroSacrifice.sol @@ -0,0 +1,82 @@ +pragma solidity 0.8.19; +// SPDX-License-Identifier: AGPL-3.0-or-later +// Temple (nexus/PartnerZeroSacrifice.sol) + +import { IRelic } from "../interfaces/nexus/IRelic.sol"; +import { IPartnerSacrifice } from "../interfaces/nexus/IBaseSacrifice.sol"; +import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; +import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; +import { ElevatedAccess } from "./access/ElevatedAccess.sol"; +import { CommonEventsAndErrors } from "../common/CommonEventsAndErrors.sol"; + +/** + * @notice A Nexus partner approved to mint Relics for their users, up to a cap. + */ +contract PartnerZeroSacrifice is IPartnerSacrifice, ElevatedAccess { + using SafeERC20 for IERC20; + + /// @notice the Relic ERC721A token + IRelic public immutable relic; + + /// @notice start time from which price increases + uint64 public originTime; + + /// @notice A cap on how many relics can be minted by this contract + uint256 public override mintCap; + + /// @notice The current amount of relics minted by this contract + uint256 public override totalMinted; + + constructor( + address _relic, + address _executor + ) ElevatedAccess(_executor) { + relic = IRelic(_relic); + } + + function setMintCap(uint256 cap) external override onlyElevatedAccess { + /// @dev cap can be 0. For unlimited mints + mintCap = cap; + emit RelicMintCapSet(cap); + } + + /* + * @notice Set origin time. + * Origin time is the start of the linear ascending price to params.priceMaxPeriod + * @param _originTime Origin time + */ + function setOriginTime(uint64 _originTime) external override onlyElevatedAccess { + if (_originTime < block.timestamp) { revert CommonEventsAndErrors.InvalidParam(); } + originTime = _originTime; + emit OriginTimeSet(originTime); + } + + /* + * @notice Get amount of TEMPLE tokens to mint a Relic + * @return Relic price + */ + function getPrice() external pure override returns (uint256) { + return 0; + } + + /* + * @notice Partner's way to mint a Relic. + * Partner's proxy contract is granted access to sacrifice. + * Partner proxy must validate minters before calling this function. + * @param enclaveId Enclave ID + * @param to Address of recipient + */ + function sacrifice(uint256 enclaveId, address to) external override onlyElevatedAccess returns (uint256 relicId) { + if (block.timestamp < originTime) { revert FutureOriginTime(originTime); } + if (to == address(0)) { revert CommonEventsAndErrors.InvalidAddress(); } + + uint256 _newTotalMinted = totalMinted + 1; + if (mintCap > 0 && _newTotalMinted > mintCap) { + revert MintCapExceeded(_newTotalMinted); + } + totalMinted = _newTotalMinted; + + relicId = relic.mintRelic(to, enclaveId); + emit PartnerZeroSacrificed(to, relicId, enclaveId); + } +} \ No newline at end of file diff --git a/protocol/contracts/nexus/Relic.sol b/protocol/contracts/nexus/Relic.sol new file mode 100644 index 000000000..b8dcc6ced --- /dev/null +++ b/protocol/contracts/nexus/Relic.sol @@ -0,0 +1,654 @@ +pragma solidity 0.8.19; +// SPDX-License-Identifier: AGPL-3.0-or-later +// Temple (nexus/Relic.sol) + + +import { ERC721ACustom } from "./ERC721ACustom.sol"; +import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; +import { EnumerableSet } from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; +import { ERC1155Holder } from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol"; +import { ERC1155Receiver } from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Receiver.sol"; +import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; +import { ERC165 } from "@openzeppelin/contracts/utils/introspection/ERC165.sol"; +import { IERC721A } from "../interfaces/nexus/IERC721A.sol"; +import { CommonEventsAndErrors } from "../common/CommonEventsAndErrors.sol"; +import { ElevatedAccess } from "./access/ElevatedAccess.sol"; +import { IShard } from "../interfaces/nexus/IShard.sol"; +import { IRelic } from "../interfaces/nexus/IRelic.sol"; +import { INexusCommon } from "../interfaces/nexus/INexusCommon.sol"; + +/* @notice Relic Contract + * Relic.sol is an ERC721A NFT contract with the functionality to receive and hold Shards. + * Relics can be minted through a process called Temple Sacrifice, where a user sacrifices some TEMPLE tokens + * to mint a Relic according to a price. More details about this price in nexus/TempleSacrifice.sol. + * Relics NFTs are the the fundamental pieces of the Nexus world. Consider Relics as containers which can + * be equipped with Shards and open mysterious doors. Relics have different rarity levels from common to rare to legendary. + * A Relic's rarity changes as XP points are gained. + */ +contract Relic is IRelic, ERC721ACustom, ERC1155Holder, ElevatedAccess { + using SafeERC20 for IERC20; + using EnumerableSet for EnumerableSet.UintSet; + + IShard public shard; + INexusCommon public nexusCommon; + + uint256 private constant PER_MINT_QUANTITY = 0x01; + bytes private constant ZERO_BYTES = ""; + + /// @notice mapping for information about relic. relicId to RelicInfo + mapping(uint256 => RelicInfo) private relicInfos; + + /// @notice base uris for different rarities + mapping(Rarity => string) private baseUris; + + /// @notice XP thresholds for Relic rarity levels + mapping(Rarity => uint256) public override rarityXPThresholds; + + /// @notice to keep track of blacklisted relics and blacklisted shard balances + mapping(uint256 => mapping(uint256 => uint256)) public override blacklistedRelicShards; + mapping(address => bool) public override blacklistedAccounts; + /// @notice count of shards blacklisted for Relic + mapping(uint256 => uint256) public override blacklistedShardsCount; + /// @notice some relic minting contracts may only mint special partner relic "enclave" Ids + mapping(address => EnumerableSet.UintSet) private relicMinterEnclaveIds; + mapping(address => EnumerableSet.UintSet) private ownerRelics; + + struct RelicInfo { + uint256 enclaveId; + Rarity rarity; + uint128 xp; + /// @notice shards equipped to this contract. can extract owner of relic from ownerOf(relicId) + mapping(uint256 => uint256) equippedShards; + /// @notice keep track of equipped shards as set + EnumerableSet.UintSet shards; + } + + constructor( + string memory name_, + string memory symbol_, + address _nexusCommon, + address _initialExecutor + ) ERC721ACustom(name_, symbol_) ElevatedAccess(_initialExecutor) { + nexusCommon = INexusCommon(_nexusCommon); + } + + /* + * @notice Set shard contract + * @param _shard Shard contract + */ + function setShard(address _shard) external override onlyElevatedAccess { + if (_shard == address(0)) { revert CommonEventsAndErrors.InvalidAddress(); } + shard = IShard(_shard); + emit ShardSet(address(shard)); + } + + /* + * @notice Set Nexus Common contract + * @param _contract Address of Nexus Common + */ + function setNexusCommon(address _contract) external override onlyElevatedAccess { + if (address(0) == _contract) { revert CommonEventsAndErrors.InvalidAddress(); } + nexusCommon = INexusCommon(_contract); + emit NexusCommonSet(_contract); + } + + /* + * @notice Override _baseURI. Modified to use relicId. URI of NFT depends on rarity of relic. + * @param enclave Enclave + * @param shardId Shard ID + */ + function _baseURI(uint256 relicId) internal view override returns (string memory uri) { + /// get uri using relicId rarity + RelicInfo storage relicInfo = relicInfos[relicId]; + uri = string( + abi.encodePacked( + baseUris[relicInfo.rarity], + _toString(uint256(relicInfo.enclaveId)) + ) + ); + } + + /** + * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. + */ + function tokenURI(uint256 tokenId) public view override(ERC721ACustom, IRelic) returns (string memory) { + if (!_exists(tokenId)) _revert(URIQueryForNonexistentToken.selector); + + return _baseURI(tokenId); + } + + /* + * @notice Set relic minter's enclave Ids to mint + * @param minter Address to mint relics + * @param enclaveIds "enclave" Ids to mint. Could be a special non-enclave id. + * @param allow If minter is allowed to mint enclave Id + */ + function setRelicMinterEnclaveIds(address minter, uint256[] memory enclaveIds, bool[] memory allow) external override onlyElevatedAccess { + if (minter == address(0)) { revert CommonEventsAndErrors.InvalidAddress(); } + uint256 _length = enclaveIds.length; + if (_length != allow.length) { revert InvalidParamLength(); } + EnumerableSet.UintSet storage minterEnclaveIds = relicMinterEnclaveIds[minter]; + uint256 enclaveId; + bool allowed; + for (uint i; i < _length;) { + allowed = allow[i]; + enclaveId = enclaveIds[i]; + if (allowed) { + minterEnclaveIds.add(enclaveId); + } else { + minterEnclaveIds.remove(enclaveId); + } + emit RelicMinterEnclaveSet(minter, enclaveId, allowed); + unchecked { + ++i; + } + } + } + + /* + * @notice Set XP threshold for rarities + * @param rarities Rarity array + * @param thresholds Thresholds for XP + */ + function setXPRarityThresholds( + Rarity[] calldata rarities, + uint256[] calldata thresholds + ) external override onlyElevatedAccess { + uint256 _length = rarities.length; + if (_length != thresholds.length) { revert InvalidParamLength(); } + for(uint i; i < _length;) { + uint256 _threshold = thresholds[i]; + Rarity _rarity = rarities[i]; + rarityXPThresholds[_rarity] = _threshold; + emit RarityXPThresholdSet(_rarity, _threshold); + unchecked { + ++i; + } + } + } + + /* + * @notice Set base URI for relic rarity + * @param rarity Rarity + * @param uri URI for relic rarity + */ + function setBaseUriRarity(Rarity rarity, string memory _uri) external override onlyElevatedAccess { + if (bytes(_uri).length == 0 ) { revert CommonEventsAndErrors.InvalidParam(); } + baseUris[rarity] = _uri; + emit RarityBaseUriSet(rarity, _uri); + } + + /* + * @notice Set blacklist for an account's Relic. Validation checks Relic is owned by account + * Set blacklist to false for whitelisting. Function checks there are no Shards blacklisted before whitelisting. + * @param account Account to blacklist + * @param relicId Id of Relic + * @param blacklist If to blacklist account + */ + function setBlacklistAccount( + address account, + uint256 relicId, + bool blacklist + ) external override onlyElevatedAccess { + _validateBlacklisting(account, relicId); + if (blacklist) { + blacklistedAccounts[account] = true; + } else { + if (blacklistedShardsCount[relicId] > 0) { revert CannotWhitelist(relicId); } + blacklistedAccounts[account] = false; + } + emit AccountBlacklisted(account, blacklist); + } + + /* + * @notice Set blacklist for an account's Relic's Shards. Validation checks for account's Relic ownership. + * Function checks and validates equipped shards before blacklisting. + * @param account Account to blacklist + * @param relicId Id of Relic + * @param shardIds An array of Shard Ids + * @param amounts An array of balances for each Shard Id to blacklist + */ + function setBlacklistedShards( + address account, + uint256 relicId, + uint256[] calldata shardIds, + uint256[] calldata amounts + ) external override onlyElevatedAccess { + _validateBlacklisting(account, relicId); + uint256 _length = shardIds.length; + if (_length != amounts.length) { revert InvalidParamLength(); } + uint256 shardId; + uint256 amount; + /// @dev only valid in storage because it contains a (nested) mapping. + mapping(uint256 => uint256) storage equippedShards = relicInfos[relicId].equippedShards; + uint256 shardsCount; + uint256 blacklistedRelicBalance; + /// cache for gas savings + mapping(uint256 => uint256) storage blacklistedRelic = blacklistedRelicShards[relicId]; + for(uint i; i < _length;) { + shardId = shardIds[i]; + amount = amounts[i]; + /// blacklist only equipped shards + blacklistedRelicBalance = blacklistedRelic[shardId] + amount; + /// @dev checks that we don't blacklist more than equipped. condition holds if shardIds are duplicated in calldata + if (equippedShards[shardId] < blacklistedRelicBalance) { + revert NotEnoughShardBalance(equippedShards[shardId], blacklistedRelicBalance); + } + blacklistedRelic[shardId] = blacklistedRelicBalance; + emit ShardBlacklistUpdated(relicId, shardId, amount); + shardsCount += amount; + unchecked { + ++i; + } + } + blacklistedShardsCount[relicId] += shardsCount; + /// @dev blacklist account if at least one shard is set. This check holds true for case shardIds is empty + if (shardsCount > 0) { + blacklistedAccounts[account] = true; + } + } + + /* + * @notice Whitelist for an account's Relic's Shards + * Function checks there are no Shards blacklisted before whitelisting. + * @param account Account to blacklist + * @param relicId Id of Relic + * @param blacklist If to blacklist account + */ + function unsetBlacklistedShards( + address account, + uint256 relicId, + uint256[] calldata shardIds, + uint256[] calldata amounts + ) external override onlyElevatedAccess { + _validateBlacklisting(account, relicId); + uint256 _length = shardIds.length; + uint256 shardId; + uint256 amount; + uint256 shardsCount; + uint256 blacklistedRelicShardsCache; + mapping(uint256 => uint256) storage blacklistedRelic = blacklistedRelicShards[relicId]; + for (uint i; i < _length;) { + shardId = shardIds[i]; + amount = amounts[i]; + blacklistedRelicShardsCache = blacklistedRelic[shardId]; + if (amount > blacklistedRelicShardsCache) { revert CommonEventsAndErrors.InvalidParam(); } + shardsCount += amount; + emit ShardBlacklistUpdated(relicId, shardId, amount); + unchecked { + blacklistedRelic[shardId] = blacklistedRelicShardsCache - amount; + ++i; + } + } + blacklistedShardsCount[relicId] -= shardsCount; + if (blacklistedShardsCount[relicId] == 0) { + blacklistedAccounts[account] = false; + } + } + + function _validateBlacklisting(address account, uint256 relicId) internal view { + /// @dev keep for cases of burned relics even if `account != ownerOf(relicId)` satisfies both cases. + if (account == address(0)) { revert CommonEventsAndErrors.InvalidAddress(); } + if (!_exists(relicId)) _revert(URIQueryForNonexistentToken.selector); + if (account != ownerOf(relicId)) { revert CommonEventsAndErrors.InvalidParam(); } + } + + /* + * @notice Set XP for a relic + * @param relicId ID of relic + * @param xp XP to set + */ + function setRelicXP(uint256 relicId, uint256 xp) external override onlyElevatedAccess { + if(!_exists(relicId)) { revert InvalidRelic(relicId); } + RelicInfo storage relicInfo = relicInfos[relicId]; + // leave open for when xp could increase or decrease + relicInfo.xp = uint128(xp); + emit RelicXPSet(relicId, xp); + _checkpointRelicRarity(relicInfo, xp); + } + + /* + * @notice Checkpoint the rarity of a relic. This function is open to external calls. + * @param relicId ID of relic + */ + function checkpointRelicRarity(uint256 relicId) external override { + if(!_exists(relicId)) { revert InvalidRelic(relicId); } + RelicInfo storage relicInfo = relicInfos[relicId]; + _checkpointRelicRarity(relicInfo, relicInfo.xp); + } + + function _checkpointRelicRarity(RelicInfo storage relicInfo, uint256 xp) internal { + // Rarity.Common is default value. so skip check + if (xp >= rarityXPThresholds[Rarity.Legendary]) { + relicInfo.rarity = Rarity.Legendary; + } else if (xp >= rarityXPThresholds[Rarity.Epic]) { + relicInfo.rarity = Rarity.Epic; + } else if (xp >= rarityXPThresholds[Rarity.Rare]) { + relicInfo.rarity = Rarity.Rare; + } else if (xp >= rarityXPThresholds[Rarity.Uncommon]) { + relicInfo.rarity = Rarity.Uncommon; + } + } + + /* + * @notice Get relics owned by owner + * @param owner Address to check for ownership + * @return _ownerRelics Array of relics + */ + function relicsOfOwner(address owner) external view override returns (uint256[] memory _ownerRelics) { + return ownerRelics[owner].values(); + } + + /* + * @notice Get balances of shards equipped by relic + * @param relicId ID of relic + * @param shardIds Shard IDs + * @return balances Balances of shards equipped in relic + */ + function getEquippedShards( + uint256 relicId, + uint256[] memory shardIds + ) external override view returns(uint256[] memory balances) { + if(!_exists(relicId)) { revert InvalidRelic(relicId); } + uint256 _length = shardIds.length; + balances = new uint256[](_length); + /// only valid in storage because it contains nested mapping + RelicInfo storage relicInfo = relicInfos[relicId]; + for (uint i; i < _length;) { + balances[i] = relicInfo.equippedShards[shardIds[i]]; + unchecked { + ++i; + } + } + } + + /* + * @notice Mint Relic. Function checks if recipient address is blacklisted + * @param to Address of recipient + * @param enclave Enclave type + */ + function mintRelic( + address to, + uint256 enclaveId + ) external override notBlacklisted(to) returns (uint256 tokenId) { + if (to == address(0)) { revert CommonEventsAndErrors.InvalidAddress(); } + if (!nexusCommon.isValidEnclaveId(enclaveId)) { revert CommonEventsAndErrors.InvalidParam(); } + if (!isRelicMinter(msg.sender, enclaveId)) { revert CallerCannotMint(msg.sender); } + + tokenId = _nextTokenId(); + RelicInfo storage relicInfo = relicInfos[tokenId]; + relicInfo.enclaveId = enclaveId; + // relicInfo.rarity = Rarity.Common; + // relicInfo.xp = uint128(0); + + ownerRelics[to].add(tokenId); + /// keeping another event because of extra details in RelicMinted event + emit RelicMinted(to, tokenId, enclaveId); + /// user can mint relic anytime after sacrificing some sacrifice tokens and getting whitelisted. one at a time + _safeMint(to, PER_MINT_QUANTITY, ZERO_BYTES); + } + + /* + * @notice Batch equip shards to a relic + * @param relicId ID of relic + * @param shardIds Shard IDs + * @return amounts Balances of shards to equip + */ + function batchEquipShards( + uint256 relicId, + uint256[] calldata shardIds, + uint256[] calldata amounts + ) external override onlyRelicOwner(relicId) notBlacklisted(msg.sender) { + uint256 _length = shardIds.length; + if (_length != amounts.length) { revert InvalidParamLength(); } + // using batch transfer as validation msg.sender owns all shards + shard.safeBatchTransferFrom(msg.sender, address(this), shardIds, amounts, ZERO_BYTES); + RelicInfo storage relicInfo = relicInfos[relicId]; + uint256 shardId; + uint256 amount; + for (uint i; i < _length;) { + shardId = shardIds[i]; + amount = amounts[i]; + relicInfo.equippedShards[shardId] += amount; + /// @dev amounts[i] could be 0 + if (amount > 0) { + relicInfo.shards.add(shardId); + } + unchecked { + ++i; + } + } + emit ShardsEquipped(msg.sender, relicId, shardIds, amounts); + } + + /* + * @notice Batch unequip shards from relic + * @param relicId ID of relic + * @param shardIds Shard IDs + * @return amounts Balances of shards to unequip + */ + function batchUnequipShards( + uint256 relicId, + uint256[] calldata shardIds, + uint256[] calldata amounts + ) external override onlyRelicOwner(relicId) notBlacklisted(msg.sender) { + uint256 _length = shardIds.length; + if (_length != amounts.length) { revert InvalidParamLength(); } + uint256 equippedAmountCache; + uint256 shardId; + uint256 amount; + RelicInfo storage relicInfo = relicInfos[relicId]; + for (uint i; i < _length;) { + shardId = shardIds[i]; + equippedAmountCache = relicInfo.equippedShards[shardId]; + amount = amounts[i]; + if (equippedAmountCache < amount) { revert InsufficientShardBalance(equippedAmountCache, amount); } + /// update Shards set + if (equippedAmountCache == amount) { + relicInfo.shards.remove(shardId); + } + unchecked { + relicInfo.equippedShards[shardId] = equippedAmountCache - amount; + ++i; + } + } + shard.safeBatchTransferFrom(address(this), msg.sender, shardIds, amounts, ZERO_BYTES); + emit ShardsUnequipped(msg.sender, relicId, shardIds, amounts); + } + + /* + * @notice Get total relics minted + * @return uint256 Amount of relics minted + */ + function totalMinted() external override view returns (uint256) { + return _totalMinted(); + } + + /* + * @notice Get next token Id + * @return uint256 Next token Id + */ + function nextTokenId() external override view returns (uint256) { + return _nextTokenId(); + } + + /* + * @notice Recover tokem sent to contract by error + * @param token Address of token + * @param to Recipient of token amount + * @return amount Amount of token to recover + */ + function recoverToken(address token, address to, uint256 amount) external override onlyElevatedAccess { + if (to == address(0)) { revert CommonEventsAndErrors.InvalidAddress(); } + IERC20(token).safeTransfer(to, amount); + emit CommonEventsAndErrors.TokenRecovered(to, token, amount); + } + /* + * @notice Burn blacklisted Relic Shards. + * Shard IDs may not be empty. + * @param account Address of account + * @param relicId Relic Id + * @param shardIds Shard Ids + * @param amounts Amounts of shards + */ + function burnBlacklistedRelicShards( // burnBlacklistedShards + address account, + uint256 relicId, + uint256[] calldata shardIds, + uint256[] calldata amounts + ) external override onlyElevatedAccess { + // account could be whitelisted or blacklisted. important check is account's Relic shards are blacklisted + _validateBlacklisting(account, relicId); + uint256 _length = shardIds.length; + if (_length != amounts.length) { revert InvalidParamLength(); } + mapping(uint256 => uint256) storage equippedShards = relicInfos[relicId].equippedShards; + mapping(uint256 => uint256) storage blacklistedShards = blacklistedRelicShards[relicId]; + uint256 shardId; + uint256 amount; + uint256 equippedShardBalance; + uint256 blacklistedShardsCountCache; + for(uint i; i < _length;) { + shardId = shardIds[i]; + amount = amounts[i]; + // update tracking variables + blacklistedShards[shardId] -= amount; + equippedShardBalance = equippedShards[shardId] - amount; + equippedShards[shardId] = equippedShardBalance; + blacklistedShardsCountCache = blacklistedShardsCount[relicId]; + blacklistedShardsCount[relicId] = blacklistedShardsCountCache - amount; + /// @dev avoid stack too deep + _updateTrackingVariables( + account, + relicId, + shardId, + blacklistedShardsCountCache == amount, + equippedShardBalance == 0 + ); + unchecked { + ++i; + } + } + /// @dev burn from this contract. equipped shards are in contract + shard.burnBatch(address(this), shardIds, amounts); + } + + /// @notice before token transfer to avoid transferring blacklisted shards + function _beforeTokenTransfers( + address from, + address to, + uint256 startTokenId, + uint256 /*quantity*/ + ) internal override { + if (from != address(0) && blacklistedAccounts[from]) { + revert CommonEventsAndErrors.AccountBlacklisted(from); + } + if (to != address(0) && blacklistedAccounts[to]) { + revert CommonEventsAndErrors.AccountBlacklisted(to); + } + // DAO/admin should handle Relic's blacklisted shards explicitly + /// @dev it is impossible to unset blacklist for an account with blacklisted shards > 0 + // if (blacklistedShardsCount[startTokenId] > 0) { + // revert RelicWithBlacklistedShards(); + // } + ownerRelics[from].remove(startTokenId); + ownerRelics[to].add(startTokenId); + } + + function _updateTrackingVariables( + address account, + uint256 relicId, + uint256 shardId, + bool blacklistedShardsCountCacheIsEqualAmount, + bool equippedShardBalanceIsEqualZero + ) internal { + // update tracking variables + if (blacklistedShardsCountCacheIsEqualAmount) { + blacklistedAccounts[account] = false; + } + if (equippedShardBalanceIsEqualZero) { + relicInfos[relicId].shards.remove(shardId); + } + } + + /* + * @notice Get equipped Shard IDs in a Relic + * @param relicId ID of relic + * @return Array of shards equipped in Relic + */ + function getEquippedShardIds(uint256 relicId) external override view returns (uint256[] memory) { + if (!_exists(relicId)) { revert CommonEventsAndErrors.InvalidParam(); } + return relicInfos[relicId].shards.values(); + } + + /* + * @notice Get Relic minter enclave Ids + * @param minter Address to check + * @return Enclave Ids + */ + function getRelicMinterEnclaveIds(address minter) external override view returns (uint256[] memory) { + return relicMinterEnclaveIds[minter].values(); + } + + /* + * @notice Get URI of rarity + * @param rarity Rarity type + * @return uri URI + */ + function getRarityBaseUri(Rarity rarity) external override view returns(string memory uri) { + uri = baseUris[rarity]; + } + + /* + * @notice Get Relic Info view + * @param relicId Id of Relic + * @return RelicInfoView + */ + function getRelicInfo(uint256 relicId) external override view returns (RelicInfoView memory info) { + RelicInfo storage relicInfo = relicInfos[relicId]; + info = RelicInfoView({ + enclaveId: relicInfo.enclaveId, + rarity: relicInfo.rarity, + xp: relicInfo.xp, + shards: relicInfo.shards.values() + }); + } + + /* + * @notice Get status of address minting Relic with enclaveId + * @param minter Address of mitner + * @param enclaveId Id of enclave + * @return True or False + */ + function isRelicMinter(address minter, uint256 enclaveId) public override view returns (bool) { + return relicMinterEnclaveIds[minter].contains(enclaveId); + } + + /** + * @dev Returns true if this contract implements the interface defined by + * `interfaceId`. See the corresponding + * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified) + * to learn more about how these ids are created. + * + * This function call must use less than 30000 gas. + */ + function supportsInterface(bytes4 interfaceId) public pure override(ERC1155Receiver, IERC721A, IRelic) returns (bool) { + // The interface IDs are constants representing the first 4 bytes + // of the XOR of all function selectors in the interface. + // See: [ERC165](https://eips.ethereum.org/EIPS/eip-165) + // (e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`) + return + interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165. + interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721. + interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata. + } + + modifier onlyRelicOwner(uint256 relicId) { + if (msg.sender != ownerOf(relicId)) { revert CommonEventsAndErrors.InvalidAccess(); } + _; + } + + modifier notBlacklisted(address account) { + if (blacklistedAccounts[account]) { revert CommonEventsAndErrors.AccountBlacklisted(account); } + _; + } +} \ No newline at end of file diff --git a/protocol/contracts/nexus/Shard.sol b/protocol/contracts/nexus/Shard.sol new file mode 100644 index 000000000..3d9c8fec0 --- /dev/null +++ b/protocol/contracts/nexus/Shard.sol @@ -0,0 +1,358 @@ +pragma solidity 0.8.19; +// SPDX-License-Identifier: AGPL-3.0-or-later +// Temple (nexus/Shard.sol) + +import { IRelic } from "../interfaces/nexus/IRelic.sol"; +import { IShard } from "../interfaces/nexus/IShard.sol"; +import { INexusCommon } from "../interfaces/nexus/INexusCommon.sol"; +import { ERC1155 } from "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; +import { ERC1155Burnable } from "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Burnable.sol"; +import { EnumerableSet } from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; +import { ElevatedAccess } from "./access/ElevatedAccess.sol"; +import { CommonEventsAndErrors } from "../common/CommonEventsAndErrors.sol"; + + +/* @notice Shard contract + * Shard.sol is a ERC1155 implementation that allows partners and permitted entities to mint so called shards. + * A Shard can be equipped into a Relic. Unlike Relics, shard IDs are not unique and this means many shards with + * the same ID can be minted by allowed entities. Permitted entities mints are controlled by caps for shards. + * Each Shard belongs to 1 enclave, but an enclave can have many Shards. + * Shards are the collection pieces and enable collaboration with partners. Shards can be equipped into Relics. + */ +contract Shard is IShard, ERC1155, ERC1155Burnable, ElevatedAccess { + using EnumerableSet for EnumerableSet.UintSet; + /// @notice Relic NFT contract + IRelic public immutable relic; + INexusCommon public nexusCommon; + uint256 private constant START_TOKEN_ID = 1; + /// @notice current token index + uint256 private _currentIndex; + /// @notice current recipe index + uint256 private _currentRecipeIndex; + + /// @notice all 3 mappings below not combined into a struct for reasons allowedShardIds is read often than the rest. + /// also for easy public reads(read functions). avoids cycle error + /// choosing mapping of address to EnumerableSet to help supporting view functions like getMintInfo + mapping(address => EnumerableSet.UintSet) private allowedShardIds; + mapping(address => mapping(uint256 => uint256)) public override allowedShardCaps; + mapping(address => mapping(uint256 => uint256)) public override mintBalances; + + /// @notice shard ids to uris + mapping(uint256 => string) private shardUris; + /// @notice Recipe for transmutation of shards. + mapping(uint256 => Recipe) private recipes; + /// @notice track total mints for each shard + mapping(uint256 => uint256) public override totalShardMints; + + + constructor( + address _relic, + address _nexusCommon, + address _initialExecutor, + string memory _uri + ) ERC1155(_uri) ElevatedAccess(_initialExecutor) { + relic = IRelic(_relic); + nexusCommon = INexusCommon(_nexusCommon); + _currentIndex = _currentRecipeIndex = START_TOKEN_ID; + } + + /* + * @notice Set Nexus Common contract + * @param _contract Address of Nexus Common + */ + function setNexusCommon(address _contract) external override onlyElevatedAccess { + if (address(0) == _contract) { revert CommonEventsAndErrors.InvalidAddress(); } + nexusCommon = INexusCommon(_contract); + emit NexusCommonSet(_contract); + } + + /* + * @notice Enable minters to mint new shards, one after the next. If there are two minters and next shard ID + * is 3, minter 1 and minter 2 can mint shard IDs 3 and 4 respectively + * @param minters Minters to enable for new shards + */ + function setNewMinterShards( + address[] calldata minters + ) external override onlyElevatedAccess returns (uint256[] memory shards){ + uint256 _length = minters.length; + if (_length == 0) { revert InvalidParamLength(); } + shards = new uint256[](_length); + uint256 shardId; + for (uint i; i < _length;) { + shardId = nextTokenId(); + _currentIndex = shardId + 1; + _setMinterAllowedShardId(minters[i], shardId, true); + shards[i] = shardId; + unchecked { + ++i; + } + } + } + + function _setMinterAllowedShardId( + address minter, + uint256 shardId, + bool allow + ) internal { + if (minter == address(0)) { revert CommonEventsAndErrors.InvalidAddress(); } + if (shardId >= nextTokenId()) { revert CommonEventsAndErrors.InvalidParam(); } + if (allow) { + allowedShardIds[minter].add(shardId); + } else { + allowedShardIds[minter].remove(shardId); + } + emit MinterAllowedShardIdSet(minter, shardId, allow); + } + + /* + * @notice Set multiple shard IDs that minter can mint. This is an explicit setting. + * Shard ID must exist. To enable minter for a new shard, use function setNewMinterShards + * @param minter Address of the minter + * @param shardIds Shard IDs + * @param allow Booleans for if the partner can mint shards + */ + function setMinterAllowedShardIds( + address minter, + uint256[] calldata shardIds, + bool[] calldata allow + ) external override onlyElevatedAccess { + uint256 _length = shardIds.length; + if (_length != allow.length) { revert InvalidParamLength(); } + bool allowed; + uint256 shardId; + for (uint i; i < _length;) { + allowed = allow[i]; + shardId = shardIds[i]; + _setMinterAllowedShardId(minter, shardId, allowed); + unchecked { + ++i; + } + } + } + + /* + * @notice Set the caps for shards minters can mint + * cap is 0 by default which means unlimited + * @param minter Address of the partner + * @param shardIds Shard IDs + * @param caps The maximum amount partner can mint for each shard + */ + function setAllowedShardCaps( + address minter, + uint256[] calldata shardIds, + uint256[] calldata caps + ) external override onlyElevatedAccess { + if (minter == address(0)) { revert CommonEventsAndErrors.InvalidAddress(); } + uint256 _length = shardIds.length; + if (_length != caps.length) { revert InvalidParamLength(); } + uint256 shardId; + uint256 cap; + for (uint i; i < _length; ) { + shardId = shardIds[i]; + if (!allowedShardIds[minter].contains(shardId)) { revert CommonEventsAndErrors.InvalidAddress(); } + cap = caps[i]; + allowedShardCaps[minter][shardId] = cap; + emit MinterAllowedShardCapSet(minter, shardId, cap); + unchecked { + ++i; + } + } + } + + /* + * @notice Add a recipe for transmutation + * @param recipe The recipe + */ + function addRecipe(Recipe calldata recipe) external override onlyElevatedAccess { + uint256 _inputLength = recipe.inputShardIds.length; + if (_inputLength != recipe.inputShardAmounts.length) { revert CommonEventsAndErrors.InvalidParam(); } + uint256 _outputLength = recipe.outputShardAmounts.length; + if (_outputLength != recipe.outputShardIds.length) { revert CommonEventsAndErrors.InvalidParam(); } + + uint256 recipeId = nextRecipeId(); + recipes[recipeId] = recipe; + _currentRecipeIndex = recipeId + 1; + emit RecipeSet(recipeId, recipe); + } + + /* + * @notice Delete recipe + * @param recipeId The recipe ID + */ + function deleteRecipe(uint256 recipeId) external override onlyElevatedAccess { + if (recipes[recipeId].inputShardIds.length == 0) { revert CommonEventsAndErrors.InvalidParam(); } + delete recipes[recipeId]; + emit RecipeDeleted(recipeId); + } + + /* + * @notice Set uri string of shard ID + * @param shardId The shard ID + * @param uri The uri string + * @return String uri of the shard ID + */ + function setShardUri(uint256 shardId, string memory _uri) external override onlyElevatedAccess { + if (bytes(_uri).length == 0 ) { revert CommonEventsAndErrors.InvalidParam(); } + shardUris[shardId] = _uri; + emit ShardUriSet(shardId, _uri); + } + + /* + * @notice Get uri string of shard ID + * @param shardId The shard ID + * @return String uri of the shard ID + */ + function uri(uint256 shardId) public view override(ERC1155, IShard) returns (string memory) { + return shardUris[shardId]; + } + + /* + * @notice Transmute caller shards to create a new shard using a recipe + * Caller shards are burned and new shard(s) are minted to caller. + * @param recipeId The ID of the recipe + */ + function transmute(uint256 recipeId) external override { + address caller = msg.sender; + Recipe memory recipe = recipes[recipeId]; + if (recipe.inputShardIds.length == 0) { revert InvalidRecipe(recipeId); } + /// @dev function checks caller has enough balances + _burnBatch(caller, recipe.inputShardIds, recipe.inputShardAmounts); + _mintBatch(caller, recipe.outputShardIds, recipe.outputShardAmounts, ""); + + emit Transmuted(caller, recipeId); + } + + /* + * @notice Mint shards in batch for allowed minters. + * This is a guarded function which only allowed contracts/addresses can mint. + * Function checks if receiving mint address is blacklisted by Relic contract. + * @param to The address to mint to + * @param shardIds The shard IDs + * @param amounts The amount of each shard ID to mint + */ + function mintBatch( + address to, + uint256[] calldata shardIds, + uint256[] calldata amounts + ) external override isNotBlacklisted(to){ + uint256 _length = shardIds.length; + if (_length != amounts.length) { revert InvalidParamLength(); } + uint256 cap; + uint256 shardId; + uint256 amount; + EnumerableSet.UintSet storage minterShards = allowedShardIds[msg.sender]; + mapping(uint256 => uint256) storage minterShardCaps = allowedShardCaps[msg.sender]; + uint256 newBalance; + for (uint i; i < _length;) { + shardId = shardIds[i]; + if (!minterShards.contains(shardId)) { revert CannotMint(shardId); } + amount = amounts[i]; + cap = minterShardCaps[shardId]; + newBalance = mintBalances[msg.sender][shardId] + amount; + /// @dev checking only if cap set. 0 (default value) is uncapped + if (cap > 0 && cap < newBalance) { + revert MintCapExceeded(cap, amount); + } + mintBalances[msg.sender][shardId] = newBalance; + totalShardMints[shardId] += amount; + unchecked { + ++i; + } + } + _mintBatch(to, shardIds, amounts, ""); + } + + /* + * @notice Burn batch shards. Overriden from base contract. + * Modified to allow Relic contract to burn blacklisted account shards. + * @param account The account owning the shard + * @param ids The shard IDs + * @param values The amounts of each shard to burn + */ + function burnBatch( + address account, + uint256[] memory ids, + uint256[] memory values + ) public override(ERC1155Burnable, IShard) { + // allow relic to burn blacklisted relic shards + if (_msgSender() == address(relic)) { + _burnBatch(account, ids, values); + return; + } else if (account != _msgSender() && !isApprovedForAll(account, _msgSender())) { + revert ERC1155MissingApprovalForAll(_msgSender(), account); + } + _burnBatch(account, ids, values); + } + + /* + * @notice Get shard IDs a minter is allowed to mint + * @param minter The minter with perms + * @return Shard IDs array + */ + function getMinterAllowedShardIds(address minter) external override view returns (uint256[] memory) { + return allowedShardIds[minter].values(); + } + + /* + * @notice Get next Shard Id + * @return ID + */ + function nextTokenId() public override view returns (uint256) { + return _currentIndex; + } + + /* + * @notice Check if given ID is a valid shard ID + * @param id The ID to check + * @return If ID is a valid shard + */ + function isShardId(uint256 id) external override view returns (bool) { + return START_TOKEN_ID <= id && id < nextTokenId(); + } + + /* + * @notice Get information about a recipe + * @param recipeId The ID of the recipe + * @return Recipe information struct. see above + */ + function getRecipeInfo(uint256 recipeId) external override view returns (Recipe memory info) { + info = recipes[recipeId]; + } + + /* + * @notice Get next Recipe Id + * @return Id of recipe + */ + function nextRecipeId() public override view returns (uint256) { + return _currentRecipeIndex; + } + + /* + * @notice Get the information of a minter. + * Function is not validating minter and reverting. Caller should check and handle zero values + * @param minter The minter + * @return MintInfo struct information of minter + */ + function getMintInfo(address minter) external override view returns (MintInfo[] memory info) { + EnumerableSet.UintSet storage minterShards = allowedShardIds[minter]; + uint256 _length = minterShards.length(); + info = new MintInfo[](_length); + uint256 shardId; + for (uint i = 0; i < _length;) { + shardId = minterShards.at(i); + info[i] = MintInfo({ + shardId: shardId, + balance: mintBalances[minter][shardId], + cap: allowedShardCaps[minter][shardId] + }); + unchecked { + ++i; + } + } + } + + modifier isNotBlacklisted(address to) { + if (relic.blacklistedAccounts(to)) { revert CommonEventsAndErrors.AccountBlacklisted(to); } + _; + } +} \ No newline at end of file diff --git a/protocol/contracts/nexus/TempleSacrifice.sol b/protocol/contracts/nexus/TempleSacrifice.sol new file mode 100644 index 000000000..795f79aad --- /dev/null +++ b/protocol/contracts/nexus/TempleSacrifice.sol @@ -0,0 +1,64 @@ +pragma solidity 0.8.19; +// SPDX-License-Identifier: AGPL-3.0-or-later +// Temple (nexus/TempleSacrifice.sol) + +import { IRelic } from "../interfaces/nexus/IRelic.sol"; +import { ITempleSacrifice } from "../interfaces/nexus/ITempleSacrifice.sol"; +import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; +import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; +import { ElevatedAccess } from "./access/ElevatedAccess.sol"; +import { BaseSacrifice } from "./BaseSacrifice.sol"; +import { CommonEventsAndErrors } from "../common/CommonEventsAndErrors.sol"; + +/** + * @notice A user sacrifices Tokens in order to mint a Relic + * The amount required to sacrifice is based on a time increasing rate unless + * otherwise overridden + */ +contract TempleSacrifice is ITempleSacrifice, BaseSacrifice { + using SafeERC20 for IERC20; + /// @notice the Relic ERC721A token + IRelic public immutable relic; + /// @notice the temple token used for payment in minting a relic + IERC20 public immutable sacrificeToken; + /// @notice send sacrificed temple to this address + address public sacrificedTokenRecipient; + + constructor( + address _relic, + address _token, + address _sacrificedTokenRecipient, + address _executor + ) ElevatedAccess(_executor) { + relic = IRelic(_relic); + sacrificeToken = IERC20(_token); + sacrificedTokenRecipient = _sacrificedTokenRecipient; + } + + /* + * @notice Set sacrificed temple recipient. + * @param recipient Recipient + */ + function setSacrificedTokenRecipient(address recipient) external override onlyElevatedAccess { + if (recipient == address(0)) { revert CommonEventsAndErrors.InvalidParam(); } + sacrificedTokenRecipient = recipient; + emit TokenRecipientSet(recipient); + } + + /* + * @notice Sacrifice tokens to mint a Relic + * Caller must approve contract to spend tokens. + * @param enclaveId Enclave ID + * @param to Destination address + */ + function sacrifice(uint256 enclaveId, address to) external override returns (uint256 relicId) { + if (block.timestamp < originTime) { revert FutureOriginTime(originTime); } + if (to == address(0)) { revert CommonEventsAndErrors.InvalidAddress(); } + + uint256 amount = _getPrice(customPrice, originTime); + sacrificeToken.safeTransferFrom(msg.sender, sacrificedTokenRecipient, amount); + + relicId = relic.mintRelic(to, enclaveId); + emit TokenSacrificed(msg.sender, address(sacrificeToken), amount); + } +} \ No newline at end of file diff --git a/protocol/contracts/nexus/access/ElevatedAccess.sol b/protocol/contracts/nexus/access/ElevatedAccess.sol new file mode 100644 index 000000000..e4dc3128c --- /dev/null +++ b/protocol/contracts/nexus/access/ElevatedAccess.sol @@ -0,0 +1,88 @@ +pragma solidity 0.8.19; +// SPDX-License-Identifier: AGPL-3.0-or-later +// Temple (nexus/access/ElevatedAccess.sol) + +import { IElevatedAccess } from "contracts/interfaces/nexus/access/IElevatedAccess.sol"; +import { CommonEventsAndErrors } from "contracts/common/CommonEventsAndErrors.sol"; + +/** + * @notice Inherit to add Executor role for DAO elevated access. + */ +abstract contract ElevatedAccess is IElevatedAccess { + + /** + * @notice The address which is approved to execute normal operations on behalf of the DAO. + */ + address public override executor; + + /** + * @notice Explicit approval for an address to execute a function. + * allowedCaller => function selector => true/false + */ + mapping(address => mapping(bytes4 => bool)) public override explicitFunctionAccess; + + /// @dev Track proposed executor + address private _proposedNewExecutor; + + constructor(address initialExecutor) { + if (initialExecutor == address(0)) revert CommonEventsAndErrors.InvalidAddress(); + + executor = initialExecutor; + } + + /** + * @notice Proposes a new Executor. + * Can only be called by the current executor + */ + function proposeNewExecutor(address account) external override onlyElevatedAccess { + if (account == address(0)) revert CommonEventsAndErrors.InvalidAddress(); + emit NewExecutorProposed(executor, _proposedNewExecutor, account); + _proposedNewExecutor = account; + } + + /** + * @notice Caller accepts the role as new Executor. + * Can only be called by the proposed executor + */ + function acceptExecutor() external override { + if (msg.sender != _proposedNewExecutor) revert CommonEventsAndErrors.InvalidAccess(); + + emit NewExecutorAccepted(executor, msg.sender); + executor = msg.sender; + delete _proposedNewExecutor; + } + + /** + * @notice Grant `allowedCaller` the rights to call the function selectors in the access list. + * @dev fnSelector == bytes4(keccak256("fn(argType1,argType2,...)")) + */ + function setExplicitAccess(address allowedCaller, ExplicitAccess[] calldata access) external override onlyElevatedAccess { + if (allowedCaller == address(0)) revert CommonEventsAndErrors.InvalidAddress(); + uint256 _length = access.length; + ExplicitAccess memory _access; + for (uint256 i; i < _length; ++i) { + _access = access[i]; + emit ExplicitAccessSet(allowedCaller, _access.fnSelector, _access.allowed); + explicitFunctionAccess[allowedCaller][_access.fnSelector] = _access.allowed; + } + } + + function isElevatedAccess(address caller, bytes4 fnSelector) internal view returns (bool) { + // true if the executor can call all functions + // or the caller has been given explicit access on this function + return ( + caller == executor || explicitFunctionAccess[caller][fnSelector] + ); + } + + /** + * @notice Under normal operations, only the executors are allowed to call.. + * @dev Important: Only for use when called from an *external* contract. + * If a function with this modifier is called internally then the `msg.sig` + * will still refer to the top level externally called function. + */ + modifier onlyElevatedAccess() { + if (!isElevatedAccess(msg.sender, msg.sig)) revert CommonEventsAndErrors.InvalidAccess(); + _; + } +} diff --git a/protocol/foundry.toml b/protocol/foundry.toml index d67e97898..b30268efe 100644 --- a/protocol/foundry.toml +++ b/protocol/foundry.toml @@ -11,7 +11,7 @@ evm_version = "paris" # See https://www.evmdiff.com/features?name=PUSH0&kind=opcode [profile.ci] - fuzz = { runs = 5000 } + fuzz = { runs = 5000, seed = "0x4444" } invariant = { runs = 1000 } [profile.lite] diff --git a/protocol/hardhat.config.ts b/protocol/hardhat.config.ts index 1c30173db..afa3820a7 100644 --- a/protocol/hardhat.config.ts +++ b/protocol/hardhat.config.ts @@ -186,6 +186,13 @@ module.exports = { url: "http://127.0.0.1:8545/", accounts: "remote", }, + arbitrumGoerli: { + url: process.env.ARBITRUM_GOERLI_RPC_URL || '', + accounts: process.env.ARBITRUM_GOERLI_ADDRESS_PRIVATE_KEY + ? [process.env.ARBITRUM_GOERLI_ADDRESS_PRIVATE_KEY] + : [], + gasPrice: 2000000000, + } }, etherscan: { @@ -196,6 +203,7 @@ module.exports = { polygon: process.env.POLYGONSCAN_API_KEY, goerli: process.env.ETHERSCAN_API_KEY, sepolia: process.env.ETHERSCAN_API_KEY, + arbitrumGoerli: process.env.ARBISCAN_API_KEY, } }, mocha: { diff --git a/protocol/lib/forge-std b/protocol/lib/forge-std index 74cfb77e3..2f1126975 160000 --- a/protocol/lib/forge-std +++ b/protocol/lib/forge-std @@ -1 +1 @@ -Subproject commit 74cfb77e308dd188d2f58864aaf44963ae6b88b1 +Subproject commit 2f112697506eab12d433a65fdc31a639548fe365 diff --git a/protocol/scripts/deploys/arbitrumGoerli/deploymentArgs/0x08C0E5d99C9BD140c2cdf3c1B6171f1Aa91D4FD0.js b/protocol/scripts/deploys/arbitrumGoerli/deploymentArgs/0x08C0E5d99C9BD140c2cdf3c1B6171f1Aa91D4FD0.js new file mode 100644 index 000000000..0dacd84a8 --- /dev/null +++ b/protocol/scripts/deploys/arbitrumGoerli/deploymentArgs/0x08C0E5d99C9BD140c2cdf3c1B6171f1Aa91D4FD0.js @@ -0,0 +1,6 @@ +// arbitrumGoerli: PARTNER_ZERO_SACRIFICE=0x08C0E5d99C9BD140c2cdf3c1B6171f1Aa91D4FD0 +// yarn hardhat verify --network arbitrumGoerli 0x08C0E5d99C9BD140c2cdf3c1B6171f1Aa91D4FD0 --constructor-args scripts/deploys/arbitrumGoerli/deploymentArgs/0x08C0E5d99C9BD140c2cdf3c1B6171f1Aa91D4FD0.js +module.exports = [ + "0x4b410e5Dc4823B24301038E1bAe9b7B1204F6608", + "0xC785695710292c042a2de8A0Ba16F3a054cC2eAD" +]; \ No newline at end of file diff --git a/protocol/scripts/deploys/arbitrumGoerli/deploymentArgs/0x4b410e5Dc4823B24301038E1bAe9b7B1204F6608.js b/protocol/scripts/deploys/arbitrumGoerli/deploymentArgs/0x4b410e5Dc4823B24301038E1bAe9b7B1204F6608.js new file mode 100644 index 000000000..f48189095 --- /dev/null +++ b/protocol/scripts/deploys/arbitrumGoerli/deploymentArgs/0x4b410e5Dc4823B24301038E1bAe9b7B1204F6608.js @@ -0,0 +1,8 @@ +// arbitrumGoerli: RELIC=0x4b410e5Dc4823B24301038E1bAe9b7B1204F6608 +// yarn hardhat verify --network arbitrumGoerli 0x4b410e5Dc4823B24301038E1bAe9b7B1204F6608 --constructor-args scripts/deploys/arbitrumGoerli/deploymentArgs/0x4b410e5Dc4823B24301038E1bAe9b7B1204F6608.js +module.exports = [ + "RELIC", + "REL", + "0xe6327BEa2966CeE72b24C79Cd90FFBf01A61e8Cc", + "0xC785695710292c042a2de8A0Ba16F3a054cC2eAD" +]; \ No newline at end of file diff --git a/protocol/scripts/deploys/arbitrumGoerli/deploymentArgs/0x53b77919E73807a491371212323EB4D0671CC238.js b/protocol/scripts/deploys/arbitrumGoerli/deploymentArgs/0x53b77919E73807a491371212323EB4D0671CC238.js new file mode 100644 index 000000000..753edbab7 --- /dev/null +++ b/protocol/scripts/deploys/arbitrumGoerli/deploymentArgs/0x53b77919E73807a491371212323EB4D0671CC238.js @@ -0,0 +1,8 @@ +// arbitrumGoerli: SHARD=0x53b77919E73807a491371212323EB4D0671CC238 +// yarn hardhat verify --network arbitrumGoerli 0x53b77919E73807a491371212323EB4D0671CC238 --constructor-args scripts/deploys/arbitrumGoerli/deploymentArgs/0x53b77919E73807a491371212323EB4D0671CC238.js +module.exports = [ + "0x915f8a22715aA064c95390542F56366a1d5D4933", + "0xe6327BEa2966CeE72b24C79Cd90FFBf01A61e8Cc", + "0xC785695710292c042a2de8A0Ba16F3a054cC2eAD", + "ipfs://QmVBhkqq3qEeQvdCDWSXQGMX7hFDymZvy7X7J4z9GsUAB3/" +]; \ No newline at end of file diff --git a/protocol/scripts/deploys/arbitrumGoerli/deploymentArgs/0xcAeAc87b834c8FE98e5E9CA4f96Ffb616AD27bc4.js b/protocol/scripts/deploys/arbitrumGoerli/deploymentArgs/0xcAeAc87b834c8FE98e5E9CA4f96Ffb616AD27bc4.js new file mode 100644 index 000000000..01841e2e2 --- /dev/null +++ b/protocol/scripts/deploys/arbitrumGoerli/deploymentArgs/0xcAeAc87b834c8FE98e5E9CA4f96Ffb616AD27bc4.js @@ -0,0 +1,8 @@ +// arbitrumGoerli: TEMPLE_SACRIFICE=0xcAeAc87b834c8FE98e5E9CA4f96Ffb616AD27bc4 +// yarn hardhat verify --network arbitrumGoerli 0xcAeAc87b834c8FE98e5E9CA4f96Ffb616AD27bc4 --constructor-args scripts/deploys/arbitrumGoerli/deploymentArgs/0xcAeAc87b834c8FE98e5E9CA4f96Ffb616AD27bc4.js +module.exports = [ + "0x915f8a22715aA064c95390542F56366a1d5D4933", + "0xcbc7cf85dd0AB91Aa2671400E86ebf3AaC6dc658", + "0xC785695710292c042a2de8A0Ba16F3a054cC2eAD", + "0xC785695710292c042a2de8A0Ba16F3a054cC2eAD" +]; \ No newline at end of file diff --git a/protocol/scripts/deploys/arbitrumGoerli/deploymentArgs/0xcbc7cf85dd0AB91Aa2671400E86ebf3AaC6dc658.js b/protocol/scripts/deploys/arbitrumGoerli/deploymentArgs/0xcbc7cf85dd0AB91Aa2671400E86ebf3AaC6dc658.js new file mode 100644 index 000000000..2ecfc7b5b --- /dev/null +++ b/protocol/scripts/deploys/arbitrumGoerli/deploymentArgs/0xcbc7cf85dd0AB91Aa2671400E86ebf3AaC6dc658.js @@ -0,0 +1,3 @@ +// arbitrumGoerli: TEMPLE=0xcbc7cf85dd0AB91Aa2671400E86ebf3AaC6dc658 +// yarn hardhat verify --network arbitrumGoerli 0xcbc7cf85dd0AB91Aa2671400E86ebf3AaC6dc658 --constructor-args scripts/deploys/arbitrumGoerli/deploymentArgs/0xcbc7cf85dd0AB91Aa2671400E86ebf3AaC6dc658.js +module.exports = []; \ No newline at end of file diff --git a/protocol/scripts/deploys/arbitrumGoerli/deploymentArgs/0xe6327BEa2966CeE72b24C79Cd90FFBf01A61e8Cc.js b/protocol/scripts/deploys/arbitrumGoerli/deploymentArgs/0xe6327BEa2966CeE72b24C79Cd90FFBf01A61e8Cc.js new file mode 100644 index 000000000..00dd22535 --- /dev/null +++ b/protocol/scripts/deploys/arbitrumGoerli/deploymentArgs/0xe6327BEa2966CeE72b24C79Cd90FFBf01A61e8Cc.js @@ -0,0 +1,5 @@ +// arbitrumGoerli: NEXUS_COMMON=0xe6327BEa2966CeE72b24C79Cd90FFBf01A61e8Cc +// yarn hardhat verify --network arbitrumGoerli 0xe6327BEa2966CeE72b24C79Cd90FFBf01A61e8Cc --constructor-args scripts/deploys/arbitrumGoerli/deploymentArgs/0xe6327BEa2966CeE72b24C79Cd90FFBf01A61e8Cc.js +module.exports = [ + "0xC785695710292c042a2de8A0Ba16F3a054cC2eAD" +]; \ No newline at end of file diff --git a/protocol/scripts/deploys/arbitrumGoerli/nexus/00-temple-token.ts b/protocol/scripts/deploys/arbitrumGoerli/nexus/00-temple-token.ts new file mode 100644 index 000000000..e2ab005ce --- /dev/null +++ b/protocol/scripts/deploys/arbitrumGoerli/nexus/00-temple-token.ts @@ -0,0 +1,27 @@ +import '@nomiclabs/hardhat-ethers'; +import { ethers } from 'hardhat'; +import { TempleERC20Token__factory } from '../../../../typechain'; +import { + deployAndMine, + ensureExpectedEnvvars, +} from '../../helpers'; + +async function main() { + ensureExpectedEnvvars(); + const [owner] = await ethers.getSigners(); + + const templeFactory = new TempleERC20Token__factory(owner); + await deployAndMine( + 'TEMPLE', templeFactory, templeFactory.deploy, + ) + +} + +// We recommend this pattern to be able to use async/await everywhere +// and properly handle errors. +main() + .then(() => process.exit(0)) + .catch(error => { + console.error(error); + process.exit(1); + }); \ No newline at end of file diff --git a/protocol/scripts/deploys/arbitrumGoerli/nexus/01-nexus-common.ts b/protocol/scripts/deploys/arbitrumGoerli/nexus/01-nexus-common.ts new file mode 100644 index 000000000..c2357b428 --- /dev/null +++ b/protocol/scripts/deploys/arbitrumGoerli/nexus/01-nexus-common.ts @@ -0,0 +1,30 @@ +import '@nomiclabs/hardhat-ethers'; +import { ethers } from 'hardhat'; +import { NexusCommon__factory } from '../../../../typechain'; +import { + deployAndMine, + ensureExpectedEnvvars, +} from '../../helpers'; + +async function main() { + ensureExpectedEnvvars(); + const [owner] = await ethers.getSigners(); + + const nexusCommonFactory= new NexusCommon__factory(owner); + await deployAndMine( + 'NEXUS_COMMON', + nexusCommonFactory, + nexusCommonFactory.deploy, + await owner.getAddress() // initial executor + ); + +} + +// We recommend this pattern to be able to use async/await everywhere +// and properly handle errors. +main() + .then(() => process.exit(0)) + .catch(error => { + console.error(error); + process.exit(1); + }); \ No newline at end of file diff --git a/protocol/scripts/deploys/arbitrumGoerli/nexus/02-relic.ts b/protocol/scripts/deploys/arbitrumGoerli/nexus/02-relic.ts new file mode 100644 index 000000000..1a5c15c7e --- /dev/null +++ b/protocol/scripts/deploys/arbitrumGoerli/nexus/02-relic.ts @@ -0,0 +1,35 @@ +import '@nomiclabs/hardhat-ethers'; +import { ethers, network } from 'hardhat'; +import { Relic__factory } from '../../../../typechain'; +import { + deployAndMine, + ensureExpectedEnvvars, + DEPLOYED_CONTRACTS +} from '../../helpers'; + +async function main() { + ensureExpectedEnvvars(); + const [owner] = await ethers.getSigners(); + + const relicFactory= new Relic__factory(owner); + const nexusCommon = DEPLOYED_CONTRACTS[network.name].NEXUS_COMMON; + await deployAndMine( + 'RELIC', + relicFactory, + relicFactory.deploy, + "RELIC", + "REL", + nexusCommon, + await owner.getAddress() // initial executor + ); + +} + +// We recommend this pattern to be able to use async/await everywhere +// and properly handle errors. +main() + .then(() => process.exit(0)) + .catch(error => { + console.error(error); + process.exit(1); + }); \ No newline at end of file diff --git a/protocol/scripts/deploys/arbitrumGoerli/nexus/03-shard.ts b/protocol/scripts/deploys/arbitrumGoerli/nexus/03-shard.ts new file mode 100644 index 000000000..7ce90776e --- /dev/null +++ b/protocol/scripts/deploys/arbitrumGoerli/nexus/03-shard.ts @@ -0,0 +1,36 @@ +import '@nomiclabs/hardhat-ethers'; +import { ethers, network } from 'hardhat'; +import { Shard__factory } from '../../../../typechain'; +import { + deployAndMine, + ensureExpectedEnvvars, + DEPLOYED_CONTRACTS +} from '../../helpers'; + +async function main() { + ensureExpectedEnvvars(); + const [owner] = await ethers.getSigners(); + const relicAddress = DEPLOYED_CONTRACTS[network.name].RELIC; + + const shardFactory = new Shard__factory(owner); + const uri = 'ipfs://QmVBhkqq3qEeQvdCDWSXQGMX7hFDymZvy7X7J4z9GsUAB3/'; + const nexusCommon = DEPLOYED_CONTRACTS[network.name].NEXUS_COMMON; + await deployAndMine( + 'SHARD', + shardFactory, + shardFactory.deploy, + relicAddress, + nexusCommon, + await owner.getAddress(), // initial executor + uri + ); +} + +// We recommend this pattern to be able to use async/await everywhere +// and properly handle errors. +main() + .then(() => process.exit(0)) + .catch(error => { + console.error(error); + process.exit(1); + }); \ No newline at end of file diff --git a/protocol/scripts/deploys/arbitrumGoerli/nexus/04-temple-sacrifice.ts b/protocol/scripts/deploys/arbitrumGoerli/nexus/04-temple-sacrifice.ts new file mode 100644 index 000000000..288dc1929 --- /dev/null +++ b/protocol/scripts/deploys/arbitrumGoerli/nexus/04-temple-sacrifice.ts @@ -0,0 +1,36 @@ +import '@nomiclabs/hardhat-ethers'; +import { ethers, network } from 'hardhat'; +import { TempleSacrifice__factory } from '../../../../typechain'; +import { + deployAndMine, + ensureExpectedEnvvars, + DEPLOYED_CONTRACTS +} from '../../helpers'; + +async function main() { + ensureExpectedEnvvars(); + const [owner] = await ethers.getSigners(); + const relicAddress = DEPLOYED_CONTRACTS[network.name].RELIC; + const templeToken = DEPLOYED_CONTRACTS[network.name].TEMPLE; + + const templeSacrifice = new TempleSacrifice__factory(owner); + const executor = await owner.getAddress(); + await deployAndMine( + 'TEMPLE_SACRIFICE', + templeSacrifice, + templeSacrifice.deploy, + relicAddress, + templeToken, + executor, // sacrificed token recipient + executor // initial executor + ); +} + +// We recommend this pattern to be able to use async/await everywhere +// and properly handle errors. +main() + .then(() => process.exit(0)) + .catch(error => { + console.error(error); + process.exit(1); + }); \ No newline at end of file diff --git a/protocol/scripts/deploys/arbitrumGoerli/nexus/05-partner-sacrifice.ts b/protocol/scripts/deploys/arbitrumGoerli/nexus/05-partner-sacrifice.ts new file mode 100644 index 000000000..5415492ab --- /dev/null +++ b/protocol/scripts/deploys/arbitrumGoerli/nexus/05-partner-sacrifice.ts @@ -0,0 +1,33 @@ +import '@nomiclabs/hardhat-ethers'; +import { ethers, network } from 'hardhat'; +import { PartnerZeroSacrifice__factory } from '../../../../typechain'; +import { + deployAndMine, + ensureExpectedEnvvars, + DEPLOYED_CONTRACTS +} from '../../helpers'; + +async function main() { + ensureExpectedEnvvars(); + const [owner] = await ethers.getSigners(); + const relicAddress = DEPLOYED_CONTRACTS[network.name].RELIC; + + const partnerSacrifice = new PartnerZeroSacrifice__factory(owner); + const executor = await owner.getAddress(); + await deployAndMine( + 'PARTNER_ZERO_SACRIFICE', + partnerSacrifice, + partnerSacrifice.deploy, + relicAddress, + executor + ); +} + +// We recommend this pattern to be able to use async/await everywhere +// and properly handle errors. +main() + .then(() => process.exit(0)) + .catch(error => { + console.error(error); + process.exit(1); + }); \ No newline at end of file diff --git a/protocol/scripts/deploys/arbitrumGoerli/nexus/99a-relic-post-deployment.ts b/protocol/scripts/deploys/arbitrumGoerli/nexus/99a-relic-post-deployment.ts new file mode 100644 index 000000000..9750a4f71 --- /dev/null +++ b/protocol/scripts/deploys/arbitrumGoerli/nexus/99a-relic-post-deployment.ts @@ -0,0 +1,44 @@ +import { ethers, network } from 'hardhat'; +import { + ensureExpectedEnvvars, + mine +} from '../../helpers'; +import { TempleERC20Token__factory, Relic__factory, TempleSacrifice__factory } from '../../../../typechain'; +import { DEPLOYED_CONTRACTS } from '../../helpers'; + +async function main() { + ensureExpectedEnvvars(); + + const [owner] = await ethers.getSigners(); + const deployedContracts = DEPLOYED_CONTRACTS[network.name]; + const relic = Relic__factory.connect(deployedContracts.RELIC, owner); + const temple = TempleERC20Token__factory.connect(deployedContracts.TEMPLE, owner); + + + const ownerAddress = await owner.getAddress(); + + // set shard + await mine(relic.setShard(deployedContracts.SHARD)); + await mine(relic.setNexusCommon(deployedContracts.NEXUS_COMMON)); + + // set Relic minter enclave IDs + const enclaveIds = [1, 2, 3, 4, 5]; + const allow = [true, true, true, true]; + await mine(relic.setRelicMinterEnclaveIds(deployedContracts.TEMPLE_SACRIFICE, enclaveIds, allow)); + const zeroRarityUri = "ipfs://QmVBhkqq3qEeQvdCDWSXQGMX7hFDymZvy7X7J4z9GsUAB3/"; + await mine(relic.setBaseUriRarity(0, zeroRarityUri)); + + // TESTNET ONLY -- Allow owner to mint Testnet Temple + { + await mine(temple.addMinter(ownerAddress)); + } +} + +// We recommend this pattern to be able to use async/await everywhere +// and properly handle errors. +main() + .then(() => process.exit(0)) + .catch(error => { + console.error(error); + process.exit(1); + }); \ No newline at end of file diff --git a/protocol/scripts/deploys/arbitrumGoerli/nexus/99b-shard-post-deployment.ts b/protocol/scripts/deploys/arbitrumGoerli/nexus/99b-shard-post-deployment.ts new file mode 100644 index 000000000..276a66b53 --- /dev/null +++ b/protocol/scripts/deploys/arbitrumGoerli/nexus/99b-shard-post-deployment.ts @@ -0,0 +1,46 @@ +import { ethers, network } from 'hardhat'; +import { + ensureExpectedEnvvars, + mine +} from '../../helpers'; +import { Shard__factory } from '../../../../typechain'; +import { DEPLOYED_CONTRACTS } from '../../helpers'; + +async function main() { + ensureExpectedEnvvars(); + + const [owner] = await ethers.getSigners(); + const deployedContracts = DEPLOYED_CONTRACTS[network.name]; + const shardId1 = 1; + const shardId2 = 2; + const shardId3 = 3; + + const shard = Shard__factory.connect(deployedContracts.SHARD, owner); + + await mine(shard.setNexusCommon(deployedContracts.NEXUS_COMMON)); + const ownerAddress = await owner.getAddress(); + const minters = [ownerAddress, ownerAddress, ownerAddress, ownerAddress, ownerAddress] + await mine(shard.setNewMinterShards(minters)); + + // recipe + { + const recipe = { + inputShardIds: [shardId1, shardId2], + inputShardAmounts: [2, 1], + outputShardIds: [shardId3], + outputShardAmounts: [1] + }; + await mine(shard.addRecipe(recipe)); + } + const shard1Uri = 'http://www.example.com/1'; + await mine(shard.setShardUri(shardId1, shard1Uri)); +} + +// We recommend this pattern to be able to use async/await everywhere +// and properly handle errors. +main() + .then(() => process.exit(0)) + .catch(error => { + console.error(error); + process.exit(1); + }); \ No newline at end of file diff --git a/protocol/scripts/deploys/arbitrumGoerli/nexus/99c-temple-sacrifice-post-deployment.ts b/protocol/scripts/deploys/arbitrumGoerli/nexus/99c-temple-sacrifice-post-deployment.ts new file mode 100644 index 000000000..dc704949b --- /dev/null +++ b/protocol/scripts/deploys/arbitrumGoerli/nexus/99c-temple-sacrifice-post-deployment.ts @@ -0,0 +1,35 @@ +import { ethers, network } from 'hardhat'; +import { + blockTimestamp, + ensureExpectedEnvvars, + mine, + toAtto +} from '../../helpers'; +import { TempleSacrifice__factory } from '../../../../typechain'; +import { DEPLOYED_CONTRACTS } from '../../helpers'; + + +async function main() { + ensureExpectedEnvvars(); + + const [owner] = await ethers.getSigners(); + const deployedContracts = DEPLOYED_CONTRACTS[network.name]; + const templeSacrifice = TempleSacrifice__factory.connect(deployedContracts.TEMPLE_SACRIFICE, owner); + + await mine(templeSacrifice.setOriginTime(await blockTimestamp())); + const priceParams = { + priceMaxPeriod: 1732125018, + minimumPrice: toAtto(30), + maximumPrice: toAtto(100) + } + await mine(templeSacrifice.setPriceParams(priceParams)); +} + +// We recommend this pattern to be able to use async/await everywhere +// and properly handle errors. +main() + .then(() => process.exit(0)) + .catch(error => { + console.error(error); + process.exit(1); + }); \ No newline at end of file diff --git a/protocol/scripts/deploys/arbitrumGoerli/nexus/99d-nexus-common-post-deployment.ts b/protocol/scripts/deploys/arbitrumGoerli/nexus/99d-nexus-common-post-deployment.ts new file mode 100644 index 000000000..c912d1413 --- /dev/null +++ b/protocol/scripts/deploys/arbitrumGoerli/nexus/99d-nexus-common-post-deployment.ts @@ -0,0 +1,41 @@ +import { ethers, network } from 'hardhat'; +import { + ensureExpectedEnvvars, + mine +} from '../../helpers'; +import { TempleERC20Token__factory, NexusCommon__factory } from '../../../../typechain'; +import { DEPLOYED_CONTRACTS } from '../../helpers'; + +async function main() { + ensureExpectedEnvvars(); + + const [owner] = await ethers.getSigners(); + const deployedContracts = DEPLOYED_CONTRACTS[network.name]; + const nexusCommon = NexusCommon__factory.connect(deployedContracts.NEXUS_COMMON, owner); + + + const ownerAddress = await owner.getAddress(); + // set shard + await mine(nexusCommon.setShard(deployedContracts.SHARD)); + // enclave names + await mine(nexusCommon.setEnclaveName(1, "CHAOS")); + await mine(nexusCommon.setEnclaveName(2, "ORDER")); + await mine(nexusCommon.setEnclaveName(3, "LOGIC")); + await mine(nexusCommon.setEnclaveName(4, "STRUCTURE")); + await mine(nexusCommon.setEnclaveName(5, "MYSTERY")); + // shard enclave Ids + await mine(nexusCommon.setShardEnclave(1, 1)); + await mine(nexusCommon.setShardEnclave(2, 2)); + await mine(nexusCommon.setShardEnclave(3, 3)); + await mine(nexusCommon.setShardEnclave(4, 4)); + await mine(nexusCommon.setShardEnclave(5, 5)); +} + +// We recommend this pattern to be able to use async/await everywhere +// and properly handle errors. +main() + .then(() => process.exit(0)) + .catch(error => { + console.error(error); + process.exit(1); + }); \ No newline at end of file diff --git a/protocol/scripts/deploys/arbitrumGoerli/nexus/99e-partner-zero-sacrifice-post-deployment.ts b/protocol/scripts/deploys/arbitrumGoerli/nexus/99e-partner-zero-sacrifice-post-deployment.ts new file mode 100644 index 000000000..464283149 --- /dev/null +++ b/protocol/scripts/deploys/arbitrumGoerli/nexus/99e-partner-zero-sacrifice-post-deployment.ts @@ -0,0 +1,30 @@ +import { ethers, network } from 'hardhat'; +import { + blockTimestamp, + ensureExpectedEnvvars, + mine +} from '../../helpers'; +import { PartnerZeroSacrifice__factory } from '../../../../typechain'; +import { DEPLOYED_CONTRACTS } from '../../helpers'; + +async function main() { + ensureExpectedEnvvars(); + + const [owner] = await ethers.getSigners(); + const deployedContracts = DEPLOYED_CONTRACTS[network.name]; + const partnerSacrifice = PartnerZeroSacrifice__factory.connect(deployedContracts.PARTNER_ZERO_SACRIFICE, owner); + + + const ownerAddress = await owner.getAddress(); + // for tesnet, use current time to enable sacrifice immediately + await mine(partnerSacrifice.setOriginTime(await blockTimestamp())); +} + +// We recommend this pattern to be able to use async/await everywhere +// and properly handle errors. +main() + .then(() => process.exit(0)) + .catch(error => { + console.error(error); + process.exit(1); + }); \ No newline at end of file diff --git a/protocol/scripts/deploys/helpers.ts b/protocol/scripts/deploys/helpers.ts index 7bfd81952..bee7b1d53 100644 --- a/protocol/scripts/deploys/helpers.ts +++ b/protocol/scripts/deploys/helpers.ts @@ -111,6 +111,13 @@ export interface DeployedContracts { TEMPLE_DAI_AURA_POOL_ID: string; TEMPLE_DAI_REWARDS: string; TEMPLE_DAI_AURA_STAKING_DEPOSIT_TOKEN: string; + + // NEXUS + RELIC: string; + SHARD: string; + TEMPLE_SACRIFICE: string; + NEXUS_COMMON: string; + PARTNER_ZERO_SACRIFICE: string; } export const DEPLOYED_CONTRACTS: { [key: string]: DeployedContracts } = { @@ -185,6 +192,13 @@ export const DEPLOYED_CONTRACTS: { [key: string]: DeployedContracts } = { TEMPLE_DAI_AURA_POOL_ID: '', TEMPLE_DAI_REWARDS: '', TEMPLE_DAI_AURA_STAKING_DEPOSIT_TOKEN: '', + + // NEXUS + RELIC: '', + SHARD: '', + TEMPLE_SACRIFICE: '', + NEXUS_COMMON: '', + PARTNER_ZERO_SACRIFICE: '' }, goerli: { // No longer active/unused @@ -264,6 +278,13 @@ export const DEPLOYED_CONTRACTS: { [key: string]: DeployedContracts } = { TEMPLE_DAI_AURA_POOL_ID: '', TEMPLE_DAI_REWARDS: '', TEMPLE_DAI_AURA_STAKING_DEPOSIT_TOKEN: '', + + // NEXUS + RELIC: '', + SHARD: '', + TEMPLE_SACRIFICE: '', + NEXUS_COMMON: '', + PARTNER_ZERO_SACRIFICE: '' }, mainnet: { // From network/environment @@ -365,6 +386,13 @@ export const DEPLOYED_CONTRACTS: { [key: string]: DeployedContracts } = { TEMPLE_DAI_REWARDS: '0x13544617b10e1923363c89d902b749bea331ac4e', TEMPLE_DAI_AURA_STAKING_DEPOSIT_TOKEN: '0x0B7C71d61D960F70d89ecaC55DC2B4c1A7b508ee', + + // NEXUS + RELIC: '', + SHARD: '', + TEMPLE_SACRIFICE: '', + NEXUS_COMMON: '', + PARTNER_ZERO_SACRIFICE: '' }, localhost: { // From network/environment (setup when 00-localhost-env.ts script is run) @@ -440,7 +468,94 @@ export const DEPLOYED_CONTRACTS: { [key: string]: DeployedContracts } = { MULTISIG: '0x8626f6940e2eb28930efb4cef49b2d1f2c9c1199', // Account #19 FARM_MULTISIG: '0x8626f6940e2eb28930efb4cef49b2d1f2c9c1199', + + // NEXUS + RELIC: '', + SHARD: '', + TEMPLE_SACRIFICE: '', + NEXUS_COMMON: '', + PARTNER_ZERO_SACRIFICE: '' }, + arbitrumGoerli: { + // From network/environment (setup when 00-localhost-env.ts script is run) + FRAX: process.env.FRAX || '', + + // Active contrats + TEMPLE: '0xcbc7cf85dd0AB91Aa2671400E86ebf3AaC6dc658', + TEMPLE_TEAM_PAYMENTS_IMPLEMENTATION: '', + TEMPLE_TEAM_PAYMENTS_FACTORY: '', + + TEMPLE_V2_FRAX_PAIR: '', + TEMPLE_V2_FEI_PAIR: '', + TEMPLE_V2_ROUTER: '', + + OPS_MANAGER: '', + OPS_MANAGER_LIB: '', + JOINING_FEE: '', + VAULT_PROXY: '', + VAULT_EARLY_WITHDRAW: '', + TREASURY_IV: '', + + GENERIC_ZAPS: '', + TEMPLE_ZAPS: '', + + // RAMOS (BB-A-USD) + RAMOS_BB_A_USD: '', + RAMOS_BB_A_USD_POOL_HELPER: '', + RAMOS_BB_A_USD_AURA_STAKING: '', + + // RAMOS (BB-E-USD) + RAMOS_BB_E_USD: '', + RAMOS_BB_E_USD_POOL_HELPER: '', + RAMOS_BB_E_USD_AURA_STAKING: '', + + // RAMOS (DAI) + RAMOS_DAI: '', + RAMOS_DAI_POOL_HELPER: '', + RAMOS_DAI_AURA_STAKING: '', + + // Balancer + BALANCER_TOKEN: '', + BALANCER_VAULT: '', + BB_A_USD_TOKEN: '', + BB_E_USD_TOKEN: '', + DAI_TOKEN: '', + + // Aura + AURA_TOKEN: '', + AURA_BOOSTER: '', + + // RAMOS dependencies (BB-A-USD) + TEMPLE_BB_A_USD_LP_TOKEN: '', + TEMPLE_BB_A_USD_BALANCER_POOL_ID: '', + TEMPLE_BB_A_USD_AURA_POOL_ID: '', + TEMPLE_BB_A_USD_REWARDS: '', + TEMPLE_BB_A_USD_AURA_STAKING_DEPOSIT_TOKEN: '', + + // RAMOS dependencies (BB-E-USD) + TEMPLE_BB_E_USD_LP_TOKEN: '', + TEMPLE_BB_E_USD_BALANCER_POOL_ID: '', + TEMPLE_BB_E_USD_AURA_POOL_ID: '', + TEMPLE_BB_E_USD_REWARDS: '', + TEMPLE_BB_E_USD_AURA_STAKING_DEPOSIT_TOKEN: '', + + // RAMOS dependencies (DAI) + TEMPLE_DAI_LP_TOKEN: '', + TEMPLE_DAI_BALANCER_POOL_ID: '', + TEMPLE_DAI_AURA_POOL_ID: '', + TEMPLE_DAI_REWARDS: '', + TEMPLE_DAI_AURA_STAKING_DEPOSIT_TOKEN: '', + + MULTISIG: '0x8626f6940e2eb28930efb4cef49b2d1f2c9c1199', // Account #19 + FARM_MULTISIG: '0x8626f6940e2eb28930efb4cef49b2d1f2c9c1199', + + // NEXUS + RELIC: '0x4b410e5Dc4823B24301038E1bAe9b7B1204F6608', + SHARD: '0x53b77919E73807a491371212323EB4D0671CC238', + TEMPLE_SACRIFICE: '0xcAeAc87b834c8FE98e5E9CA4f96Ffb616AD27bc4', + NEXUS_COMMON: '0xe6327BEa2966CeE72b24C79Cd90FFBf01A61e8Cc', + PARTNER_ZERO_SACRIFICE: '0x08C0E5d99C9BD140c2cdf3c1B6171f1Aa91D4FD0' + } }; /** @@ -567,6 +682,10 @@ export function expectAddressWithPrivateKey() { 'Missing environment variable SEPOLIA_ADDRESS_PRIVATE_KEY. A mumbai address private key with eth is required to deploy/manage contracts' ); } + + if (network.name == 'arbitrumGoerli' && !process.env.ARBITRUM_GOERLI_ADDRESS_PRIVATE_KEY) { + throw new Error("Missing environment variable ARBITRUM_GOERLI_ADDRESS_PRIVATE_KEY. An arbitrum goerli address private key with eth is required to deploy/manage contracts"); + } } const expectedEnvvars: { [key: string]: string[] } = { @@ -582,6 +701,7 @@ const expectedEnvvars: { [key: string]: string[] } = { gnosisChiado: ['GNOSIS_CHIADO_ADDRESS_PRIVATE_KEY', 'GNOSIS_CHIADO_RPC_URL'], polygonMumbai: ['MUMBAI_ADDRESS_PRIVATE_KEY', 'MUMBAI_RPC_URL'], sepolia: ['SEPOLIA_ADDRESS_PRIVATE_KEY', 'SEPOLIA_RPC_URL'], + arbitrumGoerli: ['ARBITRUM_GOERLI_ADDRESS_PRIVATE_KEY', 'ARBITRUM_GOERLI_RPC_URL'], anvil: [], localhost: [], }; diff --git a/protocol/scripts/deploys/mainnet/nexus/01-relic.ts b/protocol/scripts/deploys/mainnet/nexus/01-relic.ts new file mode 100644 index 000000000..bb8a811ff --- /dev/null +++ b/protocol/scripts/deploys/mainnet/nexus/01-relic.ts @@ -0,0 +1,36 @@ +import '@nomiclabs/hardhat-ethers'; +import { ethers } from 'hardhat'; +import { Relic__factory } from '../../../../typechain'; +import { + deployAndMine, + ensureExpectedEnvvars, +} from '../../helpers'; + + +async function main() { + ensureExpectedEnvvars(); + const [owner] = await ethers.getSigners(); + const initialRescuer = ""; + const initialExecutor = ""; + + const relicFactory = new Relic__factory(owner); + await deployAndMine( + 'RELIC', + relicFactory, + relicFactory.deploy, + 'RELIC', + 'REL', + initialRescuer, + initialExecutor + ); +} + +// We recommend this pattern to be able to use async/await everywhere +// and properly handle errors. +main() + .then(() => process.exit(0)) + .catch(error => { + console.error(error); + process.exit(1); + }); + diff --git a/protocol/scripts/deploys/mainnet/nexus/02-shard.ts b/protocol/scripts/deploys/mainnet/nexus/02-shard.ts new file mode 100644 index 000000000..354722e81 --- /dev/null +++ b/protocol/scripts/deploys/mainnet/nexus/02-shard.ts @@ -0,0 +1,37 @@ +import '@nomiclabs/hardhat-ethers'; +import { ethers, network } from 'hardhat'; +import { Shard__factory } from '../../../../typechain'; +import { + deployAndMine, + ensureExpectedEnvvars, + DEPLOYED_CONTRACTS +} from '../../helpers'; + +async function main() { + ensureExpectedEnvvars(); + const [owner] = await ethers.getSigners(); + const initialRescuer = ""; + const initialExecutor = ""; + const relicAddress = DEPLOYED_CONTRACTS[network.name].RELIC;; + const uri = ""; + + const shardFactory = new Shard__factory(owner); + await deployAndMine( + 'SHARD', + shardFactory, + shardFactory.deploy, + relicAddress, + initialRescuer, + initialExecutor, + uri + ); +} + +// We recommend this pattern to be able to use async/await everywhere +// and properly handle errors. +main() + .then(() => process.exit(0)) + .catch(error => { + console.error(error); + process.exit(1); + }); \ No newline at end of file diff --git a/protocol/scripts/deploys/mainnet/nexus/03-temple-sacrifice.ts b/protocol/scripts/deploys/mainnet/nexus/03-temple-sacrifice.ts new file mode 100644 index 000000000..d3cf3b4ff --- /dev/null +++ b/protocol/scripts/deploys/mainnet/nexus/03-temple-sacrifice.ts @@ -0,0 +1,35 @@ +import '@nomiclabs/hardhat-ethers'; +import { ethers, network } from 'hardhat'; +import { TempleSacrifice__factory } from '../../../../typechain'; +import { + deployAndMine, + ensureExpectedEnvvars, + DEPLOYED_CONTRACTS +} from '../../helpers'; + +async function main() { + ensureExpectedEnvvars(); + const [owner] = await ethers.getSigners(); + + const relicAddress = DEPLOYED_CONTRACTS[network.name].RELIC; + const templeTokenAddress = DEPLOYED_CONTRACTS[network.name].TEMPLE;; + + const templeSacrificeFactory = new TempleSacrifice__factory(owner); + await deployAndMine( + 'TEMPLE_SACRIFICE', + templeSacrificeFactory, + templeSacrificeFactory.deploy, + relicAddress, + templeTokenAddress + ); +} + + +// We recommend this pattern to be able to use async/await everywhere +// and properly handle errors. +main() + .then(() => process.exit(0)) + .catch(error => { + console.error(error); + process.exit(1); + }); \ No newline at end of file diff --git a/protocol/scripts/deploys/mainnet/nexus/99a-relic-post-deployment.ts b/protocol/scripts/deploys/mainnet/nexus/99a-relic-post-deployment.ts new file mode 100644 index 000000000..8ff24f8ff --- /dev/null +++ b/protocol/scripts/deploys/mainnet/nexus/99a-relic-post-deployment.ts @@ -0,0 +1,42 @@ +import { ethers, network } from 'hardhat'; +import { + ensureExpectedEnvvars, + mine +} from '../../helpers'; +import { Relic__factory } from '../../../../typechain'; +import { DEPLOYED_CONTRACTS } from '../../helpers'; + + +async function main() { + ensureExpectedEnvvars(); + + const [owner] = await ethers.getSigners(); + const deployedContracts = DEPLOYED_CONTRACTS[network.name]; + const relic = Relic__factory.connect(deployedContracts.RELIC, owner); + + // set shard + const shardAddress = deployedContracts.SHARD; + { + await mine(relic.setShard(shardAddress)); + } + // set relic minter (temple sacrifice) + const templeSacrificeAddress = deployedContracts.TEMPLE_SACRIFICE; + { + await mine(relic.setRelicMinter(templeSacrificeAddress, true)); + } + // set base uri rarity + { + // 0 for Common + const commonUri = 'ipfs://QmVBhkqq3qEeQvdCDWSXQGMX7hFDymZvy7X7J4z9GsUAB3/' + await mine(relic.setBaseUriRarity(0, commonUri)); + } +} + +// We recommend this pattern to be able to use async/await everywhere +// and properly handle errors. +main() + .then(() => process.exit(0)) + .catch(error => { + console.error(error); + process.exit(1); + }); \ No newline at end of file diff --git a/protocol/scripts/deploys/mainnet/nexus/99b-shard-post-deployment.ts b/protocol/scripts/deploys/mainnet/nexus/99b-shard-post-deployment.ts new file mode 100644 index 000000000..e765552c3 --- /dev/null +++ b/protocol/scripts/deploys/mainnet/nexus/99b-shard-post-deployment.ts @@ -0,0 +1,27 @@ +import { ethers, network } from 'hardhat'; +import { + ensureExpectedEnvvars, + mine +} from '../../helpers'; +import { TempleERC20Token__factory, Shard__factory } from '../../../../typechain'; +import { DEPLOYED_CONTRACTS } from '../../helpers'; + + +async function main() { + ensureExpectedEnvvars(); + + const [owner] = await ethers.getSigners(); + const deployedContracts = DEPLOYED_CONTRACTS[network.name]; + const shard = Shard__factory.connect(deployedContracts.SHARD, owner); + + +} + +// We recommend this pattern to be able to use async/await everywhere +// and properly handle errors. +main() + .then(() => process.exit(0)) + .catch(error => { + console.error(error); + process.exit(1); + }); \ No newline at end of file diff --git a/protocol/scripts/deploys/mainnet/nexus/99c-temple-sacrifice-post-deployment.ts b/protocol/scripts/deploys/mainnet/nexus/99c-temple-sacrifice-post-deployment.ts new file mode 100644 index 000000000..a4148ffb0 --- /dev/null +++ b/protocol/scripts/deploys/mainnet/nexus/99c-temple-sacrifice-post-deployment.ts @@ -0,0 +1,45 @@ +import { ethers, network } from 'hardhat'; +import { + ensureExpectedEnvvars, + mine, + toAtto +} from '../../helpers'; +import { TempleSacrifice__factory } from '../../../../typechain'; +import { DEPLOYED_CONTRACTS } from '../../helpers'; + + +async function main() { + ensureExpectedEnvvars(); + + const [owner] = await ethers.getSigners(); + const deployedContracts = DEPLOYED_CONTRACTS[network.name]; + const templeSacrifice = TempleSacrifice__factory.connect(deployedContracts.TEMPLE_SACRIFICE, owner); + + // set sacrificed temple recipient + { + const recipient = '0x759bc1678e9d35BdD78C50e4bCF4aCeAf4869A8D'; + await mine(templeSacrifice.setSacrificedTempleRecipient(recipient)); + } + // set price params + { + const priceParams = { + minimumPrice: toAtto(40), + maximumPrice: toAtto(100), + priceMaxPeriod: 365 * 24 * 60 * 60 + } + await mine(templeSacrifice.setPriceParams(priceParams)); + } + // set origin time + { + + } +} + +// We recommend this pattern to be able to use async/await everywhere +// and properly handle errors. +main() + .then(() => process.exit(0)) + .catch(error => { + console.error(error); + process.exit(1); + }); \ No newline at end of file diff --git a/protocol/slither.db.json b/protocol/slither.db.json index 71dffe7fd..98c95baab 100644 --- a/protocol/slither.db.json +++ b/protocol/slither.db.json @@ -1,222 +1,94 @@ [ - { - "elements": [], - "description": "solc-0.8.21 is not recommended for deployment\n", - "markdown": "solc-0.8.21 is not recommended for deployment\n", - "first_markdown_element": "", - "id": "d89306001b1fa2ce11230334eb8b32e1ae6da7490b6d2bb2daf2e369120bbacf", - "check": "solc-version", - "impact": "Informational", - "confidence": "High" - }, { "elements": [ { "type": "function", - "name": "_mintDToken", + "name": "sacrifice", "source_mapping": { - "start": 28533, - "length": 1205, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 2029, + "length": 540, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, - "lines": [ - 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, - 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, - 664, 665, 666, 667, 668, 669, 670 - ], + "lines": [54, 55, 56, 57, 58, 59, 60, 61, 62, 63], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "TempleSacrifice", "source_mapping": { - "start": 2150, - "length": 32023, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 765, + "length": 1806, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, - 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, - 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, - 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, - 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, - 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, - 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, - 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, - 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, - 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, - 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, - 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, - 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, - 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, - 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, - 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, - 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, - 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, - 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, - 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, - 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, - 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, - 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, - 771, 772, 773, 774, 775, 776, 777, 778, 779 + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" + "signature": "sacrifice(uint256,address)" } }, { "type": "node", - "name": "tokenConfig.dToken.mint(strategy,_newDebt)", + "name": "sacrificeToken.safeTransferFrom(msg.sender,sacrificedTokenRecipient,amount)", "source_mapping": { - "start": 29294, - "length": 43, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 2359, + "length": 77, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, - "lines": [657], - "starting_column": 13, - "ending_column": 56 + "lines": [59], + "starting_column": 9, + "ending_column": 86 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_mintDToken", + "name": "sacrifice", "source_mapping": { - "start": 28533, - "length": 1205, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 2029, + "length": 540, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, - "lines": [ - 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, - 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, - 664, 665, 666, 667, 668, 669, 670 - ], + "lines": [54, 55, 56, 57, 58, 59, 60, 61, 62, 63], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "TempleSacrifice", "source_mapping": { - "start": 2150, - "length": 32023, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 765, + "length": 1806, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, - 777, 778, 779 + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" + "signature": "sacrifice(uint256,address)" } } }, @@ -224,149 +96,140 @@ }, { "type": "node", - "name": "_tokenCredits[token] = _creditBalance = 0", + "name": "relicId = relic.mintRelic(to,enclaveId)", "source_mapping": { - "start": 29387, - "length": 41, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 2447, + "length": 40, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, - "lines": [660], - "starting_column": 13, - "ending_column": 54 + "lines": [61], + "starting_column": 9, + "ending_column": 49 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_mintDToken", + "name": "sacrifice", "source_mapping": { - "start": 28533, - "length": 1205, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 2029, + "length": 540, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, - "lines": [ - 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, - 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, - 664, 665, 666, 667, 668, 669, 670 - ], + "lines": [54, 55, 56, 57, 58, 59, 60, 61, 62, 63], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "TempleSacrifice", "source_mapping": { - "start": 2150, - "length": 32023, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 765, + "length": 1806, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, - 777, 778, 779 + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" + "signature": "sacrifice(uint256,address)" } } }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "strategyTokenCredits" - } + "additional_fields": { "underlying_type": "external_calls" } + }, + { + "type": "node", + "name": "TokenSacrificed(msg.sender,address(sacrificeToken),amount)", + "source_mapping": { + "start": 2497, + "length": 65, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", + "is_dependency": false, + "lines": [62], + "starting_column": 9, + "ending_column": 74 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "sacrifice", + "source_mapping": { + "start": 2029, + "length": 540, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", + "is_dependency": false, + "lines": [54, 55, 56, 57, 58, 59, 60, 61, 62, 63], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleSacrifice", + "source_mapping": { + "start": 765, + "length": 1806, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", + "is_dependency": false, + "lines": [ + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "sacrifice(uint256,address)" + } + } + }, + "additional_fields": { "underlying_type": "event" } } ], - "description": "Reentrancy in TreasuryReservesVault._mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256) (contracts/v2/TreasuryReservesVault.sol#638-670):\n\tExternal calls:\n\t- tokenConfig.dToken.mint(strategy,_newDebt) (contracts/v2/TreasuryReservesVault.sol#657)\n\tState variables written after the call(s):\n\t- _tokenCredits[token] = _creditBalance = 0 (contracts/v2/TreasuryReservesVault.sol#660)\n\tTreasuryReservesVault.strategyTokenCredits (contracts/v2/TreasuryReservesVault.sol#78) can be used in cross function reentrancies:\n\t- TreasuryReservesVault._availableForStrategyToBorrow(address,ITreasuryReservesVault.StrategyConfig,IERC20,uint256) (contracts/v2/TreasuryReservesVault.sol#533-551)\n\t- TreasuryReservesVault._burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256) (contracts/v2/TreasuryReservesVault.sol#677-709)\n\t- TreasuryReservesVault._mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256) (contracts/v2/TreasuryReservesVault.sol#638-670)\n\t- TreasuryReservesVault.setStrategyDebtCeiling(address,IERC20,uint256) (contracts/v2/TreasuryReservesVault.sol#242-255)\n\t- TreasuryReservesVault.shutdown(address) (contracts/v2/TreasuryReservesVault.sol#283-319)\n\t- TreasuryReservesVault.strategyBalanceSheet(address) (contracts/v2/TreasuryReservesVault.sol#447-467)\n\t- TreasuryReservesVault.strategyTokenCredits (contracts/v2/TreasuryReservesVault.sol#78)\n", - "markdown": "Reentrancy in [TreasuryReservesVault._mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)](contracts/v2/TreasuryReservesVault.sol#L638-L670):\n\tExternal calls:\n\t- [tokenConfig.dToken.mint(strategy,_newDebt)](contracts/v2/TreasuryReservesVault.sol#L657)\n\tState variables written after the call(s):\n\t- [_tokenCredits[token] = _creditBalance = 0](contracts/v2/TreasuryReservesVault.sol#L660)\n\t[TreasuryReservesVault.strategyTokenCredits](contracts/v2/TreasuryReservesVault.sol#L78) can be used in cross function reentrancies:\n\t- [TreasuryReservesVault._availableForStrategyToBorrow(address,ITreasuryReservesVault.StrategyConfig,IERC20,uint256)](contracts/v2/TreasuryReservesVault.sol#L533-L551)\n\t- [TreasuryReservesVault._burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)](contracts/v2/TreasuryReservesVault.sol#L677-L709)\n\t- [TreasuryReservesVault._mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)](contracts/v2/TreasuryReservesVault.sol#L638-L670)\n\t- [TreasuryReservesVault.setStrategyDebtCeiling(address,IERC20,uint256)](contracts/v2/TreasuryReservesVault.sol#L242-L255)\n\t- [TreasuryReservesVault.shutdown(address)](contracts/v2/TreasuryReservesVault.sol#L283-L319)\n\t- [TreasuryReservesVault.strategyBalanceSheet(address)](contracts/v2/TreasuryReservesVault.sol#L447-L467)\n\t- [TreasuryReservesVault.strategyTokenCredits](contracts/v2/TreasuryReservesVault.sol#L78)\n", - "first_markdown_element": "contracts/v2/TreasuryReservesVault.sol#L638-L670", - "id": "0ce7ad9bcbc81412efd61c0340786d494f3510ea2cdeb81edb9c0103d00c0d0c", - "check": "reentrancy-no-eth", - "impact": "Medium", + "description": "Reentrancy in TempleSacrifice.sacrifice(uint256,address) (contracts/nexus/TempleSacrifice.sol#54-63):\n\tExternal calls:\n\t- sacrificeToken.safeTransferFrom(msg.sender,sacrificedTokenRecipient,amount) (contracts/nexus/TempleSacrifice.sol#59)\n\t- relicId = relic.mintRelic(to,enclaveId) (contracts/nexus/TempleSacrifice.sol#61)\n\tEvent emitted after the call(s):\n\t- TokenSacrificed(msg.sender,address(sacrificeToken),amount) (contracts/nexus/TempleSacrifice.sol#62)\n", + "markdown": "Reentrancy in [TempleSacrifice.sacrifice(uint256,address)](contracts/nexus/TempleSacrifice.sol#L54-L63):\n\tExternal calls:\n\t- [sacrificeToken.safeTransferFrom(msg.sender,sacrificedTokenRecipient,amount)](contracts/nexus/TempleSacrifice.sol#L59)\n\t- [relicId = relic.mintRelic(to,enclaveId)](contracts/nexus/TempleSacrifice.sol#L61)\n\tEvent emitted after the call(s):\n\t- [TokenSacrificed(msg.sender,address(sacrificeToken),amount)](contracts/nexus/TempleSacrifice.sol#L62)\n", + "first_markdown_element": "contracts/nexus/TempleSacrifice.sol#L54-L63", + "id": "aa0a0e22fafa8e6237035021bc8831d6aa4d8471692443e1328ee96386a35146", + "check": "reentrancy-events", + "impact": "Low", "confidence": "Medium" }, { "elements": [ { "type": "function", - "name": "shutdown", + "name": "mintRelic", "source_mapping": { - "start": 11822, - "length": 1632, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 15249, + "length": 986, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, "lines": [ - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319 + 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, + 383, 384, 385, 386, 387, 388, 389 ], "starting_column": 5, "ending_column": 6 @@ -374,108 +237,99 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "Relic", "source_mapping": { - "start": 2150, - "length": 32023, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 1674, + "length": 24653, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, - 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, - 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, - 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, - 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, - 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, - 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, - 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, - 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, - 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, - 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, - 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, - 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, - 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, - 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, - 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, - 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, - 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, - 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, - 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, - 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, - 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, - 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, - 771, 772, 773, 774, 775, 776, 777, 778, 779 + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, + 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, + 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, + 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, + 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, + 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, + 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, + 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, + 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, + 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, + 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, + 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, + 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, + 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, + 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, + 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, + 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, + 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, + 652, 653, 654, 655 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "shutdown(address)" + "signature": "mintRelic(address,uint256)" } }, { "type": "node", - "name": "_outstandingDebt = borrowTokens[_token].dToken.burnAll(strategy)", + "name": "ownerRelics[to].add(tokenId)", "source_mapping": { - "start": 12499, - "length": 64, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 15897, + "length": 28, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, - "lines": [296], - "starting_column": 13, - "ending_column": 77 + "lines": [384], + "starting_column": 9, + "ending_column": 37 }, "type_specific_fields": { "parent": { "type": "function", - "name": "shutdown", + "name": "mintRelic", "source_mapping": { - "start": 11822, - "length": 1632, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 15249, + "length": 986, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, "lines": [ - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319 + 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, + 383, 384, 385, 386, 387, 388, 389 ], "starting_column": 5, "ending_column": 6 @@ -483,542 +337,300 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "Relic", "source_mapping": { - "start": 2150, - "length": 32023, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 1674, + "length": 24653, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, - 777, 778, 779 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "shutdown(address)" - } - } - }, - "additional_fields": { "underlying_type": "external_calls" } - }, - { - "type": "node", - "name": "delete strategies[strategy]", - "source_mapping": { - "start": 13381, - "length": 27, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, + 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, + 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, + 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, + 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, + 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, + 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, + 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, + 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, + 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, + 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, + 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, + 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, + 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, + 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, + 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, + 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, + 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, + 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, + 654, 655 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "mintRelic(address,uint256)" + } + } + } + } + ], + "description": "Relic.mintRelic(address,uint256) (contracts/nexus/Relic.sol#370-389) ignores return value by ownerRelics[to].add(tokenId) (contracts/nexus/Relic.sol#384)\n", + "markdown": "[Relic.mintRelic(address,uint256)](contracts/nexus/Relic.sol#L370-L389) ignores return value by [ownerRelics[to].add(tokenId)](contracts/nexus/Relic.sol#L384)\n", + "first_markdown_element": "contracts/nexus/Relic.sol#L370-L389", + "id": "d16d1c64fd4c41d8d2af10f66fa5dda272642bb0f10a37bd384d69df6da9c1e0", + "check": "unused-return", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "variable", + "name": "_sacrificedTokenRecipient", + "source_mapping": { + "start": 1221, + "length": 33, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, - "lines": [317], + "lines": [30], "starting_column": 9, - "ending_column": 36 + "ending_column": 42 }, "type_specific_fields": { "parent": { "type": "function", - "name": "shutdown", + "name": "constructor", "source_mapping": { - "start": 11822, - "length": 1632, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 1152, + "length": 304, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, - "lines": [ - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319 - ], + "lines": [27, 28, 29, 30, 31, 32, 33, 34, 35, 36], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "TempleSacrifice", "source_mapping": { - "start": 2150, - "length": 32023, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 765, + "length": 1812, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, - 777, 778, 779 + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "shutdown(address)" + "signature": "constructor(address,address,address,address)" } } - }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "strategies" - } - } - ], - "description": "Reentrancy in TreasuryReservesVault.shutdown(address) (contracts/v2/TreasuryReservesVault.sol#283-319):\n\tExternal calls:\n\t- _outstandingDebt = borrowTokens[_token].dToken.burnAll(strategy) (contracts/v2/TreasuryReservesVault.sol#296)\n\tState variables written after the call(s):\n\t- delete strategies[strategy] (contracts/v2/TreasuryReservesVault.sol#317)\n\tTreasuryReservesVault.strategies (contracts/v2/TreasuryReservesVault.sol#55) can be used in cross function reentrancies:\n\t- TreasuryReservesVault._getStrategyConfig(address) (contracts/v2/TreasuryReservesVault.sol#711-714)\n\t- TreasuryReservesVault._withdrawFromBaseStrategy(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,address,uint256) (contracts/v2/TreasuryReservesVault.sol#582-632)\n\t- TreasuryReservesVault.addStrategy(address,int256,ITempleStrategy.AssetBalance[]) (contracts/v2/TreasuryReservesVault.sol#173-201)\n\t- TreasuryReservesVault.shutdown(address) (contracts/v2/TreasuryReservesVault.sol#283-319)\n\t- TreasuryReservesVault.strategies (contracts/v2/TreasuryReservesVault.sol#55)\n", - "markdown": "Reentrancy in [TreasuryReservesVault.shutdown(address)](contracts/v2/TreasuryReservesVault.sol#L283-L319):\n\tExternal calls:\n\t- [_outstandingDebt = borrowTokens[_token].dToken.burnAll(strategy)](contracts/v2/TreasuryReservesVault.sol#L296)\n\tState variables written after the call(s):\n\t- [delete strategies[strategy]](contracts/v2/TreasuryReservesVault.sol#L317)\n\t[TreasuryReservesVault.strategies](contracts/v2/TreasuryReservesVault.sol#L55) can be used in cross function reentrancies:\n\t- [TreasuryReservesVault._getStrategyConfig(address)](contracts/v2/TreasuryReservesVault.sol#L711-L714)\n\t- [TreasuryReservesVault._withdrawFromBaseStrategy(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,address,uint256)](contracts/v2/TreasuryReservesVault.sol#L582-L632)\n\t- [TreasuryReservesVault.addStrategy(address,int256,ITempleStrategy.AssetBalance[])](contracts/v2/TreasuryReservesVault.sol#L173-L201)\n\t- [TreasuryReservesVault.shutdown(address)](contracts/v2/TreasuryReservesVault.sol#L283-L319)\n\t- [TreasuryReservesVault.strategies](contracts/v2/TreasuryReservesVault.sol#L55)\n", - "first_markdown_element": "contracts/v2/TreasuryReservesVault.sol#L283-L319", - "id": "29da7db88824f300cbfeae877c2e6c080f8344d5012c1ba25820228cb3feb89a", - "check": "reentrancy-no-eth", - "impact": "Medium", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "swap", - "source_mapping": { - "start": 5765, - "length": 517, - "filename_relative": "contracts/core/OtcOffer.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/core/OtcOffer.sol", - "filename_short": "contracts/core/OtcOffer.sol", - "is_dependency": false, - "lines": [131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "OtcOffer", - "source_mapping": { - "start": 847, - "length": 6468, - "filename_relative": "contracts/core/OtcOffer.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/core/OtcOffer.sol", - "filename_short": "contracts/core/OtcOffer.sol", - "is_dependency": false, - "lines": [ - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "swap(uint256)" } }, { "type": "node", - "name": "userBuyToken.safeTransferFrom(_fundsOwner,msg.sender,buyTokenAmount)", + "name": "sacrificedTokenRecipient = _sacrificedTokenRecipient", "source_mapping": { - "start": 6205, - "length": 70, - "filename_relative": "contracts/core/OtcOffer.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/core/OtcOffer.sol", - "filename_short": "contracts/core/OtcOffer.sol", + "start": 1397, + "length": 52, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, - "lines": [140], + "lines": [35], "starting_column": 9, - "ending_column": 79 + "ending_column": 61 }, "type_specific_fields": { "parent": { "type": "function", - "name": "swap", + "name": "constructor", "source_mapping": { - "start": 5765, - "length": 517, - "filename_relative": "contracts/core/OtcOffer.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/core/OtcOffer.sol", - "filename_short": "contracts/core/OtcOffer.sol", + "start": 1152, + "length": 304, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, - "lines": [131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141], + "lines": [27, 28, 29, 30, 31, 32, 33, 34, 35, 36], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "OtcOffer", + "name": "TempleSacrifice", "source_mapping": { - "start": 847, - "length": 6468, - "filename_relative": "contracts/core/OtcOffer.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/core/OtcOffer.sol", - "filename_short": "contracts/core/OtcOffer.sol", + "start": 765, + "length": 1812, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, "lines": [ - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164 + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "swap(uint256)" + "signature": "constructor(address,address,address,address)" } } } } ], - "description": "OtcOffer.swap(uint256) (contracts/core/OtcOffer.sol#131-141) uses arbitrary from in transferFrom: userBuyToken.safeTransferFrom(_fundsOwner,msg.sender,buyTokenAmount) (contracts/core/OtcOffer.sol#140)\n", - "markdown": "[OtcOffer.swap(uint256)](contracts/core/OtcOffer.sol#L131-L141) uses arbitrary from in transferFrom: [userBuyToken.safeTransferFrom(_fundsOwner,msg.sender,buyTokenAmount)](contracts/core/OtcOffer.sol#L140)\n", - "first_markdown_element": "contracts/core/OtcOffer.sol#L131-L141", - "id": "05d3d20016db7bcfcaa4746897ba0c55c97e64e9bbf77842db5d2e2d9ceae5fd", - "check": "arbitrary-send-erc20", - "impact": "High", - "confidence": "High" + "description": "TempleSacrifice.constructor(address,address,address,address)._sacrificedTokenRecipient (contracts/nexus/TempleSacrifice.sol#30) lacks a zero-check on :\n\t\t- sacrificedTokenRecipient = _sacrificedTokenRecipient (contracts/nexus/TempleSacrifice.sol#35)\n", + "markdown": "[TempleSacrifice.constructor(address,address,address,address)._sacrificedTokenRecipient](contracts/nexus/TempleSacrifice.sol#L30) lacks a zero-check on :\n\t\t- [sacrificedTokenRecipient = _sacrificedTokenRecipient](contracts/nexus/TempleSacrifice.sol#L35)\n", + "first_markdown_element": "contracts/nexus/TempleSacrifice.sol#L30", + "id": "94977691bcc9f1120cc3a5bb9f9336ccb074fc6ea9011d230be5a0e20129c2b5", + "check": "missing-zero-check", + "impact": "Low", + "confidence": "Medium" }, { "elements": [ { "type": "function", - "name": "_burnDToken", + "name": "sacrifice", "source_mapping": { - "start": 29999, - "length": 1179, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 2350, + "length": 588, + "filename_relative": "contracts/nexus/PartnerZeroSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/PartnerZeroSacrifice.sol", + "filename_short": "contracts/nexus/PartnerZeroSacrifice.sol", "is_dependency": false, - "lines": [ - 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, - 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709 - ], + "lines": [69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "PartnerZeroSacrifice", "source_mapping": { - "start": 2150, - "length": 32023, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 634, + "length": 2306, + "filename_relative": "contracts/nexus/PartnerZeroSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/PartnerZeroSacrifice.sol", + "filename_short": "contracts/nexus/PartnerZeroSacrifice.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, - 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, - 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, - 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, - 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, - 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, - 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, - 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, - 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, - 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, - 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, - 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, - 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, - 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, - 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, - 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, - 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, - 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, - 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, - 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, - 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, - 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, - 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, - 771, 772, 773, 774, 775, 776, 777, 778, 779 + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" + "signature": "sacrifice(uint256,address)" } }, { "type": "node", - "name": "_burnedAmount = tokenConfig.dToken.burn(strategy,toBurnAmount)", + "name": "relicId = relic.mintRelic(to,enclaveId)", "source_mapping": { - "start": 30398, - "length": 71, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 2823, + "length": 48, + "filename_relative": "contracts/nexus/PartnerZeroSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/PartnerZeroSacrifice.sol", + "filename_short": "contracts/nexus/PartnerZeroSacrifice.sol", "is_dependency": false, - "lines": [688], + "lines": [79], "starting_column": 9, - "ending_column": 80 + "ending_column": 57 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_burnDToken", + "name": "sacrifice", "source_mapping": { - "start": 29999, - "length": 1179, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 2350, + "length": 588, + "filename_relative": "contracts/nexus/PartnerZeroSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/PartnerZeroSacrifice.sol", + "filename_short": "contracts/nexus/PartnerZeroSacrifice.sol", "is_dependency": false, - "lines": [ - 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, - 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709 - ], + "lines": [69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "PartnerZeroSacrifice", "source_mapping": { - "start": 2150, - "length": 32023, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 634, + "length": 2306, + "filename_relative": "contracts/nexus/PartnerZeroSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/PartnerZeroSacrifice.sol", + "filename_short": "contracts/nexus/PartnerZeroSacrifice.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, - 777, 778, 779 + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" + "signature": "sacrifice(uint256,address)" } } }, @@ -1026,244 +638,160 @@ }, { "type": "node", - "name": "_tokenCredits[token] = _creditBalance", + "name": "PartnerZeroSacrificed(to,relicId,enclaveId)", "source_mapping": { - "start": 31023, - "length": 37, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 2881, + "length": 50, + "filename_relative": "contracts/nexus/PartnerZeroSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/PartnerZeroSacrifice.sol", + "filename_short": "contracts/nexus/PartnerZeroSacrifice.sol", "is_dependency": false, - "lines": [705], - "starting_column": 13, - "ending_column": 50 + "lines": [80], + "starting_column": 9, + "ending_column": 59 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_burnDToken", + "name": "sacrifice", "source_mapping": { - "start": 29999, - "length": 1179, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 2350, + "length": 588, + "filename_relative": "contracts/nexus/PartnerZeroSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/PartnerZeroSacrifice.sol", + "filename_short": "contracts/nexus/PartnerZeroSacrifice.sol", "is_dependency": false, - "lines": [ - 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, - 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709 - ], + "lines": [69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "PartnerZeroSacrifice", "source_mapping": { - "start": 2150, - "length": 32023, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 634, + "length": 2306, + "filename_relative": "contracts/nexus/PartnerZeroSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/PartnerZeroSacrifice.sol", + "filename_short": "contracts/nexus/PartnerZeroSacrifice.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, - 777, 778, 779 + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" + "signature": "sacrifice(uint256,address)" } } }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "strategyTokenCredits" - } + "additional_fields": { "underlying_type": "event" } } ], - "description": "Reentrancy in TreasuryReservesVault._burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256) (contracts/v2/TreasuryReservesVault.sol#677-709):\n\tExternal calls:\n\t- _burnedAmount = tokenConfig.dToken.burn(strategy,toBurnAmount) (contracts/v2/TreasuryReservesVault.sol#688)\n\tState variables written after the call(s):\n\t- _tokenCredits[token] = _creditBalance (contracts/v2/TreasuryReservesVault.sol#705)\n\tTreasuryReservesVault.strategyTokenCredits (contracts/v2/TreasuryReservesVault.sol#78) can be used in cross function reentrancies:\n\t- TreasuryReservesVault._availableForStrategyToBorrow(address,ITreasuryReservesVault.StrategyConfig,IERC20,uint256) (contracts/v2/TreasuryReservesVault.sol#533-551)\n\t- TreasuryReservesVault._burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256) (contracts/v2/TreasuryReservesVault.sol#677-709)\n\t- TreasuryReservesVault._mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256) (contracts/v2/TreasuryReservesVault.sol#638-670)\n\t- TreasuryReservesVault.setStrategyDebtCeiling(address,IERC20,uint256) (contracts/v2/TreasuryReservesVault.sol#242-255)\n\t- TreasuryReservesVault.shutdown(address) (contracts/v2/TreasuryReservesVault.sol#283-319)\n\t- TreasuryReservesVault.strategyBalanceSheet(address) (contracts/v2/TreasuryReservesVault.sol#447-467)\n\t- TreasuryReservesVault.strategyTokenCredits (contracts/v2/TreasuryReservesVault.sol#78)\n", - "markdown": "Reentrancy in [TreasuryReservesVault._burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)](contracts/v2/TreasuryReservesVault.sol#L677-L709):\n\tExternal calls:\n\t- [_burnedAmount = tokenConfig.dToken.burn(strategy,toBurnAmount)](contracts/v2/TreasuryReservesVault.sol#L688)\n\tState variables written after the call(s):\n\t- [_tokenCredits[token] = _creditBalance](contracts/v2/TreasuryReservesVault.sol#L705)\n\t[TreasuryReservesVault.strategyTokenCredits](contracts/v2/TreasuryReservesVault.sol#L78) can be used in cross function reentrancies:\n\t- [TreasuryReservesVault._availableForStrategyToBorrow(address,ITreasuryReservesVault.StrategyConfig,IERC20,uint256)](contracts/v2/TreasuryReservesVault.sol#L533-L551)\n\t- [TreasuryReservesVault._burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)](contracts/v2/TreasuryReservesVault.sol#L677-L709)\n\t- [TreasuryReservesVault._mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)](contracts/v2/TreasuryReservesVault.sol#L638-L670)\n\t- [TreasuryReservesVault.setStrategyDebtCeiling(address,IERC20,uint256)](contracts/v2/TreasuryReservesVault.sol#L242-L255)\n\t- [TreasuryReservesVault.shutdown(address)](contracts/v2/TreasuryReservesVault.sol#L283-L319)\n\t- [TreasuryReservesVault.strategyBalanceSheet(address)](contracts/v2/TreasuryReservesVault.sol#L447-L467)\n\t- [TreasuryReservesVault.strategyTokenCredits](contracts/v2/TreasuryReservesVault.sol#L78)\n", - "first_markdown_element": "contracts/v2/TreasuryReservesVault.sol#L677-L709", - "id": "c8932bc3a4a8bcb7213dd16df3325de16b2cfe251691839c0d5db322cdde8cc6", - "check": "reentrancy-no-eth", - "impact": "Medium", + "description": "Reentrancy in PartnerZeroSacrifice.sacrifice(uint256,address) (contracts/nexus/PartnerZeroSacrifice.sol#69-81):\n\tExternal calls:\n\t- relicId = relic.mintRelic(to,enclaveId) (contracts/nexus/PartnerZeroSacrifice.sol#79)\n\tEvent emitted after the call(s):\n\t- PartnerZeroSacrificed(to,relicId,enclaveId) (contracts/nexus/PartnerZeroSacrifice.sol#80)\n", + "markdown": "Reentrancy in [PartnerZeroSacrifice.sacrifice(uint256,address)](contracts/nexus/PartnerZeroSacrifice.sol#L69-L81):\n\tExternal calls:\n\t- [relicId = relic.mintRelic(to,enclaveId)](contracts/nexus/PartnerZeroSacrifice.sol#L79)\n\tEvent emitted after the call(s):\n\t- [PartnerZeroSacrificed(to,relicId,enclaveId)](contracts/nexus/PartnerZeroSacrifice.sol#L80)\n", + "first_markdown_element": "contracts/nexus/PartnerZeroSacrifice.sol#L69-L81", + "id": "ae76dab0b23ea493ad0d24ff42105e6daecba6b26cbdfa5a55f4c9ae43453a00", + "check": "reentrancy-events", + "impact": "Low", "confidence": "Medium" }, { "elements": [ { "type": "function", - "name": "deployPayouts", + "name": "sacrifice", "source_mapping": { - "start": 2818, - "length": 1078, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 2029, + "length": 546, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, - "lines": [ - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112 - ], + "lines": [54, 55, 56, 57, 58, 59, 60, 61, 62, 63], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleTeamPaymentsFactory", + "name": "TempleSacrifice", "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 765, + "length": 1812, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144 + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" + "signature": "sacrifice(uint256,address)" } }, { "type": "node", - "name": "paymentContract.initialize(_token)", + "name": "sacrificeToken.safeTransferFrom(msg.sender,sacrificedTokenRecipient,amount)", "source_mapping": { - "start": 3274, - "length": 34, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 2333, + "length": 77, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, - "lines": [89], + "lines": [59], "starting_column": 9, - "ending_column": 43 + "ending_column": 86 }, "type_specific_fields": { "parent": { "type": "function", - "name": "deployPayouts", + "name": "sacrifice", "source_mapping": { - "start": 2818, - "length": 1078, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 2029, + "length": 546, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, - "lines": [ - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112 - ], + "lines": [54, 55, 56, 57, 58, 59, 60, 61, 62, 63], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleTeamPaymentsFactory", + "name": "TempleSacrifice", "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 765, + "length": 1812, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" + "signature": "sacrifice(uint256,address)" } } }, @@ -1271,65 +799,55 @@ }, { "type": "node", - "name": "paymentContract.setAllocations(_dests,_allocations)", + "name": "relicId = relic.mintRelic(to,enclaveId)", "source_mapping": { - "start": 3318, - "length": 52, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 2421, + "length": 48, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, - "lines": [90], + "lines": [61], "starting_column": 9, - "ending_column": 61 + "ending_column": 57 }, "type_specific_fields": { "parent": { "type": "function", - "name": "deployPayouts", + "name": "sacrifice", "source_mapping": { - "start": 2818, - "length": 1078, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 2029, + "length": 546, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, - "lines": [ - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112 - ], + "lines": [54, 55, 56, 57, 58, 59, 60, 61, 62, 63], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleTeamPaymentsFactory", + "name": "TempleSacrifice", "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 765, + "length": 1812, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" + "signature": "sacrifice(uint256,address)" } } }, @@ -1337,1281 +855,1048 @@ }, { "type": "node", - "name": "paymentContract.transferOwnership(msg.sender)", + "name": "TokenSacrificed(msg.sender,to,address(sacrificeToken),amount,relicId,enclaveId)", "source_mapping": { - "start": 3381, - "length": 45, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 2479, + "length": 89, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, - "lines": [92], + "lines": [62], "starting_column": 9, - "ending_column": 54 + "ending_column": 98 }, "type_specific_fields": { "parent": { "type": "function", - "name": "deployPayouts", + "name": "sacrifice", "source_mapping": { - "start": 2818, - "length": 1078, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 2029, + "length": 546, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, - "lines": [ - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112 - ], + "lines": [54, 55, 56, 57, 58, 59, 60, 61, 62, 63], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleTeamPaymentsFactory", + "name": "TempleSacrifice", "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 765, + "length": 1812, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" + "signature": "sacrifice(uint256,address)" } } }, - "additional_fields": { "underlying_type": "external_calls" } + "additional_fields": { "underlying_type": "event" } + } + ], + "description": "Reentrancy in TempleSacrifice.sacrifice(uint256,address) (contracts/nexus/TempleSacrifice.sol#54-63):\n\tExternal calls:\n\t- sacrificeToken.safeTransferFrom(msg.sender,sacrificedTokenRecipient,amount) (contracts/nexus/TempleSacrifice.sol#59)\n\t- relicId = relic.mintRelic(to,enclaveId) (contracts/nexus/TempleSacrifice.sol#61)\n\tEvent emitted after the call(s):\n\t- TokenSacrificed(msg.sender,to,address(sacrificeToken),amount,relicId,enclaveId) (contracts/nexus/TempleSacrifice.sol#62)\n", + "markdown": "Reentrancy in [TempleSacrifice.sacrifice(uint256,address)](contracts/nexus/TempleSacrifice.sol#L54-L63):\n\tExternal calls:\n\t- [sacrificeToken.safeTransferFrom(msg.sender,sacrificedTokenRecipient,amount)](contracts/nexus/TempleSacrifice.sol#L59)\n\t- [relicId = relic.mintRelic(to,enclaveId)](contracts/nexus/TempleSacrifice.sol#L61)\n\tEvent emitted after the call(s):\n\t- [TokenSacrificed(msg.sender,to,address(sacrificeToken),amount,relicId,enclaveId)](contracts/nexus/TempleSacrifice.sol#L62)\n", + "first_markdown_element": "contracts/nexus/TempleSacrifice.sol#L54-L63", + "id": "0ecf54139e3b96225c16c63712a092734c08cac2d771c6f609396df7fb6d4d74", + "check": "reentrancy-events", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "setOriginTime", + "source_mapping": { + "start": 1626, + "length": 253, + "filename_relative": "contracts/nexus/PartnerZeroSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/PartnerZeroSacrifice.sol", + "filename_short": "contracts/nexus/PartnerZeroSacrifice.sol", + "is_dependency": false, + "lines": [48, 49, 50, 51, 52], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "PartnerZeroSacrifice", + "source_mapping": { + "start": 634, + "length": 2306, + "filename_relative": "contracts/nexus/PartnerZeroSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/PartnerZeroSacrifice.sol", + "filename_short": "contracts/nexus/PartnerZeroSacrifice.sol", + "is_dependency": false, + "lines": [ + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "setOriginTime(uint64)" + } }, { "type": "node", - "name": "SafeERC20.safeTransferFrom(_token,msg.sender,address(paymentContract),_totalFunding)", + "name": "_originTime < block.timestamp", "source_mapping": { - "start": 3473, - "length": 165, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 1720, + "length": 29, + "filename_relative": "contracts/nexus/PartnerZeroSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/PartnerZeroSacrifice.sol", + "filename_short": "contracts/nexus/PartnerZeroSacrifice.sol", "is_dependency": false, - "lines": [95, 96, 97, 98, 99, 100], + "lines": [49], "starting_column": 13, - "ending_column": 14 + "ending_column": 42 }, "type_specific_fields": { "parent": { "type": "function", - "name": "deployPayouts", + "name": "setOriginTime", "source_mapping": { - "start": 2818, - "length": 1078, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 1626, + "length": 253, + "filename_relative": "contracts/nexus/PartnerZeroSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/PartnerZeroSacrifice.sol", + "filename_short": "contracts/nexus/PartnerZeroSacrifice.sol", "is_dependency": false, - "lines": [ - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112 - ], + "lines": [48, 49, 50, 51, 52], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleTeamPaymentsFactory", + "name": "PartnerZeroSacrifice", "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 634, + "length": 2306, + "filename_relative": "contracts/nexus/PartnerZeroSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/PartnerZeroSacrifice.sol", + "filename_short": "contracts/nexus/PartnerZeroSacrifice.sol", "is_dependency": false, "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" + "signature": "setOriginTime(uint64)" } } + } + } + ], + "description": "PartnerZeroSacrifice.setOriginTime(uint64) (contracts/nexus/PartnerZeroSacrifice.sol#48-52) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- _originTime < block.timestamp (contracts/nexus/PartnerZeroSacrifice.sol#49)\n", + "markdown": "[PartnerZeroSacrifice.setOriginTime(uint64)](contracts/nexus/PartnerZeroSacrifice.sol#L48-L52) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [_originTime < block.timestamp](contracts/nexus/PartnerZeroSacrifice.sol#L49)\n", + "first_markdown_element": "contracts/nexus/PartnerZeroSacrifice.sol#L48-L52", + "id": "f5f9bc48d544b4fedeb851a283a7c948d30418fd6206ffb977a15b05c946b556", + "check": "timestamp", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "sacrifice", + "source_mapping": { + "start": 2350, + "length": 588, + "filename_relative": "contracts/nexus/PartnerZeroSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/PartnerZeroSacrifice.sol", + "filename_short": "contracts/nexus/PartnerZeroSacrifice.sol", + "is_dependency": false, + "lines": [69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81], + "starting_column": 5, + "ending_column": 6 }, - "additional_fields": { "underlying_type": "external_calls" } + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "PartnerZeroSacrifice", + "source_mapping": { + "start": 634, + "length": 2306, + "filename_relative": "contracts/nexus/PartnerZeroSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/PartnerZeroSacrifice.sol", + "filename_short": "contracts/nexus/PartnerZeroSacrifice.sol", + "is_dependency": false, + "lines": [ + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "sacrifice(uint256,address)" + } }, { "type": "node", - "name": "incrementEpoch(address(paymentContract),_totalFunding)", + "name": "block.timestamp < originTime", "source_mapping": { - "start": 3649, - "length": 55, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 2451, + "length": 28, + "filename_relative": "contracts/nexus/PartnerZeroSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/PartnerZeroSacrifice.sol", + "filename_short": "contracts/nexus/PartnerZeroSacrifice.sol", "is_dependency": false, - "lines": [102], - "starting_column": 9, - "ending_column": 64 + "lines": [70], + "starting_column": 13, + "ending_column": 41 }, "type_specific_fields": { "parent": { "type": "function", - "name": "deployPayouts", + "name": "sacrifice", "source_mapping": { - "start": 2818, - "length": 1078, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 2350, + "length": 588, + "filename_relative": "contracts/nexus/PartnerZeroSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/PartnerZeroSacrifice.sol", + "filename_short": "contracts/nexus/PartnerZeroSacrifice.sol", "is_dependency": false, - "lines": [ - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112 - ], + "lines": [69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleTeamPaymentsFactory", + "name": "PartnerZeroSacrifice", "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 634, + "length": 2306, + "filename_relative": "contracts/nexus/PartnerZeroSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/PartnerZeroSacrifice.sol", + "filename_short": "contracts/nexus/PartnerZeroSacrifice.sol", "is_dependency": false, "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" + "signature": "sacrifice(uint256,address)" } } + } + } + ], + "description": "PartnerZeroSacrifice.sacrifice(uint256,address) (contracts/nexus/PartnerZeroSacrifice.sol#69-81) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- block.timestamp < originTime (contracts/nexus/PartnerZeroSacrifice.sol#70)\n", + "markdown": "[PartnerZeroSacrifice.sacrifice(uint256,address)](contracts/nexus/PartnerZeroSacrifice.sol#L69-L81) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [block.timestamp < originTime](contracts/nexus/PartnerZeroSacrifice.sol#L70)\n", + "first_markdown_element": "contracts/nexus/PartnerZeroSacrifice.sol#L69-L81", + "id": "9060c9975bb99acb580ffb4d8a8c02b4a7d2f4942741e626f38333e78b7451a5", + "check": "timestamp", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "sacrifice", + "source_mapping": { + "start": 2029, + "length": 546, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", + "is_dependency": false, + "lines": [54, 55, 56, 57, 58, 59, 60, 61, 62, 63], + "starting_column": 5, + "ending_column": 6 }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "lastPaidEpoch" + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleSacrifice", + "source_mapping": { + "start": 765, + "length": 1812, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", + "is_dependency": false, + "lines": [ + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "sacrifice(uint256,address)" } }, { "type": "node", - "name": "data = FundingData({paymentContract:address(_paymentContract),totalFunding:_totalFunding,epoch:lastPaidEpoch ++})", + "name": "block.timestamp < originTime", "source_mapping": { - "start": 1542, - "length": 182, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 2111, + "length": 28, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, - "lines": [50, 51, 52, 53, 54], - "starting_column": 9, - "ending_column": 11 + "lines": [55], + "starting_column": 13, + "ending_column": 41 }, "type_specific_fields": { "parent": { "type": "function", - "name": "incrementEpoch", + "name": "sacrifice", "source_mapping": { - "start": 1428, - "length": 347, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 2029, + "length": 546, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, - "lines": [46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56], + "lines": [54, 55, 56, 57, 58, 59, 60, 61, 62, 63], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleTeamPaymentsFactory", + "name": "TempleSacrifice", "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 765, + "length": 1812, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "incrementEpoch(address,uint256)" + "signature": "sacrifice(uint256,address)" } } - }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "lastPaidEpoch" } } ], - "description": "Reentrancy in TempleTeamPaymentsFactory.deployPayouts(IERC20,address[],uint256[],uint256) (contracts/admin/TempleTeamPaymentsFactory.sol#79-112):\n\tExternal calls:\n\t- paymentContract.initialize(_token) (contracts/admin/TempleTeamPaymentsFactory.sol#89)\n\t- paymentContract.setAllocations(_dests,_allocations) (contracts/admin/TempleTeamPaymentsFactory.sol#90)\n\t- paymentContract.transferOwnership(msg.sender) (contracts/admin/TempleTeamPaymentsFactory.sol#92)\n\t- SafeERC20.safeTransferFrom(_token,msg.sender,address(paymentContract),_totalFunding) (contracts/admin/TempleTeamPaymentsFactory.sol#95-100)\n\tState variables written after the call(s):\n\t- incrementEpoch(address(paymentContract),_totalFunding) (contracts/admin/TempleTeamPaymentsFactory.sol#102)\n\t\t- data = FundingData({paymentContract:address(_paymentContract),totalFunding:_totalFunding,epoch:lastPaidEpoch ++}) (contracts/admin/TempleTeamPaymentsFactory.sol#50-54)\n\tTempleTeamPaymentsFactory.lastPaidEpoch (contracts/admin/TempleTeamPaymentsFactory.sol#23) can be used in cross function reentrancies:\n\t- TempleTeamPaymentsFactory.constructor(address,uint16) (contracts/admin/TempleTeamPaymentsFactory.sol#40-44)\n\t- TempleTeamPaymentsFactory.deployPayouts(IERC20,address[],uint256[],uint256) (contracts/admin/TempleTeamPaymentsFactory.sol#79-112)\n\t- TempleTeamPaymentsFactory.directPayouts(IERC20,address[],uint256[]) (contracts/admin/TempleTeamPaymentsFactory.sol#119-143)\n\t- TempleTeamPaymentsFactory.incrementEpoch(address,uint256) (contracts/admin/TempleTeamPaymentsFactory.sol#46-56)\n\t- TempleTeamPaymentsFactory.lastPaidEpoch (contracts/admin/TempleTeamPaymentsFactory.sol#23)\n", - "markdown": "Reentrancy in [TempleTeamPaymentsFactory.deployPayouts(IERC20,address[],uint256[],uint256)](contracts/admin/TempleTeamPaymentsFactory.sol#L79-L112):\n\tExternal calls:\n\t- [paymentContract.initialize(_token)](contracts/admin/TempleTeamPaymentsFactory.sol#L89)\n\t- [paymentContract.setAllocations(_dests,_allocations)](contracts/admin/TempleTeamPaymentsFactory.sol#L90)\n\t- [paymentContract.transferOwnership(msg.sender)](contracts/admin/TempleTeamPaymentsFactory.sol#L92)\n\t- [SafeERC20.safeTransferFrom(_token,msg.sender,address(paymentContract),_totalFunding)](contracts/admin/TempleTeamPaymentsFactory.sol#L95-L100)\n\tState variables written after the call(s):\n\t- [incrementEpoch(address(paymentContract),_totalFunding)](contracts/admin/TempleTeamPaymentsFactory.sol#L102)\n\t\t- [data = FundingData({paymentContract:address(_paymentContract),totalFunding:_totalFunding,epoch:lastPaidEpoch ++})](contracts/admin/TempleTeamPaymentsFactory.sol#L50-L54)\n\t[TempleTeamPaymentsFactory.lastPaidEpoch](contracts/admin/TempleTeamPaymentsFactory.sol#L23) can be used in cross function reentrancies:\n\t- [TempleTeamPaymentsFactory.constructor(address,uint16)](contracts/admin/TempleTeamPaymentsFactory.sol#L40-L44)\n\t- [TempleTeamPaymentsFactory.deployPayouts(IERC20,address[],uint256[],uint256)](contracts/admin/TempleTeamPaymentsFactory.sol#L79-L112)\n\t- [TempleTeamPaymentsFactory.directPayouts(IERC20,address[],uint256[])](contracts/admin/TempleTeamPaymentsFactory.sol#L119-L143)\n\t- [TempleTeamPaymentsFactory.incrementEpoch(address,uint256)](contracts/admin/TempleTeamPaymentsFactory.sol#L46-L56)\n\t- [TempleTeamPaymentsFactory.lastPaidEpoch](contracts/admin/TempleTeamPaymentsFactory.sol#L23)\n", - "first_markdown_element": "contracts/admin/TempleTeamPaymentsFactory.sol#L79-L112", - "id": "1239a22bea2c9a42dbde3ae4ac80f8aa9a378a084fd732a81c3169ae01c87319", - "check": "reentrancy-no-eth", - "impact": "Medium", + "description": "TempleSacrifice.sacrifice(uint256,address) (contracts/nexus/TempleSacrifice.sol#54-63) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- block.timestamp < originTime (contracts/nexus/TempleSacrifice.sol#55)\n", + "markdown": "[TempleSacrifice.sacrifice(uint256,address)](contracts/nexus/TempleSacrifice.sol#L54-L63) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [block.timestamp < originTime](contracts/nexus/TempleSacrifice.sol#L55)\n", + "first_markdown_element": "contracts/nexus/TempleSacrifice.sol#L54-L63", + "id": "5f83c688b3632430bdc57bf425dd430bded05cc855276ee1aa8739e795ce45af", + "check": "timestamp", + "impact": "Low", "confidence": "Medium" }, { "elements": [ { "type": "function", - "name": "shutdown", + "name": "borrowAndDeposit", "source_mapping": { - "start": 11822, - "length": 1632, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 7809, + "length": 246, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [ - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319 - ], + "lines": [195, 196, 197, 198, 199], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 2150, - "length": 32023, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, - 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, - 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, - 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, - 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, - 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, - 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, - 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, - 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, - 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, - 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, - 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, - 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, - 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, - 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, - 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, - 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, - 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, - 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, - 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, - 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, - 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, - 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, - 771, 772, 773, 774, 775, 776, 777, 778, 779 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "shutdown(address)" + "signature": "borrowAndDeposit(uint256)" } }, { "type": "node", - "name": "_strategySet.remove(strategy)", + "name": "treasuryReservesVault.borrow(daiToken,amount,address(this))", "source_mapping": { - "start": 13418, - "length": 29, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 7958, + "length": 61, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [318], + "lines": [197], "starting_column": 9, - "ending_column": 38 + "ending_column": 70 }, "type_specific_fields": { "parent": { "type": "function", - "name": "shutdown", + "name": "borrowAndDeposit", "source_mapping": { - "start": 11822, - "length": 1632, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 7809, + "length": 246, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [ - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319 - ], + "lines": [195, 196, 197, 198, 199], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 2150, - "length": 32023, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, - 777, 778, 779 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "shutdown(address)" + "signature": "borrowAndDeposit(uint256)" } } - } - } - ], - "description": "TreasuryReservesVault.shutdown(address) (contracts/v2/TreasuryReservesVault.sol#283-319) ignores return value by _strategySet.remove(strategy) (contracts/v2/TreasuryReservesVault.sol#318)\n", - "markdown": "[TreasuryReservesVault.shutdown(address)](contracts/v2/TreasuryReservesVault.sol#L283-L319) ignores return value by [_strategySet.remove(strategy)](contracts/v2/TreasuryReservesVault.sol#L318)\n", - "first_markdown_element": "contracts/v2/TreasuryReservesVault.sol#L283-L319", - "id": "14b0ae4775bb656e93254a9232479092aea49d94c14762546af7a2b568164211", - "check": "unused-return", - "impact": "Medium", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "latestAssetBalances", - "source_mapping": { - "start": 5827, - "length": 565, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", - "is_dependency": false, - "lines": [ - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159 - ], - "starting_column": 5, - "ending_column": 6 }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "RamosStrategy", - "source_mapping": { - "start": 1131, - "length": 9320, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", - "is_dependency": false, - "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "latestAssetBalances()" - } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "(templeTokenBalance,quoteTokenBalance) = ramos.positions()", + "name": "_dsrDeposit(amount)", "source_mapping": { - "start": 5992, - "length": 77, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 8029, + "length": 19, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [148], + "lines": [198], "starting_column": 9, - "ending_column": 86 + "ending_column": 28 }, "type_specific_fields": { "parent": { "type": "function", - "name": "latestAssetBalances", + "name": "borrowAndDeposit", "source_mapping": { - "start": 5827, - "length": 565, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 7809, + "length": 246, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [ - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159 - ], + "lines": [195, 196, 197, 198, 199], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "RamosStrategy", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 1131, - "length": 9320, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "latestAssetBalances()" + "signature": "borrowAndDeposit(uint256)" } } - } - } - ], - "description": "RamosStrategy.latestAssetBalances() (contracts/v2/strategies/RamosStrategy.sol#144-159) ignores return value by (templeTokenBalance,quoteTokenBalance) = ramos.positions() (contracts/v2/strategies/RamosStrategy.sol#148)\n", - "markdown": "[RamosStrategy.latestAssetBalances()](contracts/v2/strategies/RamosStrategy.sol#L144-L159) ignores return value by [(templeTokenBalance,quoteTokenBalance) = ramos.positions()](contracts/v2/strategies/RamosStrategy.sol#L148)\n", - "first_markdown_element": "contracts/v2/strategies/RamosStrategy.sol#L144-L159", - "id": "420dcd2cbb24da1b9ab2dafe842594bf844fae670bc85fc21d1d3835c68dd336", - "check": "unused-return", - "impact": "Medium", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "proportionalAddLiquidityQuote", - "source_mapping": { - "start": 6569, - "length": 393, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", - "is_dependency": false, - "lines": [165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175], - "starting_column": 5, - "ending_column": 6 }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "RamosStrategy", - "source_mapping": { - "start": 1131, - "length": 9320, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", - "is_dependency": false, - "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "proportionalAddLiquidityQuote(uint256,uint256)" - } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "ramos.poolHelper().proportionalAddLiquidityQuote(_quoteTokenAmount,_slippageBps)", + "name": "daiJoin.join(address(this),amount)", "source_mapping": { - "start": 6867, - "length": 88, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 8342, + "length": 35, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [174], + "lines": [207], "starting_column": 9, - "ending_column": 97 + "ending_column": 44 }, "type_specific_fields": { "parent": { "type": "function", - "name": "proportionalAddLiquidityQuote", + "name": "_dsrDeposit", "source_mapping": { - "start": 6569, - "length": 393, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 8061, + "length": 349, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175], + "lines": [201, 202, 203, 204, 205, 206, 207, 208, 209], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "RamosStrategy", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 1131, - "length": 9320, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "proportionalAddLiquidityQuote(uint256,uint256)" + "signature": "_dsrDeposit(uint256)" } } - } - } - ], - "description": "RamosStrategy.proportionalAddLiquidityQuote(uint256,uint256) (contracts/v2/strategies/RamosStrategy.sol#165-175) ignores return value by ramos.poolHelper().proportionalAddLiquidityQuote(_quoteTokenAmount,_slippageBps) (contracts/v2/strategies/RamosStrategy.sol#174)\n", - "markdown": "[RamosStrategy.proportionalAddLiquidityQuote(uint256,uint256)](contracts/v2/strategies/RamosStrategy.sol#L165-L175) ignores return value by [ramos.poolHelper().proportionalAddLiquidityQuote(_quoteTokenAmount,_slippageBps)](contracts/v2/strategies/RamosStrategy.sol#L174)\n", - "first_markdown_element": "contracts/v2/strategies/RamosStrategy.sol#L165-L175", - "id": "b56d2f4548e025710d998bc242ac7f3032f0e8ea504c62f800fead5160f65786", - "check": "unused-return", - "impact": "Medium", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "proportionalRemoveLiquidityQuote", - "source_mapping": { - "start": 7587, - "length": 438, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", - "is_dependency": false, - "lines": [192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203], - "starting_column": 5, - "ending_column": 6 }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "RamosStrategy", - "source_mapping": { - "start": 1131, - "length": 9320, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", - "is_dependency": false, - "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "proportionalRemoveLiquidityQuote(uint256,uint256)" - } + "additional_fields": { "underlying_type": "external_calls_sending_eth" } }, { "type": "node", - "name": "ramos.poolHelper().proportionalRemoveLiquidityQuote(_bptAmount,_slippageBps)", + "name": "chi = pot.drip()", "source_mapping": { - "start": 7934, - "length": 84, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 5566, + "length": 60, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [202], + "lines": [142], "starting_column": 9, - "ending_column": 93 + "ending_column": 69 }, "type_specific_fields": { "parent": { "type": "function", - "name": "proportionalRemoveLiquidityQuote", + "name": "_checkpointChi", "source_mapping": { - "start": 7587, - "length": 438, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 5445, + "length": 188, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [ - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203 - ], + "lines": [140, 141, 142, 143], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "RamosStrategy", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 1131, - "length": 9320, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "proportionalRemoveLiquidityQuote(uint256,uint256)" - } - } - } - } - ], - "description": "RamosStrategy.proportionalRemoveLiquidityQuote(uint256,uint256) (contracts/v2/strategies/RamosStrategy.sol#192-203) ignores return value by ramos.poolHelper().proportionalRemoveLiquidityQuote(_bptAmount,_slippageBps) (contracts/v2/strategies/RamosStrategy.sol#202)\n", - "markdown": "[RamosStrategy.proportionalRemoveLiquidityQuote(uint256,uint256)](contracts/v2/strategies/RamosStrategy.sol#L192-L203) ignores return value by [ramos.poolHelper().proportionalRemoveLiquidityQuote(_bptAmount,_slippageBps)](contracts/v2/strategies/RamosStrategy.sol#L202)\n", - "first_markdown_element": "contracts/v2/strategies/RamosStrategy.sol#L192-L203", - "id": "ed71e6585e1914cd70e3ed747dea0a932bd4ba9629191c626628ce16c695c11d", - "check": "unused-return", - "impact": "Medium", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "populateShutdownData", - "source_mapping": { - "start": 9022, - "length": 564, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", - "is_dependency": false, - "lines": [232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "RamosStrategy", - "source_mapping": { - "start": 1131, - "length": 9320, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", - "is_dependency": false, - "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265 - ], - "starting_column": 1, - "ending_column": 0 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "_checkpointChi()" } - }, - "signature": "populateShutdownData(bytes)" - } + } + }, + "additional_fields": { "underlying_type": "external_calls_sending_eth" } }, { "type": "node", - "name": "(shutdownParams.bptAmount,None,None) = ramos.positions()", + "name": "pot.join(shares)", "source_mapping": { - "start": 9349, - "length": 48, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 8387, + "length": 16, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [240], + "lines": [208], "starting_column": 9, - "ending_column": 57 + "ending_column": 25 }, "type_specific_fields": { "parent": { "type": "function", - "name": "populateShutdownData", + "name": "_dsrDeposit", "source_mapping": { - "start": 9022, - "length": 564, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 8061, + "length": 349, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [ - 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243 - ], + "lines": [201, 202, 203, 204, 205, 206, 207, 208, 209], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "RamosStrategy", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 1131, - "length": 9320, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "populateShutdownData(bytes)" + "signature": "_dsrDeposit(uint256)" } } - } - } - ], - "description": "RamosStrategy.populateShutdownData(bytes) (contracts/v2/strategies/RamosStrategy.sol#232-243) ignores return value by (shutdownParams.bptAmount,None,None) = ramos.positions() (contracts/v2/strategies/RamosStrategy.sol#240)\n", - "markdown": "[RamosStrategy.populateShutdownData(bytes)](contracts/v2/strategies/RamosStrategy.sol#L232-L243) ignores return value by [(shutdownParams.bptAmount,None,None) = ramos.positions()](contracts/v2/strategies/RamosStrategy.sol#L240)\n", - "first_markdown_element": "contracts/v2/strategies/RamosStrategy.sol#L232-L243", - "id": "e68b668794a623b6a5a283b3672d9ddf56508b69062c77c9f4af7f0faf1aa51e", - "check": "unused-return", - "impact": "Medium", - "confidence": "Medium" - }, - { - "elements": [ + }, + "additional_fields": { "underlying_type": "external_calls_sending_eth" } + }, { - "type": "function", - "name": "_doShutdown", + "type": "node", + "name": "DaiDeposited(amount)", "source_mapping": { - "start": 9818, - "length": 631, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 8307, + "length": 25, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [ - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263 - ], - "starting_column": 5, - "ending_column": 6 + "lines": [206], + "starting_column": 9, + "ending_column": 34 }, "type_specific_fields": { "parent": { - "type": "contract", - "name": "RamosStrategy", + "type": "function", + "name": "_dsrDeposit", "source_mapping": { - "start": 1131, - "length": 9320, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 8061, + "length": 349, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265 - ], - "starting_column": 1, - "ending_column": 0 + "lines": [201, 202, 203, 204, 205, 206, 207, 208, 209], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DsrBaseStrategy", + "source_mapping": { + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "is_dependency": false, + "lines": [ + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "_dsrDeposit(uint256)" } - }, - "signature": "_doShutdown(bytes)" - } + } + }, + "additional_fields": { "underlying_type": "event" } }, { "type": "node", - "name": "ramos.removeLiquidity(params.requestData,params.bptAmount)", + "name": "_dsrDeposit(amount)", "source_mapping": { - "start": 9989, - "length": 59, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 8029, + "length": 19, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [252], + "lines": [198], "starting_column": 9, - "ending_column": 68 + "ending_column": 28 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_doShutdown", + "name": "borrowAndDeposit", "source_mapping": { - "start": 9818, - "length": 631, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 7809, + "length": 246, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [ - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263 - ], + "lines": [195, 196, 197, 198, 199], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "RamosStrategy", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 1131, - "length": 9320, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_doShutdown(bytes)" + "signature": "borrowAndDeposit(uint256)" } } - } + }, + "additional_fields": { "underlying_type": "event" } } ], - "description": "RamosStrategy._doShutdown(bytes) (contracts/v2/strategies/RamosStrategy.sol#250-263) ignores return value by ramos.removeLiquidity(params.requestData,params.bptAmount) (contracts/v2/strategies/RamosStrategy.sol#252)\n", - "markdown": "[RamosStrategy._doShutdown(bytes)](contracts/v2/strategies/RamosStrategy.sol#L250-L263) ignores return value by [ramos.removeLiquidity(params.requestData,params.bptAmount)](contracts/v2/strategies/RamosStrategy.sol#L252)\n", - "first_markdown_element": "contracts/v2/strategies/RamosStrategy.sol#L250-L263", - "id": "cab4a6d607fc52a73a76b47684750061e88667af7fd3a9cc5e85e235479031b6", - "check": "unused-return", - "impact": "Medium", + "description": "Reentrancy in DsrBaseStrategy.borrowAndDeposit(uint256) (contracts/v2/strategies/DsrBaseStrategy.sol#195-199):\n\tExternal calls:\n\t- treasuryReservesVault.borrow(daiToken,amount,address(this)) (contracts/v2/strategies/DsrBaseStrategy.sol#197)\n\t- _dsrDeposit(amount) (contracts/v2/strategies/DsrBaseStrategy.sol#198)\n\t\t- daiJoin.join(address(this),amount) (contracts/v2/strategies/DsrBaseStrategy.sol#207)\n\t\t- chi = pot.drip() (contracts/v2/strategies/DsrBaseStrategy.sol#142)\n\t\t- pot.join(shares) (contracts/v2/strategies/DsrBaseStrategy.sol#208)\n\tEvent emitted after the call(s):\n\t- DaiDeposited(amount) (contracts/v2/strategies/DsrBaseStrategy.sol#206)\n\t\t- _dsrDeposit(amount) (contracts/v2/strategies/DsrBaseStrategy.sol#198)\n", + "markdown": "Reentrancy in [DsrBaseStrategy.borrowAndDeposit(uint256)](contracts/v2/strategies/DsrBaseStrategy.sol#L195-L199):\n\tExternal calls:\n\t- [treasuryReservesVault.borrow(daiToken,amount,address(this))](contracts/v2/strategies/DsrBaseStrategy.sol#L197)\n\t- [_dsrDeposit(amount)](contracts/v2/strategies/DsrBaseStrategy.sol#L198)\n\t\t- [daiJoin.join(address(this),amount)](contracts/v2/strategies/DsrBaseStrategy.sol#L207)\n\t\t- [chi = pot.drip()](contracts/v2/strategies/DsrBaseStrategy.sol#L142)\n\t\t- [pot.join(shares)](contracts/v2/strategies/DsrBaseStrategy.sol#L208)\n\tEvent emitted after the call(s):\n\t- [DaiDeposited(amount)](contracts/v2/strategies/DsrBaseStrategy.sol#L206)\n\t\t- [_dsrDeposit(amount)](contracts/v2/strategies/DsrBaseStrategy.sol#L198)\n", + "first_markdown_element": "contracts/v2/strategies/DsrBaseStrategy.sol#L195-L199", + "id": "6f150fd09fac2796a24b461a93dcda378e0b73d3d94cc538625af3f9b9d80747", + "check": "reentrancy-events", + "impact": "Low", "confidence": "Medium" }, { "elements": [ { - "type": "variable", - "name": "_fundsOwner", + "type": "function", + "name": "swap", "source_mapping": { - "start": 3149, - "length": 19, + "start": 5765, + "length": 517, "filename_relative": "contracts/core/OtcOffer.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/core/OtcOffer.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OtcOffer.sol", "filename_short": "contracts/core/OtcOffer.sol", "is_dependency": false, - "lines": [72], - "starting_column": 9, - "ending_column": 28 + "lines": [131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141], + "starting_column": 5, + "ending_column": 6 }, "type_specific_fields": { "parent": { - "type": "function", - "name": "constructor", + "type": "contract", + "name": "OtcOffer", "source_mapping": { - "start": 3065, - "length": 1117, + "start": 847, + "length": 6468, "filename_relative": "contracts/core/OtcOffer.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/core/OtcOffer.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OtcOffer.sol", "filename_short": "contracts/core/OtcOffer.sol", "is_dependency": false, "lines": [ - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95 + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164 ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "OtcOffer", - "source_mapping": { - "start": 847, - "length": 6468, - "filename_relative": "contracts/core/OtcOffer.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/core/OtcOffer.sol", - "filename_short": "contracts/core/OtcOffer.sol", - "is_dependency": false, - "lines": [ - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "constructor(address,address,address,uint256,OtcOffer.OfferPricingToken,uint128,uint128)" + "starting_column": 1, + "ending_column": 2 } - } + }, + "signature": "swap(uint256)" } }, { "type": "node", - "name": "fundsOwner = _fundsOwner", + "name": "userBuyToken.safeTransferFrom(_fundsOwner,msg.sender,buyTokenAmount)", "source_mapping": { - "start": 3444, - "length": 24, + "start": 6205, + "length": 70, "filename_relative": "contracts/core/OtcOffer.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/core/OtcOffer.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OtcOffer.sol", "filename_short": "contracts/core/OtcOffer.sol", "is_dependency": false, - "lines": [80], + "lines": [140], "starting_column": 9, - "ending_column": 33 + "ending_column": 79 }, "type_specific_fields": { "parent": { "type": "function", - "name": "constructor", + "name": "swap", "source_mapping": { - "start": 3065, - "length": 1117, + "start": 5765, + "length": 517, "filename_relative": "contracts/core/OtcOffer.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/core/OtcOffer.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OtcOffer.sol", "filename_short": "contracts/core/OtcOffer.sol", "is_dependency": false, - "lines": [ - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95 - ], + "lines": [131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141], "starting_column": 5, "ending_column": 6 }, @@ -2623,7 +1908,7 @@ "start": 847, "length": 6468, "filename_relative": "contracts/core/OtcOffer.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/core/OtcOffer.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OtcOffer.sol", "filename_short": "contracts/core/OtcOffer.sol", "is_dependency": false, "lines": [ @@ -2643,254 +1928,161 @@ "ending_column": 2 } }, - "signature": "constructor(address,address,address,uint256,OtcOffer.OfferPricingToken,uint128,uint128)" + "signature": "swap(uint256)" } } } } ], - "description": "OtcOffer.constructor(address,address,address,uint256,OtcOffer.OfferPricingToken,uint128,uint128)._fundsOwner (contracts/core/OtcOffer.sol#72) lacks a zero-check on :\n\t\t- fundsOwner = _fundsOwner (contracts/core/OtcOffer.sol#80)\n", - "markdown": "[OtcOffer.constructor(address,address,address,uint256,OtcOffer.OfferPricingToken,uint128,uint128)._fundsOwner](contracts/core/OtcOffer.sol#L72) lacks a zero-check on :\n\t\t- [fundsOwner = _fundsOwner](contracts/core/OtcOffer.sol#L80)\n", - "first_markdown_element": "contracts/core/OtcOffer.sol#L72", - "id": "318c72045beea63d39db91e2c64959d93dbfe0e966ec4e74e6cbf32f20a24e68", - "check": "missing-zero-check", - "impact": "Low", - "confidence": "Medium" + "description": "OtcOffer.swap(uint256) (contracts/core/OtcOffer.sol#131-141) uses arbitrary from in transferFrom: userBuyToken.safeTransferFrom(_fundsOwner,msg.sender,buyTokenAmount) (contracts/core/OtcOffer.sol#140)\n", + "markdown": "[OtcOffer.swap(uint256)](contracts/core/OtcOffer.sol#L131-L141) uses arbitrary from in transferFrom: [userBuyToken.safeTransferFrom(_fundsOwner,msg.sender,buyTokenAmount)](contracts/core/OtcOffer.sol#L140)\n", + "first_markdown_element": "contracts/core/OtcOffer.sol#L131-L141", + "id": "05d3d20016db7bcfcaa4746897ba0c55c97e64e9bbf77842db5d2e2d9ceae5fd", + "check": "arbitrary-send-erc20", + "impact": "High", + "confidence": "High" }, { "elements": [ { "type": "function", - "name": "strategyBalanceSheet", + "name": "_update", "source_mapping": { - "start": 19539, - "length": 1196, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 3107, + "length": 847, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [ - 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, - 460, 461, 462, 463, 464, 465, 466, 467 - ], + "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 2150, - "length": 32023, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, - 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, - 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, - 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, - 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, - 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, - 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, - 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, - 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, - 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, - 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, - 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, - 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, - 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, - 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, - 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, - 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, - 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, - 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, - 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, - 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, - 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, - 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, - 771, 772, 773, 774, 775, 776, 777, 778, 779 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "strategyBalanceSheet(address)" + "signature": "_update(uint256,uint256,uint112,uint112)" } }, { "type": "node", - "name": "dTokenBalances[i] = ITempleStrategy.AssetBalance(_token,borrowTokens[IERC20(_token)].dToken.balanceOf(strategy))", + "name": "blockTimestamp = uint32(block.timestamp % 2 ** 32)", "source_mapping": { - "start": 20490, - "length": 113, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 3302, + "length": 55, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [464], - "starting_column": 13, - "ending_column": 126 + "lines": [82], + "starting_column": 9, + "ending_column": 64 }, "type_specific_fields": { "parent": { "type": "function", - "name": "strategyBalanceSheet", + "name": "_update", "source_mapping": { - "start": 19539, - "length": 1196, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 3107, + "length": 847, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [ - 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, - 460, 461, 462, 463, 464, 465, 466, 467 - ], + "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 2150, - "length": 32023, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, - 777, 778, 779 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "strategyBalanceSheet(address)" + "signature": "_update(uint256,uint256,uint112,uint112)" } } } } ], - "description": "TreasuryReservesVault.strategyBalanceSheet(address) (contracts/v2/TreasuryReservesVault.sol#447-467) has external calls inside a loop: dTokenBalances[i] = ITempleStrategy.AssetBalance(_token,borrowTokens[IERC20(_token)].dToken.balanceOf(strategy)) (contracts/v2/TreasuryReservesVault.sol#464)\n", - "markdown": "[TreasuryReservesVault.strategyBalanceSheet(address)](contracts/v2/TreasuryReservesVault.sol#L447-L467) has external calls inside a loop: [dTokenBalances[i] = ITempleStrategy.AssetBalance(_token,borrowTokens[IERC20(_token)].dToken.balanceOf(strategy))](contracts/v2/TreasuryReservesVault.sol#L464)\n", - "first_markdown_element": "contracts/v2/TreasuryReservesVault.sol#L447-L467", - "id": "20bcad4f9996938c51c34e640ba88b7c6f2e553a9bfd34b0e170bf1b1904292b", - "check": "calls-loop", - "impact": "Low", + "description": "TempleUniswapV2Pair._update(uint256,uint256,uint112,uint112) (contracts/amm/TempleUniswapV2Pair.sol#80-93) uses a weak PRNG: \"blockTimestamp = uint32(block.timestamp % 2 ** 32) (contracts/amm/TempleUniswapV2Pair.sol#82)\" \n", + "markdown": "[TempleUniswapV2Pair._update(uint256,uint256,uint112,uint112)](contracts/amm/TempleUniswapV2Pair.sol#L80-L93) uses a weak PRNG: \"[blockTimestamp = uint32(block.timestamp % 2 ** 32)](contracts/amm/TempleUniswapV2Pair.sol#L82)\" \n", + "first_markdown_element": "contracts/amm/TempleUniswapV2Pair.sol#L80-L93", + "id": "290357789cffd43bf264062cb5a528e9a368f77182c65ce7dcfbd4feb9020833", + "check": "weak-prng", + "impact": "High", "confidence": "Medium" }, { "elements": [ { "type": "function", - "name": "directPayouts", + "name": "_mint", "source_mapping": { - "start": 4101, - "length": 829, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 28890, + "length": 2251, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143 + 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, + 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, + 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, + 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, + 808, 809, 810 ], "starting_column": 5, "ending_column": 6 @@ -2898,17 +2090,15 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleTeamPaymentsFactory", + "name": "ERC721ACustom", "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, @@ -2916,43 +2106,127 @@ 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144 + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, + 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, + 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, + 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, + 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, + 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, + 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, + 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, + 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, + 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, + 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, + 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, + 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, + 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, + 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, + 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, + 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, + 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, + 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, + 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, + 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, + 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, + 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, + 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, + 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, + 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, + 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, + 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, + 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, + 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, + 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, + 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, + 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, + 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, + 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, + 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, + 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, + 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, + 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, + 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, + 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, + 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, + 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, + 1150, 1151, 1152, 1153, 1154, 1155 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "directPayouts(IERC20,address[],uint256[])" + "signature": "_mint(address,uint256)" } }, { "type": "node", - "name": "SafeERC20.safeTransferFrom(_token,msg.sender,dest,value)", + "name": "_packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1)", "source_mapping": { - "start": 4642, - "length": 59, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 29942, + "length": 71, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, - "lines": [133], + "lines": [781], "starting_column": 13, - "ending_column": 72 + "ending_column": 84 }, "type_specific_fields": { "parent": { "type": "function", - "name": "directPayouts", + "name": "_mint", "source_mapping": { - "start": 4101, - "length": 829, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 28890, + "length": 2251, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143 + 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, + 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, + 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, + 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, + 808, 809, 810 ], "starting_column": 5, "ending_column": 6 @@ -2960,64 +2234,293 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleTeamPaymentsFactory", + "name": "ERC721ACustom", "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "directPayouts(IERC20,address[],uint256[])" - } - } + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, + 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, + 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, + 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, + 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, + 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, + 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, + 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, + 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, + 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, + 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, + 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, + 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, + 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, + 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, + 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, + 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, + 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, + 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, + 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, + 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, + 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, + 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, + 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, + 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, + 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, + 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, + 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, + 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, + 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, + 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, + 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, + 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, + 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, + 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, + 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, + 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, + 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, + 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, + 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, + 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, + 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, + 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, + 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, + 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, + 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, + 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, + 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, + 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, + 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, + 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, + 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, + 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, + 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, + 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, + 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, + 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, + 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, + 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, + 1151, 1152, 1153, 1154, 1155 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "_mint(address,uint256)" + } + } + } + } + ], + "description": "ERC721ACustom._mint(address,uint256) (contracts/nexus/ERC721ACustom.sol#756-810) contains an incorrect shift operation: _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1) (contracts/nexus/ERC721ACustom.sol#781)\n", + "markdown": "[ERC721ACustom._mint(address,uint256)](contracts/nexus/ERC721ACustom.sol#L756-L810) contains an incorrect shift operation: [_packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1)](contracts/nexus/ERC721ACustom.sol#L781)\n", + "first_markdown_element": "contracts/nexus/ERC721ACustom.sol#L756-L810", + "id": "af939ff077f9e126e7b503c877cc5fa72b8783a72f39a3a8274980f994937dc4", + "check": "incorrect-shift", + "impact": "High", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "_burn", + "source_mapping": { + "start": 36529, + "length": 3024, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", + "is_dependency": false, + "lines": [ + 970, 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, + 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, + 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, + 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, + 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, + 1030, 1031, 1032, 1033, 1034, 1035, 1036 + ], + "starting_column": 5, + "ending_column": 6 }, - "additional_fields": { "underlying_type": "external_calls" } + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ERC721ACustom", + "source_mapping": { + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", + "is_dependency": false, + "lines": [ + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, + 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, + 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, + 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, + 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, + 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, + 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, + 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, + 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, + 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, + 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, + 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, + 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, + 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, + 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, + 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, + 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, + 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, + 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, + 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, + 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, + 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, + 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, + 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, + 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, + 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, + 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, + 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, + 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, + 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, + 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, + 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, + 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, + 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, + 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, + 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, + 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, + 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, + 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, + 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, + 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, + 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, + 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, + 1150, 1151, 1152, 1153, 1154, 1155 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "_burn(uint256,bool)" + } }, { "type": "node", - "name": "SafeERC20.safeTransferFrom(_token,msg.sender,dest,value)", + "name": "_packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1", "source_mapping": { - "start": 4642, - "length": 59, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 38056, + "length": 60, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, - "lines": [133], + "lines": [1003], "starting_column": 13, - "ending_column": 72 + "ending_column": 73 }, "type_specific_fields": { "parent": { "type": "function", - "name": "directPayouts", + "name": "_burn", "source_mapping": { - "start": 4101, - "length": 829, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 36529, + "length": 3024, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143 + 970, 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, + 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, + 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 1006, + 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, + 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, + 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036 ], "starting_column": 5, "ending_column": 6 @@ -3025,343 +2528,362 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleTeamPaymentsFactory", + "name": "ERC721ACustom", "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "directPayouts(IERC20,address[],uint256[])" - } - } - }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } - }, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, + 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, + 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, + 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, + 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, + 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, + 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, + 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, + 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, + 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, + 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, + 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, + 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, + 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, + 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, + 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, + 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, + 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, + 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, + 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, + 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, + 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, + 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, + 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, + 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, + 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, + 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, + 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, + 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, + 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, + 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, + 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, + 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, + 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, + 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, + 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, + 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, + 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, + 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, + 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, + 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, + 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, + 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, + 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, + 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, + 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, + 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, + 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, + 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, + 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, + 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, + 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, + 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, + 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, + 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, + 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, + 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, + 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, + 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, + 1151, 1152, 1153, 1154, 1155 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "_burn(uint256,bool)" + } + } + } + } + ], + "description": "ERC721ACustom._burn(uint256,bool) (contracts/nexus/ERC721ACustom.sol#970-1036) contains an incorrect shift operation: _packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1 (contracts/nexus/ERC721ACustom.sol#1003)\n", + "markdown": "[ERC721ACustom._burn(uint256,bool)](contracts/nexus/ERC721ACustom.sol#L970-L1036) contains an incorrect shift operation: [_packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1](contracts/nexus/ERC721ACustom.sol#L1003)\n", + "first_markdown_element": "contracts/nexus/ERC721ACustom.sol#L970-L1036", + "id": "1e78b96e5ed82d96d0a784621a2a9324dc06f23e9a803ef3e81dacfbdbddc628", + "check": "incorrect-shift", + "impact": "High", + "confidence": "High" + }, + { + "elements": [ { - "type": "node", - "name": "incrementEpoch(address(this),totalFunding)", + "type": "variable", + "name": "nonces", "source_mapping": { - "start": 4816, - "length": 43, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 1578, + "length": 50, + "filename_relative": "contracts/governance/ElderElection.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/governance/ElderElection.sol", + "filename_short": "contracts/governance/ElderElection.sol", "is_dependency": false, - "lines": [140], - "starting_column": 9, - "ending_column": 52 + "lines": [45], + "starting_column": 5, + "ending_column": 55 }, "type_specific_fields": { "parent": { - "type": "function", - "name": "directPayouts", + "type": "contract", + "name": "ElderElection", "source_mapping": { - "start": 4101, - "length": 829, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 908, + "length": 5057, + "filename_relative": "contracts/governance/ElderElection.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/governance/ElderElection.sol", + "filename_short": "contracts/governance/ElderElection.sol", "is_dependency": false, "lines": [ - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143 + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184 ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleTeamPaymentsFactory", - "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", - "is_dependency": false, - "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "directPayouts(IERC20,address[],uint256[])" + "starting_column": 1, + "ending_column": 2 } } - }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "epochsFunded" } }, { - "type": "node", - "name": "epochsFunded[lastPaidEpoch] = data", + "type": "function", + "name": "_useNonce", "source_mapping": { - "start": 1734, - "length": 34, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 4540, + "length": 196, + "filename_relative": "contracts/governance/ElderElection.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/governance/ElderElection.sol", + "filename_short": "contracts/governance/ElderElection.sol", "is_dependency": false, - "lines": [55], - "starting_column": 9, - "ending_column": 43 + "lines": [138, 139, 140, 141, 142], + "starting_column": 5, + "ending_column": 6 }, "type_specific_fields": { "parent": { - "type": "function", - "name": "incrementEpoch", + "type": "contract", + "name": "ElderElection", "source_mapping": { - "start": 1428, - "length": 347, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 908, + "length": 5057, + "filename_relative": "contracts/governance/ElderElection.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/governance/ElderElection.sol", + "filename_short": "contracts/governance/ElderElection.sol", "is_dependency": false, - "lines": [46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleTeamPaymentsFactory", - "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", - "is_dependency": false, - "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "incrementEpoch(address,uint256)" + "lines": [ + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184 + ], + "starting_column": 1, + "ending_column": 2 } - } - }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "epochsFunded" + }, + "signature": "_useNonce(address)" } - }, + } + ], + "description": "ElderElection.nonces (contracts/governance/ElderElection.sol#45) is never initialized. It is used in:\n\t- ElderElection._useNonce(address) (contracts/governance/ElderElection.sol#138-142)\n", + "markdown": "[ElderElection.nonces](contracts/governance/ElderElection.sol#L45) is never initialized. It is used in:\n\t- [ElderElection._useNonce(address)](contracts/governance/ElderElection.sol#L138-L142)\n", + "first_markdown_element": "contracts/governance/ElderElection.sol#L45", + "id": "a16c4c3a7455ad8f717c8aaf616d23de5d06be103f191c78e6dc3fdbb5eff5e8", + "check": "uninitialized-state", + "impact": "High", + "confidence": "High" + }, + { + "elements": [ { - "type": "node", - "name": "incrementEpoch(address(this),totalFunding)", + "type": "function", + "name": "calc", "source_mapping": { - "start": 4816, - "length": 43, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 836, + "length": 613, + "filename_relative": "contracts/core/JoiningFee.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/JoiningFee.sol", + "filename_short": "contracts/core/JoiningFee.sol", "is_dependency": false, - "lines": [140], - "starting_column": 9, - "ending_column": 52 + "lines": [26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39], + "starting_column": 5, + "ending_column": 6 }, "type_specific_fields": { "parent": { - "type": "function", - "name": "directPayouts", + "type": "contract", + "name": "JoiningFee", "source_mapping": { - "start": 4101, - "length": 829, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 461, + "length": 1345, + "filename_relative": "contracts/core/JoiningFee.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/JoiningFee.sol", + "filename_short": "contracts/core/JoiningFee.sol", "is_dependency": false, "lines": [ - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143 + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53 ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleTeamPaymentsFactory", - "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", - "is_dependency": false, - "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "directPayouts(IERC20,address[],uint256[])" + "starting_column": 1, + "ending_column": 0 } - } - }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "lastPaidEpoch" + }, + "signature": "calc(uint256,uint256,address)" } }, { "type": "node", - "name": "data = FundingData({paymentContract:address(_paymentContract),totalFunding:_totalFunding,epoch:lastPaidEpoch ++})", + "name": "(block.timestamp - (numCycles * periodDuration) - firstPeriodStartTimestamp) / 3600 * feePerHour", "source_mapping": { - "start": 1542, - "length": 182, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 1339, + "length": 103, + "filename_relative": "contracts/core/JoiningFee.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/JoiningFee.sol", + "filename_short": "contracts/core/JoiningFee.sol", "is_dependency": false, - "lines": [50, 51, 52, 53, 54], + "lines": [38], "starting_column": 9, - "ending_column": 11 + "ending_column": 112 }, "type_specific_fields": { "parent": { "type": "function", - "name": "incrementEpoch", + "name": "calc", "source_mapping": { - "start": 1428, - "length": 347, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 836, + "length": 613, + "filename_relative": "contracts/core/JoiningFee.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/JoiningFee.sol", + "filename_short": "contracts/core/JoiningFee.sol", "is_dependency": false, - "lines": [46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56], + "lines": [26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleTeamPaymentsFactory", + "name": "JoiningFee", "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 461, + "length": 1345, + "filename_relative": "contracts/core/JoiningFee.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/JoiningFee.sol", + "filename_short": "contracts/core/JoiningFee.sol", "is_dependency": false, "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "incrementEpoch(address,uint256)" + "signature": "calc(uint256,uint256,address)" } } - }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "lastPaidEpoch" } } ], - "description": "Reentrancy in TempleTeamPaymentsFactory.directPayouts(IERC20,address[],uint256[]) (contracts/admin/TempleTeamPaymentsFactory.sol#119-143):\n\tExternal calls:\n\t- SafeERC20.safeTransferFrom(_token,msg.sender,dest,value) (contracts/admin/TempleTeamPaymentsFactory.sol#133)\n\tState variables written after the call(s):\n\t- incrementEpoch(address(this),totalFunding) (contracts/admin/TempleTeamPaymentsFactory.sol#140)\n\t\t- epochsFunded[lastPaidEpoch] = data (contracts/admin/TempleTeamPaymentsFactory.sol#55)\n\t- incrementEpoch(address(this),totalFunding) (contracts/admin/TempleTeamPaymentsFactory.sol#140)\n\t\t- data = FundingData({paymentContract:address(_paymentContract),totalFunding:_totalFunding,epoch:lastPaidEpoch ++}) (contracts/admin/TempleTeamPaymentsFactory.sol#50-54)\n", - "markdown": "Reentrancy in [TempleTeamPaymentsFactory.directPayouts(IERC20,address[],uint256[])](contracts/admin/TempleTeamPaymentsFactory.sol#L119-L143):\n\tExternal calls:\n\t- [SafeERC20.safeTransferFrom(_token,msg.sender,dest,value)](contracts/admin/TempleTeamPaymentsFactory.sol#L133)\n\tState variables written after the call(s):\n\t- [incrementEpoch(address(this),totalFunding)](contracts/admin/TempleTeamPaymentsFactory.sol#L140)\n\t\t- [epochsFunded[lastPaidEpoch] = data](contracts/admin/TempleTeamPaymentsFactory.sol#L55)\n\t- [incrementEpoch(address(this),totalFunding)](contracts/admin/TempleTeamPaymentsFactory.sol#L140)\n\t\t- [data = FundingData({paymentContract:address(_paymentContract),totalFunding:_totalFunding,epoch:lastPaidEpoch ++})](contracts/admin/TempleTeamPaymentsFactory.sol#L50-L54)\n", - "first_markdown_element": "contracts/admin/TempleTeamPaymentsFactory.sol#L119-L143", - "id": "e7d7cc7383e1682a576694bbc276f3a8cb1f5f6783434f8f5336ea3b0d9bf554", - "check": "reentrancy-benign", - "impact": "Low", + "description": "JoiningFee.calc(uint256,uint256,address) (contracts/core/JoiningFee.sol#26-39) performs a multiplication on the result of a division:\n\t- (block.timestamp - (numCycles * periodDuration) - firstPeriodStartTimestamp) / 3600 * feePerHour (contracts/core/JoiningFee.sol#38)\n", + "markdown": "[JoiningFee.calc(uint256,uint256,address)](contracts/core/JoiningFee.sol#L26-L39) performs a multiplication on the result of a division:\n\t- [(block.timestamp - (numCycles * periodDuration) - firstPeriodStartTimestamp) / 3600 * feePerHour](contracts/core/JoiningFee.sol#L38)\n", + "first_markdown_element": "contracts/core/JoiningFee.sol#L26-L39", + "id": "c0d4beb09bbb97e4ec3e7a9e3bd4fc713e216c086a2436671c0e4fdbaa26965b", + "check": "divide-before-multiply", + "impact": "Medium", "confidence": "Medium" }, { "elements": [ { "type": "function", - "name": "_burnDToken", + "name": "inEnterExitWindow", "source_mapping": { - "start": 29999, - "length": 1179, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 5359, + "length": 569, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, - "lines": [ - 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, - 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709 - ], + "lines": [140, 141, 142, 143, 144, 145, 146, 147, 148], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "Vault", "source_mapping": { - "start": 2150, - "length": 32023, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 1161, + "length": 7823, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, "lines": [ + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, @@ -3375,1424 +2897,1174 @@ 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, - 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, - 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, - 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, - 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, - 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, - 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, - 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, - 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, - 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, - 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, - 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, - 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, - 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, - 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, - 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, - 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, - 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, - 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, - 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, - 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, - 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, - 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, - 771, 772, 773, 774, 775, 776, 777, 778, 779 + 225, 226, 227, 228, 229, 230, 231, 232, 233 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "_burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" + "signature": "inEnterExitWindow()" } }, { "type": "node", - "name": "_burnedAmount = tokenConfig.dToken.burn(strategy,toBurnAmount)", + "name": "cycleNumber = (block.timestamp - firstPeriodStartTimestamp) / periodDuration", "source_mapping": { - "start": 30398, - "length": 71, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 5697, + "length": 76, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, - "lines": [688], + "lines": [146], "starting_column": 9, - "ending_column": 80 + "ending_column": 85 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_burnDToken", + "name": "inEnterExitWindow", "source_mapping": { - "start": 29999, - "length": 1179, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 5359, + "length": 569, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, - "lines": [ - 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, - 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709 - ], + "lines": [140, 141, 142, 143, 144, 145, 146, 147, 148], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "Vault", "source_mapping": { - "start": 2150, - "length": 32023, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 1161, + "length": 7823, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, - 777, 778, 779 + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "_burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" + "signature": "inEnterExitWindow()" } } - }, - "additional_fields": { "underlying_type": "external_calls" } + } }, { "type": "node", - "name": "StrategyCreditAndDebtBalance(strategy,address(token),_creditBalance,dTokenBalance)", + "name": "inWindow = cycleNumber * periodDuration + firstPeriodStartTimestamp + enterExitWindowDuration + ENTER_EXIT_WINDOW_BUFFER > block.timestamp", "source_mapping": { - "start": 31081, - "length": 90, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 5783, + "length": 138, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, - "lines": [708], + "lines": [147], "starting_column": 9, - "ending_column": 99 + "ending_column": 147 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_burnDToken", + "name": "inEnterExitWindow", "source_mapping": { - "start": 29999, - "length": 1179, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 5359, + "length": 569, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, - "lines": [ - 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, - 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709 - ], + "lines": [140, 141, 142, 143, 144, 145, 146, 147, 148], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "Vault", "source_mapping": { - "start": 2150, - "length": 32023, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 1161, + "length": 7823, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, - 777, 778, 779 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "_burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" - } + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "inEnterExitWindow()" + } } - }, - "additional_fields": { "underlying_type": "event" } + } } ], - "description": "Reentrancy in TreasuryReservesVault._burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256) (contracts/v2/TreasuryReservesVault.sol#677-709):\n\tExternal calls:\n\t- _burnedAmount = tokenConfig.dToken.burn(strategy,toBurnAmount) (contracts/v2/TreasuryReservesVault.sol#688)\n\tEvent emitted after the call(s):\n\t- StrategyCreditAndDebtBalance(strategy,address(token),_creditBalance,dTokenBalance) (contracts/v2/TreasuryReservesVault.sol#708)\n", - "markdown": "Reentrancy in [TreasuryReservesVault._burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)](contracts/v2/TreasuryReservesVault.sol#L677-L709):\n\tExternal calls:\n\t- [_burnedAmount = tokenConfig.dToken.burn(strategy,toBurnAmount)](contracts/v2/TreasuryReservesVault.sol#L688)\n\tEvent emitted after the call(s):\n\t- [StrategyCreditAndDebtBalance(strategy,address(token),_creditBalance,dTokenBalance)](contracts/v2/TreasuryReservesVault.sol#L708)\n", - "first_markdown_element": "contracts/v2/TreasuryReservesVault.sol#L677-L709", - "id": "39b30f51cb8e0f3bb137afd7388e494f2a117088a846eb999e1fe7c8a4337328", - "check": "reentrancy-events", - "impact": "Low", + "description": "Vault.inEnterExitWindow() (contracts/core/Vault.sol#140-148) performs a multiplication on the result of a division:\n\t- cycleNumber = (block.timestamp - firstPeriodStartTimestamp) / periodDuration (contracts/core/Vault.sol#146)\n\t- inWindow = cycleNumber * periodDuration + firstPeriodStartTimestamp + enterExitWindowDuration + ENTER_EXIT_WINDOW_BUFFER > block.timestamp (contracts/core/Vault.sol#147)\n", + "markdown": "[Vault.inEnterExitWindow()](contracts/core/Vault.sol#L140-L148) performs a multiplication on the result of a division:\n\t- [cycleNumber = (block.timestamp - firstPeriodStartTimestamp) / periodDuration](contracts/core/Vault.sol#L146)\n\t- [inWindow = cycleNumber * periodDuration + firstPeriodStartTimestamp + enterExitWindowDuration + ENTER_EXIT_WINDOW_BUFFER > block.timestamp](contracts/core/Vault.sol#L147)\n", + "first_markdown_element": "contracts/core/Vault.sol#L140-L148", + "id": "3aabd4762a2fde5d3ca708a653713c64a4f9b65daaecb672955c03acd76d5927", + "check": "divide-before-multiply", + "impact": "Medium", "confidence": "Medium" }, { "elements": [ { "type": "function", - "name": "_doShutdown", + "name": "_safeTransfer", "source_mapping": { - "start": 12280, - "length": 502, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 1892, + "length": 284, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303], + "lines": [49, 50, 51, 52], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_doShutdown(bytes)" + "signature": "_safeTransfer(address,address,uint256)" } }, { "type": "node", - "name": "(daiAvailable,sharesAvailable) = _checkpointDaiBalance()", + "name": "require(bool,string)(success && (data.length == 0 || abi.decode(data,(bool))),UniswapV2: TRANSFER_FAILED)", "source_mapping": { - "start": 12387, - "length": 74, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2073, + "length": 96, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [295], + "lines": [51], "starting_column": 9, - "ending_column": 83 + "ending_column": 105 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_doShutdown", + "name": "_safeTransfer", "source_mapping": { - "start": 12280, - "length": 502, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 1892, + "length": 284, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303], + "lines": [49, 50, 51, 52], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_doShutdown(bytes)" + "signature": "_safeTransfer(address,address,uint256)" } } - }, - "additional_fields": { "underlying_type": "external_calls" } - }, + } + } + ], + "description": "TempleUniswapV2Pair._safeTransfer(address,address,uint256) (contracts/amm/TempleUniswapV2Pair.sol#49-52) uses a dangerous strict equality:\n\t- require(bool,string)(success && (data.length == 0 || abi.decode(data,(bool))),UniswapV2: TRANSFER_FAILED) (contracts/amm/TempleUniswapV2Pair.sol#51)\n", + "markdown": "[TempleUniswapV2Pair._safeTransfer(address,address,uint256)](contracts/amm/TempleUniswapV2Pair.sol#L49-L52) uses a dangerous strict equality:\n\t- [require(bool,string)(success && (data.length == 0 || abi.decode(data,(bool))),UniswapV2: TRANSFER_FAILED)](contracts/amm/TempleUniswapV2Pair.sol#L51)\n", + "first_markdown_element": "contracts/amm/TempleUniswapV2Pair.sol#L49-L52", + "id": "2ee4045d0f377d6f8b394394680249a386668a22c42975e90902df9d8fa3b850", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ { - "type": "node", - "name": "chi = pot.drip()", + "type": "function", + "name": "mint", "source_mapping": { - "start": 5566, - "length": 60, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 4063, + "length": 1069, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [142], - "starting_column": 9, - "ending_column": 69 + "lines": [ + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115 + ], + "starting_column": 5, + "ending_column": 6 }, "type_specific_fields": { "parent": { - "type": "function", - "name": "_checkpointChi", + "type": "contract", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 5445, - "length": 188, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [140, 141, 142, 143], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "DsrBaseStrategy", - "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", - "is_dependency": false, - "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "_checkpointChi()" + "lines": [ + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185 + ], + "starting_column": 1, + "ending_column": 0 } - } - }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + }, + "signature": "mint(address)" + } }, { "type": "node", - "name": "_dsrWithdrawal(sharesAvailable,daiAvailable)", + "name": "_totalSupply == 0", "source_mapping": { - "start": 12471, - "length": 45, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 4568, + "length": 17, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [296], - "starting_column": 9, - "ending_column": 54 + "lines": [104], + "starting_column": 13, + "ending_column": 30 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_doShutdown", + "name": "mint", "source_mapping": { - "start": 12280, - "length": 502, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 4063, + "length": 1069, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303], + "lines": [ + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_doShutdown(bytes)" + "signature": "mint(address)" } } + } + } + ], + "description": "TempleUniswapV2Pair.mint(address) (contracts/amm/TempleUniswapV2Pair.sol#96-115) uses a dangerous strict equality:\n\t- _totalSupply == 0 (contracts/amm/TempleUniswapV2Pair.sol#104)\n", + "markdown": "[TempleUniswapV2Pair.mint(address)](contracts/amm/TempleUniswapV2Pair.sol#L96-L115) uses a dangerous strict equality:\n\t- [_totalSupply == 0](contracts/amm/TempleUniswapV2Pair.sol#L104)\n", + "first_markdown_element": "contracts/amm/TempleUniswapV2Pair.sol#L96-L115", + "id": "f3faa53f859ed259e9ff2509250c109f539dc4c8a41ed53a9c3a3342c73a4cea", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "amountPerShare", + "source_mapping": { + "start": 4981, + "length": 372, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", + "is_dependency": false, + "lines": [ + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138 + ], + "starting_column": 5, + "ending_column": 6 }, - "additional_fields": { "underlying_type": "external_calls" } + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Vault", + "source_mapping": { + "start": 1161, + "length": 7823, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", + "is_dependency": false, + "lines": [ + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "amountPerShare()" + } }, { "type": "node", - "name": "pot.exit(sharesAmount)", + "name": "p == 0", "source_mapping": { - "start": 11597, - "length": 22, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 5257, + "length": 6, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, - "lines": [279], - "starting_column": 9, - "ending_column": 31 + "lines": [131], + "starting_column": 13, + "ending_column": 19 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_dsrWithdrawal", + "name": "amountPerShare", "source_mapping": { - "start": 11513, - "length": 199, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 4981, + "length": 372, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, - "lines": [278, 279, 280, 281, 282], + "lines": [ + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "Vault", "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 1161, + "length": 7823, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306 + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "_dsrWithdrawal(uint256,uint256)" + "signature": "amountPerShare()" } } + } + } + ], + "description": "Vault.amountPerShare() (contracts/core/Vault.sol#125-138) uses a dangerous strict equality:\n\t- p == 0 (contracts/core/Vault.sol#131)\n", + "markdown": "[Vault.amountPerShare()](contracts/core/Vault.sol#L125-L138) uses a dangerous strict equality:\n\t- [p == 0](contracts/core/Vault.sol#L131)\n", + "first_markdown_element": "contracts/core/Vault.sol#L125-L138", + "id": "4158c1e69d81519dc5989e6d6c111d02083aaaabb931ca68f7b53bccf0ab30fa", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "burn", + "source_mapping": { + "start": 5241, + "length": 1294, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "is_dependency": false, + "lines": [ + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138 + ], + "starting_column": 5, + "ending_column": 6 }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleUniswapV2Pair", + "source_mapping": { + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "is_dependency": false, + "lines": [ + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "burn(address)" + } }, { "type": "node", - "name": "daiJoin.exit(address(this),daiAmount)", + "name": "_safeTransfer(_token0,to,amount0)", "source_mapping": { - "start": 11629, - "length": 38, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 6213, + "length": 35, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [280], + "lines": [131], "starting_column": 9, - "ending_column": 47 + "ending_column": 44 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_dsrWithdrawal", + "name": "burn", "source_mapping": { - "start": 11513, - "length": 199, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 5241, + "length": 1294, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [278, 279, 280, 281, 282], + "lines": [ + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_dsrWithdrawal(uint256,uint256)" + "signature": "burn(address)" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "DaiWithdrawn(daiAmount)", + "name": "(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))", "source_mapping": { - "start": 11677, - "length": 28, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 1972, + "length": 91, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [281], + "lines": [50], "starting_column": 9, - "ending_column": 37 + "ending_column": 100 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_dsrWithdrawal", + "name": "_safeTransfer", "source_mapping": { - "start": 11513, - "length": 199, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 1892, + "length": 284, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [278, 279, 280, 281, 282], + "lines": [49, 50, 51, 52], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_dsrWithdrawal(uint256,uint256)" + "signature": "_safeTransfer(address,address,uint256)" } } }, - "additional_fields": { "underlying_type": "event" } + "additional_fields": { "underlying_type": "external_calls_sending_eth" } }, { "type": "node", - "name": "_dsrWithdrawal(sharesAvailable,daiAvailable)", + "name": "_safeTransfer(_token1,to,amount1)", "source_mapping": { - "start": 12471, - "length": 45, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 6258, + "length": 35, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [296], + "lines": [132], "starting_column": 9, - "ending_column": 54 + "ending_column": 44 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_doShutdown", + "name": "burn", "source_mapping": { - "start": 12280, - "length": 502, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 5241, + "length": 1294, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303], + "lines": [ + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_doShutdown(bytes)" + "signature": "burn(address)" } } }, - "additional_fields": { "underlying_type": "event" } - } - ], - "description": "Reentrancy in DsrBaseStrategy._doShutdown(bytes) (contracts/v2/strategies/DsrBaseStrategy.sol#293-303):\n\tExternal calls:\n\t- (daiAvailable,sharesAvailable) = _checkpointDaiBalance() (contracts/v2/strategies/DsrBaseStrategy.sol#295)\n\t\t- chi = pot.drip() (contracts/v2/strategies/DsrBaseStrategy.sol#142)\n\t- _dsrWithdrawal(sharesAvailable,daiAvailable) (contracts/v2/strategies/DsrBaseStrategy.sol#296)\n\t\t- pot.exit(sharesAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#279)\n\t\t- daiJoin.exit(address(this),daiAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#280)\n\tEvent emitted after the call(s):\n\t- DaiWithdrawn(daiAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#281)\n\t\t- _dsrWithdrawal(sharesAvailable,daiAvailable) (contracts/v2/strategies/DsrBaseStrategy.sol#296)\n", - "markdown": "Reentrancy in [DsrBaseStrategy._doShutdown(bytes)](contracts/v2/strategies/DsrBaseStrategy.sol#L293-L303):\n\tExternal calls:\n\t- [(daiAvailable,sharesAvailable) = _checkpointDaiBalance()](contracts/v2/strategies/DsrBaseStrategy.sol#L295)\n\t\t- [chi = pot.drip()](contracts/v2/strategies/DsrBaseStrategy.sol#L142)\n\t- [_dsrWithdrawal(sharesAvailable,daiAvailable)](contracts/v2/strategies/DsrBaseStrategy.sol#L296)\n\t\t- [pot.exit(sharesAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L279)\n\t\t- [daiJoin.exit(address(this),daiAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L280)\n\tEvent emitted after the call(s):\n\t- [DaiWithdrawn(daiAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L281)\n\t\t- [_dsrWithdrawal(sharesAvailable,daiAvailable)](contracts/v2/strategies/DsrBaseStrategy.sol#L296)\n", - "first_markdown_element": "contracts/v2/strategies/DsrBaseStrategy.sol#L293-L303", - "id": "2d01281faf7161866f00d8f2c914cd6f900f84c01032af46a90491363ac26414", - "check": "reentrancy-events", - "impact": "Low", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "_dsrWithdrawal", - "source_mapping": { - "start": 11513, - "length": 199, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", - "is_dependency": false, - "lines": [278, 279, 280, 281, 282], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "DsrBaseStrategy", - "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", - "is_dependency": false, - "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "_dsrWithdrawal(uint256,uint256)" - } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "pot.exit(sharesAmount)", + "name": "(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))", "source_mapping": { - "start": 11597, - "length": 22, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 1972, + "length": 91, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [279], + "lines": [50], "starting_column": 9, - "ending_column": 31 + "ending_column": 100 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_dsrWithdrawal", + "name": "_safeTransfer", "source_mapping": { - "start": 11513, - "length": 199, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 1892, + "length": 284, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [278, 279, 280, 281, 282], + "lines": [49, 50, 51, 52], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_dsrWithdrawal(uint256,uint256)" + "signature": "_safeTransfer(address,address,uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls" } + "additional_fields": { "underlying_type": "external_calls_sending_eth" } }, { "type": "node", - "name": "daiJoin.exit(address(this),daiAmount)", + "name": "_update(balance0,balance1,_reserve0,_reserve1)", "source_mapping": { - "start": 11629, - "length": 38, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 6426, + "length": 49, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [280], + "lines": [136], "starting_column": 9, - "ending_column": 47 + "ending_column": 58 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_dsrWithdrawal", + "name": "burn", "source_mapping": { - "start": 11513, - "length": 199, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 5241, + "length": 1294, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [278, 279, 280, 281, 282], + "lines": [ + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "_dsrWithdrawal(uint256,uint256)" - } - } - }, - "additional_fields": { "underlying_type": "external_calls" } - }, - { + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "burn(address)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "blockTimestampLast" + } + }, + { "type": "node", - "name": "DaiWithdrawn(daiAmount)", + "name": "blockTimestampLast = blockTimestamp", "source_mapping": { - "start": 11677, - "length": 28, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 3873, + "length": 35, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [281], + "lines": [91], "starting_column": 9, - "ending_column": 37 + "ending_column": 44 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_dsrWithdrawal", + "name": "_update", "source_mapping": { - "start": 11513, - "length": 199, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 3107, + "length": 847, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [278, 279, 280, 281, 282], + "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_dsrWithdrawal(uint256,uint256)" + "signature": "_update(uint256,uint256,uint112,uint112)" } } }, - "additional_fields": { "underlying_type": "event" } - } - ], - "description": "Reentrancy in DsrBaseStrategy._dsrWithdrawal(uint256,uint256) (contracts/v2/strategies/DsrBaseStrategy.sol#278-282):\n\tExternal calls:\n\t- pot.exit(sharesAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#279)\n\t- daiJoin.exit(address(this),daiAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#280)\n\tEvent emitted after the call(s):\n\t- DaiWithdrawn(daiAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#281)\n", - "markdown": "Reentrancy in [DsrBaseStrategy._dsrWithdrawal(uint256,uint256)](contracts/v2/strategies/DsrBaseStrategy.sol#L278-L282):\n\tExternal calls:\n\t- [pot.exit(sharesAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L279)\n\t- [daiJoin.exit(address(this),daiAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L280)\n\tEvent emitted after the call(s):\n\t- [DaiWithdrawn(daiAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L281)\n", - "first_markdown_element": "contracts/v2/strategies/DsrBaseStrategy.sol#L278-L282", - "id": "d35e410305415164f2083f99e160a70431f3fb38caf25144473d47103896e96b", - "check": "reentrancy-events", - "impact": "Low", - "confidence": "Medium" - }, - { - "elements": [ + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "blockTimestampLast" + } + }, { - "type": "function", - "name": "_mintDToken", + "type": "node", + "name": "_update(balance0,balance1,_reserve0,_reserve1)", "source_mapping": { - "start": 28533, - "length": 1205, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 6426, + "length": 49, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [ - 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, - 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, - 664, 665, 666, 667, 668, 669, 670 - ], - "starting_column": 5, - "ending_column": 6 + "lines": [136], + "starting_column": 9, + "ending_column": 58 }, "type_specific_fields": { "parent": { - "type": "contract", - "name": "TreasuryReservesVault", + "type": "function", + "name": "burn", "source_mapping": { - "start": 2150, - "length": 32023, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 5241, + "length": 1294, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, - 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, - 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, - 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, - 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, - 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, - 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, - 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, - 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, - 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, - 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, - 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, - 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, - 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, - 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, - 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, - 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, - 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, - 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, - 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, - 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, - 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, - 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, - 771, 772, 773, 774, 775, 776, 777, 778, 779 + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138 ], - "starting_column": 1, - "ending_column": 0 + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleUniswapV2Pair", + "source_mapping": { + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "is_dependency": false, + "lines": [ + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "burn(address)" } - }, - "signature": "_mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "reserve0" } }, { "type": "node", - "name": "tokenConfig.dToken.mint(strategy,_newDebt)", + "name": "reserve0 = uint112(balance0)", "source_mapping": { - "start": 29294, - "length": 43, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 3797, + "length": 28, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [657], - "starting_column": 13, - "ending_column": 56 + "lines": [89], + "starting_column": 9, + "ending_column": 37 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_mintDToken", + "name": "_update", "source_mapping": { - "start": 28533, - "length": 1205, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 3107, + "length": 847, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [ - 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, - 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, - 664, 665, 666, 667, 668, 669, 670 - ], + "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 2150, - "length": 32023, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, - 777, 778, 779 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" + "signature": "_update(uint256,uint256,uint112,uint112)" } } }, - "additional_fields": { "underlying_type": "external_calls" } + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "reserve0" + } }, { "type": "node", - "name": "StrategyCreditAndDebtBalance(strategy,address(token),_creditBalance,dTokenBalance)", + "name": "_update(balance0,balance1,_reserve0,_reserve1)", "source_mapping": { - "start": 29641, - "length": 90, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 6426, + "length": 49, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [669], + "lines": [136], "starting_column": 9, - "ending_column": 99 + "ending_column": 58 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_mintDToken", + "name": "burn", "source_mapping": { - "start": 28533, - "length": 1205, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 5241, + "length": 1294, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, - 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, - 664, 665, 666, 667, 668, 669, 670 + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138 ], "starting_column": 5, "ending_column": 6 @@ -4800,113 +4072,137 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 2150, - "length": 32023, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, - 777, 778, 779 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" + "signature": "burn(address)" } } }, - "additional_fields": { "underlying_type": "event" } - } - ], - "description": "Reentrancy in TreasuryReservesVault._mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256) (contracts/v2/TreasuryReservesVault.sol#638-670):\n\tExternal calls:\n\t- tokenConfig.dToken.mint(strategy,_newDebt) (contracts/v2/TreasuryReservesVault.sol#657)\n\tEvent emitted after the call(s):\n\t- StrategyCreditAndDebtBalance(strategy,address(token),_creditBalance,dTokenBalance) (contracts/v2/TreasuryReservesVault.sol#669)\n", - "markdown": "Reentrancy in [TreasuryReservesVault._mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)](contracts/v2/TreasuryReservesVault.sol#L638-L670):\n\tExternal calls:\n\t- [tokenConfig.dToken.mint(strategy,_newDebt)](contracts/v2/TreasuryReservesVault.sol#L657)\n\tEvent emitted after the call(s):\n\t- [StrategyCreditAndDebtBalance(strategy,address(token),_creditBalance,dTokenBalance)](contracts/v2/TreasuryReservesVault.sol#L669)\n", - "first_markdown_element": "contracts/v2/TreasuryReservesVault.sol#L638-L670", - "id": "d06d6a53d0451e137729438d3e1093db6d5e7f0f78494fe8b2a70bd44b393675", - "check": "reentrancy-events", - "impact": "Low", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "_withdrawFromBaseStrategy", + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "reserve1" + } + }, + { + "type": "node", + "name": "reserve1 = uint112(balance1)", "source_mapping": { - "start": 25804, - "length": 2552, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 3835, + "length": 28, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "is_dependency": false, + "lines": [90], + "starting_column": 9, + "ending_column": 37 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "_update", + "source_mapping": { + "start": 3107, + "length": 847, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "is_dependency": false, + "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleUniswapV2Pair", + "source_mapping": { + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "is_dependency": false, + "lines": [ + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "_update(uint256,uint256,uint112,uint112)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "reserve1" + } + } + ], + "description": "Reentrancy in TempleUniswapV2Pair.burn(address) (contracts/amm/TempleUniswapV2Pair.sol#118-138):\n\tExternal calls:\n\t- _safeTransfer(_token0,to,amount0) (contracts/amm/TempleUniswapV2Pair.sol#131)\n\t\t- (success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value)) (contracts/amm/TempleUniswapV2Pair.sol#50)\n\t- _safeTransfer(_token1,to,amount1) (contracts/amm/TempleUniswapV2Pair.sol#132)\n\t\t- (success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value)) (contracts/amm/TempleUniswapV2Pair.sol#50)\n\tState variables written after the call(s):\n\t- _update(balance0,balance1,_reserve0,_reserve1) (contracts/amm/TempleUniswapV2Pair.sol#136)\n\t\t- blockTimestampLast = blockTimestamp (contracts/amm/TempleUniswapV2Pair.sol#91)\n\tTempleUniswapV2Pair.blockTimestampLast (contracts/amm/TempleUniswapV2Pair.sol#25) can be used in cross function reentrancies:\n\t- TempleUniswapV2Pair._update(uint256,uint256,uint112,uint112) (contracts/amm/TempleUniswapV2Pair.sol#80-93)\n\t- TempleUniswapV2Pair.getReserves() (contracts/amm/TempleUniswapV2Pair.sol#43-47)\n\t- _update(balance0,balance1,_reserve0,_reserve1) (contracts/amm/TempleUniswapV2Pair.sol#136)\n\t\t- reserve0 = uint112(balance0) (contracts/amm/TempleUniswapV2Pair.sol#89)\n\tTempleUniswapV2Pair.reserve0 (contracts/amm/TempleUniswapV2Pair.sol#23) can be used in cross function reentrancies:\n\t- TempleUniswapV2Pair._update(uint256,uint256,uint112,uint112) (contracts/amm/TempleUniswapV2Pair.sol#80-93)\n\t- TempleUniswapV2Pair.getReserves() (contracts/amm/TempleUniswapV2Pair.sol#43-47)\n\t- TempleUniswapV2Pair.skim(address) (contracts/amm/TempleUniswapV2Pair.sol#173-178)\n\t- TempleUniswapV2Pair.sync() (contracts/amm/TempleUniswapV2Pair.sol#181-183)\n\t- _update(balance0,balance1,_reserve0,_reserve1) (contracts/amm/TempleUniswapV2Pair.sol#136)\n\t\t- reserve1 = uint112(balance1) (contracts/amm/TempleUniswapV2Pair.sol#90)\n\tTempleUniswapV2Pair.reserve1 (contracts/amm/TempleUniswapV2Pair.sol#24) can be used in cross function reentrancies:\n\t- TempleUniswapV2Pair._update(uint256,uint256,uint112,uint112) (contracts/amm/TempleUniswapV2Pair.sol#80-93)\n\t- TempleUniswapV2Pair.getReserves() (contracts/amm/TempleUniswapV2Pair.sol#43-47)\n\t- TempleUniswapV2Pair.skim(address) (contracts/amm/TempleUniswapV2Pair.sol#173-178)\n\t- TempleUniswapV2Pair.sync() (contracts/amm/TempleUniswapV2Pair.sol#181-183)\n", + "markdown": "Reentrancy in [TempleUniswapV2Pair.burn(address)](contracts/amm/TempleUniswapV2Pair.sol#L118-L138):\n\tExternal calls:\n\t- [_safeTransfer(_token0,to,amount0)](contracts/amm/TempleUniswapV2Pair.sol#L131)\n\t\t- [(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))](contracts/amm/TempleUniswapV2Pair.sol#L50)\n\t- [_safeTransfer(_token1,to,amount1)](contracts/amm/TempleUniswapV2Pair.sol#L132)\n\t\t- [(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))](contracts/amm/TempleUniswapV2Pair.sol#L50)\n\tState variables written after the call(s):\n\t- [_update(balance0,balance1,_reserve0,_reserve1)](contracts/amm/TempleUniswapV2Pair.sol#L136)\n\t\t- [blockTimestampLast = blockTimestamp](contracts/amm/TempleUniswapV2Pair.sol#L91)\n\t[TempleUniswapV2Pair.blockTimestampLast](contracts/amm/TempleUniswapV2Pair.sol#L25) can be used in cross function reentrancies:\n\t- [TempleUniswapV2Pair._update(uint256,uint256,uint112,uint112)](contracts/amm/TempleUniswapV2Pair.sol#L80-L93)\n\t- [TempleUniswapV2Pair.getReserves()](contracts/amm/TempleUniswapV2Pair.sol#L43-L47)\n\t- [_update(balance0,balance1,_reserve0,_reserve1)](contracts/amm/TempleUniswapV2Pair.sol#L136)\n\t\t- [reserve0 = uint112(balance0)](contracts/amm/TempleUniswapV2Pair.sol#L89)\n\t[TempleUniswapV2Pair.reserve0](contracts/amm/TempleUniswapV2Pair.sol#L23) can be used in cross function reentrancies:\n\t- [TempleUniswapV2Pair._update(uint256,uint256,uint112,uint112)](contracts/amm/TempleUniswapV2Pair.sol#L80-L93)\n\t- [TempleUniswapV2Pair.getReserves()](contracts/amm/TempleUniswapV2Pair.sol#L43-L47)\n\t- [TempleUniswapV2Pair.skim(address)](contracts/amm/TempleUniswapV2Pair.sol#L173-L178)\n\t- [TempleUniswapV2Pair.sync()](contracts/amm/TempleUniswapV2Pair.sol#L181-L183)\n\t- [_update(balance0,balance1,_reserve0,_reserve1)](contracts/amm/TempleUniswapV2Pair.sol#L136)\n\t\t- [reserve1 = uint112(balance1)](contracts/amm/TempleUniswapV2Pair.sol#L90)\n\t[TempleUniswapV2Pair.reserve1](contracts/amm/TempleUniswapV2Pair.sol#L24) can be used in cross function reentrancies:\n\t- [TempleUniswapV2Pair._update(uint256,uint256,uint112,uint112)](contracts/amm/TempleUniswapV2Pair.sol#L80-L93)\n\t- [TempleUniswapV2Pair.getReserves()](contracts/amm/TempleUniswapV2Pair.sol#L43-L47)\n\t- [TempleUniswapV2Pair.skim(address)](contracts/amm/TempleUniswapV2Pair.sol#L173-L178)\n\t- [TempleUniswapV2Pair.sync()](contracts/amm/TempleUniswapV2Pair.sol#L181-L183)\n", + "first_markdown_element": "contracts/amm/TempleUniswapV2Pair.sol#L118-L138", + "id": "0379a89cc8645c2b5e10653eb1e7b3fe6480ded71ea4fc2c34965051d126019a", + "check": "reentrancy-no-eth", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "swap", + "source_mapping": { + "start": 6644, + "length": 1950, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, - 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632 + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170 ], "starting_column": 5, "ending_column": 6 @@ -4914,109 +4210,65 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 2150, - "length": 32023, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, - 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, - 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, - 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, - 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, - 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, - 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, - 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, - 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, - 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, - 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, - 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, - 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, - 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, - 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, - 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, - 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, - 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, - 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, - 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, - 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, - 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, - 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, - 771, 772, 773, 774, 775, 776, 777, 778, 779 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_withdrawFromBaseStrategy(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,address,uint256)" + "signature": "swap(uint256,uint256,address,bytes)" } }, { "type": "node", - "name": "_withdrawnAmount = _baseStrategy.trvWithdraw(_withdrawFromBaseStrategyAmount)", + "name": "_safeTransfer(_token0,to,amount0Out)", "source_mapping": { - "start": 27290, - "length": 85, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 7388, + "length": 38, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [608], - "starting_column": 17, - "ending_column": 102 + "lines": [153], + "starting_column": 29, + "ending_column": 67 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_withdrawFromBaseStrategy", + "name": "swap", "source_mapping": { - "start": 25804, - "length": 2552, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 6644, + "length": 1950, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, - 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632 + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170 ], "starting_column": 5, "ending_column": 6 @@ -5024,82 +4276,35 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 2150, - "length": 32023, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, - 777, 778, 779 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_withdrawFromBaseStrategy(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,address,uint256)" + "signature": "swap(uint256,uint256,address,bytes)" } } }, @@ -5107,151 +4312,99 @@ }, { "type": "node", - "name": "_burnDToken(_baseStrategyAddr,strategies[_baseStrategyAddr],token,tokenConfig,_withdrawnAmount,tokenConfig.dToken.balanceOf(_baseStrategyAddr))", + "name": "(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))", "source_mapping": { - "start": 27553, - "length": 319, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 1972, + "length": 91, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [614, 615, 616, 617, 618, 619, 620, 621], - "starting_column": 21, - "ending_column": 22 + "lines": [50], + "starting_column": 9, + "ending_column": 100 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_withdrawFromBaseStrategy", + "name": "_safeTransfer", "source_mapping": { - "start": 25804, - "length": 2552, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 1892, + "length": 284, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [ - 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, - 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632 - ], + "lines": [49, 50, 51, 52], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 2150, - "length": 32023, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, - 777, 778, 779 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_withdrawFromBaseStrategy(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,address,uint256)" + "signature": "_safeTransfer(address,address,uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls" } + "additional_fields": { "underlying_type": "external_calls_sending_eth" } }, { "type": "node", - "name": "_burnedAmount = tokenConfig.dToken.burn(strategy,toBurnAmount)", + "name": "_safeTransfer(_token1,to,amount1Out)", "source_mapping": { - "start": 30398, - "length": 71, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 7490, + "length": 38, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [688], - "starting_column": 9, - "ending_column": 80 + "lines": [154], + "starting_column": 29, + "ending_column": 67 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_burnDToken", + "name": "swap", "source_mapping": { - "start": 29999, - "length": 1179, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 6644, + "length": 1950, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, - 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709 + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170 ], "starting_column": 5, "ending_column": 6 @@ -5259,234 +4412,135 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 2150, - "length": 32023, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, - 777, 778, 779 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" + "signature": "swap(uint256,uint256,address,bytes)" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "StrategyCreditAndDebtBalance(strategy,address(token),_creditBalance,dTokenBalance)", + "name": "(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))", "source_mapping": { - "start": 31081, - "length": 90, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 1972, + "length": 91, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [708], + "lines": [50], "starting_column": 9, - "ending_column": 99 + "ending_column": 100 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_burnDToken", + "name": "_safeTransfer", "source_mapping": { - "start": 29999, - "length": 1179, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 1892, + "length": 284, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [ - 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, - 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709 - ], + "lines": [49, 50, 51, 52], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 2150, - "length": 32023, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, - 777, 778, 779 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" + "signature": "_safeTransfer(address,address,uint256)" } } }, - "additional_fields": { "underlying_type": "event" } + "additional_fields": { "underlying_type": "external_calls_sending_eth" } }, { "type": "node", - "name": "_burnDToken(_baseStrategyAddr,strategies[_baseStrategyAddr],token,tokenConfig,_withdrawnAmount,tokenConfig.dToken.balanceOf(_baseStrategyAddr))", + "name": "IUniswapV2Callee(to).uniswapV2Call(msg.sender,amount0Out,amount1Out,data)", "source_mapping": { - "start": 27553, - "length": 319, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 7593, + "length": 76, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [614, 615, 616, 617, 618, 619, 620, 621], - "starting_column": 21, - "ending_column": 22 + "lines": [155], + "starting_column": 30, + "ending_column": 106 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_withdrawFromBaseStrategy", + "name": "swap", "source_mapping": { - "start": 25804, - "length": 2552, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 6644, + "length": 1950, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, - 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632 + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170 ], "starting_column": 5, "ending_column": 6 @@ -5494,1116 +4548,1174 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 2150, - "length": 32023, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, - 777, 778, 779 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_withdrawFromBaseStrategy(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,address,uint256)" + "signature": "swap(uint256,uint256,address,bytes)" } } }, - "additional_fields": { "underlying_type": "event" } - } - ], - "description": "Reentrancy in TreasuryReservesVault._withdrawFromBaseStrategy(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,address,uint256) (contracts/v2/TreasuryReservesVault.sol#582-632):\n\tExternal calls:\n\t- _withdrawnAmount = _baseStrategy.trvWithdraw(_withdrawFromBaseStrategyAmount) (contracts/v2/TreasuryReservesVault.sol#608)\n\t- _burnDToken(_baseStrategyAddr,strategies[_baseStrategyAddr],token,tokenConfig,_withdrawnAmount,tokenConfig.dToken.balanceOf(_baseStrategyAddr)) (contracts/v2/TreasuryReservesVault.sol#614-621)\n\t\t- _burnedAmount = tokenConfig.dToken.burn(strategy,toBurnAmount) (contracts/v2/TreasuryReservesVault.sol#688)\n\tEvent emitted after the call(s):\n\t- StrategyCreditAndDebtBalance(strategy,address(token),_creditBalance,dTokenBalance) (contracts/v2/TreasuryReservesVault.sol#708)\n\t\t- _burnDToken(_baseStrategyAddr,strategies[_baseStrategyAddr],token,tokenConfig,_withdrawnAmount,tokenConfig.dToken.balanceOf(_baseStrategyAddr)) (contracts/v2/TreasuryReservesVault.sol#614-621)\n", - "markdown": "Reentrancy in [TreasuryReservesVault._withdrawFromBaseStrategy(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,address,uint256)](contracts/v2/TreasuryReservesVault.sol#L582-L632):\n\tExternal calls:\n\t- [_withdrawnAmount = _baseStrategy.trvWithdraw(_withdrawFromBaseStrategyAmount)](contracts/v2/TreasuryReservesVault.sol#L608)\n\t- [_burnDToken(_baseStrategyAddr,strategies[_baseStrategyAddr],token,tokenConfig,_withdrawnAmount,tokenConfig.dToken.balanceOf(_baseStrategyAddr))](contracts/v2/TreasuryReservesVault.sol#L614-L621)\n\t\t- [_burnedAmount = tokenConfig.dToken.burn(strategy,toBurnAmount)](contracts/v2/TreasuryReservesVault.sol#L688)\n\tEvent emitted after the call(s):\n\t- [StrategyCreditAndDebtBalance(strategy,address(token),_creditBalance,dTokenBalance)](contracts/v2/TreasuryReservesVault.sol#L708)\n\t\t- [_burnDToken(_baseStrategyAddr,strategies[_baseStrategyAddr],token,tokenConfig,_withdrawnAmount,tokenConfig.dToken.balanceOf(_baseStrategyAddr))](contracts/v2/TreasuryReservesVault.sol#L614-L621)\n", - "first_markdown_element": "contracts/v2/TreasuryReservesVault.sol#L582-L632", - "id": "89618dfba3ac7d15e5970daa2e83a543e99a75c999d6a13fbdd7a2d009309297", - "check": "reentrancy-events", - "impact": "Low", - "confidence": "Medium" - }, - { - "elements": [ + "additional_fields": { "underlying_type": "external_calls" } + }, { - "type": "function", - "name": "addLiquidity", + "type": "node", + "name": "_update(balance0,balance1,_reserve0,_reserve1)", "source_mapping": { - "start": 7071, - "length": 365, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 8457, + "length": 49, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [181, 182, 183, 184, 185, 186, 187, 188], - "starting_column": 5, - "ending_column": 6 + "lines": [168], + "starting_column": 9, + "ending_column": 58 }, "type_specific_fields": { "parent": { - "type": "contract", - "name": "RamosStrategy", + "type": "function", + "name": "swap", "source_mapping": { - "start": 1131, - "length": 9320, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 6644, + "length": 1950, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265 + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170 ], - "starting_column": 1, - "ending_column": 0 + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleUniswapV2Pair", + "source_mapping": { + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "is_dependency": false, + "lines": [ + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "swap(uint256,uint256,address,bytes)" } - }, - "signature": "addLiquidity(IBalancerVault.JoinPoolRequest)" + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "blockTimestampLast" } }, { "type": "node", - "name": "(quoteTokenAmount,protocolTokenAmount,bptTokensStaked) = ramos.addLiquidity(_requestData)", + "name": "blockTimestampLast = blockTimestamp", "source_mapping": { - "start": 7185, - "length": 161, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 3873, + "length": 35, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [182, 183, 184, 185, 186], + "lines": [91], "starting_column": 9, - "ending_column": 45 + "ending_column": 44 }, "type_specific_fields": { "parent": { "type": "function", - "name": "addLiquidity", + "name": "_update", "source_mapping": { - "start": 7071, - "length": 365, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 3107, + "length": 847, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [181, 182, 183, 184, 185, 186, 187, 188], + "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "RamosStrategy", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 1131, - "length": 9320, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "addLiquidity(IBalancerVault.JoinPoolRequest)" + "signature": "_update(uint256,uint256,uint112,uint112)" } } }, - "additional_fields": { "underlying_type": "external_calls" } + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "blockTimestampLast" + } }, { "type": "node", - "name": "AddLiquidity(quoteTokenAmount,protocolTokenAmount,bptTokensStaked)", + "name": "_update(balance0,balance1,_reserve0,_reserve1)", "source_mapping": { - "start": 7356, - "length": 73, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 8457, + "length": 49, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [187], + "lines": [168], "starting_column": 9, - "ending_column": 82 + "ending_column": 58 }, "type_specific_fields": { "parent": { "type": "function", - "name": "addLiquidity", + "name": "swap", "source_mapping": { - "start": 7071, - "length": 365, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 6644, + "length": 1950, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [181, 182, 183, 184, 185, 186, 187, 188], + "lines": [ + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "RamosStrategy", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 1131, - "length": 9320, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "addLiquidity(IBalancerVault.JoinPoolRequest)" + "signature": "swap(uint256,uint256,address,bytes)" } } }, - "additional_fields": { "underlying_type": "event" } - } - ], - "description": "Reentrancy in RamosStrategy.addLiquidity(IBalancerVault.JoinPoolRequest) (contracts/v2/strategies/RamosStrategy.sol#181-188):\n\tExternal calls:\n\t- (quoteTokenAmount,protocolTokenAmount,bptTokensStaked) = ramos.addLiquidity(_requestData) (contracts/v2/strategies/RamosStrategy.sol#182-186)\n\tEvent emitted after the call(s):\n\t- AddLiquidity(quoteTokenAmount,protocolTokenAmount,bptTokensStaked) (contracts/v2/strategies/RamosStrategy.sol#187)\n", - "markdown": "Reentrancy in [RamosStrategy.addLiquidity(IBalancerVault.JoinPoolRequest)](contracts/v2/strategies/RamosStrategy.sol#L181-L188):\n\tExternal calls:\n\t- [(quoteTokenAmount,protocolTokenAmount,bptTokensStaked) = ramos.addLiquidity(_requestData)](contracts/v2/strategies/RamosStrategy.sol#L182-L186)\n\tEvent emitted after the call(s):\n\t- [AddLiquidity(quoteTokenAmount,protocolTokenAmount,bptTokensStaked)](contracts/v2/strategies/RamosStrategy.sol#L187)\n", - "first_markdown_element": "contracts/v2/strategies/RamosStrategy.sol#L181-L188", - "id": "86c6739a14ef579509f4e0190b6310b585123eb008deed594e5fdc44ec40eefe", - "check": "reentrancy-events", - "impact": "Low", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "borrowAndDeposit", - "source_mapping": { - "start": 7809, - "length": 246, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", - "is_dependency": false, - "lines": [195, 196, 197, 198, 199], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "DsrBaseStrategy", - "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", - "is_dependency": false, - "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "borrowAndDeposit(uint256)" + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "reserve0" } }, { "type": "node", - "name": "treasuryReservesVault.borrow(daiToken,amount,address(this))", + "name": "reserve0 = uint112(balance0)", "source_mapping": { - "start": 7958, - "length": 61, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 3797, + "length": 28, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [197], + "lines": [89], "starting_column": 9, - "ending_column": 70 + "ending_column": 37 }, "type_specific_fields": { "parent": { "type": "function", - "name": "borrowAndDeposit", + "name": "_update", "source_mapping": { - "start": 7809, - "length": 246, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 3107, + "length": 847, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [195, 196, 197, 198, 199], + "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "borrowAndDeposit(uint256)" + "signature": "_update(uint256,uint256,uint112,uint112)" } } }, - "additional_fields": { "underlying_type": "external_calls" } + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "reserve0" + } }, { "type": "node", - "name": "_dsrDeposit(amount)", + "name": "_update(balance0,balance1,_reserve0,_reserve1)", "source_mapping": { - "start": 8029, - "length": 19, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 8457, + "length": 49, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [198], + "lines": [168], "starting_column": 9, - "ending_column": 28 + "ending_column": 58 }, "type_specific_fields": { "parent": { "type": "function", - "name": "borrowAndDeposit", + "name": "swap", "source_mapping": { - "start": 7809, - "length": 246, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 6644, + "length": 1950, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [195, 196, 197, 198, 199], + "lines": [ + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "borrowAndDeposit(uint256)" + "signature": "swap(uint256,uint256,address,bytes)" } } }, - "additional_fields": { "underlying_type": "external_calls" } + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "reserve1" + } }, { "type": "node", - "name": "daiJoin.join(address(this),amount)", + "name": "reserve1 = uint112(balance1)", "source_mapping": { - "start": 8342, - "length": 35, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 3835, + "length": 28, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [207], + "lines": [90], "starting_column": 9, - "ending_column": 44 + "ending_column": 37 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_dsrDeposit", + "name": "_update", "source_mapping": { - "start": 8061, - "length": 349, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 3107, + "length": 847, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [201, 202, 203, 204, 205, 206, 207, 208, 209], + "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_dsrDeposit(uint256)" + "signature": "_update(uint256,uint256,uint112,uint112)" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "reserve1" + } + } + ], + "description": "Reentrancy in TempleUniswapV2Pair.swap(uint256,uint256,address,bytes) (contracts/amm/TempleUniswapV2Pair.sol#141-170):\n\tExternal calls:\n\t- _safeTransfer(_token0,to,amount0Out) (contracts/amm/TempleUniswapV2Pair.sol#153)\n\t\t- (success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value)) (contracts/amm/TempleUniswapV2Pair.sol#50)\n\t- _safeTransfer(_token1,to,amount1Out) (contracts/amm/TempleUniswapV2Pair.sol#154)\n\t\t- (success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value)) (contracts/amm/TempleUniswapV2Pair.sol#50)\n\t- IUniswapV2Callee(to).uniswapV2Call(msg.sender,amount0Out,amount1Out,data) (contracts/amm/TempleUniswapV2Pair.sol#155)\n\tState variables written after the call(s):\n\t- _update(balance0,balance1,_reserve0,_reserve1) (contracts/amm/TempleUniswapV2Pair.sol#168)\n\t\t- blockTimestampLast = blockTimestamp (contracts/amm/TempleUniswapV2Pair.sol#91)\n\tTempleUniswapV2Pair.blockTimestampLast (contracts/amm/TempleUniswapV2Pair.sol#25) can be used in cross function reentrancies:\n\t- TempleUniswapV2Pair._update(uint256,uint256,uint112,uint112) (contracts/amm/TempleUniswapV2Pair.sol#80-93)\n\t- TempleUniswapV2Pair.getReserves() (contracts/amm/TempleUniswapV2Pair.sol#43-47)\n\t- _update(balance0,balance1,_reserve0,_reserve1) (contracts/amm/TempleUniswapV2Pair.sol#168)\n\t\t- reserve0 = uint112(balance0) (contracts/amm/TempleUniswapV2Pair.sol#89)\n\tTempleUniswapV2Pair.reserve0 (contracts/amm/TempleUniswapV2Pair.sol#23) can be used in cross function reentrancies:\n\t- TempleUniswapV2Pair._update(uint256,uint256,uint112,uint112) (contracts/amm/TempleUniswapV2Pair.sol#80-93)\n\t- TempleUniswapV2Pair.getReserves() (contracts/amm/TempleUniswapV2Pair.sol#43-47)\n\t- TempleUniswapV2Pair.skim(address) (contracts/amm/TempleUniswapV2Pair.sol#173-178)\n\t- TempleUniswapV2Pair.sync() (contracts/amm/TempleUniswapV2Pair.sol#181-183)\n\t- _update(balance0,balance1,_reserve0,_reserve1) (contracts/amm/TempleUniswapV2Pair.sol#168)\n\t\t- reserve1 = uint112(balance1) (contracts/amm/TempleUniswapV2Pair.sol#90)\n\tTempleUniswapV2Pair.reserve1 (contracts/amm/TempleUniswapV2Pair.sol#24) can be used in cross function reentrancies:\n\t- TempleUniswapV2Pair._update(uint256,uint256,uint112,uint112) (contracts/amm/TempleUniswapV2Pair.sol#80-93)\n\t- TempleUniswapV2Pair.getReserves() (contracts/amm/TempleUniswapV2Pair.sol#43-47)\n\t- TempleUniswapV2Pair.skim(address) (contracts/amm/TempleUniswapV2Pair.sol#173-178)\n\t- TempleUniswapV2Pair.sync() (contracts/amm/TempleUniswapV2Pair.sol#181-183)\n", + "markdown": "Reentrancy in [TempleUniswapV2Pair.swap(uint256,uint256,address,bytes)](contracts/amm/TempleUniswapV2Pair.sol#L141-L170):\n\tExternal calls:\n\t- [_safeTransfer(_token0,to,amount0Out)](contracts/amm/TempleUniswapV2Pair.sol#L153)\n\t\t- [(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))](contracts/amm/TempleUniswapV2Pair.sol#L50)\n\t- [_safeTransfer(_token1,to,amount1Out)](contracts/amm/TempleUniswapV2Pair.sol#L154)\n\t\t- [(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))](contracts/amm/TempleUniswapV2Pair.sol#L50)\n\t- [IUniswapV2Callee(to).uniswapV2Call(msg.sender,amount0Out,amount1Out,data)](contracts/amm/TempleUniswapV2Pair.sol#L155)\n\tState variables written after the call(s):\n\t- [_update(balance0,balance1,_reserve0,_reserve1)](contracts/amm/TempleUniswapV2Pair.sol#L168)\n\t\t- [blockTimestampLast = blockTimestamp](contracts/amm/TempleUniswapV2Pair.sol#L91)\n\t[TempleUniswapV2Pair.blockTimestampLast](contracts/amm/TempleUniswapV2Pair.sol#L25) can be used in cross function reentrancies:\n\t- [TempleUniswapV2Pair._update(uint256,uint256,uint112,uint112)](contracts/amm/TempleUniswapV2Pair.sol#L80-L93)\n\t- [TempleUniswapV2Pair.getReserves()](contracts/amm/TempleUniswapV2Pair.sol#L43-L47)\n\t- [_update(balance0,balance1,_reserve0,_reserve1)](contracts/amm/TempleUniswapV2Pair.sol#L168)\n\t\t- [reserve0 = uint112(balance0)](contracts/amm/TempleUniswapV2Pair.sol#L89)\n\t[TempleUniswapV2Pair.reserve0](contracts/amm/TempleUniswapV2Pair.sol#L23) can be used in cross function reentrancies:\n\t- [TempleUniswapV2Pair._update(uint256,uint256,uint112,uint112)](contracts/amm/TempleUniswapV2Pair.sol#L80-L93)\n\t- [TempleUniswapV2Pair.getReserves()](contracts/amm/TempleUniswapV2Pair.sol#L43-L47)\n\t- [TempleUniswapV2Pair.skim(address)](contracts/amm/TempleUniswapV2Pair.sol#L173-L178)\n\t- [TempleUniswapV2Pair.sync()](contracts/amm/TempleUniswapV2Pair.sol#L181-L183)\n\t- [_update(balance0,balance1,_reserve0,_reserve1)](contracts/amm/TempleUniswapV2Pair.sol#L168)\n\t\t- [reserve1 = uint112(balance1)](contracts/amm/TempleUniswapV2Pair.sol#L90)\n\t[TempleUniswapV2Pair.reserve1](contracts/amm/TempleUniswapV2Pair.sol#L24) can be used in cross function reentrancies:\n\t- [TempleUniswapV2Pair._update(uint256,uint256,uint112,uint112)](contracts/amm/TempleUniswapV2Pair.sol#L80-L93)\n\t- [TempleUniswapV2Pair.getReserves()](contracts/amm/TempleUniswapV2Pair.sol#L43-L47)\n\t- [TempleUniswapV2Pair.skim(address)](contracts/amm/TempleUniswapV2Pair.sol#L173-L178)\n\t- [TempleUniswapV2Pair.sync()](contracts/amm/TempleUniswapV2Pair.sol#L181-L183)\n", + "first_markdown_element": "contracts/amm/TempleUniswapV2Pair.sol#L141-L170", + "id": "5cdaaff3e567de31630793ad7f06e2a605da21349f80f6007c70ec2bd319fbc0", + "check": "reentrancy-no-eth", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "_burnDToken", + "source_mapping": { + "start": 29999, + "length": 1179, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "is_dependency": false, + "lines": [ + 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, + 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, + 703, 704, 705, 706, 707, 708, 709 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TreasuryReservesVault", + "source_mapping": { + "start": 2150, + "length": 32023, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "is_dependency": false, + "lines": [ + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, + 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, + 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, + 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, + 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, + 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, + 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, + 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, + 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, + 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, + 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, + 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, + 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, + 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, + 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, + 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, + 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, + 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, + 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, + 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, + 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, + 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, + 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, + 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, + 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, + 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, + 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, + 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, + 771, 772, 773, 774, 775, 776, 777, 778, 779 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "_burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" + } }, { "type": "node", - "name": "chi = pot.drip()", + "name": "_burnedAmount = tokenConfig.dToken.burn(strategy,toBurnAmount)", "source_mapping": { - "start": 5566, - "length": 60, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 30398, + "length": 71, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [142], + "lines": [688], "starting_column": 9, - "ending_column": 69 + "ending_column": 80 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_checkpointChi", + "name": "_burnDToken", "source_mapping": { - "start": 5445, - "length": 188, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 29999, + "length": 1179, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [140, 141, 142, 143], + "lines": [ + 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, + 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, + 703, 704, 705, 706, 707, 708, 709 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TreasuryReservesVault", "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2150, + "length": 32023, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "_checkpointChi()" - } - } - }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } - }, - { - "type": "node", - "name": "pot.join(shares)", - "source_mapping": { - "start": 8387, - "length": 16, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", - "is_dependency": false, - "lines": [208], - "starting_column": 9, - "ending_column": 25 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "_dsrDeposit", - "source_mapping": { - "start": 8061, - "length": 349, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", - "is_dependency": false, - "lines": [201, 202, 203, 204, 205, 206, 207, 208, 209], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "DsrBaseStrategy", - "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", - "is_dependency": false, - "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "_dsrDeposit(uint256)" - } - } - }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } - }, - { - "type": "node", - "name": "DaiDeposited(amount)", - "source_mapping": { - "start": 8307, - "length": 25, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", - "is_dependency": false, - "lines": [206], - "starting_column": 9, - "ending_column": 34 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "_dsrDeposit", - "source_mapping": { - "start": 8061, - "length": 349, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", - "is_dependency": false, - "lines": [201, 202, 203, 204, 205, 206, 207, 208, 209], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "DsrBaseStrategy", - "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", - "is_dependency": false, - "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306 + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, + 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, + 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, + 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, + 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, + 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, + 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, + 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, + 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, + 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, + 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, + 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, + 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, + 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, + 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, + 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, + 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, + 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, + 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, + 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, + 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, + 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, + 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, + 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, + 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, + 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, + 777, 778, 779 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_dsrDeposit(uint256)" + "signature": "_burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" } } }, - "additional_fields": { "underlying_type": "event" } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "_dsrDeposit(amount)", + "name": "_tokenCredits[token] = _creditBalance", "source_mapping": { - "start": 8029, - "length": 19, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 31023, + "length": 37, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [198], - "starting_column": 9, - "ending_column": 28 + "lines": [705], + "starting_column": 13, + "ending_column": 50 }, "type_specific_fields": { "parent": { "type": "function", - "name": "borrowAndDeposit", + "name": "_burnDToken", "source_mapping": { - "start": 7809, - "length": 246, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 29999, + "length": 1179, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [195, 196, 197, 198, 199], + "lines": [ + 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, + 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, + 703, 704, 705, 706, 707, 708, 709 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TreasuryReservesVault", "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2150, + "length": 32023, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306 + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, + 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, + 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, + 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, + 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, + 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, + 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, + 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, + 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, + 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, + 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, + 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, + 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, + 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, + 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, + 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, + 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, + 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, + 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, + 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, + 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, + 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, + 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, + 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, + 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, + 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, + 777, 778, 779 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "borrowAndDeposit(uint256)" + "signature": "_burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" } } }, - "additional_fields": { "underlying_type": "event" } + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "strategyTokenCredits" + } } ], - "description": "Reentrancy in DsrBaseStrategy.borrowAndDeposit(uint256) (contracts/v2/strategies/DsrBaseStrategy.sol#195-199):\n\tExternal calls:\n\t- treasuryReservesVault.borrow(daiToken,amount,address(this)) (contracts/v2/strategies/DsrBaseStrategy.sol#197)\n\t- _dsrDeposit(amount) (contracts/v2/strategies/DsrBaseStrategy.sol#198)\n\t\t- daiJoin.join(address(this),amount) (contracts/v2/strategies/DsrBaseStrategy.sol#207)\n\t\t- chi = pot.drip() (contracts/v2/strategies/DsrBaseStrategy.sol#142)\n\t\t- pot.join(shares) (contracts/v2/strategies/DsrBaseStrategy.sol#208)\n\tEvent emitted after the call(s):\n\t- DaiDeposited(amount) (contracts/v2/strategies/DsrBaseStrategy.sol#206)\n\t\t- _dsrDeposit(amount) (contracts/v2/strategies/DsrBaseStrategy.sol#198)\n", - "markdown": "Reentrancy in [DsrBaseStrategy.borrowAndDeposit(uint256)](contracts/v2/strategies/DsrBaseStrategy.sol#L195-L199):\n\tExternal calls:\n\t- [treasuryReservesVault.borrow(daiToken,amount,address(this))](contracts/v2/strategies/DsrBaseStrategy.sol#L197)\n\t- [_dsrDeposit(amount)](contracts/v2/strategies/DsrBaseStrategy.sol#L198)\n\t\t- [daiJoin.join(address(this),amount)](contracts/v2/strategies/DsrBaseStrategy.sol#L207)\n\t\t- [chi = pot.drip()](contracts/v2/strategies/DsrBaseStrategy.sol#L142)\n\t\t- [pot.join(shares)](contracts/v2/strategies/DsrBaseStrategy.sol#L208)\n\tEvent emitted after the call(s):\n\t- [DaiDeposited(amount)](contracts/v2/strategies/DsrBaseStrategy.sol#L206)\n\t\t- [_dsrDeposit(amount)](contracts/v2/strategies/DsrBaseStrategy.sol#L198)\n", - "first_markdown_element": "contracts/v2/strategies/DsrBaseStrategy.sol#L195-L199", - "id": "6f150fd09fac2796a24b461a93dcda378e0b73d3d94cc538625af3f9b9d80747", - "check": "reentrancy-events", - "impact": "Low", + "description": "Reentrancy in TreasuryReservesVault._burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256) (contracts/v2/TreasuryReservesVault.sol#677-709):\n\tExternal calls:\n\t- _burnedAmount = tokenConfig.dToken.burn(strategy,toBurnAmount) (contracts/v2/TreasuryReservesVault.sol#688)\n\tState variables written after the call(s):\n\t- _tokenCredits[token] = _creditBalance (contracts/v2/TreasuryReservesVault.sol#705)\n\tTreasuryReservesVault.strategyTokenCredits (contracts/v2/TreasuryReservesVault.sol#78) can be used in cross function reentrancies:\n\t- TreasuryReservesVault._availableForStrategyToBorrow(address,ITreasuryReservesVault.StrategyConfig,IERC20,uint256) (contracts/v2/TreasuryReservesVault.sol#533-551)\n\t- TreasuryReservesVault._burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256) (contracts/v2/TreasuryReservesVault.sol#677-709)\n\t- TreasuryReservesVault._mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256) (contracts/v2/TreasuryReservesVault.sol#638-670)\n\t- TreasuryReservesVault.setStrategyDebtCeiling(address,IERC20,uint256) (contracts/v2/TreasuryReservesVault.sol#242-255)\n\t- TreasuryReservesVault.shutdown(address) (contracts/v2/TreasuryReservesVault.sol#283-319)\n\t- TreasuryReservesVault.strategyBalanceSheet(address) (contracts/v2/TreasuryReservesVault.sol#447-467)\n\t- TreasuryReservesVault.strategyTokenCredits (contracts/v2/TreasuryReservesVault.sol#78)\n", + "markdown": "Reentrancy in [TreasuryReservesVault._burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)](contracts/v2/TreasuryReservesVault.sol#L677-L709):\n\tExternal calls:\n\t- [_burnedAmount = tokenConfig.dToken.burn(strategy,toBurnAmount)](contracts/v2/TreasuryReservesVault.sol#L688)\n\tState variables written after the call(s):\n\t- [_tokenCredits[token] = _creditBalance](contracts/v2/TreasuryReservesVault.sol#L705)\n\t[TreasuryReservesVault.strategyTokenCredits](contracts/v2/TreasuryReservesVault.sol#L78) can be used in cross function reentrancies:\n\t- [TreasuryReservesVault._availableForStrategyToBorrow(address,ITreasuryReservesVault.StrategyConfig,IERC20,uint256)](contracts/v2/TreasuryReservesVault.sol#L533-L551)\n\t- [TreasuryReservesVault._burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)](contracts/v2/TreasuryReservesVault.sol#L677-L709)\n\t- [TreasuryReservesVault._mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)](contracts/v2/TreasuryReservesVault.sol#L638-L670)\n\t- [TreasuryReservesVault.setStrategyDebtCeiling(address,IERC20,uint256)](contracts/v2/TreasuryReservesVault.sol#L242-L255)\n\t- [TreasuryReservesVault.shutdown(address)](contracts/v2/TreasuryReservesVault.sol#L283-L319)\n\t- [TreasuryReservesVault.strategyBalanceSheet(address)](contracts/v2/TreasuryReservesVault.sol#L447-L467)\n\t- [TreasuryReservesVault.strategyTokenCredits](contracts/v2/TreasuryReservesVault.sol#L78)\n", + "first_markdown_element": "contracts/v2/TreasuryReservesVault.sol#L677-L709", + "id": "c8932bc3a4a8bcb7213dd16df3325de16b2cfe251691839c0d5db322cdde8cc6", + "check": "reentrancy-no-eth", + "impact": "Medium", "confidence": "Medium" }, { "elements": [ { "type": "function", - "name": "removeLiquidity", + "name": "_mintDToken", "source_mapping": { - "start": 8140, - "length": 365, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 28533, + "length": 1205, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [209, 210, 211, 212, 213, 214, 215], + "lines": [ + 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, + 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, + 664, 665, 666, 667, 668, 669, 670 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "RamosStrategy", + "name": "TreasuryReservesVault", "source_mapping": { - "start": 1131, - "length": 9320, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 2150, + "length": 32023, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265 + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, + 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, + 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, + 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, + 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, + 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, + 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, + 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, + 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, + 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, + 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, + 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, + 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, + 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, + 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, + 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, + 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, + 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, + 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, + 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, + 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, + 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, + 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, + 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, + 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, + 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, + 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, + 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, + 771, 772, 773, 774, 775, 776, 777, 778, 779 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "removeLiquidity(IBalancerVault.ExitPoolRequest,uint256)" + "signature": "_mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" } }, { "type": "node", - "name": "(quoteTokenAmount,protocolTokenAmount) = ramos.removeLiquidity(_requestData,_bptAmount)", + "name": "tokenConfig.dToken.mint(strategy,_newDebt)", "source_mapping": { - "start": 8277, - "length": 140, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 29294, + "length": 43, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [210, 211, 212, 213], - "starting_column": 9, - "ending_column": 60 + "lines": [657], + "starting_column": 13, + "ending_column": 56 }, "type_specific_fields": { "parent": { "type": "function", - "name": "removeLiquidity", + "name": "_mintDToken", "source_mapping": { - "start": 8140, - "length": 365, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 28533, + "length": 1205, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [209, 210, 211, 212, 213, 214, 215], + "lines": [ + 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, + 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, + 664, 665, 666, 667, 668, 669, 670 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "RamosStrategy", + "name": "TreasuryReservesVault", "source_mapping": { - "start": 1131, - "length": 9320, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 2150, + "length": 32023, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "removeLiquidity(IBalancerVault.ExitPoolRequest,uint256)" - } + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, + 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, + 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, + 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, + 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, + 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, + 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, + 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, + 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, + 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, + 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, + 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, + 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, + 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, + 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, + 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, + 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, + 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, + 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, + 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, + 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, + 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, + 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, + 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, + 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, + 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, + 777, 778, 779 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "_mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" + } } }, "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "RemoveLiquidity(quoteTokenAmount,protocolTokenAmount,_bptAmount)", + "name": "_tokenCredits[token] = _creditBalance = 0", "source_mapping": { - "start": 8427, - "length": 71, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 29387, + "length": 41, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [214], - "starting_column": 9, - "ending_column": 80 + "lines": [660], + "starting_column": 13, + "ending_column": 54 }, "type_specific_fields": { "parent": { "type": "function", - "name": "removeLiquidity", + "name": "_mintDToken", "source_mapping": { - "start": 8140, - "length": 365, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 28533, + "length": 1205, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [209, 210, 211, 212, 213, 214, 215], + "lines": [ + 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, + 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, + 664, 665, 666, 667, 668, 669, 670 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "RamosStrategy", + "name": "TreasuryReservesVault", "source_mapping": { - "start": 1131, - "length": 9320, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 2150, + "length": 32023, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265 + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, + 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, + 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, + 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, + 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, + 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, + 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, + 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, + 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, + 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, + 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, + 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, + 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, + 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, + 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, + 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, + 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, + 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, + 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, + 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, + 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, + 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, + 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, + 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, + 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, + 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, + 777, 778, 779 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "removeLiquidity(IBalancerVault.ExitPoolRequest,uint256)" + "signature": "_mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" } } }, - "additional_fields": { "underlying_type": "event" } + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "strategyTokenCredits" + } } ], - "description": "Reentrancy in RamosStrategy.removeLiquidity(IBalancerVault.ExitPoolRequest,uint256) (contracts/v2/strategies/RamosStrategy.sol#209-215):\n\tExternal calls:\n\t- (quoteTokenAmount,protocolTokenAmount) = ramos.removeLiquidity(_requestData,_bptAmount) (contracts/v2/strategies/RamosStrategy.sol#210-213)\n\tEvent emitted after the call(s):\n\t- RemoveLiquidity(quoteTokenAmount,protocolTokenAmount,_bptAmount) (contracts/v2/strategies/RamosStrategy.sol#214)\n", - "markdown": "Reentrancy in [RamosStrategy.removeLiquidity(IBalancerVault.ExitPoolRequest,uint256)](contracts/v2/strategies/RamosStrategy.sol#L209-L215):\n\tExternal calls:\n\t- [(quoteTokenAmount,protocolTokenAmount) = ramos.removeLiquidity(_requestData,_bptAmount)](contracts/v2/strategies/RamosStrategy.sol#L210-L213)\n\tEvent emitted after the call(s):\n\t- [RemoveLiquidity(quoteTokenAmount,protocolTokenAmount,_bptAmount)](contracts/v2/strategies/RamosStrategy.sol#L214)\n", - "first_markdown_element": "contracts/v2/strategies/RamosStrategy.sol#L209-L215", - "id": "7c31093def50156c36e632afd1bdd7b3c7f967dee0aff539f837b6a8448615ae", - "check": "reentrancy-events", - "impact": "Low", + "description": "Reentrancy in TreasuryReservesVault._mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256) (contracts/v2/TreasuryReservesVault.sol#638-670):\n\tExternal calls:\n\t- tokenConfig.dToken.mint(strategy,_newDebt) (contracts/v2/TreasuryReservesVault.sol#657)\n\tState variables written after the call(s):\n\t- _tokenCredits[token] = _creditBalance = 0 (contracts/v2/TreasuryReservesVault.sol#660)\n\tTreasuryReservesVault.strategyTokenCredits (contracts/v2/TreasuryReservesVault.sol#78) can be used in cross function reentrancies:\n\t- TreasuryReservesVault._availableForStrategyToBorrow(address,ITreasuryReservesVault.StrategyConfig,IERC20,uint256) (contracts/v2/TreasuryReservesVault.sol#533-551)\n\t- TreasuryReservesVault._burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256) (contracts/v2/TreasuryReservesVault.sol#677-709)\n\t- TreasuryReservesVault._mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256) (contracts/v2/TreasuryReservesVault.sol#638-670)\n\t- TreasuryReservesVault.setStrategyDebtCeiling(address,IERC20,uint256) (contracts/v2/TreasuryReservesVault.sol#242-255)\n\t- TreasuryReservesVault.shutdown(address) (contracts/v2/TreasuryReservesVault.sol#283-319)\n\t- TreasuryReservesVault.strategyBalanceSheet(address) (contracts/v2/TreasuryReservesVault.sol#447-467)\n\t- TreasuryReservesVault.strategyTokenCredits (contracts/v2/TreasuryReservesVault.sol#78)\n", + "markdown": "Reentrancy in [TreasuryReservesVault._mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)](contracts/v2/TreasuryReservesVault.sol#L638-L670):\n\tExternal calls:\n\t- [tokenConfig.dToken.mint(strategy,_newDebt)](contracts/v2/TreasuryReservesVault.sol#L657)\n\tState variables written after the call(s):\n\t- [_tokenCredits[token] = _creditBalance = 0](contracts/v2/TreasuryReservesVault.sol#L660)\n\t[TreasuryReservesVault.strategyTokenCredits](contracts/v2/TreasuryReservesVault.sol#L78) can be used in cross function reentrancies:\n\t- [TreasuryReservesVault._availableForStrategyToBorrow(address,ITreasuryReservesVault.StrategyConfig,IERC20,uint256)](contracts/v2/TreasuryReservesVault.sol#L533-L551)\n\t- [TreasuryReservesVault._burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)](contracts/v2/TreasuryReservesVault.sol#L677-L709)\n\t- [TreasuryReservesVault._mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)](contracts/v2/TreasuryReservesVault.sol#L638-L670)\n\t- [TreasuryReservesVault.setStrategyDebtCeiling(address,IERC20,uint256)](contracts/v2/TreasuryReservesVault.sol#L242-L255)\n\t- [TreasuryReservesVault.shutdown(address)](contracts/v2/TreasuryReservesVault.sol#L283-L319)\n\t- [TreasuryReservesVault.strategyBalanceSheet(address)](contracts/v2/TreasuryReservesVault.sol#L447-L467)\n\t- [TreasuryReservesVault.strategyTokenCredits](contracts/v2/TreasuryReservesVault.sol#L78)\n", + "first_markdown_element": "contracts/v2/TreasuryReservesVault.sol#L638-L670", + "id": "0ce7ad9bcbc81412efd61c0340786d494f3510ea2cdeb81edb9c0103d00c0d0c", + "check": "reentrancy-no-eth", + "impact": "Medium", "confidence": "Medium" }, { "elements": [ { "type": "function", - "name": "setTlcStrategy", + "name": "removeCollateral", "source_mapping": { - "start": 15688, - "length": 875, + "start": 6498, + "length": 1031, "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, "lines": [ - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410 + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190 ], "starting_column": 5, "ending_column": 6 @@ -6616,7 +5728,7 @@ "start": 1433, "length": 31753, "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, "lines": [ @@ -6690,37 +5802,37 @@ "ending_column": 0 } }, - "signature": "setTlcStrategy(address)" + "signature": "removeCollateral(uint128,address)" } }, { "type": "node", - "name": "daiToken.safeApprove(previousTrv,0)", + "name": "circuitBreakerProxy.preCheck(address(templeToken),msg.sender,amount)", "source_mapping": { - "start": 16002, - "length": 36, + "start": 7012, + "length": 118, "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, - "lines": [394], - "starting_column": 13, - "ending_column": 49 + "lines": [173, 174, 175, 176, 177], + "starting_column": 9, + "ending_column": 10 }, "type_specific_fields": { "parent": { "type": "function", - "name": "setTlcStrategy", + "name": "removeCollateral", "source_mapping": { - "start": 15688, - "length": 875, + "start": 6498, + "length": 1031, "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, "lines": [ - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410 + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190 ], "starting_column": 5, "ending_column": 6 @@ -6733,7 +5845,7 @@ "start": 1433, "length": 31753, "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, "lines": [ @@ -6813,7 +5925,7 @@ "ending_column": 0 } }, - "signature": "setTlcStrategy(address)" + "signature": "removeCollateral(uint128,address)" } } }, @@ -6821,32 +5933,32 @@ }, { "type": "node", - "name": "daiToken.safeApprove(_trv,0)", + "name": "_accountData.collateral = _collateral - amount", "source_mapping": { - "start": 16249, - "length": 29, + "start": 7229, + "length": 46, "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, - "lines": [402], - "starting_column": 13, - "ending_column": 42 + "lines": [180], + "starting_column": 9, + "ending_column": 55 }, "type_specific_fields": { "parent": { "type": "function", - "name": "setTlcStrategy", + "name": "removeCollateral", "source_mapping": { - "start": 15688, - "length": 875, + "start": 6498, + "length": 1031, "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, "lines": [ - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410 + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190 ], "starting_column": 5, "ending_column": 6 @@ -6859,7 +5971,7 @@ "start": 1433, "length": 31753, "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, "lines": [ @@ -6939,25 +6051,141 @@ "ending_column": 0 } }, - "signature": "setTlcStrategy(address)" + "signature": "removeCollateral(uint128,address)" } } }, - "additional_fields": { "underlying_type": "external_calls" } + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "allAccountsData" + } + } + ], + "description": "Reentrancy in TempleLineOfCredit.removeCollateral(uint128,address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#166-190):\n\tExternal calls:\n\t- circuitBreakerProxy.preCheck(address(templeToken),msg.sender,amount) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#173-177)\n\tState variables written after the call(s):\n\t- _accountData.collateral = _collateral - amount (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#180)\n\tTempleLineOfCredit.allAccountsData (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#68) can be used in cross function reentrancies:\n\t- TempleLineOfCredit.accountData(address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#540-546)\n\t- TempleLineOfCredit.accountPosition(address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#484-503)\n\t- TempleLineOfCredit.addCollateral(uint128,address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#145-159)\n\t- TempleLineOfCredit.batchLiquidate(address[]) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#318-359)\n\t- TempleLineOfCredit.borrow(uint128,address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#205-242)\n\t- TempleLineOfCredit.computeLiquidity(address[]) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#523-535)\n\t- TempleLineOfCredit.removeCollateral(uint128,address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#166-190)\n\t- TempleLineOfCredit.repay(uint128,address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#253-280)\n\t- TempleLineOfCredit.repayAll(address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#287-305)\n", + "markdown": "Reentrancy in [TempleLineOfCredit.removeCollateral(uint128,address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L166-L190):\n\tExternal calls:\n\t- [circuitBreakerProxy.preCheck(address(templeToken),msg.sender,amount)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L173-L177)\n\tState variables written after the call(s):\n\t- [_accountData.collateral = _collateral - amount](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L180)\n\t[TempleLineOfCredit.allAccountsData](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L68) can be used in cross function reentrancies:\n\t- [TempleLineOfCredit.accountData(address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L540-L546)\n\t- [TempleLineOfCredit.accountPosition(address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L484-L503)\n\t- [TempleLineOfCredit.addCollateral(uint128,address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L145-L159)\n\t- [TempleLineOfCredit.batchLiquidate(address[])](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L318-L359)\n\t- [TempleLineOfCredit.borrow(uint128,address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L205-L242)\n\t- [TempleLineOfCredit.computeLiquidity(address[])](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L523-L535)\n\t- [TempleLineOfCredit.removeCollateral(uint128,address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L166-L190)\n\t- [TempleLineOfCredit.repay(uint128,address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L253-L280)\n\t- [TempleLineOfCredit.repayAll(address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L287-L305)\n", + "first_markdown_element": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L166-L190", + "id": "dffbe20bcc1c2f91394c175a10bd84f3964c2b4101e0079bbddcef08bf456d02", + "check": "reentrancy-no-eth", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "setTlcStrategy", + "source_mapping": { + "start": 15688, + "length": 875, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "is_dependency": false, + "lines": [ + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, + 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleLineOfCredit", + "source_mapping": { + "start": 1433, + "length": 31753, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "is_dependency": false, + "lines": [ + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, + 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, + 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, + 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, + 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, + 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, + 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, + 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, + 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, + 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, + 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, + 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, + 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, + 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, + 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, + 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, + 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, + 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, + 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, + 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, + 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, + 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, + 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, + 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, + 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, + 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, + 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, + 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, + 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, + 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, + 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, + 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, + 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, + 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, + 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, + 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, + 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, + 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "setTlcStrategy(address)" + } }, { "type": "node", - "name": "daiToken.safeIncreaseAllowance(_trv,type()(uint256).max)", + "name": "daiToken.safeApprove(previousTrv,0)", "source_mapping": { - "start": 16292, - "length": 55, + "start": 16002, + "length": 36, "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, - "lines": [403], + "lines": [394], "starting_column": 13, - "ending_column": 68 + "ending_column": 49 }, "type_specific_fields": { "parent": { @@ -6967,7 +6195,7 @@ "start": 15688, "length": 875, "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, "lines": [ @@ -6985,7 +6213,7 @@ "start": 1433, "length": 31753, "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, "lines": [ @@ -7073,17 +6301,17 @@ }, { "type": "node", - "name": "TlcStrategySet(newTlcStrategy,_trv)", + "name": "treasuryReservesVault = ITreasuryReservesVault(_trv)", "source_mapping": { - "start": 16368, - "length": 41, + "start": 16128, + "length": 52, "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, - "lines": [406], + "lines": [398], "starting_column": 9, - "ending_column": 50 + "ending_column": 61 }, "type_specific_fields": { "parent": { @@ -7093,7 +6321,7 @@ "start": 15688, "length": 875, "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, "lines": [ @@ -7111,7 +6339,7 @@ "start": 1433, "length": 31753, "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, "lines": [ @@ -7195,33 +6423,35 @@ } } }, - "additional_fields": { "underlying_type": "event" } + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "treasuryReservesVault" + } } ], - "description": "Reentrancy in TempleLineOfCredit.setTlcStrategy(address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#386-410):\n\tExternal calls:\n\t- daiToken.safeApprove(previousTrv,0) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#394)\n\t- daiToken.safeApprove(_trv,0) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#402)\n\t- daiToken.safeIncreaseAllowance(_trv,type()(uint256).max) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#403)\n\tEvent emitted after the call(s):\n\t- TlcStrategySet(newTlcStrategy,_trv) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#406)\n", - "markdown": "Reentrancy in [TempleLineOfCredit.setTlcStrategy(address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L386-L410):\n\tExternal calls:\n\t- [daiToken.safeApprove(previousTrv,0)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L394)\n\t- [daiToken.safeApprove(_trv,0)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L402)\n\t- [daiToken.safeIncreaseAllowance(_trv,type()(uint256).max)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L403)\n\tEvent emitted after the call(s):\n\t- [TlcStrategySet(newTlcStrategy,_trv)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L406)\n", + "description": "Reentrancy in TempleLineOfCredit.setTlcStrategy(address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#386-410):\n\tExternal calls:\n\t- daiToken.safeApprove(previousTrv,0) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#394)\n\tState variables written after the call(s):\n\t- treasuryReservesVault = ITreasuryReservesVault(_trv) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#398)\n\tTempleLineOfCredit.treasuryReservesVault (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#53) can be used in cross function reentrancies:\n\t- TempleLineOfCredit._initDebtTokenCache(TempleLineOfCredit.DebtTokenCache) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#619-658)\n\t- TempleLineOfCredit._repayToken(TempleLineOfCredit.DebtTokenCache,uint128,address,address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#705-721)\n\t- TempleLineOfCredit.batchLiquidate(address[]) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#318-359)\n\t- TempleLineOfCredit.setTlcStrategy(address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#386-410)\n\t- TempleLineOfCredit.treasuryReservesVault (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#53)\n", + "markdown": "Reentrancy in [TempleLineOfCredit.setTlcStrategy(address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L386-L410):\n\tExternal calls:\n\t- [daiToken.safeApprove(previousTrv,0)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L394)\n\tState variables written after the call(s):\n\t- [treasuryReservesVault = ITreasuryReservesVault(_trv)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L398)\n\t[TempleLineOfCredit.treasuryReservesVault](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L53) can be used in cross function reentrancies:\n\t- [TempleLineOfCredit._initDebtTokenCache(TempleLineOfCredit.DebtTokenCache)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L619-L658)\n\t- [TempleLineOfCredit._repayToken(TempleLineOfCredit.DebtTokenCache,uint128,address,address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L705-L721)\n\t- [TempleLineOfCredit.batchLiquidate(address[])](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L318-L359)\n\t- [TempleLineOfCredit.setTlcStrategy(address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L386-L410)\n\t- [TempleLineOfCredit.treasuryReservesVault](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L53)\n", "first_markdown_element": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L386-L410", - "id": "324c860350f8b013fe53e7e16c80f3c65372dc79913460521e82a2cd87c23a45", - "check": "reentrancy-events", - "impact": "Low", + "id": "45124547e30483595bf298aa091c92ce13c079404c993c2c8406499fd02de4c8", + "check": "reentrancy-no-eth", + "impact": "Medium", "confidence": "Medium" }, { "elements": [ { "type": "function", - "name": "shutdown", + "name": "setTokenVault", "source_mapping": { - "start": 11822, - "length": 1632, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 7963, + "length": 749, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319 + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209 ], "starting_column": 5, "ending_column": 6 @@ -7229,87 +6459,493 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "Ramos", "source_mapping": { - "start": 2150, - "length": 32023, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, - 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, - 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, - 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, - 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, - 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, - 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, - 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, - 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, - 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, - 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, - 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, - 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, - 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, - 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, - 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, - 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, - 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, - 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, - 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, - 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, - 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, - 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, - 771, 772, 773, 774, 775, 776, 777, 778, 779 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "shutdown(address)" - } - }, - { - "type": "node", - "name": "_outstandingDebt = borrowTokens[_token].dToken.burnAll(strategy)", - "source_mapping": { + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, + 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, + 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, + 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, + 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, + 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, + 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, + 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, + 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, + 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, + 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, + 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, + 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, + 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, + 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, + 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, + 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, + 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, + 621 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "setTokenVault(address)" + } + }, + { + "type": "node", + "name": "protocolToken.safeApprove(previousVault,0)", + "source_mapping": { + "start": 8231, + "length": 43, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", + "is_dependency": false, + "lines": [195], + "starting_column": 13, + "ending_column": 56 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "setTokenVault", + "source_mapping": { + "start": 7963, + "length": 749, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", + "is_dependency": false, + "lines": [ + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Ramos", + "source_mapping": { + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", + "is_dependency": false, + "lines": [ + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, + 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, + 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, + 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, + 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, + 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, + 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "setTokenVault(address)" + } + } + }, + "additional_fields": { "underlying_type": "external_calls" } + }, + { + "type": "node", + "name": "quoteToken.safeApprove(previousVault,0)", + "source_mapping": { + "start": 8288, + "length": 40, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", + "is_dependency": false, + "lines": [196], + "starting_column": 13, + "ending_column": 53 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "setTokenVault", + "source_mapping": { + "start": 7963, + "length": 749, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", + "is_dependency": false, + "lines": [ + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Ramos", + "source_mapping": { + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", + "is_dependency": false, + "lines": [ + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, + 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, + 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, + 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, + 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, + 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, + 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "setTokenVault(address)" + } + } + }, + "additional_fields": { "underlying_type": "external_calls" } + }, + { + "type": "node", + "name": "tokenVault = IRamosTokenVault(vault)", + "source_mapping": { + "start": 8349, + "length": 36, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", + "is_dependency": false, + "lines": [199], + "starting_column": 9, + "ending_column": 45 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "setTokenVault", + "source_mapping": { + "start": 7963, + "length": 749, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", + "is_dependency": false, + "lines": [ + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Ramos", + "source_mapping": { + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", + "is_dependency": false, + "lines": [ + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, + 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, + 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, + 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, + 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, + 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, + 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "setTokenVault(address)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "tokenVault" + } + } + ], + "description": "Reentrancy in Ramos.setTokenVault(address) (contracts/amo/Ramos.sol#189-209):\n\tExternal calls:\n\t- protocolToken.safeApprove(previousVault,0) (contracts/amo/Ramos.sol#195)\n\t- quoteToken.safeApprove(previousVault,0) (contracts/amo/Ramos.sol#196)\n\tState variables written after the call(s):\n\t- tokenVault = IRamosTokenVault(vault) (contracts/amo/Ramos.sol#199)\n\tRamos.tokenVault (contracts/amo/Ramos.sol#78) can be used in cross function reentrancies:\n\t- Ramos.addLiquidity(IBalancerVault.JoinPoolRequest) (contracts/amo/Ramos.sol#464-513)\n\t- Ramos.rebalanceDownExit(uint256,uint256) (contracts/amo/Ramos.sol#334-364)\n\t- Ramos.rebalanceDownJoin(uint256,uint256) (contracts/amo/Ramos.sol#421-455)\n\t- Ramos.rebalanceUpExit(uint256,uint256) (contracts/amo/Ramos.sol#290-322)\n\t- Ramos.rebalanceUpJoin(uint256,uint256) (contracts/amo/Ramos.sol#376-409)\n\t- Ramos.removeLiquidity(IBalancerVault.ExitPoolRequest,uint256) (contracts/amo/Ramos.sol#522-559)\n\t- Ramos.setTokenVault(address) (contracts/amo/Ramos.sol#189-209)\n\t- Ramos.tokenVault (contracts/amo/Ramos.sol#78)\n", + "markdown": "Reentrancy in [Ramos.setTokenVault(address)](contracts/amo/Ramos.sol#L189-L209):\n\tExternal calls:\n\t- [protocolToken.safeApprove(previousVault,0)](contracts/amo/Ramos.sol#L195)\n\t- [quoteToken.safeApprove(previousVault,0)](contracts/amo/Ramos.sol#L196)\n\tState variables written after the call(s):\n\t- [tokenVault = IRamosTokenVault(vault)](contracts/amo/Ramos.sol#L199)\n\t[Ramos.tokenVault](contracts/amo/Ramos.sol#L78) can be used in cross function reentrancies:\n\t- [Ramos.addLiquidity(IBalancerVault.JoinPoolRequest)](contracts/amo/Ramos.sol#L464-L513)\n\t- [Ramos.rebalanceDownExit(uint256,uint256)](contracts/amo/Ramos.sol#L334-L364)\n\t- [Ramos.rebalanceDownJoin(uint256,uint256)](contracts/amo/Ramos.sol#L421-L455)\n\t- [Ramos.rebalanceUpExit(uint256,uint256)](contracts/amo/Ramos.sol#L290-L322)\n\t- [Ramos.rebalanceUpJoin(uint256,uint256)](contracts/amo/Ramos.sol#L376-L409)\n\t- [Ramos.removeLiquidity(IBalancerVault.ExitPoolRequest,uint256)](contracts/amo/Ramos.sol#L522-L559)\n\t- [Ramos.setTokenVault(address)](contracts/amo/Ramos.sol#L189-L209)\n\t- [Ramos.tokenVault](contracts/amo/Ramos.sol#L78)\n", + "first_markdown_element": "contracts/amo/Ramos.sol#L189-L209", + "id": "51c39733accdc5dde8af1e99214d3003e0a2be1fffb777f3eb06a7fc56a19db1", + "check": "reentrancy-no-eth", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "shutdown", + "source_mapping": { + "start": 11822, + "length": 1632, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "is_dependency": false, + "lines": [ + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TreasuryReservesVault", + "source_mapping": { + "start": 2150, + "length": 32023, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "is_dependency": false, + "lines": [ + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, + 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, + 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, + 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, + 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, + 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, + 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, + 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, + 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, + 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, + 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, + 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, + 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, + 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, + 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, + 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, + 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, + 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, + 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, + 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, + 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, + 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, + 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, + 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, + 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, + 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, + 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, + 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, + 771, 772, 773, 774, 775, 776, 777, 778, 779 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "shutdown(address)" + } + }, + { + "type": "node", + "name": "_outstandingDebt = borrowTokens[_token].dToken.burnAll(strategy)", + "source_mapping": { "start": 12499, "length": 64, "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, "lines": [296], @@ -7324,7 +6960,7 @@ "start": 11822, "length": 1632, "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, "lines": [ @@ -7343,7 +6979,7 @@ "start": 2150, "length": 32023, "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, "lines": [ @@ -7421,17 +7057,17 @@ }, { "type": "node", - "name": "StrategyRemoved(strategy)", + "name": "delete strategies[strategy]", "source_mapping": { - "start": 13162, - "length": 30, + "start": 13381, + "length": 27, "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [312], + "lines": [317], "starting_column": 9, - "ending_column": 39 + "ending_column": 36 }, "type_specific_fields": { "parent": { @@ -7441,7 +7077,7 @@ "start": 11822, "length": 1632, "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, "lines": [ @@ -7460,7 +7096,7 @@ "start": 2150, "length": 32023, "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, "lines": [ @@ -7534,267 +7170,115 @@ } } }, - "additional_fields": { "underlying_type": "event" } - }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "strategies" + } + } + ], + "description": "Reentrancy in TreasuryReservesVault.shutdown(address) (contracts/v2/TreasuryReservesVault.sol#283-319):\n\tExternal calls:\n\t- _outstandingDebt = borrowTokens[_token].dToken.burnAll(strategy) (contracts/v2/TreasuryReservesVault.sol#296)\n\tState variables written after the call(s):\n\t- delete strategies[strategy] (contracts/v2/TreasuryReservesVault.sol#317)\n\tTreasuryReservesVault.strategies (contracts/v2/TreasuryReservesVault.sol#55) can be used in cross function reentrancies:\n\t- TreasuryReservesVault._getStrategyConfig(address) (contracts/v2/TreasuryReservesVault.sol#711-714)\n\t- TreasuryReservesVault._withdrawFromBaseStrategy(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,address,uint256) (contracts/v2/TreasuryReservesVault.sol#582-632)\n\t- TreasuryReservesVault.addStrategy(address,int256,ITempleStrategy.AssetBalance[]) (contracts/v2/TreasuryReservesVault.sol#173-201)\n\t- TreasuryReservesVault.shutdown(address) (contracts/v2/TreasuryReservesVault.sol#283-319)\n\t- TreasuryReservesVault.strategies (contracts/v2/TreasuryReservesVault.sol#55)\n", + "markdown": "Reentrancy in [TreasuryReservesVault.shutdown(address)](contracts/v2/TreasuryReservesVault.sol#L283-L319):\n\tExternal calls:\n\t- [_outstandingDebt = borrowTokens[_token].dToken.burnAll(strategy)](contracts/v2/TreasuryReservesVault.sol#L296)\n\tState variables written after the call(s):\n\t- [delete strategies[strategy]](contracts/v2/TreasuryReservesVault.sol#L317)\n\t[TreasuryReservesVault.strategies](contracts/v2/TreasuryReservesVault.sol#L55) can be used in cross function reentrancies:\n\t- [TreasuryReservesVault._getStrategyConfig(address)](contracts/v2/TreasuryReservesVault.sol#L711-L714)\n\t- [TreasuryReservesVault._withdrawFromBaseStrategy(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,address,uint256)](contracts/v2/TreasuryReservesVault.sol#L582-L632)\n\t- [TreasuryReservesVault.addStrategy(address,int256,ITempleStrategy.AssetBalance[])](contracts/v2/TreasuryReservesVault.sol#L173-L201)\n\t- [TreasuryReservesVault.shutdown(address)](contracts/v2/TreasuryReservesVault.sol#L283-L319)\n\t- [TreasuryReservesVault.strategies](contracts/v2/TreasuryReservesVault.sol#L55)\n", + "first_markdown_element": "contracts/v2/TreasuryReservesVault.sol#L283-L319", + "id": "29da7db88824f300cbfeae877c2e6c080f8344d5012c1ba25820228cb3feb89a", + "check": "reentrancy-no-eth", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ { - "type": "node", - "name": "StrategyShutdownCreditAndDebt({strategy:strategy,token:address(_token),outstandingCredit:credits[_token],outstandingDebt:_outstandingDebt})", + "type": "function", + "name": "decreaseShares", "source_mapping": { - "start": 12577, - "length": 231, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 2355, + "length": 302, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [297, 298, 299, 300, 301, 302], - "starting_column": 13, - "ending_column": 15 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "shutdown", - "source_mapping": { - "start": 11822, - "length": 1632, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", - "is_dependency": false, - "lines": [ - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TreasuryReservesVault", - "source_mapping": { - "start": 2150, - "length": 32023, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", - "is_dependency": false, - "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, - 777, 778, 779 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "shutdown(address)" - } - } - }, - "additional_fields": { "underlying_type": "event" } - } - ], - "description": "Reentrancy in TreasuryReservesVault.shutdown(address) (contracts/v2/TreasuryReservesVault.sol#283-319):\n\tExternal calls:\n\t- _outstandingDebt = borrowTokens[_token].dToken.burnAll(strategy) (contracts/v2/TreasuryReservesVault.sol#296)\n\tEvent emitted after the call(s):\n\t- StrategyRemoved(strategy) (contracts/v2/TreasuryReservesVault.sol#312)\n\t- StrategyShutdownCreditAndDebt({strategy:strategy,token:address(_token),outstandingCredit:credits[_token],outstandingDebt:_outstandingDebt}) (contracts/v2/TreasuryReservesVault.sol#297-302)\n", - "markdown": "Reentrancy in [TreasuryReservesVault.shutdown(address)](contracts/v2/TreasuryReservesVault.sol#L283-L319):\n\tExternal calls:\n\t- [_outstandingDebt = borrowTokens[_token].dToken.burnAll(strategy)](contracts/v2/TreasuryReservesVault.sol#L296)\n\tEvent emitted after the call(s):\n\t- [StrategyRemoved(strategy)](contracts/v2/TreasuryReservesVault.sol#L312)\n\t- [StrategyShutdownCreditAndDebt({strategy:strategy,token:address(_token),outstandingCredit:credits[_token],outstandingDebt:_outstandingDebt})](contracts/v2/TreasuryReservesVault.sol#L297-L302)\n", - "first_markdown_element": "contracts/v2/TreasuryReservesVault.sol#L283-L319", - "id": "3770a3cd34d6db65975f14acb9170e3663edac9809964808500e613a8be2344e", - "check": "reentrancy-events", - "impact": "Low", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "trvWithdraw", - "source_mapping": { - "start": 10560, - "length": 947, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", - "is_dependency": false, - "lines": [ - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276 - ], - "starting_column": 5, - "ending_column": 6 + "lines": [69, 70, 71, 72, 73, 74, 75, 76, 77], + "starting_column": 5, + "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TreasuryFarmingRevenue", "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 547, + "length": 3059, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "trvWithdraw(uint256)" + "signature": "decreaseShares(address,uint256)" } }, { "type": "node", - "name": "(daiAvailable,chi,sharesAvailable) = _checkpointDaiBalance()", + "name": "claimFor(account)", "source_mapping": { - "start": 11010, - "length": 86, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2441, + "length": 17, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [264], + "lines": [70], "starting_column": 9, - "ending_column": 95 + "ending_column": 26 }, "type_specific_fields": { "parent": { "type": "function", - "name": "trvWithdraw", + "name": "decreaseShares", "source_mapping": { - "start": 10560, - "length": 947, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2355, + "length": 302, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [ - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276 - ], + "lines": [69, 70, 71, 72, 73, 74, 75, 76, 77], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TreasuryFarmingRevenue", "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 547, + "length": 3059, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "trvWithdraw(uint256)" + "signature": "decreaseShares(address,uint256)" } } }, @@ -7802,74 +7286,57 @@ }, { "type": "node", - "name": "chi = pot.drip()", + "name": "exposure.mint(account,unclaimedScaled / SCALING_FACTOR)", "source_mapping": { - "start": 5566, - "length": 60, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 3194, + "length": 56, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [142], + "lines": [91], "starting_column": 9, - "ending_column": 69 + "ending_column": 65 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_checkpointChi", + "name": "claimFor", "source_mapping": { - "start": 5445, - "length": 188, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2718, + "length": 611, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [140, 141, 142, 143], + "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TreasuryFarmingRevenue", "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 547, + "length": 3059, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_checkpointChi()" + "signature": "claimFor(address)" } } }, @@ -7877,335 +7344,280 @@ }, { "type": "node", - "name": "_dsrWithdrawal(sharesAmount,requestedAmount)", + "name": "claimedByScaled[account] -= amount * lifetimeAccRevenueScaledByShare", "source_mapping": { - "start": 11365, - "length": 45, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2535, + "length": 68, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [273], + "lines": [74], "starting_column": 9, - "ending_column": 54 + "ending_column": 77 }, "type_specific_fields": { "parent": { "type": "function", - "name": "trvWithdraw", + "name": "decreaseShares", "source_mapping": { - "start": 10560, - "length": 947, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2355, + "length": 302, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [ - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276 - ], + "lines": [69, 70, 71, 72, 73, 74, 75, 76, 77], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TreasuryFarmingRevenue", "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 547, + "length": 3059, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "trvWithdraw(uint256)" + "signature": "decreaseShares(address,uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls" } + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "claimedByScaled" + } }, { "type": "node", - "name": "pot.exit(sharesAmount)", + "name": "shares[account] -= amount", "source_mapping": { - "start": 11597, - "length": 22, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2469, + "length": 25, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [279], + "lines": [72], "starting_column": 9, - "ending_column": 31 + "ending_column": 34 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_dsrWithdrawal", + "name": "decreaseShares", "source_mapping": { - "start": 11513, - "length": 199, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2355, + "length": 302, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [278, 279, 280, 281, 282], + "lines": [69, 70, 71, 72, 73, 74, 75, 76, 77], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TreasuryFarmingRevenue", "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 547, + "length": 3059, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_dsrWithdrawal(uint256,uint256)" + "signature": "decreaseShares(address,uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } - }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "shares" + } + } + ], + "description": "Reentrancy in TreasuryFarmingRevenue.decreaseShares(address,uint256) (contracts/core/TreasuryFarmingRevenue.sol#69-77):\n\tExternal calls:\n\t- claimFor(account) (contracts/core/TreasuryFarmingRevenue.sol#70)\n\t\t- exposure.mint(account,unclaimedScaled / SCALING_FACTOR) (contracts/core/TreasuryFarmingRevenue.sol#91)\n\tState variables written after the call(s):\n\t- claimedByScaled[account] -= amount * lifetimeAccRevenueScaledByShare (contracts/core/TreasuryFarmingRevenue.sol#74)\n\tTreasuryFarmingRevenue.claimedByScaled (contracts/core/TreasuryFarmingRevenue.sol#30) can be used in cross function reentrancies:\n\t- TreasuryFarmingRevenue.claimFor(address) (contracts/core/TreasuryFarmingRevenue.sol#80-93)\n\t- TreasuryFarmingRevenue.claimedByScaled (contracts/core/TreasuryFarmingRevenue.sol#30)\n\t- TreasuryFarmingRevenue.decreaseShares(address,uint256) (contracts/core/TreasuryFarmingRevenue.sol#69-77)\n\t- TreasuryFarmingRevenue.increaseShares(address,uint256) (contracts/core/TreasuryFarmingRevenue.sol#56-64)\n\t- shares[account] -= amount (contracts/core/TreasuryFarmingRevenue.sol#72)\n\tTreasuryFarmingRevenue.shares (contracts/core/TreasuryFarmingRevenue.sol#24) can be used in cross function reentrancies:\n\t- TreasuryFarmingRevenue.claimFor(address) (contracts/core/TreasuryFarmingRevenue.sol#80-93)\n\t- TreasuryFarmingRevenue.decreaseShares(address,uint256) (contracts/core/TreasuryFarmingRevenue.sol#69-77)\n\t- TreasuryFarmingRevenue.increaseShares(address,uint256) (contracts/core/TreasuryFarmingRevenue.sol#56-64)\n\t- TreasuryFarmingRevenue.shares (contracts/core/TreasuryFarmingRevenue.sol#24)\n", + "markdown": "Reentrancy in [TreasuryFarmingRevenue.decreaseShares(address,uint256)](contracts/core/TreasuryFarmingRevenue.sol#L69-L77):\n\tExternal calls:\n\t- [claimFor(account)](contracts/core/TreasuryFarmingRevenue.sol#L70)\n\t\t- [exposure.mint(account,unclaimedScaled / SCALING_FACTOR)](contracts/core/TreasuryFarmingRevenue.sol#L91)\n\tState variables written after the call(s):\n\t- [claimedByScaled[account] -= amount * lifetimeAccRevenueScaledByShare](contracts/core/TreasuryFarmingRevenue.sol#L74)\n\t[TreasuryFarmingRevenue.claimedByScaled](contracts/core/TreasuryFarmingRevenue.sol#L30) can be used in cross function reentrancies:\n\t- [TreasuryFarmingRevenue.claimFor(address)](contracts/core/TreasuryFarmingRevenue.sol#L80-L93)\n\t- [TreasuryFarmingRevenue.claimedByScaled](contracts/core/TreasuryFarmingRevenue.sol#L30)\n\t- [TreasuryFarmingRevenue.decreaseShares(address,uint256)](contracts/core/TreasuryFarmingRevenue.sol#L69-L77)\n\t- [TreasuryFarmingRevenue.increaseShares(address,uint256)](contracts/core/TreasuryFarmingRevenue.sol#L56-L64)\n\t- [shares[account] -= amount](contracts/core/TreasuryFarmingRevenue.sol#L72)\n\t[TreasuryFarmingRevenue.shares](contracts/core/TreasuryFarmingRevenue.sol#L24) can be used in cross function reentrancies:\n\t- [TreasuryFarmingRevenue.claimFor(address)](contracts/core/TreasuryFarmingRevenue.sol#L80-L93)\n\t- [TreasuryFarmingRevenue.decreaseShares(address,uint256)](contracts/core/TreasuryFarmingRevenue.sol#L69-L77)\n\t- [TreasuryFarmingRevenue.increaseShares(address,uint256)](contracts/core/TreasuryFarmingRevenue.sol#L56-L64)\n\t- [TreasuryFarmingRevenue.shares](contracts/core/TreasuryFarmingRevenue.sol#L24)\n", + "first_markdown_element": "contracts/core/TreasuryFarmingRevenue.sol#L69-L77", + "id": "cc45c8f5d22793c2ba894c4d32e4043890c1184c0a94e5502d25b97876a95c86", + "check": "reentrancy-no-eth", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ { - "type": "node", - "name": "daiJoin.exit(address(this),daiAmount)", + "type": "function", + "name": "deployPayouts", "source_mapping": { - "start": 11629, - "length": 38, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2818, + "length": 1078, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [280], - "starting_column": 9, - "ending_column": 47 + "lines": [ + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112 + ], + "starting_column": 5, + "ending_column": 6 }, "type_specific_fields": { "parent": { - "type": "function", - "name": "_dsrWithdrawal", + "type": "contract", + "name": "TempleTeamPaymentsFactory", "source_mapping": { - "start": 11513, - "length": 199, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 279, + "length": 4653, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [278, 279, 280, 281, 282], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "DsrBaseStrategy", - "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", - "is_dependency": false, - "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "_dsrWithdrawal(uint256,uint256)" + "lines": [ + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144 + ], + "starting_column": 1, + "ending_column": 2 } - } - }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + }, + "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" + } }, { "type": "node", - "name": "DaiWithdrawn(daiAmount)", + "name": "paymentContract.initialize(_token)", "source_mapping": { - "start": 11677, - "length": 28, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 3274, + "length": 34, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [281], + "lines": [89], "starting_column": 9, - "ending_column": 37 + "ending_column": 43 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_dsrWithdrawal", + "name": "deployPayouts", "source_mapping": { - "start": 11513, - "length": 199, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2818, + "length": 1078, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [278, 279, 280, 281, 282], + "lines": [ + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TempleTeamPaymentsFactory", "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 279, + "length": 4653, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306 + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "_dsrWithdrawal(uint256,uint256)" + "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" } } }, - "additional_fields": { "underlying_type": "event" } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "_dsrWithdrawal(sharesAmount,requestedAmount)", + "name": "paymentContract.setAllocations(_dests,_allocations)", "source_mapping": { - "start": 11365, - "length": 45, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 3318, + "length": 52, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [273], + "lines": [90], "starting_column": 9, - "ending_column": 54 + "ending_column": 61 }, "type_specific_fields": { "parent": { "type": "function", - "name": "trvWithdraw", + "name": "deployPayouts", "source_mapping": { - "start": 10560, - "length": 947, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2818, + "length": 1078, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276 + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112 ], "starting_column": 5, "ending_column": 6 @@ -8213,145 +7625,65 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TempleTeamPaymentsFactory", "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 279, + "length": 4653, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306 + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "trvWithdraw(uint256)" + "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" } } }, - "additional_fields": { "underlying_type": "event" } - } - ], - "description": "Reentrancy in DsrBaseStrategy.trvWithdraw(uint256) (contracts/v2/strategies/DsrBaseStrategy.sol#257-276):\n\tExternal calls:\n\t- (daiAvailable,chi,sharesAvailable) = _checkpointDaiBalance() (contracts/v2/strategies/DsrBaseStrategy.sol#264)\n\t\t- chi = pot.drip() (contracts/v2/strategies/DsrBaseStrategy.sol#142)\n\t- _dsrWithdrawal(sharesAmount,requestedAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#273)\n\t\t- pot.exit(sharesAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#279)\n\t\t- daiJoin.exit(address(this),daiAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#280)\n\tEvent emitted after the call(s):\n\t- DaiWithdrawn(daiAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#281)\n\t\t- _dsrWithdrawal(sharesAmount,requestedAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#273)\n", - "markdown": "Reentrancy in [DsrBaseStrategy.trvWithdraw(uint256)](contracts/v2/strategies/DsrBaseStrategy.sol#L257-L276):\n\tExternal calls:\n\t- [(daiAvailable,chi,sharesAvailable) = _checkpointDaiBalance()](contracts/v2/strategies/DsrBaseStrategy.sol#L264)\n\t\t- [chi = pot.drip()](contracts/v2/strategies/DsrBaseStrategy.sol#L142)\n\t- [_dsrWithdrawal(sharesAmount,requestedAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L273)\n\t\t- [pot.exit(sharesAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L279)\n\t\t- [daiJoin.exit(address(this),daiAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L280)\n\tEvent emitted after the call(s):\n\t- [DaiWithdrawn(daiAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L281)\n\t\t- [_dsrWithdrawal(sharesAmount,requestedAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L273)\n", - "first_markdown_element": "contracts/v2/strategies/DsrBaseStrategy.sol#L257-L276", - "id": "0a4c8e86f10e88f7cdc66960b0dd281291f86c22d1d8b92e68909c1d477f23ac", - "check": "reentrancy-events", - "impact": "Low", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "withdrawAndRepay", - "source_mapping": { - "start": 8509, - "length": 786, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", - "is_dependency": false, - "lines": [ - 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "DsrBaseStrategy", - "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", - "is_dependency": false, - "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "withdrawAndRepay(uint256)" - } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "(daiAvailable,chi) = _checkpointDaiBalance()", + "name": "paymentContract.transferOwnership(msg.sender)", "source_mapping": { - "start": 8690, - "length": 63, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 3381, + "length": 45, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [217], + "lines": [92], "starting_column": 9, - "ending_column": 72 + "ending_column": 54 }, "type_specific_fields": { "parent": { "type": "function", - "name": "withdrawAndRepay", + "name": "deployPayouts", "source_mapping": { - "start": 8509, - "length": 786, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2818, + "length": 1078, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227 + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112 ], "starting_column": 5, "ending_column": 6 @@ -8359,44 +7691,31 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TempleTeamPaymentsFactory", "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 279, + "length": 4653, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306 + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "withdrawAndRepay(uint256)" + "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" } } }, @@ -8404,107 +7723,99 @@ }, { "type": "node", - "name": "chi = pot.drip()", + "name": "SafeERC20.safeTransferFrom(_token,msg.sender,address(paymentContract),_totalFunding)", "source_mapping": { - "start": 5566, - "length": 60, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 3473, + "length": 165, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [142], - "starting_column": 9, - "ending_column": 69 + "lines": [95, 96, 97, 98, 99, 100], + "starting_column": 13, + "ending_column": 14 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_checkpointChi", + "name": "deployPayouts", "source_mapping": { - "start": 5445, - "length": 188, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2818, + "length": 1078, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [140, 141, 142, 143], + "lines": [ + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TempleTeamPaymentsFactory", "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 279, + "length": 4653, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306 + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "_checkpointChi()" + "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "_dsrWithdrawal(sharesAmount,withdrawalAmount)", + "name": "incrementEpoch(address(paymentContract),_totalFunding)", "source_mapping": { - "start": 9025, - "length": 46, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 3649, + "length": 55, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [222], + "lines": [102], "starting_column": 9, - "ending_column": 55 + "ending_column": 64 }, "type_specific_fields": { "parent": { "type": "function", - "name": "withdrawAndRepay", + "name": "deployPayouts", "source_mapping": { - "start": 8509, - "length": 786, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2818, + "length": 1078, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227 + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112 ], "starting_column": 5, "ending_column": 6 @@ -8512,967 +7823,987 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TempleTeamPaymentsFactory", "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 279, + "length": 4653, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306 + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "withdrawAndRepay(uint256)" + "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls" } + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "lastPaidEpoch" + } }, { "type": "node", - "name": "pot.exit(sharesAmount)", + "name": "data = FundingData({paymentContract:address(_paymentContract),totalFunding:_totalFunding,epoch:lastPaidEpoch ++})", "source_mapping": { - "start": 11597, - "length": 22, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 1542, + "length": 182, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [279], + "lines": [50, 51, 52, 53, 54], "starting_column": 9, - "ending_column": 31 + "ending_column": 11 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_dsrWithdrawal", + "name": "incrementEpoch", "source_mapping": { - "start": 11513, - "length": 199, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 1428, + "length": 347, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [278, 279, 280, 281, 282], + "lines": [46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TempleTeamPaymentsFactory", "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 279, + "length": 4653, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306 + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "_dsrWithdrawal(uint256,uint256)" + "signature": "incrementEpoch(address,uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "lastPaidEpoch" + } + } + ], + "description": "Reentrancy in TempleTeamPaymentsFactory.deployPayouts(IERC20,address[],uint256[],uint256) (contracts/admin/TempleTeamPaymentsFactory.sol#79-112):\n\tExternal calls:\n\t- paymentContract.initialize(_token) (contracts/admin/TempleTeamPaymentsFactory.sol#89)\n\t- paymentContract.setAllocations(_dests,_allocations) (contracts/admin/TempleTeamPaymentsFactory.sol#90)\n\t- paymentContract.transferOwnership(msg.sender) (contracts/admin/TempleTeamPaymentsFactory.sol#92)\n\t- SafeERC20.safeTransferFrom(_token,msg.sender,address(paymentContract),_totalFunding) (contracts/admin/TempleTeamPaymentsFactory.sol#95-100)\n\tState variables written after the call(s):\n\t- incrementEpoch(address(paymentContract),_totalFunding) (contracts/admin/TempleTeamPaymentsFactory.sol#102)\n\t\t- data = FundingData({paymentContract:address(_paymentContract),totalFunding:_totalFunding,epoch:lastPaidEpoch ++}) (contracts/admin/TempleTeamPaymentsFactory.sol#50-54)\n\tTempleTeamPaymentsFactory.lastPaidEpoch (contracts/admin/TempleTeamPaymentsFactory.sol#23) can be used in cross function reentrancies:\n\t- TempleTeamPaymentsFactory.constructor(address,uint16) (contracts/admin/TempleTeamPaymentsFactory.sol#40-44)\n\t- TempleTeamPaymentsFactory.deployPayouts(IERC20,address[],uint256[],uint256) (contracts/admin/TempleTeamPaymentsFactory.sol#79-112)\n\t- TempleTeamPaymentsFactory.directPayouts(IERC20,address[],uint256[]) (contracts/admin/TempleTeamPaymentsFactory.sol#119-143)\n\t- TempleTeamPaymentsFactory.incrementEpoch(address,uint256) (contracts/admin/TempleTeamPaymentsFactory.sol#46-56)\n\t- TempleTeamPaymentsFactory.lastPaidEpoch (contracts/admin/TempleTeamPaymentsFactory.sol#23)\n", + "markdown": "Reentrancy in [TempleTeamPaymentsFactory.deployPayouts(IERC20,address[],uint256[],uint256)](contracts/admin/TempleTeamPaymentsFactory.sol#L79-L112):\n\tExternal calls:\n\t- [paymentContract.initialize(_token)](contracts/admin/TempleTeamPaymentsFactory.sol#L89)\n\t- [paymentContract.setAllocations(_dests,_allocations)](contracts/admin/TempleTeamPaymentsFactory.sol#L90)\n\t- [paymentContract.transferOwnership(msg.sender)](contracts/admin/TempleTeamPaymentsFactory.sol#L92)\n\t- [SafeERC20.safeTransferFrom(_token,msg.sender,address(paymentContract),_totalFunding)](contracts/admin/TempleTeamPaymentsFactory.sol#L95-L100)\n\tState variables written after the call(s):\n\t- [incrementEpoch(address(paymentContract),_totalFunding)](contracts/admin/TempleTeamPaymentsFactory.sol#L102)\n\t\t- [data = FundingData({paymentContract:address(_paymentContract),totalFunding:_totalFunding,epoch:lastPaidEpoch ++})](contracts/admin/TempleTeamPaymentsFactory.sol#L50-L54)\n\t[TempleTeamPaymentsFactory.lastPaidEpoch](contracts/admin/TempleTeamPaymentsFactory.sol#L23) can be used in cross function reentrancies:\n\t- [TempleTeamPaymentsFactory.constructor(address,uint16)](contracts/admin/TempleTeamPaymentsFactory.sol#L40-L44)\n\t- [TempleTeamPaymentsFactory.deployPayouts(IERC20,address[],uint256[],uint256)](contracts/admin/TempleTeamPaymentsFactory.sol#L79-L112)\n\t- [TempleTeamPaymentsFactory.directPayouts(IERC20,address[],uint256[])](contracts/admin/TempleTeamPaymentsFactory.sol#L119-L143)\n\t- [TempleTeamPaymentsFactory.incrementEpoch(address,uint256)](contracts/admin/TempleTeamPaymentsFactory.sol#L46-L56)\n\t- [TempleTeamPaymentsFactory.lastPaidEpoch](contracts/admin/TempleTeamPaymentsFactory.sol#L23)\n", + "first_markdown_element": "contracts/admin/TempleTeamPaymentsFactory.sol#L79-L112", + "id": "1239a22bea2c9a42dbde3ae4ac80f8aa9a378a084fd732a81c3169ae01c87319", + "check": "reentrancy-no-eth", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "increaseShares", + "source_mapping": { + "start": 1987, + "length": 302, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "is_dependency": false, + "lines": [56, 57, 58, 59, 60, 61, 62, 63, 64], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TreasuryFarmingRevenue", + "source_mapping": { + "start": 547, + "length": 3059, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "is_dependency": false, + "lines": [ + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "increaseShares(address,uint256)" + } }, { "type": "node", - "name": "daiJoin.exit(address(this),daiAmount)", + "name": "claimFor(account)", "source_mapping": { - "start": 11629, - "length": 38, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2073, + "length": 17, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [280], + "lines": [57], "starting_column": 9, - "ending_column": 47 + "ending_column": 26 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_dsrWithdrawal", + "name": "increaseShares", "source_mapping": { - "start": 11513, - "length": 199, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 1987, + "length": 302, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [278, 279, 280, 281, 282], + "lines": [56, 57, 58, 59, 60, 61, 62, 63, 64], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TreasuryFarmingRevenue", "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 547, + "length": 3059, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_dsrWithdrawal(uint256,uint256)" + "signature": "increaseShares(address,uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "DaiWithdrawn(daiAmount)", + "name": "exposure.mint(account,unclaimedScaled / SCALING_FACTOR)", "source_mapping": { - "start": 11677, - "length": 28, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 3194, + "length": 56, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [281], + "lines": [91], "starting_column": 9, - "ending_column": 37 + "ending_column": 65 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_dsrWithdrawal", + "name": "claimFor", "source_mapping": { - "start": 11513, - "length": 199, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2718, + "length": 611, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [278, 279, 280, 281, 282], + "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TreasuryFarmingRevenue", "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 547, + "length": 3059, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_dsrWithdrawal(uint256,uint256)" + "signature": "claimFor(address)" } } }, - "additional_fields": { "underlying_type": "event" } + "additional_fields": { "underlying_type": "external_calls_sending_eth" } }, { "type": "node", - "name": "_dsrWithdrawal(sharesAmount,withdrawalAmount)", + "name": "claimedByScaled[account] += amount * lifetimeAccRevenueScaledByShare", "source_mapping": { - "start": 9025, - "length": 46, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2167, + "length": 68, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [222], + "lines": [61], "starting_column": 9, - "ending_column": 55 + "ending_column": 77 }, "type_specific_fields": { "parent": { "type": "function", - "name": "withdrawAndRepay", + "name": "increaseShares", "source_mapping": { - "start": 8509, - "length": 786, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 1987, + "length": 302, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [ - 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227 - ], + "lines": [56, 57, 58, 59, 60, 61, 62, 63, 64], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TreasuryFarmingRevenue", "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 547, + "length": 3059, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "withdrawAndRepay(uint256)" + "signature": "increaseShares(address,uint256)" } } }, - "additional_fields": { "underlying_type": "event" } - } - ], - "description": "Reentrancy in DsrBaseStrategy.withdrawAndRepay(uint256) (contracts/v2/strategies/DsrBaseStrategy.sol#214-227):\n\tExternal calls:\n\t- (daiAvailable,chi) = _checkpointDaiBalance() (contracts/v2/strategies/DsrBaseStrategy.sol#217)\n\t\t- chi = pot.drip() (contracts/v2/strategies/DsrBaseStrategy.sol#142)\n\t- _dsrWithdrawal(sharesAmount,withdrawalAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#222)\n\t\t- pot.exit(sharesAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#279)\n\t\t- daiJoin.exit(address(this),daiAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#280)\n\tEvent emitted after the call(s):\n\t- DaiWithdrawn(daiAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#281)\n\t\t- _dsrWithdrawal(sharesAmount,withdrawalAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#222)\n", - "markdown": "Reentrancy in [DsrBaseStrategy.withdrawAndRepay(uint256)](contracts/v2/strategies/DsrBaseStrategy.sol#L214-L227):\n\tExternal calls:\n\t- [(daiAvailable,chi) = _checkpointDaiBalance()](contracts/v2/strategies/DsrBaseStrategy.sol#L217)\n\t\t- [chi = pot.drip()](contracts/v2/strategies/DsrBaseStrategy.sol#L142)\n\t- [_dsrWithdrawal(sharesAmount,withdrawalAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L222)\n\t\t- [pot.exit(sharesAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L279)\n\t\t- [daiJoin.exit(address(this),daiAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L280)\n\tEvent emitted after the call(s):\n\t- [DaiWithdrawn(daiAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L281)\n\t\t- [_dsrWithdrawal(sharesAmount,withdrawalAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L222)\n", - "first_markdown_element": "contracts/v2/strategies/DsrBaseStrategy.sol#L214-L227", - "id": "38cb9f382307934e51255ca3f7d7f51604f44bc46a20af75d7f155182cf9bb95", - "check": "reentrancy-events", - "impact": "Low", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "withdrawAndRepayAll", - "source_mapping": { - "start": 9412, - "length": 465, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", - "is_dependency": false, - "lines": [232, 233, 234, 235, 236, 237, 238, 239, 240], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "DsrBaseStrategy", - "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", - "is_dependency": false, - "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "withdrawAndRepayAll()" + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "claimedByScaled" } }, { "type": "node", - "name": "(daiAvailable,sharesAvailable) = _checkpointDaiBalance()", + "name": "shares[account] += amount", "source_mapping": { - "start": 9499, - "length": 74, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2101, + "length": 25, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [233], + "lines": [59], "starting_column": 9, - "ending_column": 83 + "ending_column": 34 }, "type_specific_fields": { "parent": { "type": "function", - "name": "withdrawAndRepayAll", + "name": "increaseShares", "source_mapping": { - "start": 9412, - "length": 465, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 1987, + "length": 302, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [232, 233, 234, 235, 236, 237, 238, 239, 240], + "lines": [56, 57, 58, 59, 60, 61, 62, 63, 64], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TreasuryFarmingRevenue", "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 547, + "length": 3059, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "withdrawAndRepayAll()" + "signature": "increaseShares(address,uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls" } - }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "shares" + } + } + ], + "description": "Reentrancy in TreasuryFarmingRevenue.increaseShares(address,uint256) (contracts/core/TreasuryFarmingRevenue.sol#56-64):\n\tExternal calls:\n\t- claimFor(account) (contracts/core/TreasuryFarmingRevenue.sol#57)\n\t\t- exposure.mint(account,unclaimedScaled / SCALING_FACTOR) (contracts/core/TreasuryFarmingRevenue.sol#91)\n\tState variables written after the call(s):\n\t- claimedByScaled[account] += amount * lifetimeAccRevenueScaledByShare (contracts/core/TreasuryFarmingRevenue.sol#61)\n\tTreasuryFarmingRevenue.claimedByScaled (contracts/core/TreasuryFarmingRevenue.sol#30) can be used in cross function reentrancies:\n\t- TreasuryFarmingRevenue.claimFor(address) (contracts/core/TreasuryFarmingRevenue.sol#80-93)\n\t- TreasuryFarmingRevenue.claimedByScaled (contracts/core/TreasuryFarmingRevenue.sol#30)\n\t- TreasuryFarmingRevenue.decreaseShares(address,uint256) (contracts/core/TreasuryFarmingRevenue.sol#69-77)\n\t- TreasuryFarmingRevenue.increaseShares(address,uint256) (contracts/core/TreasuryFarmingRevenue.sol#56-64)\n\t- shares[account] += amount (contracts/core/TreasuryFarmingRevenue.sol#59)\n\tTreasuryFarmingRevenue.shares (contracts/core/TreasuryFarmingRevenue.sol#24) can be used in cross function reentrancies:\n\t- TreasuryFarmingRevenue.claimFor(address) (contracts/core/TreasuryFarmingRevenue.sol#80-93)\n\t- TreasuryFarmingRevenue.decreaseShares(address,uint256) (contracts/core/TreasuryFarmingRevenue.sol#69-77)\n\t- TreasuryFarmingRevenue.increaseShares(address,uint256) (contracts/core/TreasuryFarmingRevenue.sol#56-64)\n\t- TreasuryFarmingRevenue.shares (contracts/core/TreasuryFarmingRevenue.sol#24)\n", + "markdown": "Reentrancy in [TreasuryFarmingRevenue.increaseShares(address,uint256)](contracts/core/TreasuryFarmingRevenue.sol#L56-L64):\n\tExternal calls:\n\t- [claimFor(account)](contracts/core/TreasuryFarmingRevenue.sol#L57)\n\t\t- [exposure.mint(account,unclaimedScaled / SCALING_FACTOR)](contracts/core/TreasuryFarmingRevenue.sol#L91)\n\tState variables written after the call(s):\n\t- [claimedByScaled[account] += amount * lifetimeAccRevenueScaledByShare](contracts/core/TreasuryFarmingRevenue.sol#L61)\n\t[TreasuryFarmingRevenue.claimedByScaled](contracts/core/TreasuryFarmingRevenue.sol#L30) can be used in cross function reentrancies:\n\t- [TreasuryFarmingRevenue.claimFor(address)](contracts/core/TreasuryFarmingRevenue.sol#L80-L93)\n\t- [TreasuryFarmingRevenue.claimedByScaled](contracts/core/TreasuryFarmingRevenue.sol#L30)\n\t- [TreasuryFarmingRevenue.decreaseShares(address,uint256)](contracts/core/TreasuryFarmingRevenue.sol#L69-L77)\n\t- [TreasuryFarmingRevenue.increaseShares(address,uint256)](contracts/core/TreasuryFarmingRevenue.sol#L56-L64)\n\t- [shares[account] += amount](contracts/core/TreasuryFarmingRevenue.sol#L59)\n\t[TreasuryFarmingRevenue.shares](contracts/core/TreasuryFarmingRevenue.sol#L24) can be used in cross function reentrancies:\n\t- [TreasuryFarmingRevenue.claimFor(address)](contracts/core/TreasuryFarmingRevenue.sol#L80-L93)\n\t- [TreasuryFarmingRevenue.decreaseShares(address,uint256)](contracts/core/TreasuryFarmingRevenue.sol#L69-L77)\n\t- [TreasuryFarmingRevenue.increaseShares(address,uint256)](contracts/core/TreasuryFarmingRevenue.sol#L56-L64)\n\t- [TreasuryFarmingRevenue.shares](contracts/core/TreasuryFarmingRevenue.sol#L24)\n", + "first_markdown_element": "contracts/core/TreasuryFarmingRevenue.sol#L56-L64", + "id": "7136d46cea8f0cb4f10b428d075c61a8ad801ba9ca1ef8c90733aaa52034f6ed", + "check": "reentrancy-no-eth", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ { - "type": "node", - "name": "chi = pot.drip()", + "type": "variable", + "name": "baseStrategyAvailable", "source_mapping": { - "start": 5566, - "length": 60, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 21089, + "length": 29, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [142], + "lines": [476], "starting_column": 9, - "ending_column": 69 + "ending_column": 38 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_checkpointChi", + "name": "totalAvailable", "source_mapping": { - "start": 5445, - "length": 188, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 20920, + "length": 877, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [140, 141, 142, 143], + "lines": [ + 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, + 486, 487, 488, 489 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TreasuryReservesVault", "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2150, + "length": 32023, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306 + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, + 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, + 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, + 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, + 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, + 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, + 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, + 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, + 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, + 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, + 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, + 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, + 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, + 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, + 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, + 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, + 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, + 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, + 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, + 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, + 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, + 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, + 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, + 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, + 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, + 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, + 777, 778, 779 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_checkpointChi()" + "signature": "totalAvailable(IERC20)" } } - }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } - }, + } + } + ], + "description": "TreasuryReservesVault.totalAvailable(IERC20).baseStrategyAvailable (contracts/v2/TreasuryReservesVault.sol#476) is a local variable never initialized\n", + "markdown": "[TreasuryReservesVault.totalAvailable(IERC20).baseStrategyAvailable](contracts/v2/TreasuryReservesVault.sol#L476) is a local variable never initialized\n", + "first_markdown_element": "contracts/v2/TreasuryReservesVault.sol#L476", + "id": "5a877bceafff56259a481e94173f69b6c70a20fc470647802278ccdef5ab0fcd", + "check": "uninitialized-local", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ { - "type": "node", - "name": "_dsrWithdrawal(sharesAvailable,daiAvailable)", + "type": "variable", + "name": "i", "source_mapping": { - "start": 9583, - "length": 45, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 8364, + "length": 9, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [234], + "lines": [213], "starting_column": 9, - "ending_column": 54 + "ending_column": 18 }, "type_specific_fields": { "parent": { "type": "function", - "name": "withdrawAndRepayAll", + "name": "updateStrategyEnabledBorrowTokens", "source_mapping": { - "start": 9412, - "length": 465, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 8067, + "length": 898, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [232, 233, 234, 235, 236, 237, 238, 239, 240], + "lines": [ + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TreasuryReservesVault", "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2150, + "length": 32023, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306 + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, + 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, + 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, + 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, + 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, + 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, + 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, + 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, + 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, + 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, + 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, + 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, + 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, + 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, + 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, + 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, + 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, + 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, + 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, + 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, + 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, + 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, + 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, + 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, + 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, + 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, + 777, 778, 779 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "withdrawAndRepayAll()" + "signature": "updateStrategyEnabledBorrowTokens(address,IERC20[],IERC20[])" } } - }, - "additional_fields": { "underlying_type": "external_calls" } - }, + } + } + ], + "description": "TreasuryReservesVault.updateStrategyEnabledBorrowTokens(address,IERC20[],IERC20[]).i (contracts/v2/TreasuryReservesVault.sol#213) is a local variable never initialized\n", + "markdown": "[TreasuryReservesVault.updateStrategyEnabledBorrowTokens(address,IERC20[],IERC20[]).i](contracts/v2/TreasuryReservesVault.sol#L213) is a local variable never initialized\n", + "first_markdown_element": "contracts/v2/TreasuryReservesVault.sol#L213", + "id": "ccb61a70ed00f67ef5318dfebba8dd5906b02a2b7022418f095ca6131f2e87a0", + "check": "uninitialized-local", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ { - "type": "node", - "name": "pot.exit(sharesAmount)", + "type": "variable", + "name": "shutdownParams", "source_mapping": { - "start": 11597, - "length": 22, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 9302, + "length": 36, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, - "lines": [279], + "lines": [238], "starting_column": 9, - "ending_column": 31 + "ending_column": 45 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_dsrWithdrawal", + "name": "populateShutdownData", "source_mapping": { - "start": 11513, - "length": 199, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 9022, + "length": 564, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, - "lines": [278, 279, 280, 281, 282], + "lines": [ + 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "RamosStrategy", "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 1131, + "length": 9320, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306 + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_dsrWithdrawal(uint256,uint256)" + "signature": "populateShutdownData(bytes)" } } - }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } - }, + } + } + ], + "description": "RamosStrategy.populateShutdownData(bytes).shutdownParams (contracts/v2/strategies/RamosStrategy.sol#238) is a local variable never initialized\n", + "markdown": "[RamosStrategy.populateShutdownData(bytes).shutdownParams](contracts/v2/strategies/RamosStrategy.sol#L238) is a local variable never initialized\n", + "first_markdown_element": "contracts/v2/strategies/RamosStrategy.sol#L238", + "id": "e3b0c7352e8da48d32a58f5b6962b6132c525566519d363234f70e52d4760882", + "check": "uninitialized-local", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ { - "type": "node", - "name": "daiJoin.exit(address(this),daiAmount)", + "type": "function", + "name": "depositAndStake", "source_mapping": { - "start": 11629, - "length": 38, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2874, + "length": 351, + "filename_relative": "contracts/amo/AuraStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/AuraStaking.sol", + "filename_short": "contracts/amo/AuraStaking.sol", "is_dependency": false, - "lines": [280], - "starting_column": 9, - "ending_column": 47 + "lines": [79, 80, 81, 82, 83, 84, 85], + "starting_column": 5, + "ending_column": 6 }, "type_specific_fields": { "parent": { - "type": "function", - "name": "_dsrWithdrawal", + "type": "contract", + "name": "AuraStaking", "source_mapping": { - "start": 11513, - "length": 199, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 604, + "length": 5204, + "filename_relative": "contracts/amo/AuraStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/AuraStaking.sol", + "filename_short": "contracts/amo/AuraStaking.sol", "is_dependency": false, - "lines": [278, 279, 280, 281, 282], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "DsrBaseStrategy", - "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", - "is_dependency": false, - "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "_dsrWithdrawal(uint256,uint256)" + "lines": [ + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151 + ], + "starting_column": 1, + "ending_column": 0 } - } - }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + }, + "signature": "depositAndStake(uint256)" + } }, { "type": "node", - "name": "DaiWithdrawn(daiAmount)", + "name": "booster.deposit(auraPoolInfo.pId,amount,true)", "source_mapping": { - "start": 11677, - "length": 28, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 3161, + "length": 47, + "filename_relative": "contracts/amo/AuraStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/AuraStaking.sol", + "filename_short": "contracts/amo/AuraStaking.sol", "is_dependency": false, - "lines": [281], - "starting_column": 9, - "ending_column": 37 + "lines": [83], + "starting_column": 13, + "ending_column": 60 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_dsrWithdrawal", + "name": "depositAndStake", "source_mapping": { - "start": 11513, - "length": 199, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2874, + "length": 351, + "filename_relative": "contracts/amo/AuraStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/AuraStaking.sol", + "filename_short": "contracts/amo/AuraStaking.sol", "is_dependency": false, - "lines": [278, 279, 280, 281, 282], + "lines": [79, 80, 81, 82, 83, 84, 85], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "AuraStaking", "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 604, + "length": 5204, + "filename_relative": "contracts/amo/AuraStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/AuraStaking.sol", + "filename_short": "contracts/amo/AuraStaking.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306 + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_dsrWithdrawal(uint256,uint256)" + "signature": "depositAndStake(uint256)" } } - }, - "additional_fields": { "underlying_type": "event" } + } + } + ], + "description": "AuraStaking.depositAndStake(uint256) (contracts/amo/AuraStaking.sol#79-85) ignores return value by booster.deposit(auraPoolInfo.pId,amount,true) (contracts/amo/AuraStaking.sol#83)\n", + "markdown": "[AuraStaking.depositAndStake(uint256)](contracts/amo/AuraStaking.sol#L79-L85) ignores return value by [booster.deposit(auraPoolInfo.pId,amount,true)](contracts/amo/AuraStaking.sol#L83)\n", + "first_markdown_element": "contracts/amo/AuraStaking.sol#L79-L85", + "id": "df1bba2db758866958a0bd3d600869193c2a4c54635aeec3c0158683eb3c6bd1", + "check": "unused-return", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "withdrawAndUnwrap", + "source_mapping": { + "start": 3286, + "length": 634, + "filename_relative": "contracts/amo/AuraStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/AuraStaking.sol", + "filename_short": "contracts/amo/AuraStaking.sol", + "is_dependency": false, + "lines": [88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "AuraStaking", + "source_mapping": { + "start": 604, + "length": 5204, + "filename_relative": "contracts/amo/AuraStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/AuraStaking.sol", + "filename_short": "contracts/amo/AuraStaking.sol", + "is_dependency": false, + "lines": [ + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "withdrawAndUnwrap(uint256,bool,address)" + } }, { "type": "node", - "name": "_dsrWithdrawal(sharesAvailable,daiAvailable)", + "name": "IAuraBaseRewardPool(auraPoolInfo.rewards).withdrawAndUnwrap(toUnstake,claim)", "source_mapping": { - "start": 9583, - "length": 45, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 3680, + "length": 77, + "filename_relative": "contracts/amo/AuraStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/AuraStaking.sol", + "filename_short": "contracts/amo/AuraStaking.sol", "is_dependency": false, - "lines": [234], - "starting_column": 9, - "ending_column": 54 + "lines": [93], + "starting_column": 13, + "ending_column": 90 }, "type_specific_fields": { "parent": { "type": "function", - "name": "withdrawAndRepayAll", + "name": "withdrawAndUnwrap", "source_mapping": { - "start": 9412, - "length": 465, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 3286, + "length": 634, + "filename_relative": "contracts/amo/AuraStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/AuraStaking.sol", + "filename_short": "contracts/amo/AuraStaking.sol", "is_dependency": false, - "lines": [232, 233, 234, 235, 236, 237, 238, 239, 240], + "lines": [88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "AuraStaking", "source_mapping": { - "start": 1041, - "length": 11744, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 604, + "length": 5204, + "filename_relative": "contracts/amo/AuraStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/AuraStaking.sol", + "filename_short": "contracts/amo/AuraStaking.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306 + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "withdrawAndRepayAll()" + "signature": "withdrawAndUnwrap(uint256,bool,address)" } } - }, - "additional_fields": { "underlying_type": "event" } + } } ], - "description": "Reentrancy in DsrBaseStrategy.withdrawAndRepayAll() (contracts/v2/strategies/DsrBaseStrategy.sol#232-240):\n\tExternal calls:\n\t- (daiAvailable,sharesAvailable) = _checkpointDaiBalance() (contracts/v2/strategies/DsrBaseStrategy.sol#233)\n\t\t- chi = pot.drip() (contracts/v2/strategies/DsrBaseStrategy.sol#142)\n\t- _dsrWithdrawal(sharesAvailable,daiAvailable) (contracts/v2/strategies/DsrBaseStrategy.sol#234)\n\t\t- pot.exit(sharesAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#279)\n\t\t- daiJoin.exit(address(this),daiAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#280)\n\tEvent emitted after the call(s):\n\t- DaiWithdrawn(daiAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#281)\n\t\t- _dsrWithdrawal(sharesAvailable,daiAvailable) (contracts/v2/strategies/DsrBaseStrategy.sol#234)\n", - "markdown": "Reentrancy in [DsrBaseStrategy.withdrawAndRepayAll()](contracts/v2/strategies/DsrBaseStrategy.sol#L232-L240):\n\tExternal calls:\n\t- [(daiAvailable,sharesAvailable) = _checkpointDaiBalance()](contracts/v2/strategies/DsrBaseStrategy.sol#L233)\n\t\t- [chi = pot.drip()](contracts/v2/strategies/DsrBaseStrategy.sol#L142)\n\t- [_dsrWithdrawal(sharesAvailable,daiAvailable)](contracts/v2/strategies/DsrBaseStrategy.sol#L234)\n\t\t- [pot.exit(sharesAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L279)\n\t\t- [daiJoin.exit(address(this),daiAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L280)\n\tEvent emitted after the call(s):\n\t- [DaiWithdrawn(daiAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L281)\n\t\t- [_dsrWithdrawal(sharesAvailable,daiAvailable)](contracts/v2/strategies/DsrBaseStrategy.sol#L234)\n", - "first_markdown_element": "contracts/v2/strategies/DsrBaseStrategy.sol#L232-L240", - "id": "4ba8e3c4596e10b0920e312a0648a8fa3ef9456ad23cffc62074dc7f78916f68", - "check": "reentrancy-events", - "impact": "Low", + "description": "AuraStaking.withdrawAndUnwrap(uint256,bool,address) (contracts/amo/AuraStaking.sol#88-100) ignores return value by IAuraBaseRewardPool(auraPoolInfo.rewards).withdrawAndUnwrap(toUnstake,claim) (contracts/amo/AuraStaking.sol#93)\n", + "markdown": "[AuraStaking.withdrawAndUnwrap(uint256,bool,address)](contracts/amo/AuraStaking.sol#L88-L100) ignores return value by [IAuraBaseRewardPool(auraPoolInfo.rewards).withdrawAndUnwrap(toUnstake,claim)](contracts/amo/AuraStaking.sol#L93)\n", + "first_markdown_element": "contracts/amo/AuraStaking.sol#L88-L100", + "id": "a3f11c21d94cc0286397b0f4acf966b2e7b4421bbb8026550ce5beae49adbf78", + "check": "unused-return", + "impact": "Medium", "confidence": "Medium" }, { "elements": [ { "type": "function", - "name": "_initBaseCache", + "name": "getReward", "source_mapping": { - "start": 26049, - "length": 748, - "filename_relative": "contracts/v2/TempleDebtToken.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TempleDebtToken.sol", - "filename_short": "contracts/v2/TempleDebtToken.sol", + "start": 4291, + "length": 657, + "filename_relative": "contracts/amo/AuraStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/AuraStaking.sol", + "filename_short": "contracts/amo/AuraStaking.sol", "is_dependency": false, "lines": [ - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, - 610, 611, 612, 613, 614, 615, 616, 617 + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125 ], "starting_column": 5, "ending_column": 6 @@ -9480,108 +8811,61 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleDebtToken", + "name": "AuraStaking", "source_mapping": { - "start": 2202, - "length": 30641, - "filename_relative": "contracts/v2/TempleDebtToken.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TempleDebtToken.sol", - "filename_short": "contracts/v2/TempleDebtToken.sol", + "start": 604, + "length": 5204, + "filename_relative": "contracts/amo/AuraStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/AuraStaking.sol", + "filename_short": "contracts/amo/AuraStaking.sol", "is_dependency": false, "lines": [ - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, - 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, - 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, - 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, - 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, - 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, - 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, - 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, - 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, - 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, - 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, - 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, - 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, - 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, - 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, - 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, - 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, - 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, - 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, - 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, - 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, - 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, - 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, - 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, - 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, - 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, - 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, - 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, - 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, - 778, 779, 780, 781, 782 + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "_initBaseCache(TempleDebtToken.BaseCache)" + "signature": "getReward(bool)" } }, { "type": "node", - "name": "_timeElapsed > 0", + "name": "IAuraBaseRewardPool(auraPoolInfo.rewards).getReward(address(this),claimExtras)", "source_mapping": { - "start": 26435, - "length": 16, - "filename_relative": "contracts/v2/TempleDebtToken.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TempleDebtToken.sol", - "filename_short": "contracts/v2/TempleDebtToken.sol", + "start": 4356, + "length": 79, + "filename_relative": "contracts/amo/AuraStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/AuraStaking.sol", + "filename_short": "contracts/amo/AuraStaking.sol", "is_dependency": false, - "lines": [607], - "starting_column": 13, - "ending_column": 29 + "lines": [111], + "starting_column": 9, + "ending_column": 88 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_initBaseCache", + "name": "getReward", "source_mapping": { - "start": 26049, - "length": 748, - "filename_relative": "contracts/v2/TempleDebtToken.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TempleDebtToken.sol", - "filename_short": "contracts/v2/TempleDebtToken.sol", + "start": 4291, + "length": 657, + "filename_relative": "contracts/amo/AuraStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/AuraStaking.sol", + "filename_short": "contracts/amo/AuraStaking.sol", "is_dependency": false, "lines": [ - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, - 610, 611, 612, 613, 614, 615, 616, 617 + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125 ], "starting_column": 5, "ending_column": 6 @@ -9589,337 +8873,222 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleDebtToken", + "name": "AuraStaking", "source_mapping": { - "start": 2202, - "length": 30641, - "filename_relative": "contracts/v2/TempleDebtToken.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TempleDebtToken.sol", - "filename_short": "contracts/v2/TempleDebtToken.sol", + "start": 604, + "length": 5204, + "filename_relative": "contracts/amo/AuraStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/AuraStaking.sol", + "filename_short": "contracts/amo/AuraStaking.sol", "is_dependency": false, "lines": [ - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, - 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, - 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, - 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, - 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, - 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, - 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, - 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, - 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, - 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, - 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, - 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, - 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, - 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, - 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, - 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, - 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, - 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, - 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, - 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, - 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, - 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, - 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, - 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, - 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, - 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, - 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, - 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, - 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, - 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, - 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, - 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, - 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, - 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, - 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, - 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, - 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, - 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, - 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782 + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "_initBaseCache(TempleDebtToken.BaseCache)" + "signature": "getReward(bool)" } } } } ], - "description": "TempleDebtToken._initBaseCache(TempleDebtToken.BaseCache) (contracts/v2/TempleDebtToken.sol#597-617) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- _timeElapsed > 0 (contracts/v2/TempleDebtToken.sol#607)\n", - "markdown": "[TempleDebtToken._initBaseCache(TempleDebtToken.BaseCache)](contracts/v2/TempleDebtToken.sol#L597-L617) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [_timeElapsed > 0](contracts/v2/TempleDebtToken.sol#L607)\n", - "first_markdown_element": "contracts/v2/TempleDebtToken.sol#L597-L617", - "id": "31468fb88b544bfa40953f9c670145ae2d6cc30a857f141027542b78efe5314e", - "check": "timestamp", - "impact": "Low", + "description": "AuraStaking.getReward(bool) (contracts/amo/AuraStaking.sol#110-125) ignores return value by IAuraBaseRewardPool(auraPoolInfo.rewards).getReward(address(this),claimExtras) (contracts/amo/AuraStaking.sol#111)\n", + "markdown": "[AuraStaking.getReward(bool)](contracts/amo/AuraStaking.sol#L110-L125) ignores return value by [IAuraBaseRewardPool(auraPoolInfo.rewards).getReward(address(this),claimExtras)](contracts/amo/AuraStaking.sol#L111)\n", + "first_markdown_element": "contracts/amo/AuraStaking.sol#L110-L125", + "id": "334cc08346f4acb06b750e6d7ca0bbba6ed0f1443127882a8bce2dba76eedff5", + "check": "unused-return", + "impact": "Medium", "confidence": "Medium" }, { "elements": [ { "type": "function", - "name": "_initDebtorCache", + "name": "getBalances", "source_mapping": { - "start": 28507, - "length": 2281, - "filename_relative": "contracts/v2/TempleDebtToken.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TempleDebtToken.sol", - "filename_short": "contracts/v2/TempleDebtToken.sol", + "start": 2079, + "length": 154, + "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", "is_dependency": false, - "lines": [ - 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, - 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, - 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, - 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, - 724, 725, 726, 727 - ], + "lines": [55, 56, 57], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleDebtToken", + "name": "BalancerPoolHelper", "source_mapping": { - "start": 2202, - "length": 30641, - "filename_relative": "contracts/v2/TempleDebtToken.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TempleDebtToken.sol", - "filename_short": "contracts/v2/TempleDebtToken.sol", + "start": 739, + "length": 19014, + "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", "is_dependency": false, "lines": [ - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, - 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, - 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, - 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, - 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, - 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, - 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, - 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, - 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, - 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, - 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, - 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, - 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, - 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, - 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, - 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, - 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, - 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, - 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, - 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, - 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, - 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, - 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, - 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, - 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, - 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, - 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, - 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, - 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, - 778, 779, 780, 781, 782 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, + 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, + 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, + 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, + 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, + 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "_initDebtorCache(TempleDebtToken.BaseCache,ITempleDebtToken.Debtor,TempleDebtToken.DebtorCache,bool)" + "signature": "getBalances()" } }, { "type": "node", - "name": "_timeElapsed > 0", + "name": "(None,balances,None) = balancerVault.getPoolTokens(balancerPoolId)", "source_mapping": { - "start": 29667, - "length": 16, - "filename_relative": "contracts/v2/TempleDebtToken.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TempleDebtToken.sol", - "filename_short": "contracts/v2/TempleDebtToken.sol", + "start": 2167, + "length": 59, + "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", "is_dependency": false, - "lines": [703], - "starting_column": 13, - "ending_column": 29 + "lines": [56], + "starting_column": 7, + "ending_column": 66 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_initDebtorCache", + "name": "getBalances", "source_mapping": { - "start": 28507, - "length": 2281, - "filename_relative": "contracts/v2/TempleDebtToken.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TempleDebtToken.sol", - "filename_short": "contracts/v2/TempleDebtToken.sol", - "is_dependency": false, - "lines": [ - 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, - 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, - 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, - 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, - 724, 725, 726, 727 - ], + "start": 2079, + "length": 154, + "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", + "is_dependency": false, + "lines": [55, 56, 57], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleDebtToken", + "name": "BalancerPoolHelper", "source_mapping": { - "start": 2202, - "length": 30641, - "filename_relative": "contracts/v2/TempleDebtToken.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/TempleDebtToken.sol", - "filename_short": "contracts/v2/TempleDebtToken.sol", + "start": 739, + "length": 19014, + "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", "is_dependency": false, "lines": [ - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, - 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, - 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, - 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, - 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, - 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, - 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, - 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, - 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, - 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, - 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, - 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, - 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, - 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, - 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, - 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, - 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, - 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, - 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, - 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, - 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, - 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, - 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, - 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, - 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, - 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, - 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, - 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, - 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, - 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, - 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, - 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, - 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, - 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, - 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, - 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, - 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, - 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, - 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, + 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, + 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "_initDebtorCache(TempleDebtToken.BaseCache,ITempleDebtToken.Debtor,TempleDebtToken.DebtorCache,bool)" + "signature": "getBalances()" } } } } ], - "description": "TempleDebtToken._initDebtorCache(TempleDebtToken.BaseCache,ITempleDebtToken.Debtor,TempleDebtToken.DebtorCache,bool) (contracts/v2/TempleDebtToken.sol#672-727) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- _timeElapsed > 0 (contracts/v2/TempleDebtToken.sol#703)\n", - "markdown": "[TempleDebtToken._initDebtorCache(TempleDebtToken.BaseCache,ITempleDebtToken.Debtor,TempleDebtToken.DebtorCache,bool)](contracts/v2/TempleDebtToken.sol#L672-L727) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [_timeElapsed > 0](contracts/v2/TempleDebtToken.sol#L703)\n", - "first_markdown_element": "contracts/v2/TempleDebtToken.sol#L672-L727", - "id": "a6d589cd4caf5ac6f228dd6218ef29c77e92ed66db618140855c2644b3b2cb10", - "check": "timestamp", - "impact": "Low", + "description": "BalancerPoolHelper.getBalances() (contracts/amo/helpers/BalancerPoolHelper.sol#55-57) ignores return value by (None,balances,None) = balancerVault.getPoolTokens(balancerPoolId) (contracts/amo/helpers/BalancerPoolHelper.sol#56)\n", + "markdown": "[BalancerPoolHelper.getBalances()](contracts/amo/helpers/BalancerPoolHelper.sol#L55-L57) ignores return value by [(None,balances,None) = balancerVault.getPoolTokens(balancerPoolId)](contracts/amo/helpers/BalancerPoolHelper.sol#L56)\n", + "first_markdown_element": "contracts/amo/helpers/BalancerPoolHelper.sol#L55-L57", + "id": "97630a6a935fd6fa31a1e214fdb8582cf37cbb5ba228037742cc7ccc77486019", + "check": "unused-return", + "impact": "Medium", "confidence": "Medium" }, { "elements": [ { "type": "function", - "name": "_initDebtTokenCache", + "name": "proportionalAddLiquidityQuote", "source_mapping": { - "start": 24259, - "length": 1450, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 15567, + "length": 1930, + "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", "is_dependency": false, "lines": [ - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, - 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658 + 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, + 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380 ], "starting_column": 5, "ending_column": 6 @@ -9927,118 +9096,83 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "BalancerPoolHelper", "source_mapping": { - "start": 1433, - "length": 31753, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 739, + "length": 19014, + "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, - 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, - 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, - 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, - 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, - 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, - 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, - 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, - 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, - 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, - 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, - 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, - 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, - 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, - 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, - 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, - 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, - 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, - 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, - 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, - 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, - 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, - 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, - 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, - 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, - 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, - 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, - 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, - 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, - 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, - 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, - 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, - 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, + 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, + 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, + 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, + 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, + 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_initDebtTokenCache(TempleLineOfCredit.DebtTokenCache)" + "signature": "proportionalAddLiquidityQuote(uint256,uint256)" } }, { "type": "node", - "name": "_timeElapsed > 0", + "name": "(expectedBptAmount,None) = balancerHelpers.queryJoin(balancerPoolId,amo,amo,requestData)", "source_mapping": { - "start": 25121, - "length": 16, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 17103, + "length": 88, + "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", "is_dependency": false, - "lines": [641], - "starting_column": 13, - "ending_column": 29 + "lines": [374], + "starting_column": 9, + "ending_column": 97 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_initDebtTokenCache", + "name": "proportionalAddLiquidityQuote", "source_mapping": { - "start": 24259, - "length": 1450, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 15567, + "length": 1930, + "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", "is_dependency": false, "lines": [ - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, - 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, - 658 + 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, + 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380 ], "starting_column": 5, "ending_column": 6 @@ -10046,456 +9180,450 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "BalancerPoolHelper", "source_mapping": { - "start": 1433, - "length": 31753, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 739, + "length": 19014, + "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, - 883, 884, 885 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, + 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, + 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_initDebtTokenCache(TempleLineOfCredit.DebtTokenCache)" + "signature": "proportionalAddLiquidityQuote(uint256,uint256)" } } } } ], - "description": "TempleLineOfCredit._initDebtTokenCache(TempleLineOfCredit.DebtTokenCache) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#619-658) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- _timeElapsed > 0 (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#641)\n", - "markdown": "[TempleLineOfCredit._initDebtTokenCache(TempleLineOfCredit.DebtTokenCache)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L619-L658) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [_timeElapsed > 0](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L641)\n", - "first_markdown_element": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L619-L658", - "id": "1d9fb732d9369c4da234795950c435996e1f5d0b0c4fd71e2ad0007ec6f7558b", - "check": "timestamp", - "impact": "Low", + "description": "BalancerPoolHelper.proportionalAddLiquidityQuote(uint256,uint256) (contracts/amo/helpers/BalancerPoolHelper.sol#348-380) ignores return value by (expectedBptAmount,None) = balancerHelpers.queryJoin(balancerPoolId,amo,amo,requestData) (contracts/amo/helpers/BalancerPoolHelper.sol#374)\n", + "markdown": "[BalancerPoolHelper.proportionalAddLiquidityQuote(uint256,uint256)](contracts/amo/helpers/BalancerPoolHelper.sol#L348-L380) ignores return value by [(expectedBptAmount,None) = balancerHelpers.queryJoin(balancerPoolId,amo,amo,requestData)](contracts/amo/helpers/BalancerPoolHelper.sol#L374)\n", + "first_markdown_element": "contracts/amo/helpers/BalancerPoolHelper.sol#L348-L380", + "id": "44982b3b03e18740f01aed72e03f5657be31a18422cec5c4f5a8d53b084f8256", + "check": "unused-return", + "impact": "Medium", "confidence": "Medium" }, - { - "elements": [ - { - "type": "pragma", - "name": "0.8.19", - "source_mapping": { - "start": 0, - "length": 23, - "filename_relative": "contracts/core/OtcOffer.sol", - "filename_absolute": "/Users/frontier/git/temple-2/protocol/contracts/core/OtcOffer.sol", - "filename_short": "contracts/core/OtcOffer.sol", - "is_dependency": false, - "lines": [1], - "starting_column": 1, - "ending_column": 24 - }, - "type_specific_fields": { "directive": ["solidity", "0.8", ".19"] } - } - ], - "description": "Pragma version0.8.19 (contracts/core/OtcOffer.sol#1) necessitates a version too recent to be trusted. Consider deploying with 0.8.18.\n", - "markdown": "Pragma version[0.8.19](contracts/core/OtcOffer.sol#L1) necessitates a version too recent to be trusted. Consider deploying with 0.8.18.\n", - "first_markdown_element": "contracts/core/OtcOffer.sol#L1", - "id": "2940a3848f7667cc3706f80c2537856ed07e8563cbff86311c852b3f61815e74", - "check": "solc-version", - "impact": "Informational", - "confidence": "High" - }, { "elements": [ { "type": "function", - "name": "_update", + "name": "proportionalRemoveLiquidityQuote", "source_mapping": { - "start": 3107, - "length": 847, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 17648, + "length": 1775, + "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", "is_dependency": false, - "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], + "lines": [ + 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, + 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "BalancerPoolHelper", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 739, + "length": 19014, + "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "_update(uint256,uint256,uint112,uint112)" - } - }, - { - "type": "node", - "name": "blockTimestamp = uint32(block.timestamp % 2 ** 32)", - "source_mapping": { - "start": 3302, - "length": 55, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", - "is_dependency": false, - "lines": [82], - "starting_column": 9, - "ending_column": 64 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "_update", - "source_mapping": { - "start": 3107, - "length": 847, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, + 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, + 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, + 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, + 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, + 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "proportionalRemoveLiquidityQuote(uint256,uint256)" + } + }, + { + "type": "node", + "name": "(None,requestData.minAmountsOut) = balancerHelpers.queryExit(balancerPoolId,amo,amo,requestData)", + "source_mapping": { + "start": 18569, + "length": 96, + "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", + "is_dependency": false, + "lines": [405], + "starting_column": 9, + "ending_column": 105 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "proportionalRemoveLiquidityQuote", + "source_mapping": { + "start": 17648, + "length": 1775, + "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", "is_dependency": false, - "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], + "lines": [ + 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, + 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "BalancerPoolHelper", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 739, + "length": 19014, + "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, + 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, + 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_update(uint256,uint256,uint112,uint112)" + "signature": "proportionalRemoveLiquidityQuote(uint256,uint256)" } } } } ], - "description": "TempleUniswapV2Pair._update(uint256,uint256,uint112,uint112) (contracts/amm/TempleUniswapV2Pair.sol#80-93) uses a weak PRNG: \"blockTimestamp = uint32(block.timestamp % 2 ** 32) (contracts/amm/TempleUniswapV2Pair.sol#82)\" \n", - "markdown": "[TempleUniswapV2Pair._update(uint256,uint256,uint112,uint112)](contracts/amm/TempleUniswapV2Pair.sol#L80-L93) uses a weak PRNG: \"[blockTimestamp = uint32(block.timestamp % 2 ** 32)](contracts/amm/TempleUniswapV2Pair.sol#L82)\" \n", - "first_markdown_element": "contracts/amm/TempleUniswapV2Pair.sol#L80-L93", - "id": "290357789cffd43bf264062cb5a528e9a368f77182c65ce7dcfbd4feb9020833", - "check": "weak-prng", - "impact": "High", + "description": "BalancerPoolHelper.proportionalRemoveLiquidityQuote(uint256,uint256) (contracts/amo/helpers/BalancerPoolHelper.sol#384-416) ignores return value by (None,requestData.minAmountsOut) = balancerHelpers.queryExit(balancerPoolId,amo,amo,requestData) (contracts/amo/helpers/BalancerPoolHelper.sol#405)\n", + "markdown": "[BalancerPoolHelper.proportionalRemoveLiquidityQuote(uint256,uint256)](contracts/amo/helpers/BalancerPoolHelper.sol#L384-L416) ignores return value by [(None,requestData.minAmountsOut) = balancerHelpers.queryExit(balancerPoolId,amo,amo,requestData)](contracts/amo/helpers/BalancerPoolHelper.sol#L405)\n", + "first_markdown_element": "contracts/amo/helpers/BalancerPoolHelper.sol#L384-L416", + "id": "08b9be6d43268a91c87113facf1f93ba28159d15047c9ef6e2a5e42a2a791c97", + "check": "unused-return", + "impact": "Medium", "confidence": "Medium" }, { "elements": [ { - "type": "variable", - "name": "nonces", + "type": "function", + "name": "setEnclaveName", "source_mapping": { - "start": 1578, - "length": 50, - "filename_relative": "contracts/governance/ElderElection.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/governance/ElderElection.sol", - "filename_short": "contracts/governance/ElderElection.sol", + "start": 1581, + "length": 356, + "filename_relative": "contracts/nexus/NexusCommon.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/NexusCommon.sol", + "filename_short": "contracts/nexus/NexusCommon.sol", "is_dependency": false, - "lines": [45], + "lines": [43, 44, 45, 46, 47, 48, 49], "starting_column": 5, - "ending_column": 55 + "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "ElderElection", + "name": "NexusCommon", "source_mapping": { - "start": 908, - "length": 5057, - "filename_relative": "contracts/governance/ElderElection.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/governance/ElderElection.sol", - "filename_short": "contracts/governance/ElderElection.sol", + "start": 461, + "length": 3080, + "filename_relative": "contracts/nexus/NexusCommon.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/NexusCommon.sol", + "filename_short": "contracts/nexus/NexusCommon.sol", "is_dependency": false, "lines": [ - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184 + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } - } + }, + "signature": "setEnclaveName(uint256,string)" } }, { - "type": "function", - "name": "_useNonce", + "type": "node", + "name": "enclaveIds.add(id)", "source_mapping": { - "start": 4540, - "length": 196, - "filename_relative": "contracts/governance/ElderElection.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/governance/ElderElection.sol", - "filename_short": "contracts/governance/ElderElection.sol", + "start": 1873, + "length": 18, + "filename_relative": "contracts/nexus/NexusCommon.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/NexusCommon.sol", + "filename_short": "contracts/nexus/NexusCommon.sol", "is_dependency": false, - "lines": [138, 139, 140, 141, 142], - "starting_column": 5, - "ending_column": 6 + "lines": [47], + "starting_column": 9, + "ending_column": 27 }, "type_specific_fields": { "parent": { - "type": "contract", - "name": "ElderElection", + "type": "function", + "name": "setEnclaveName", "source_mapping": { - "start": 908, - "length": 5057, - "filename_relative": "contracts/governance/ElderElection.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/governance/ElderElection.sol", - "filename_short": "contracts/governance/ElderElection.sol", + "start": 1581, + "length": 356, + "filename_relative": "contracts/nexus/NexusCommon.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/NexusCommon.sol", + "filename_short": "contracts/nexus/NexusCommon.sol", "is_dependency": false, - "lines": [ - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184 - ], - "starting_column": 1, - "ending_column": 2 + "lines": [43, 44, 45, 46, 47, 48, 49], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "NexusCommon", + "source_mapping": { + "start": 461, + "length": 3080, + "filename_relative": "contracts/nexus/NexusCommon.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/NexusCommon.sol", + "filename_short": "contracts/nexus/NexusCommon.sol", + "is_dependency": false, + "lines": [ + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "setEnclaveName(uint256,string)" } - }, - "signature": "_useNonce(address)" + } } } ], - "description": "ElderElection.nonces (contracts/governance/ElderElection.sol#45) is never initialized. It is used in:\n\t- ElderElection._useNonce(address) (contracts/governance/ElderElection.sol#138-142)\n", - "markdown": "[ElderElection.nonces](contracts/governance/ElderElection.sol#L45) is never initialized. It is used in:\n\t- [ElderElection._useNonce(address)](contracts/governance/ElderElection.sol#L138-L142)\n", - "first_markdown_element": "contracts/governance/ElderElection.sol#L45", - "id": "a16c4c3a7455ad8f717c8aaf616d23de5d06be103f191c78e6dc3fdbb5eff5e8", - "check": "uninitialized-state", - "impact": "High", - "confidence": "High" + "description": "NexusCommon.setEnclaveName(uint256,string) (contracts/nexus/NexusCommon.sol#43-49) ignores return value by enclaveIds.add(id) (contracts/nexus/NexusCommon.sol#47)\n", + "markdown": "[NexusCommon.setEnclaveName(uint256,string)](contracts/nexus/NexusCommon.sol#L43-L49) ignores return value by [enclaveIds.add(id)](contracts/nexus/NexusCommon.sol#L47)\n", + "first_markdown_element": "contracts/nexus/NexusCommon.sol#L43-L49", + "id": "a3423f7baf255c33e565754c2bcee80f78d6bd6637fbf4bb582f78b91edc4b75", + "check": "unused-return", + "impact": "Medium", + "confidence": "Medium" }, { "elements": [ { "type": "function", - "name": "calc", + "name": "setShardEnclave", "source_mapping": { - "start": 836, - "length": 613, - "filename_relative": "contracts/core/JoiningFee.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/JoiningFee.sol", - "filename_short": "contracts/core/JoiningFee.sol", + "start": 2057, + "length": 722, + "filename_relative": "contracts/nexus/NexusCommon.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/NexusCommon.sol", + "filename_short": "contracts/nexus/NexusCommon.sol", "is_dependency": false, - "lines": [26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39], + "lines": [56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "JoiningFee", + "name": "NexusCommon", "source_mapping": { "start": 461, - "length": 1345, - "filename_relative": "contracts/core/JoiningFee.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/JoiningFee.sol", - "filename_short": "contracts/core/JoiningFee.sol", + "length": 3080, + "filename_relative": "contracts/nexus/NexusCommon.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/NexusCommon.sol", + "filename_short": "contracts/nexus/NexusCommon.sol", "is_dependency": false, "lines": [ - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53 + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "calc(uint256,uint256,address)" + "signature": "setShardEnclave(uint256,uint256)" } }, { "type": "node", - "name": "(block.timestamp - (numCycles * periodDuration) - firstPeriodStartTimestamp) / 3600 * feePerHour", + "name": "enclaveToShards[oldEnclaveId].remove(shardId)", "source_mapping": { - "start": 1339, - "length": 103, - "filename_relative": "contracts/core/JoiningFee.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/JoiningFee.sol", - "filename_short": "contracts/core/JoiningFee.sol", + "start": 2548, + "length": 45, + "filename_relative": "contracts/nexus/NexusCommon.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/NexusCommon.sol", + "filename_short": "contracts/nexus/NexusCommon.sol", "is_dependency": false, - "lines": [38], + "lines": [62], "starting_column": 9, - "ending_column": 112 + "ending_column": 54 }, "type_specific_fields": { "parent": { "type": "function", - "name": "calc", + "name": "setShardEnclave", "source_mapping": { - "start": 836, - "length": 613, - "filename_relative": "contracts/core/JoiningFee.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/JoiningFee.sol", - "filename_short": "contracts/core/JoiningFee.sol", + "start": 2057, + "length": 722, + "filename_relative": "contracts/nexus/NexusCommon.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/NexusCommon.sol", + "filename_short": "contracts/nexus/NexusCommon.sol", "is_dependency": false, - "lines": [26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39], + "lines": [56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "JoiningFee", + "name": "NexusCommon", "source_mapping": { "start": 461, - "length": 1345, - "filename_relative": "contracts/core/JoiningFee.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/JoiningFee.sol", - "filename_short": "contracts/core/JoiningFee.sol", + "length": 3080, + "filename_relative": "contracts/nexus/NexusCommon.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/NexusCommon.sol", + "filename_short": "contracts/nexus/NexusCommon.sol", "is_dependency": false, "lines": [ - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53 + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "calc(uint256,uint256,address)" + "signature": "setShardEnclave(uint256,uint256)" } } } } ], - "description": "JoiningFee.calc(uint256,uint256,address) (contracts/core/JoiningFee.sol#26-39) performs a multiplication on the result of a division:\n\t- (block.timestamp - (numCycles * periodDuration) - firstPeriodStartTimestamp) / 3600 * feePerHour (contracts/core/JoiningFee.sol#38)\n", - "markdown": "[JoiningFee.calc(uint256,uint256,address)](contracts/core/JoiningFee.sol#L26-L39) performs a multiplication on the result of a division:\n\t- [(block.timestamp - (numCycles * periodDuration) - firstPeriodStartTimestamp) / 3600 * feePerHour](contracts/core/JoiningFee.sol#L38)\n", - "first_markdown_element": "contracts/core/JoiningFee.sol#L26-L39", - "id": "c0d4beb09bbb97e4ec3e7a9e3bd4fc713e216c086a2436671c0e4fdbaa26965b", - "check": "divide-before-multiply", + "description": "NexusCommon.setShardEnclave(uint256,uint256) (contracts/nexus/NexusCommon.sol#56-68) ignores return value by enclaveToShards[oldEnclaveId].remove(shardId) (contracts/nexus/NexusCommon.sol#62)\n", + "markdown": "[NexusCommon.setShardEnclave(uint256,uint256)](contracts/nexus/NexusCommon.sol#L56-L68) ignores return value by [enclaveToShards[oldEnclaveId].remove(shardId)](contracts/nexus/NexusCommon.sol#L62)\n", + "first_markdown_element": "contracts/nexus/NexusCommon.sol#L56-L68", + "id": "2606fbe65b9b9855173ee819f5af4ee55b8ac5e7a39aaae707e3d3dcbed66d5c", + "check": "unused-return", "impact": "Medium", "confidence": "Medium" }, @@ -10503,193 +9631,107 @@ "elements": [ { "type": "function", - "name": "inEnterExitWindow", + "name": "setShardEnclave", "source_mapping": { - "start": 5359, - "length": 569, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 2057, + "length": 722, + "filename_relative": "contracts/nexus/NexusCommon.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/NexusCommon.sol", + "filename_short": "contracts/nexus/NexusCommon.sol", "is_dependency": false, - "lines": [140, 141, 142, 143, 144, 145, 146, 147, 148], + "lines": [56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "Vault", + "name": "NexusCommon", "source_mapping": { - "start": 1161, - "length": 7823, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 461, + "length": 3080, + "filename_relative": "contracts/nexus/NexusCommon.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/NexusCommon.sol", + "filename_short": "contracts/nexus/NexusCommon.sol", "is_dependency": false, "lines": [ - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233 + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "inEnterExitWindow()" - } - }, - { - "type": "node", - "name": "cycleNumber = (block.timestamp - firstPeriodStartTimestamp) / periodDuration", - "source_mapping": { - "start": 5697, - "length": 76, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", - "is_dependency": false, - "lines": [146], - "starting_column": 9, - "ending_column": 85 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "inEnterExitWindow", - "source_mapping": { - "start": 5359, - "length": 569, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", - "is_dependency": false, - "lines": [140, 141, 142, 143, 144, 145, 146, 147, 148], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "Vault", - "source_mapping": { - "start": 1161, - "length": 7823, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", - "is_dependency": false, - "lines": [ - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "inEnterExitWindow()" - } - } + "signature": "setShardEnclave(uint256,uint256)" } }, { "type": "node", - "name": "inWindow = cycleNumber * periodDuration + firstPeriodStartTimestamp + enterExitWindowDuration + ENTER_EXIT_WINDOW_BUFFER > block.timestamp", + "name": "enclaveToShards[enclaveId].add(shardId)", "source_mapping": { - "start": 5783, - "length": 138, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 2638, + "length": 39, + "filename_relative": "contracts/nexus/NexusCommon.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/NexusCommon.sol", + "filename_short": "contracts/nexus/NexusCommon.sol", "is_dependency": false, - "lines": [147], + "lines": [65], "starting_column": 9, - "ending_column": 147 + "ending_column": 48 }, "type_specific_fields": { "parent": { "type": "function", - "name": "inEnterExitWindow", + "name": "setShardEnclave", "source_mapping": { - "start": 5359, - "length": 569, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 2057, + "length": 722, + "filename_relative": "contracts/nexus/NexusCommon.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/NexusCommon.sol", + "filename_short": "contracts/nexus/NexusCommon.sol", "is_dependency": false, - "lines": [140, 141, 142, 143, 144, 145, 146, 147, 148], + "lines": [56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "Vault", + "name": "NexusCommon", "source_mapping": { - "start": 1161, - "length": 7823, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 461, + "length": 3080, + "filename_relative": "contracts/nexus/NexusCommon.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/NexusCommon.sol", + "filename_short": "contracts/nexus/NexusCommon.sol", "is_dependency": false, "lines": [ - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233 + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "inEnterExitWindow()" + "signature": "setShardEnclave(uint256,uint256)" } } } } ], - "description": "Vault.inEnterExitWindow() (contracts/core/Vault.sol#140-148) performs a multiplication on the result of a division:\n\t- cycleNumber = (block.timestamp - firstPeriodStartTimestamp) / periodDuration (contracts/core/Vault.sol#146)\n\t- inWindow = cycleNumber * periodDuration + firstPeriodStartTimestamp + enterExitWindowDuration + ENTER_EXIT_WINDOW_BUFFER > block.timestamp (contracts/core/Vault.sol#147)\n", - "markdown": "[Vault.inEnterExitWindow()](contracts/core/Vault.sol#L140-L148) performs a multiplication on the result of a division:\n\t- [cycleNumber = (block.timestamp - firstPeriodStartTimestamp) / periodDuration](contracts/core/Vault.sol#L146)\n\t- [inWindow = cycleNumber * periodDuration + firstPeriodStartTimestamp + enterExitWindowDuration + ENTER_EXIT_WINDOW_BUFFER > block.timestamp](contracts/core/Vault.sol#L147)\n", - "first_markdown_element": "contracts/core/Vault.sol#L140-L148", - "id": "3aabd4762a2fde5d3ca708a653713c64a4f9b65daaecb672955c03acd76d5927", - "check": "divide-before-multiply", + "description": "NexusCommon.setShardEnclave(uint256,uint256) (contracts/nexus/NexusCommon.sol#56-68) ignores return value by enclaveToShards[enclaveId].add(shardId) (contracts/nexus/NexusCommon.sol#65)\n", + "markdown": "[NexusCommon.setShardEnclave(uint256,uint256)](contracts/nexus/NexusCommon.sol#L56-L68) ignores return value by [enclaveToShards[enclaveId].add(shardId)](contracts/nexus/NexusCommon.sol#L65)\n", + "first_markdown_element": "contracts/nexus/NexusCommon.sol#L56-L68", + "id": "49bee44daceda70afe899488639a6d7774845de05b8597e1b727e0d035dbbe23", + "check": "unused-return", "impact": "Medium", "confidence": "Medium" }, @@ -10697,140 +9739,219 @@ "elements": [ { "type": "function", - "name": "_safeTransfer", + "name": "setRelicMinterEnclaveIds", "source_mapping": { - "start": 1892, - "length": 284, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 5403, + "length": 889, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, - "lines": [49, 50, 51, 52], + "lines": [ + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "Relic", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1674, + "length": 24655, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185 + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, + 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, + 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, + 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, + 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, + 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, + 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, + 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, + 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, + 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, + 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, + 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, + 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, + 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, + 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, + 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, + 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, + 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, + 652, 653, 654, 655 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_safeTransfer(address,address,uint256)" + "signature": "setRelicMinterEnclaveIds(address,uint256[],bool[])" } }, { "type": "node", - "name": "require(bool,string)(success && (data.length == 0 || abi.decode(data,(bool))),UniswapV2: TRANSFER_FAILED)", + "name": "minterEnclaveIds.add(enclaveId)", "source_mapping": { - "start": 2073, - "length": 96, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 6030, + "length": 31, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, - "lines": [51], - "starting_column": 9, - "ending_column": 105 + "lines": [137], + "starting_column": 17, + "ending_column": 48 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_safeTransfer", + "name": "setRelicMinterEnclaveIds", "source_mapping": { - "start": 1892, - "length": 284, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 5403, + "length": 889, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, - "lines": [49, 50, 51, 52], + "lines": [ + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "Relic", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1674, + "length": 24655, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "_safeTransfer(address,address,uint256)" - } - } - } - } - ], - "description": "TempleUniswapV2Pair._safeTransfer(address,address,uint256) (contracts/amm/TempleUniswapV2Pair.sol#49-52) uses a dangerous strict equality:\n\t- require(bool,string)(success && (data.length == 0 || abi.decode(data,(bool))),UniswapV2: TRANSFER_FAILED) (contracts/amm/TempleUniswapV2Pair.sol#51)\n", - "markdown": "[TempleUniswapV2Pair._safeTransfer(address,address,uint256)](contracts/amm/TempleUniswapV2Pair.sol#L49-L52) uses a dangerous strict equality:\n\t- [require(bool,string)(success && (data.length == 0 || abi.decode(data,(bool))),UniswapV2: TRANSFER_FAILED)](contracts/amm/TempleUniswapV2Pair.sol#L51)\n", - "first_markdown_element": "contracts/amm/TempleUniswapV2Pair.sol#L49-L52", - "id": "2ee4045d0f377d6f8b394394680249a386668a22c42975e90902df9d8fa3b850", - "check": "incorrect-equality", + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, + 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, + 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, + 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, + 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, + 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, + 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, + 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, + 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, + 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, + 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, + 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, + 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, + 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, + 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, + 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, + 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, + 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, + 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, + 654, 655 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "setRelicMinterEnclaveIds(address,uint256[],bool[])" + } + } + } + } + ], + "description": "Relic.setRelicMinterEnclaveIds(address,uint256[],bool[]) (contracts/nexus/Relic.sol#126-146) ignores return value by minterEnclaveIds.add(enclaveId) (contracts/nexus/Relic.sol#137)\n", + "markdown": "[Relic.setRelicMinterEnclaveIds(address,uint256[],bool[])](contracts/nexus/Relic.sol#L126-L146) ignores return value by [minterEnclaveIds.add(enclaveId)](contracts/nexus/Relic.sol#L137)\n", + "first_markdown_element": "contracts/nexus/Relic.sol#L126-L146", + "id": "8e4ae0223ecef5b025f9cd16db5fe026de6c2b5d49aa1536266effebeaa4850d", + "check": "unused-return", "impact": "Medium", - "confidence": "High" + "confidence": "Medium" }, { "elements": [ { "type": "function", - "name": "mint", + "name": "setRelicMinterEnclaveIds", "source_mapping": { - "start": 4063, - "length": 1069, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 5403, + "length": 889, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, "lines": [ - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115 + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146 ], "starting_column": 5, "ending_column": 6 @@ -10838,64 +9959,99 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "Relic", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1674, + "length": 24655, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185 + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, + 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, + 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, + 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, + 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, + 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, + 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, + 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, + 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, + 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, + 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, + 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, + 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, + 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, + 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, + 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, + 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, + 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, + 652, 653, 654, 655 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "mint(address)" + "signature": "setRelicMinterEnclaveIds(address,uint256[],bool[])" } }, { "type": "node", - "name": "_totalSupply == 0", + "name": "minterEnclaveIds.remove(enclaveId)", "source_mapping": { - "start": 4568, - "length": 17, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 6100, + "length": 34, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, - "lines": [104], - "starting_column": 13, - "ending_column": 30 + "lines": [139], + "starting_column": 17, + "ending_column": 51 }, "type_specific_fields": { "parent": { "type": "function", - "name": "mint", + "name": "setRelicMinterEnclaveIds", "source_mapping": { - "start": 4063, - "length": 1069, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 5403, + "length": 889, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, "lines": [ - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115 + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146 ], "starting_column": 5, "ending_column": 6 @@ -10903,62 +10059,101 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "Relic", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1674, + "length": 24655, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "mint(address)" - } - } - } - } - ], - "description": "TempleUniswapV2Pair.mint(address) (contracts/amm/TempleUniswapV2Pair.sol#96-115) uses a dangerous strict equality:\n\t- _totalSupply == 0 (contracts/amm/TempleUniswapV2Pair.sol#104)\n", - "markdown": "[TempleUniswapV2Pair.mint(address)](contracts/amm/TempleUniswapV2Pair.sol#L96-L115) uses a dangerous strict equality:\n\t- [_totalSupply == 0](contracts/amm/TempleUniswapV2Pair.sol#L104)\n", - "first_markdown_element": "contracts/amm/TempleUniswapV2Pair.sol#L96-L115", - "id": "f3faa53f859ed259e9ff2509250c109f539dc4c8a41ed53a9c3a3342c73a4cea", - "check": "incorrect-equality", + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, + 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, + 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, + 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, + 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, + 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, + 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, + 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, + 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, + 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, + 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, + 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, + 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, + 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, + 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, + 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, + 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, + 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, + 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, + 654, 655 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "setRelicMinterEnclaveIds(address,uint256[],bool[])" + } + } + } + } + ], + "description": "Relic.setRelicMinterEnclaveIds(address,uint256[],bool[]) (contracts/nexus/Relic.sol#126-146) ignores return value by minterEnclaveIds.remove(enclaveId) (contracts/nexus/Relic.sol#139)\n", + "markdown": "[Relic.setRelicMinterEnclaveIds(address,uint256[],bool[])](contracts/nexus/Relic.sol#L126-L146) ignores return value by [minterEnclaveIds.remove(enclaveId)](contracts/nexus/Relic.sol#L139)\n", + "first_markdown_element": "contracts/nexus/Relic.sol#L126-L146", + "id": "89a429d577dd4c85eb3d40731c908650b3b4567227fe3a1af465ef8d945f0d59", + "check": "unused-return", "impact": "Medium", - "confidence": "High" + "confidence": "Medium" }, { "elements": [ { "type": "function", - "name": "amountPerShare", + "name": "mintRelic", "source_mapping": { - "start": 4981, - "length": 372, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 15249, + "length": 988, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, "lines": [ - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138 + 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, + 383, 384, 385, 386, 387, 388, 389 ], "starting_column": 5, "ending_column": 6 @@ -10966,66 +10161,99 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "Vault", + "name": "Relic", "source_mapping": { - "start": 1161, - "length": 7823, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 1674, + "length": 24655, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, "lines": [ - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233 + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, + 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, + 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, + 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, + 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, + 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, + 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, + 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, + 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, + 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, + 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, + 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, + 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, + 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, + 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, + 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, + 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, + 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, + 652, 653, 654, 655 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "amountPerShare()" + "signature": "mintRelic(address,uint256)" } }, { "type": "node", - "name": "p == 0", + "name": "ownerRelics[to].add(nextTokenId_)", "source_mapping": { - "start": 5257, - "length": 6, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 15889, + "length": 33, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, - "lines": [131], - "starting_column": 13, - "ending_column": 19 + "lines": [384], + "starting_column": 9, + "ending_column": 42 }, "type_specific_fields": { "parent": { "type": "function", - "name": "amountPerShare", + "name": "mintRelic", "source_mapping": { - "start": 4981, - "length": 372, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 15249, + "length": 988, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, "lines": [ - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138 + 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, + 383, 384, 385, 386, 387, 388, 389 ], "starting_column": 5, "ending_column": 6 @@ -11033,65 +10261,101 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "Vault", + "name": "Relic", "source_mapping": { - "start": 1161, - "length": 7823, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 1674, + "length": 24655, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, "lines": [ - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "amountPerShare()" - } - } - } - } - ], - "description": "Vault.amountPerShare() (contracts/core/Vault.sol#125-138) uses a dangerous strict equality:\n\t- p == 0 (contracts/core/Vault.sol#131)\n", - "markdown": "[Vault.amountPerShare()](contracts/core/Vault.sol#L125-L138) uses a dangerous strict equality:\n\t- [p == 0](contracts/core/Vault.sol#L131)\n", - "first_markdown_element": "contracts/core/Vault.sol#L125-L138", - "id": "4158c1e69d81519dc5989e6d6c111d02083aaaabb931ca68f7b53bccf0ab30fa", - "check": "incorrect-equality", + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, + 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, + 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, + 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, + 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, + 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, + 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, + 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, + 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, + 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, + 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, + 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, + 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, + 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, + 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, + 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, + 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, + 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, + 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, + 654, 655 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "mintRelic(address,uint256)" + } + } + } + } + ], + "description": "Relic.mintRelic(address,uint256) (contracts/nexus/Relic.sol#370-389) ignores return value by ownerRelics[to].add(nextTokenId_) (contracts/nexus/Relic.sol#384)\n", + "markdown": "[Relic.mintRelic(address,uint256)](contracts/nexus/Relic.sol#L370-L389) ignores return value by [ownerRelics[to].add(nextTokenId_)](contracts/nexus/Relic.sol#L384)\n", + "first_markdown_element": "contracts/nexus/Relic.sol#L370-L389", + "id": "2b599e44a0072635573e9c6fe2672ea206bfb3b09d09e8fb97169f071fd4bccf", + "check": "unused-return", "impact": "Medium", - "confidence": "High" + "confidence": "Medium" }, { "elements": [ { "type": "function", - "name": "burn", + "name": "batchEquipShards", "source_mapping": { - "start": 5241, - "length": 1294, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 16421, + "length": 1032, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, "lines": [ - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138 + 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422 ], "starting_column": 5, "ending_column": 6 @@ -11099,64 +10363,99 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "Relic", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1674, + "length": 24655, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185 + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, + 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, + 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, + 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, + 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, + 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, + 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, + 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, + 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, + 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, + 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, + 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, + 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, + 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, + 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, + 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, + 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, + 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, + 652, 653, 654, 655 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "burn(address)" + "signature": "batchEquipShards(uint256,uint256[],uint256[])" } }, { "type": "node", - "name": "_safeTransfer(_token0,to,amount0)", + "name": "relicInfo.shards.add(shardId)", "source_mapping": { - "start": 6213, - "length": 35, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 17265, + "length": 29, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, - "lines": [131], - "starting_column": 9, - "ending_column": 44 + "lines": [415], + "starting_column": 17, + "ending_column": 46 }, "type_specific_fields": { "parent": { "type": "function", - "name": "burn", + "name": "batchEquipShards", "source_mapping": { - "start": 5241, - "length": 1294, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 16421, + "length": 1032, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, "lines": [ - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138 + 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422 ], "starting_column": 5, "ending_column": 6 @@ -11164,134 +10463,405 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "Relic", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1674, + "length": 24655, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "burn(address)" - } - } + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, + 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, + 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, + 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, + 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, + 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, + 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, + 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, + 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, + 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, + 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, + 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, + 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, + 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, + 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, + 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, + 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, + 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, + 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, + 654, 655 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "batchEquipShards(uint256,uint256[],uint256[])" + } + } + } + } + ], + "description": "Relic.batchEquipShards(uint256,uint256[],uint256[]) (contracts/nexus/Relic.sol#397-422) ignores return value by relicInfo.shards.add(shardId) (contracts/nexus/Relic.sol#415)\n", + "markdown": "[Relic.batchEquipShards(uint256,uint256[],uint256[])](contracts/nexus/Relic.sol#L397-L422) ignores return value by [relicInfo.shards.add(shardId)](contracts/nexus/Relic.sol#L415)\n", + "first_markdown_element": "contracts/nexus/Relic.sol#L397-L422", + "id": "30a84a041543cf5c2dc4fd988eece45e60afb0447a10af15a5dbc8e2bc0ee9e0", + "check": "unused-return", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "batchUnequipShards", + "source_mapping": { + "start": 17641, + "length": 1218, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", + "is_dependency": false, + "lines": [ + 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, + 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, + 456, 457 + ], + "starting_column": 5, + "ending_column": 6 }, - "additional_fields": { "underlying_type": "external_calls" } + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Relic", + "source_mapping": { + "start": 1674, + "length": 24655, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", + "is_dependency": false, + "lines": [ + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, + 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, + 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, + 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, + 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, + 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, + 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, + 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, + 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, + 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, + 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, + 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, + 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, + 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, + 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, + 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, + 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, + 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, + 652, 653, 654, 655 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "batchUnequipShards(uint256,uint256[],uint256[])" + } }, { "type": "node", - "name": "(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))", + "name": "relicInfo.shards.remove(shardId)", "source_mapping": { - "start": 1972, - "length": 91, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 18489, + "length": 32, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, - "lines": [50], - "starting_column": 9, - "ending_column": 100 + "lines": [448], + "starting_column": 17, + "ending_column": 49 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_safeTransfer", + "name": "batchUnequipShards", "source_mapping": { - "start": 1892, - "length": 284, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 17641, + "length": 1218, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, - "lines": [49, 50, 51, 52], + "lines": [ + 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, + 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, + 456, 457 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "Relic", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1674, + "length": 24655, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "_safeTransfer(address,address,uint256)" - } - } + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, + 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, + 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, + 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, + 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, + 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, + 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, + 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, + 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, + 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, + 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, + 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, + 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, + 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, + 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, + 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, + 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, + 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, + 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, + 654, 655 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "batchUnequipShards(uint256,uint256[],uint256[])" + } + } + } + } + ], + "description": "Relic.batchUnequipShards(uint256,uint256[],uint256[]) (contracts/nexus/Relic.sol#430-457) ignores return value by relicInfo.shards.remove(shardId) (contracts/nexus/Relic.sol#448)\n", + "markdown": "[Relic.batchUnequipShards(uint256,uint256[],uint256[])](contracts/nexus/Relic.sol#L430-L457) ignores return value by [relicInfo.shards.remove(shardId)](contracts/nexus/Relic.sol#L448)\n", + "first_markdown_element": "contracts/nexus/Relic.sol#L430-L457", + "id": "83741c5243cc5e59efa43b839ac4837b89b4ae19c8ec596db8265c25c789555b", + "check": "unused-return", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "_beforeTokenTransfers", + "source_mapping": { + "start": 21896, + "length": 822, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", + "is_dependency": false, + "lines": [ + 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, + 549, 550, 551, 552, 553, 554, 555 + ], + "starting_column": 5, + "ending_column": 6 }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Relic", + "source_mapping": { + "start": 1674, + "length": 24655, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", + "is_dependency": false, + "lines": [ + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, + 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, + 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, + 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, + 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, + 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, + 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, + 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, + 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, + 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, + 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, + 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, + 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, + 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, + 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, + 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, + 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, + 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, + 652, 653, 654, 655 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "_beforeTokenTransfers(address,address,uint256,uint256)" + } }, { "type": "node", - "name": "_safeTransfer(_token1,to,amount1)", + "name": "ownerRelics[from].remove(startTokenId)", "source_mapping": { - "start": 6258, - "length": 35, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 22630, + "length": 38, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, - "lines": [132], + "lines": [553], "starting_column": 9, - "ending_column": 44 + "ending_column": 47 }, "type_specific_fields": { "parent": { "type": "function", - "name": "burn", + "name": "_beforeTokenTransfers", "source_mapping": { - "start": 5241, - "length": 1294, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 21896, + "length": 822, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, "lines": [ - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138 + 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, + 549, 550, 551, 552, 553, 554, 555 ], "starting_column": 5, "ending_column": 6 @@ -11299,134 +10869,403 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "Relic", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1674, + "length": 24655, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "burn(address)" - } - } + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, + 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, + 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, + 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, + 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, + 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, + 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, + 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, + 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, + 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, + 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, + 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, + 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, + 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, + 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, + 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, + 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, + 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, + 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, + 654, 655 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "_beforeTokenTransfers(address,address,uint256,uint256)" + } + } + } + } + ], + "description": "Relic._beforeTokenTransfers(address,address,uint256,uint256) (contracts/nexus/Relic.sol#536-555) ignores return value by ownerRelics[from].remove(startTokenId) (contracts/nexus/Relic.sol#553)\n", + "markdown": "[Relic._beforeTokenTransfers(address,address,uint256,uint256)](contracts/nexus/Relic.sol#L536-L555) ignores return value by [ownerRelics[from].remove(startTokenId)](contracts/nexus/Relic.sol#L553)\n", + "first_markdown_element": "contracts/nexus/Relic.sol#L536-L555", + "id": "3413ee950baeb72691e84cbc145061647f7ff8dd030afa3b2aa03072dd1f802b", + "check": "unused-return", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "_beforeTokenTransfers", + "source_mapping": { + "start": 21896, + "length": 822, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", + "is_dependency": false, + "lines": [ + 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, + 549, 550, 551, 552, 553, 554, 555 + ], + "starting_column": 5, + "ending_column": 6 }, - "additional_fields": { "underlying_type": "external_calls" } + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Relic", + "source_mapping": { + "start": 1674, + "length": 24655, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", + "is_dependency": false, + "lines": [ + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, + 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, + 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, + 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, + 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, + 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, + 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, + 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, + 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, + 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, + 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, + 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, + 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, + 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, + 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, + 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, + 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, + 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, + 652, 653, 654, 655 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "_beforeTokenTransfers(address,address,uint256,uint256)" + } }, { "type": "node", - "name": "(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))", + "name": "ownerRelics[to].add(startTokenId)", "source_mapping": { - "start": 1972, - "length": 91, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 22678, + "length": 33, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, - "lines": [50], + "lines": [554], "starting_column": 9, - "ending_column": 100 + "ending_column": 42 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_safeTransfer", + "name": "_beforeTokenTransfers", "source_mapping": { - "start": 1892, - "length": 284, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 21896, + "length": 822, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, - "lines": [49, 50, 51, 52], + "lines": [ + 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, + 549, 550, 551, 552, 553, 554, 555 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "Relic", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1674, + "length": 24655, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "_safeTransfer(address,address,uint256)" - } - } + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, + 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, + 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, + 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, + 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, + 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, + 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, + 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, + 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, + 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, + 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, + 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, + 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, + 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, + 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, + 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, + 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, + 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, + 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, + 654, 655 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "_beforeTokenTransfers(address,address,uint256,uint256)" + } + } + } + } + ], + "description": "Relic._beforeTokenTransfers(address,address,uint256,uint256) (contracts/nexus/Relic.sol#536-555) ignores return value by ownerRelics[to].add(startTokenId) (contracts/nexus/Relic.sol#554)\n", + "markdown": "[Relic._beforeTokenTransfers(address,address,uint256,uint256)](contracts/nexus/Relic.sol#L536-L555) ignores return value by [ownerRelics[to].add(startTokenId)](contracts/nexus/Relic.sol#L554)\n", + "first_markdown_element": "contracts/nexus/Relic.sol#L536-L555", + "id": "f4818a83e1f3f614828f19e3abd8228ff9f203a3647ac38c209a44657efe750f", + "check": "unused-return", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "_updateTrackingVariables", + "source_mapping": { + "start": 22724, + "length": 498, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", + "is_dependency": false, + "lines": [ + 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, + 570, 571 + ], + "starting_column": 5, + "ending_column": 6 }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Relic", + "source_mapping": { + "start": 1674, + "length": 24655, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", + "is_dependency": false, + "lines": [ + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, + 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, + 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, + 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, + 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, + 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, + 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, + 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, + 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, + 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, + 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, + 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, + 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, + 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, + 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, + 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, + 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, + 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, + 652, 653, 654, 655 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "_updateTrackingVariables(address,uint256,uint256,bool,bool)" + } }, { "type": "node", - "name": "_update(balance0,balance1,_reserve0,_reserve1)", + "name": "relicInfos[relicId].shards.remove(shardId)", "source_mapping": { - "start": 6426, - "length": 49, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 23163, + "length": 42, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, - "lines": [136], - "starting_column": 9, - "ending_column": 58 + "lines": [569], + "starting_column": 13, + "ending_column": 55 }, "type_specific_fields": { "parent": { "type": "function", - "name": "burn", + "name": "_updateTrackingVariables", "source_mapping": { - "start": 5241, - "length": 1294, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 22724, + "length": 498, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, "lines": [ - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138 + 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, + 570, 571 ], "starting_column": 5, "ending_column": 6 @@ -11434,400 +11273,606 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "Relic", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1674, + "length": 24655, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "burn(address)" - } - } + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, + 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, + 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, + 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, + 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, + 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, + 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, + 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, + 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, + 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, + 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, + 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, + 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, + 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, + 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, + 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, + 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, + 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, + 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, + 654, 655 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "_updateTrackingVariables(address,uint256,uint256,bool,bool)" + } + } + } + } + ], + "description": "Relic._updateTrackingVariables(address,uint256,uint256,bool,bool) (contracts/nexus/Relic.sol#557-571) ignores return value by relicInfos[relicId].shards.remove(shardId) (contracts/nexus/Relic.sol#569)\n", + "markdown": "[Relic._updateTrackingVariables(address,uint256,uint256,bool,bool)](contracts/nexus/Relic.sol#L557-L571) ignores return value by [relicInfos[relicId].shards.remove(shardId)](contracts/nexus/Relic.sol#L569)\n", + "first_markdown_element": "contracts/nexus/Relic.sol#L557-L571", + "id": "6015f98f45acf25841cd8e8b9aa76ff43d2c4512d8ba437abd150b63d15ca933", + "check": "unused-return", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "_setMinterAllowedShardId", + "source_mapping": { + "start": 4080, + "length": 511, + "filename_relative": "contracts/nexus/Shard.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Shard.sol", + "filename_short": "contracts/nexus/Shard.sol", + "is_dependency": false, + "lines": [ + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105 + ], + "starting_column": 5, + "ending_column": 6 }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "blockTimestampLast" + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Shard", + "source_mapping": { + "start": 1243, + "length": 12607, + "filename_relative": "contracts/nexus/Shard.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Shard.sol", + "filename_short": "contracts/nexus/Shard.sol", + "is_dependency": false, + "lines": [ + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, + 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, + 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "_setMinterAllowedShardId(address,uint256,bool)" } }, { "type": "node", - "name": "blockTimestampLast = blockTimestamp", + "name": "allowedShardIds[minter].add(shardId)", "source_mapping": { - "start": 3873, - "length": 35, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 4405, + "length": 36, + "filename_relative": "contracts/nexus/Shard.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Shard.sol", + "filename_short": "contracts/nexus/Shard.sol", "is_dependency": false, - "lines": [91], - "starting_column": 9, - "ending_column": 44 + "lines": [100], + "starting_column": 13, + "ending_column": 49 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_update", + "name": "_setMinterAllowedShardId", "source_mapping": { - "start": 3107, - "length": 847, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 4080, + "length": 511, + "filename_relative": "contracts/nexus/Shard.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Shard.sol", + "filename_short": "contracts/nexus/Shard.sol", "is_dependency": false, - "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], + "lines": [ + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "Shard", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1243, + "length": 12607, + "filename_relative": "contracts/nexus/Shard.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Shard.sol", + "filename_short": "contracts/nexus/Shard.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, + 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, + 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_update(uint256,uint256,uint112,uint112)" + "signature": "_setMinterAllowedShardId(address,uint256,bool)" } } - }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "blockTimestampLast" } - }, + } + ], + "description": "Shard._setMinterAllowedShardId(address,uint256,bool) (contracts/nexus/Shard.sol#92-105) ignores return value by allowedShardIds[minter].add(shardId) (contracts/nexus/Shard.sol#100)\n", + "markdown": "[Shard._setMinterAllowedShardId(address,uint256,bool)](contracts/nexus/Shard.sol#L92-L105) ignores return value by [allowedShardIds[minter].add(shardId)](contracts/nexus/Shard.sol#L100)\n", + "first_markdown_element": "contracts/nexus/Shard.sol#L92-L105", + "id": "0075cc21d9377abc49cf42234d960c1b1f1d24e7f767cbf4e687d2daeaa40a03", + "check": "unused-return", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ { - "type": "node", - "name": "_update(balance0,balance1,_reserve0,_reserve1)", + "type": "function", + "name": "_setMinterAllowedShardId", "source_mapping": { - "start": 6426, - "length": 49, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 4080, + "length": 511, + "filename_relative": "contracts/nexus/Shard.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Shard.sol", + "filename_short": "contracts/nexus/Shard.sol", "is_dependency": false, - "lines": [136], - "starting_column": 9, - "ending_column": 58 + "lines": [ + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105 + ], + "starting_column": 5, + "ending_column": 6 }, "type_specific_fields": { "parent": { - "type": "function", - "name": "burn", + "type": "contract", + "name": "Shard", "source_mapping": { - "start": 5241, - "length": 1294, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1243, + "length": 12607, + "filename_relative": "contracts/nexus/Shard.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Shard.sol", + "filename_short": "contracts/nexus/Shard.sol", "is_dependency": false, "lines": [ - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleUniswapV2Pair", - "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", - "is_dependency": false, - "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "burn(address)" + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, + 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, + 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359 + ], + "starting_column": 1, + "ending_column": 0 } - } - }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "reserve0" + }, + "signature": "_setMinterAllowedShardId(address,uint256,bool)" } }, { "type": "node", - "name": "reserve0 = uint112(balance0)", + "name": "allowedShardIds[minter].remove(shardId)", "source_mapping": { - "start": 3797, - "length": 28, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 4472, + "length": 39, + "filename_relative": "contracts/nexus/Shard.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Shard.sol", + "filename_short": "contracts/nexus/Shard.sol", "is_dependency": false, - "lines": [89], - "starting_column": 9, - "ending_column": 37 + "lines": [102], + "starting_column": 13, + "ending_column": 52 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_update", + "name": "_setMinterAllowedShardId", "source_mapping": { - "start": 3107, - "length": 847, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 4080, + "length": 511, + "filename_relative": "contracts/nexus/Shard.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Shard.sol", + "filename_short": "contracts/nexus/Shard.sol", "is_dependency": false, - "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], + "lines": [ + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "Shard", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1243, + "length": 12607, + "filename_relative": "contracts/nexus/Shard.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Shard.sol", + "filename_short": "contracts/nexus/Shard.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, + 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, + 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_update(uint256,uint256,uint112,uint112)" + "signature": "_setMinterAllowedShardId(address,uint256,bool)" } } - }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "reserve0" } - }, + } + ], + "description": "Shard._setMinterAllowedShardId(address,uint256,bool) (contracts/nexus/Shard.sol#92-105) ignores return value by allowedShardIds[minter].remove(shardId) (contracts/nexus/Shard.sol#102)\n", + "markdown": "[Shard._setMinterAllowedShardId(address,uint256,bool)](contracts/nexus/Shard.sol#L92-L105) ignores return value by [allowedShardIds[minter].remove(shardId)](contracts/nexus/Shard.sol#L102)\n", + "first_markdown_element": "contracts/nexus/Shard.sol#L92-L105", + "id": "38b1da35ed56aa9ab718fe778d7af3e30ebdc76afa44bc61d2d3d6e5fe0e54ac", + "check": "unused-return", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ { - "type": "node", - "name": "_update(balance0,balance1,_reserve0,_reserve1)", + "type": "function", + "name": "setBorrowToken", "source_mapping": { - "start": 6426, - "length": 49, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 4145, + "length": 1025, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [136], - "starting_column": 9, - "ending_column": 58 + "lines": [ + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127 + ], + "starting_column": 5, + "ending_column": 6 }, "type_specific_fields": { "parent": { - "type": "function", - "name": "burn", + "type": "contract", + "name": "TreasuryReservesVault", "source_mapping": { - "start": 5241, - "length": 1294, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 2150, + "length": 32023, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, "lines": [ - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138 + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, + 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, + 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, + 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, + 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, + 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, + 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, + 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, + 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, + 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, + 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, + 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, + 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, + 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, + 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, + 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, + 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, + 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, + 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, + 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, + 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, + 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, + 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, + 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, + 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, + 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, + 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, + 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, + 771, 772, 773, 774, 775, 776, 777, 778, 779 ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleUniswapV2Pair", - "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", - "is_dependency": false, - "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "burn(address)" + "starting_column": 1, + "ending_column": 0 } - } - }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "reserve1" + }, + "signature": "setBorrowToken(IERC20,address,uint256,uint256,address)" } }, { "type": "node", - "name": "reserve1 = uint112(balance1)", + "name": "_borrowTokenSet.add(address(token))", "source_mapping": { - "start": 3835, - "length": 28, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 5128, + "length": 35, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [90], + "lines": [126], "starting_column": 9, - "ending_column": 37 + "ending_column": 44 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_update", + "name": "setBorrowToken", "source_mapping": { - "start": 3107, - "length": 847, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 4145, + "length": 1025, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], + "lines": [ + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "TreasuryReservesVault", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 2150, + "length": 32023, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, + 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, + 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, + 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, + 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, + 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, + 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, + 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, + 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, + 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, + 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, + 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, + 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, + 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, + 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, + 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, + 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, + 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, + 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, + 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, + 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, + 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, + 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, + 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, + 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, + 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, + 777, 778, 779 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_update(uint256,uint256,uint112,uint112)" + "signature": "setBorrowToken(IERC20,address,uint256,uint256,address)" } } - }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "reserve1" } } ], - "description": "Reentrancy in TempleUniswapV2Pair.burn(address) (contracts/amm/TempleUniswapV2Pair.sol#118-138):\n\tExternal calls:\n\t- _safeTransfer(_token0,to,amount0) (contracts/amm/TempleUniswapV2Pair.sol#131)\n\t\t- (success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value)) (contracts/amm/TempleUniswapV2Pair.sol#50)\n\t- _safeTransfer(_token1,to,amount1) (contracts/amm/TempleUniswapV2Pair.sol#132)\n\t\t- (success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value)) (contracts/amm/TempleUniswapV2Pair.sol#50)\n\tState variables written after the call(s):\n\t- _update(balance0,balance1,_reserve0,_reserve1) (contracts/amm/TempleUniswapV2Pair.sol#136)\n\t\t- blockTimestampLast = blockTimestamp (contracts/amm/TempleUniswapV2Pair.sol#91)\n\tTempleUniswapV2Pair.blockTimestampLast (contracts/amm/TempleUniswapV2Pair.sol#25) can be used in cross function reentrancies:\n\t- TempleUniswapV2Pair._update(uint256,uint256,uint112,uint112) (contracts/amm/TempleUniswapV2Pair.sol#80-93)\n\t- TempleUniswapV2Pair.getReserves() (contracts/amm/TempleUniswapV2Pair.sol#43-47)\n\t- _update(balance0,balance1,_reserve0,_reserve1) (contracts/amm/TempleUniswapV2Pair.sol#136)\n\t\t- reserve0 = uint112(balance0) (contracts/amm/TempleUniswapV2Pair.sol#89)\n\tTempleUniswapV2Pair.reserve0 (contracts/amm/TempleUniswapV2Pair.sol#23) can be used in cross function reentrancies:\n\t- TempleUniswapV2Pair._update(uint256,uint256,uint112,uint112) (contracts/amm/TempleUniswapV2Pair.sol#80-93)\n\t- TempleUniswapV2Pair.getReserves() (contracts/amm/TempleUniswapV2Pair.sol#43-47)\n\t- TempleUniswapV2Pair.skim(address) (contracts/amm/TempleUniswapV2Pair.sol#173-178)\n\t- TempleUniswapV2Pair.sync() (contracts/amm/TempleUniswapV2Pair.sol#181-183)\n\t- _update(balance0,balance1,_reserve0,_reserve1) (contracts/amm/TempleUniswapV2Pair.sol#136)\n\t\t- reserve1 = uint112(balance1) (contracts/amm/TempleUniswapV2Pair.sol#90)\n\tTempleUniswapV2Pair.reserve1 (contracts/amm/TempleUniswapV2Pair.sol#24) can be used in cross function reentrancies:\n\t- TempleUniswapV2Pair._update(uint256,uint256,uint112,uint112) (contracts/amm/TempleUniswapV2Pair.sol#80-93)\n\t- TempleUniswapV2Pair.getReserves() (contracts/amm/TempleUniswapV2Pair.sol#43-47)\n\t- TempleUniswapV2Pair.skim(address) (contracts/amm/TempleUniswapV2Pair.sol#173-178)\n\t- TempleUniswapV2Pair.sync() (contracts/amm/TempleUniswapV2Pair.sol#181-183)\n", - "markdown": "Reentrancy in [TempleUniswapV2Pair.burn(address)](contracts/amm/TempleUniswapV2Pair.sol#L118-L138):\n\tExternal calls:\n\t- [_safeTransfer(_token0,to,amount0)](contracts/amm/TempleUniswapV2Pair.sol#L131)\n\t\t- [(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))](contracts/amm/TempleUniswapV2Pair.sol#L50)\n\t- [_safeTransfer(_token1,to,amount1)](contracts/amm/TempleUniswapV2Pair.sol#L132)\n\t\t- [(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))](contracts/amm/TempleUniswapV2Pair.sol#L50)\n\tState variables written after the call(s):\n\t- [_update(balance0,balance1,_reserve0,_reserve1)](contracts/amm/TempleUniswapV2Pair.sol#L136)\n\t\t- [blockTimestampLast = blockTimestamp](contracts/amm/TempleUniswapV2Pair.sol#L91)\n\t[TempleUniswapV2Pair.blockTimestampLast](contracts/amm/TempleUniswapV2Pair.sol#L25) can be used in cross function reentrancies:\n\t- [TempleUniswapV2Pair._update(uint256,uint256,uint112,uint112)](contracts/amm/TempleUniswapV2Pair.sol#L80-L93)\n\t- [TempleUniswapV2Pair.getReserves()](contracts/amm/TempleUniswapV2Pair.sol#L43-L47)\n\t- [_update(balance0,balance1,_reserve0,_reserve1)](contracts/amm/TempleUniswapV2Pair.sol#L136)\n\t\t- [reserve0 = uint112(balance0)](contracts/amm/TempleUniswapV2Pair.sol#L89)\n\t[TempleUniswapV2Pair.reserve0](contracts/amm/TempleUniswapV2Pair.sol#L23) can be used in cross function reentrancies:\n\t- [TempleUniswapV2Pair._update(uint256,uint256,uint112,uint112)](contracts/amm/TempleUniswapV2Pair.sol#L80-L93)\n\t- [TempleUniswapV2Pair.getReserves()](contracts/amm/TempleUniswapV2Pair.sol#L43-L47)\n\t- [TempleUniswapV2Pair.skim(address)](contracts/amm/TempleUniswapV2Pair.sol#L173-L178)\n\t- [TempleUniswapV2Pair.sync()](contracts/amm/TempleUniswapV2Pair.sol#L181-L183)\n\t- [_update(balance0,balance1,_reserve0,_reserve1)](contracts/amm/TempleUniswapV2Pair.sol#L136)\n\t\t- [reserve1 = uint112(balance1)](contracts/amm/TempleUniswapV2Pair.sol#L90)\n\t[TempleUniswapV2Pair.reserve1](contracts/amm/TempleUniswapV2Pair.sol#L24) can be used in cross function reentrancies:\n\t- [TempleUniswapV2Pair._update(uint256,uint256,uint112,uint112)](contracts/amm/TempleUniswapV2Pair.sol#L80-L93)\n\t- [TempleUniswapV2Pair.getReserves()](contracts/amm/TempleUniswapV2Pair.sol#L43-L47)\n\t- [TempleUniswapV2Pair.skim(address)](contracts/amm/TempleUniswapV2Pair.sol#L173-L178)\n\t- [TempleUniswapV2Pair.sync()](contracts/amm/TempleUniswapV2Pair.sol#L181-L183)\n", - "first_markdown_element": "contracts/amm/TempleUniswapV2Pair.sol#L118-L138", - "id": "0379a89cc8645c2b5e10653eb1e7b3fe6480ded71ea4fc2c34965051d126019a", - "check": "reentrancy-no-eth", + "description": "TreasuryReservesVault.setBorrowToken(IERC20,address,uint256,uint256,address) (contracts/v2/TreasuryReservesVault.sol#108-127) ignores return value by _borrowTokenSet.add(address(token)) (contracts/v2/TreasuryReservesVault.sol#126)\n", + "markdown": "[TreasuryReservesVault.setBorrowToken(IERC20,address,uint256,uint256,address)](contracts/v2/TreasuryReservesVault.sol#L108-L127) ignores return value by [_borrowTokenSet.add(address(token))](contracts/v2/TreasuryReservesVault.sol#L126)\n", + "first_markdown_element": "contracts/v2/TreasuryReservesVault.sol#L108-L127", + "id": "5cf78f34e420dc046a400c32810667b772002358e964fa3e56b9b0a68b28a33f", + "check": "unused-return", "impact": "Medium", "confidence": "Medium" }, @@ -11835,426 +11880,629 @@ "elements": [ { "type": "function", - "name": "swap", + "name": "removeBorrowToken", "source_mapping": { - "start": 6644, - "length": 1950, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 5247, + "length": 319, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [ - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170 - ], + "lines": [132, 133, 134, 135, 136, 137, 138, 139], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "TreasuryReservesVault", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 2150, + "length": 32023, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185 + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, + 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, + 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, + 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, + 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, + 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, + 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, + 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, + 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, + 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, + 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, + 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, + 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, + 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, + 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, + 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, + 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, + 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, + 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, + 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, + 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, + 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, + 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, + 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, + 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, + 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, + 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, + 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, + 771, 772, 773, 774, 775, 776, 777, 778, 779 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "swap(uint256,uint256,address,bytes)" + "signature": "removeBorrowToken(IERC20)" } }, { "type": "node", - "name": "_safeTransfer(_token0,to,amount0Out)", + "name": "_borrowTokenSet.remove(address(token))", "source_mapping": { - "start": 7388, + "start": 5521, "length": 38, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [153], - "starting_column": 29, - "ending_column": 67 + "lines": [138], + "starting_column": 9, + "ending_column": 47 }, "type_specific_fields": { "parent": { "type": "function", - "name": "swap", + "name": "removeBorrowToken", "source_mapping": { - "start": 6644, - "length": 1950, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 5247, + "length": 319, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [ - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170 - ], + "lines": [132, 133, 134, 135, 136, 137, 138, 139], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "TreasuryReservesVault", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 2150, + "length": 32023, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, + 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, + 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, + 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, + 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, + 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, + 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, + 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, + 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, + 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, + 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, + 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, + 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, + 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, + 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, + 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, + 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, + 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, + 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, + 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, + 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, + 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, + 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, + 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, + 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, + 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, + 777, 778, 779 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "swap(uint256,uint256,address,bytes)" + "signature": "removeBorrowToken(IERC20)" } } + } + } + ], + "description": "TreasuryReservesVault.removeBorrowToken(IERC20) (contracts/v2/TreasuryReservesVault.sol#132-139) ignores return value by _borrowTokenSet.remove(address(token)) (contracts/v2/TreasuryReservesVault.sol#138)\n", + "markdown": "[TreasuryReservesVault.removeBorrowToken(IERC20)](contracts/v2/TreasuryReservesVault.sol#L132-L139) ignores return value by [_borrowTokenSet.remove(address(token))](contracts/v2/TreasuryReservesVault.sol#L138)\n", + "first_markdown_element": "contracts/v2/TreasuryReservesVault.sol#L132-L139", + "id": "5474dfbc0dfd2144f1d3592aebc4e72de5fca48cbeb8ec28a4e82aa1c1ea096c", + "check": "unused-return", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "shutdown", + "source_mapping": { + "start": 11822, + "length": 1632, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "is_dependency": false, + "lines": [ + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319 + ], + "starting_column": 5, + "ending_column": 6 }, - "additional_fields": { "underlying_type": "external_calls" } + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TreasuryReservesVault", + "source_mapping": { + "start": 2150, + "length": 32023, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "is_dependency": false, + "lines": [ + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, + 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, + 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, + 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, + 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, + 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, + 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, + 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, + 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, + 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, + 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, + 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, + 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, + 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, + 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, + 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, + 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, + 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, + 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, + 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, + 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, + 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, + 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, + 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, + 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, + 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, + 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, + 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, + 771, 772, 773, 774, 775, 776, 777, 778, 779 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "shutdown(address)" + } }, { "type": "node", - "name": "(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))", + "name": "_strategySet.remove(strategy)", "source_mapping": { - "start": 1972, - "length": 91, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 13418, + "length": 29, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [50], + "lines": [318], "starting_column": 9, - "ending_column": 100 + "ending_column": 38 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_safeTransfer", + "name": "shutdown", "source_mapping": { - "start": 1892, - "length": 284, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 11822, + "length": 1632, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [49, 50, 51, 52], + "lines": [ + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "TreasuryReservesVault", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 2150, + "length": 32023, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, + 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, + 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, + 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, + 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, + 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, + 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, + 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, + 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, + 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, + 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, + 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, + 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, + 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, + 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, + 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, + 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, + 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, + 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, + 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, + 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, + 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, + 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, + 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, + 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, + 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, + 777, 778, 779 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_safeTransfer(address,address,uint256)" + "signature": "shutdown(address)" } } - }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } - }, + } + } + ], + "description": "TreasuryReservesVault.shutdown(address) (contracts/v2/TreasuryReservesVault.sol#283-319) ignores return value by _strategySet.remove(strategy) (contracts/v2/TreasuryReservesVault.sol#318)\n", + "markdown": "[TreasuryReservesVault.shutdown(address)](contracts/v2/TreasuryReservesVault.sol#L283-L319) ignores return value by [_strategySet.remove(strategy)](contracts/v2/TreasuryReservesVault.sol#L318)\n", + "first_markdown_element": "contracts/v2/TreasuryReservesVault.sol#L283-L319", + "id": "14b0ae4775bb656e93254a9232479092aea49d94c14762546af7a2b568164211", + "check": "unused-return", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ { - "type": "node", - "name": "_safeTransfer(_token1,to,amount1Out)", + "type": "function", + "name": "setIdentifierForCaller", "source_mapping": { - "start": 7490, - "length": 38, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1967, + "length": 555, + "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol", + "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol", "is_dependency": false, - "lines": [154], - "starting_column": 29, - "ending_column": 67 + "lines": [47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59], + "starting_column": 5, + "ending_column": 6 }, "type_specific_fields": { "parent": { - "type": "function", - "name": "swap", + "type": "contract", + "name": "TempleCircuitBreakerProxy", "source_mapping": { - "start": 6644, - "length": 1950, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 808, + "length": 3156, + "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol", + "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol", "is_dependency": false, "lines": [ - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100 ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleUniswapV2Pair", - "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", - "is_dependency": false, - "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "swap(uint256,uint256,address,bytes)" + "starting_column": 1, + "ending_column": 0 } - } - }, - "additional_fields": { "underlying_type": "external_calls" } + }, + "signature": "setIdentifierForCaller(address,string)" + } }, { "type": "node", - "name": "(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))", + "name": "_identifiers.add(_identifier)", "source_mapping": { - "start": 1972, - "length": 91, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 2409, + "length": 29, + "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol", + "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol", "is_dependency": false, - "lines": [50], + "lines": [56], "starting_column": 9, - "ending_column": 100 + "ending_column": 38 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_safeTransfer", + "name": "setIdentifierForCaller", "source_mapping": { - "start": 1892, - "length": 284, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1967, + "length": 555, + "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol", + "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol", "is_dependency": false, - "lines": [49, 50, 51, 52], + "lines": [47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "TempleCircuitBreakerProxy", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 808, + "length": 3156, + "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol", + "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_safeTransfer(address,address,uint256)" + "signature": "setIdentifierForCaller(address,string)" } } - }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } - }, + } + } + ], + "description": "TempleCircuitBreakerProxy.setIdentifierForCaller(address,string) (contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol#47-59) ignores return value by _identifiers.add(_identifier) (contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol#56)\n", + "markdown": "[TempleCircuitBreakerProxy.setIdentifierForCaller(address,string)](contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol#L47-L59) ignores return value by [_identifiers.add(_identifier)](contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol#L56)\n", + "first_markdown_element": "contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol#L47-L59", + "id": "e72127f3ec266630bd01282f5d373e9eadb2fa635a529f17decfa267707680e0", + "check": "unused-return", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ { - "type": "node", - "name": "IUniswapV2Callee(to).uniswapV2Call(msg.sender,amount0Out,amount1Out,data)", + "type": "function", + "name": "latestAssetBalances", "source_mapping": { - "start": 7593, - "length": 76, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 5827, + "length": 565, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, - "lines": [155], - "starting_column": 30, - "ending_column": 106 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "swap", + "lines": [ + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "RamosStrategy", "source_mapping": { - "start": 6644, - "length": 1950, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1131, + "length": 9320, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, "lines": [ - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170 + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265 ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleUniswapV2Pair", - "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", - "is_dependency": false, - "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "swap(uint256,uint256,address,bytes)" + "starting_column": 1, + "ending_column": 0 } - } - }, - "additional_fields": { "underlying_type": "external_calls" } + }, + "signature": "latestAssetBalances()" + } }, { "type": "node", - "name": "_update(balance0,balance1,_reserve0,_reserve1)", + "name": "(templeTokenBalance,quoteTokenBalance) = ramos.positions()", "source_mapping": { - "start": 8457, - "length": 49, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 5992, + "length": 77, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, - "lines": [168], + "lines": [148], "starting_column": 9, - "ending_column": 58 + "ending_column": 86 }, "type_specific_fields": { "parent": { "type": "function", - "name": "swap", + "name": "latestAssetBalances", "source_mapping": { - "start": 6644, - "length": 1950, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 5827, + "length": 565, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, "lines": [ - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170 + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159 ], "starting_column": 5, "ending_column": 6 @@ -12262,283 +12510,405 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "RamosStrategy", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1131, + "length": 9320, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "swap(uint256,uint256,address,bytes)" + "signature": "latestAssetBalances()" } } + } + } + ], + "description": "RamosStrategy.latestAssetBalances() (contracts/v2/strategies/RamosStrategy.sol#144-159) ignores return value by (templeTokenBalance,quoteTokenBalance) = ramos.positions() (contracts/v2/strategies/RamosStrategy.sol#148)\n", + "markdown": "[RamosStrategy.latestAssetBalances()](contracts/v2/strategies/RamosStrategy.sol#L144-L159) ignores return value by [(templeTokenBalance,quoteTokenBalance) = ramos.positions()](contracts/v2/strategies/RamosStrategy.sol#L148)\n", + "first_markdown_element": "contracts/v2/strategies/RamosStrategy.sol#L144-L159", + "id": "420dcd2cbb24da1b9ab2dafe842594bf844fae670bc85fc21d1d3835c68dd336", + "check": "unused-return", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "proportionalAddLiquidityQuote", + "source_mapping": { + "start": 6569, + "length": 393, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "is_dependency": false, + "lines": [165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175], + "starting_column": 5, + "ending_column": 6 }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "blockTimestampLast" + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "RamosStrategy", + "source_mapping": { + "start": 1131, + "length": 9320, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "is_dependency": false, + "lines": [ + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "proportionalAddLiquidityQuote(uint256,uint256)" } }, { "type": "node", - "name": "blockTimestampLast = blockTimestamp", + "name": "ramos.poolHelper().proportionalAddLiquidityQuote(_quoteTokenAmount,_slippageBps)", "source_mapping": { - "start": 3873, - "length": 35, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 6867, + "length": 88, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, - "lines": [91], + "lines": [174], "starting_column": 9, - "ending_column": 44 + "ending_column": 97 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_update", + "name": "proportionalAddLiquidityQuote", "source_mapping": { - "start": 3107, - "length": 847, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 6569, + "length": 393, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, - "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], + "lines": [165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "RamosStrategy", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1131, + "length": 9320, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_update(uint256,uint256,uint112,uint112)" + "signature": "proportionalAddLiquidityQuote(uint256,uint256)" } } - }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "blockTimestampLast" } - }, + } + ], + "description": "RamosStrategy.proportionalAddLiquidityQuote(uint256,uint256) (contracts/v2/strategies/RamosStrategy.sol#165-175) ignores return value by ramos.poolHelper().proportionalAddLiquidityQuote(_quoteTokenAmount,_slippageBps) (contracts/v2/strategies/RamosStrategy.sol#174)\n", + "markdown": "[RamosStrategy.proportionalAddLiquidityQuote(uint256,uint256)](contracts/v2/strategies/RamosStrategy.sol#L165-L175) ignores return value by [ramos.poolHelper().proportionalAddLiquidityQuote(_quoteTokenAmount,_slippageBps)](contracts/v2/strategies/RamosStrategy.sol#L174)\n", + "first_markdown_element": "contracts/v2/strategies/RamosStrategy.sol#L165-L175", + "id": "b56d2f4548e025710d998bc242ac7f3032f0e8ea504c62f800fead5160f65786", + "check": "unused-return", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ { - "type": "node", - "name": "_update(balance0,balance1,_reserve0,_reserve1)", + "type": "function", + "name": "proportionalRemoveLiquidityQuote", "source_mapping": { - "start": 8457, - "length": 49, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 7587, + "length": 438, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, - "lines": [168], - "starting_column": 9, - "ending_column": 58 + "lines": [192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203], + "starting_column": 5, + "ending_column": 6 }, "type_specific_fields": { "parent": { - "type": "function", - "name": "swap", + "type": "contract", + "name": "RamosStrategy", "source_mapping": { - "start": 6644, - "length": 1950, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1131, + "length": 9320, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, "lines": [ - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170 + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265 ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleUniswapV2Pair", - "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", - "is_dependency": false, - "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "swap(uint256,uint256,address,bytes)" + "starting_column": 1, + "ending_column": 0 } - } - }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "reserve0" + }, + "signature": "proportionalRemoveLiquidityQuote(uint256,uint256)" } }, { "type": "node", - "name": "reserve0 = uint112(balance0)", + "name": "ramos.poolHelper().proportionalRemoveLiquidityQuote(_bptAmount,_slippageBps)", "source_mapping": { - "start": 3797, - "length": 28, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 7934, + "length": 84, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, - "lines": [89], + "lines": [202], "starting_column": 9, - "ending_column": 37 + "ending_column": 93 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_update", + "name": "proportionalRemoveLiquidityQuote", "source_mapping": { - "start": 3107, - "length": 847, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 7587, + "length": 438, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, - "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], + "lines": [ + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "RamosStrategy", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1131, + "length": 9320, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_update(uint256,uint256,uint112,uint112)" + "signature": "proportionalRemoveLiquidityQuote(uint256,uint256)" } } - }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "reserve0" } - }, + } + ], + "description": "RamosStrategy.proportionalRemoveLiquidityQuote(uint256,uint256) (contracts/v2/strategies/RamosStrategy.sol#192-203) ignores return value by ramos.poolHelper().proportionalRemoveLiquidityQuote(_bptAmount,_slippageBps) (contracts/v2/strategies/RamosStrategy.sol#202)\n", + "markdown": "[RamosStrategy.proportionalRemoveLiquidityQuote(uint256,uint256)](contracts/v2/strategies/RamosStrategy.sol#L192-L203) ignores return value by [ramos.poolHelper().proportionalRemoveLiquidityQuote(_bptAmount,_slippageBps)](contracts/v2/strategies/RamosStrategy.sol#L202)\n", + "first_markdown_element": "contracts/v2/strategies/RamosStrategy.sol#L192-L203", + "id": "ed71e6585e1914cd70e3ed747dea0a932bd4ba9629191c626628ce16c695c11d", + "check": "unused-return", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ { - "type": "node", - "name": "_update(balance0,balance1,_reserve0,_reserve1)", + "type": "function", + "name": "populateShutdownData", "source_mapping": { - "start": 8457, - "length": 49, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 9022, + "length": 564, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, - "lines": [168], - "starting_column": 9, - "ending_column": 58 - }, - "type_specific_fields": { + "lines": [232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "RamosStrategy", + "source_mapping": { + "start": 1131, + "length": 9320, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "is_dependency": false, + "lines": [ + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "populateShutdownData(bytes)" + } + }, + { + "type": "node", + "name": "(shutdownParams.bptAmount,None,None) = ramos.positions()", + "source_mapping": { + "start": 9349, + "length": 48, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "is_dependency": false, + "lines": [240], + "starting_column": 9, + "ending_column": 57 + }, + "type_specific_fields": { "parent": { "type": "function", - "name": "swap", + "name": "populateShutdownData", "source_mapping": { - "start": 6644, - "length": 1950, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 9022, + "length": 564, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, "lines": [ - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170 + 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243 ], "starting_column": 5, "ending_column": 6 @@ -12546,118 +12916,190 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "RamosStrategy", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1131, + "length": 9320, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "swap(uint256,uint256,address,bytes)" + "signature": "populateShutdownData(bytes)" } } + } + } + ], + "description": "RamosStrategy.populateShutdownData(bytes) (contracts/v2/strategies/RamosStrategy.sol#232-243) ignores return value by (shutdownParams.bptAmount,None,None) = ramos.positions() (contracts/v2/strategies/RamosStrategy.sol#240)\n", + "markdown": "[RamosStrategy.populateShutdownData(bytes)](contracts/v2/strategies/RamosStrategy.sol#L232-L243) ignores return value by [(shutdownParams.bptAmount,None,None) = ramos.positions()](contracts/v2/strategies/RamosStrategy.sol#L240)\n", + "first_markdown_element": "contracts/v2/strategies/RamosStrategy.sol#L232-L243", + "id": "e68b668794a623b6a5a283b3672d9ddf56508b69062c77c9f4af7f0faf1aa51e", + "check": "unused-return", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "_doShutdown", + "source_mapping": { + "start": 9818, + "length": 631, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "is_dependency": false, + "lines": [ + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263 + ], + "starting_column": 5, + "ending_column": 6 }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "reserve1" + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "RamosStrategy", + "source_mapping": { + "start": 1131, + "length": 9320, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "is_dependency": false, + "lines": [ + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "_doShutdown(bytes)" } }, { "type": "node", - "name": "reserve1 = uint112(balance1)", + "name": "ramos.removeLiquidity(params.requestData,params.bptAmount)", "source_mapping": { - "start": 3835, - "length": 28, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 9989, + "length": 59, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, - "lines": [90], + "lines": [252], "starting_column": 9, - "ending_column": 37 + "ending_column": 68 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_update", + "name": "_doShutdown", "source_mapping": { - "start": 3107, - "length": 847, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 9818, + "length": 631, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, - "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], + "lines": [ + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "RamosStrategy", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1131, + "length": 9320, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_update(uint256,uint256,uint112,uint112)" + "signature": "_doShutdown(bytes)" } } - }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "reserve1" } } ], - "description": "Reentrancy in TempleUniswapV2Pair.swap(uint256,uint256,address,bytes) (contracts/amm/TempleUniswapV2Pair.sol#141-170):\n\tExternal calls:\n\t- _safeTransfer(_token0,to,amount0Out) (contracts/amm/TempleUniswapV2Pair.sol#153)\n\t\t- (success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value)) (contracts/amm/TempleUniswapV2Pair.sol#50)\n\t- _safeTransfer(_token1,to,amount1Out) (contracts/amm/TempleUniswapV2Pair.sol#154)\n\t\t- (success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value)) (contracts/amm/TempleUniswapV2Pair.sol#50)\n\t- IUniswapV2Callee(to).uniswapV2Call(msg.sender,amount0Out,amount1Out,data) (contracts/amm/TempleUniswapV2Pair.sol#155)\n\tState variables written after the call(s):\n\t- _update(balance0,balance1,_reserve0,_reserve1) (contracts/amm/TempleUniswapV2Pair.sol#168)\n\t\t- blockTimestampLast = blockTimestamp (contracts/amm/TempleUniswapV2Pair.sol#91)\n\tTempleUniswapV2Pair.blockTimestampLast (contracts/amm/TempleUniswapV2Pair.sol#25) can be used in cross function reentrancies:\n\t- TempleUniswapV2Pair._update(uint256,uint256,uint112,uint112) (contracts/amm/TempleUniswapV2Pair.sol#80-93)\n\t- TempleUniswapV2Pair.getReserves() (contracts/amm/TempleUniswapV2Pair.sol#43-47)\n\t- _update(balance0,balance1,_reserve0,_reserve1) (contracts/amm/TempleUniswapV2Pair.sol#168)\n\t\t- reserve0 = uint112(balance0) (contracts/amm/TempleUniswapV2Pair.sol#89)\n\tTempleUniswapV2Pair.reserve0 (contracts/amm/TempleUniswapV2Pair.sol#23) can be used in cross function reentrancies:\n\t- TempleUniswapV2Pair._update(uint256,uint256,uint112,uint112) (contracts/amm/TempleUniswapV2Pair.sol#80-93)\n\t- TempleUniswapV2Pair.getReserves() (contracts/amm/TempleUniswapV2Pair.sol#43-47)\n\t- TempleUniswapV2Pair.skim(address) (contracts/amm/TempleUniswapV2Pair.sol#173-178)\n\t- TempleUniswapV2Pair.sync() (contracts/amm/TempleUniswapV2Pair.sol#181-183)\n\t- _update(balance0,balance1,_reserve0,_reserve1) (contracts/amm/TempleUniswapV2Pair.sol#168)\n\t\t- reserve1 = uint112(balance1) (contracts/amm/TempleUniswapV2Pair.sol#90)\n\tTempleUniswapV2Pair.reserve1 (contracts/amm/TempleUniswapV2Pair.sol#24) can be used in cross function reentrancies:\n\t- TempleUniswapV2Pair._update(uint256,uint256,uint112,uint112) (contracts/amm/TempleUniswapV2Pair.sol#80-93)\n\t- TempleUniswapV2Pair.getReserves() (contracts/amm/TempleUniswapV2Pair.sol#43-47)\n\t- TempleUniswapV2Pair.skim(address) (contracts/amm/TempleUniswapV2Pair.sol#173-178)\n\t- TempleUniswapV2Pair.sync() (contracts/amm/TempleUniswapV2Pair.sol#181-183)\n", - "markdown": "Reentrancy in [TempleUniswapV2Pair.swap(uint256,uint256,address,bytes)](contracts/amm/TempleUniswapV2Pair.sol#L141-L170):\n\tExternal calls:\n\t- [_safeTransfer(_token0,to,amount0Out)](contracts/amm/TempleUniswapV2Pair.sol#L153)\n\t\t- [(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))](contracts/amm/TempleUniswapV2Pair.sol#L50)\n\t- [_safeTransfer(_token1,to,amount1Out)](contracts/amm/TempleUniswapV2Pair.sol#L154)\n\t\t- [(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))](contracts/amm/TempleUniswapV2Pair.sol#L50)\n\t- [IUniswapV2Callee(to).uniswapV2Call(msg.sender,amount0Out,amount1Out,data)](contracts/amm/TempleUniswapV2Pair.sol#L155)\n\tState variables written after the call(s):\n\t- [_update(balance0,balance1,_reserve0,_reserve1)](contracts/amm/TempleUniswapV2Pair.sol#L168)\n\t\t- [blockTimestampLast = blockTimestamp](contracts/amm/TempleUniswapV2Pair.sol#L91)\n\t[TempleUniswapV2Pair.blockTimestampLast](contracts/amm/TempleUniswapV2Pair.sol#L25) can be used in cross function reentrancies:\n\t- [TempleUniswapV2Pair._update(uint256,uint256,uint112,uint112)](contracts/amm/TempleUniswapV2Pair.sol#L80-L93)\n\t- [TempleUniswapV2Pair.getReserves()](contracts/amm/TempleUniswapV2Pair.sol#L43-L47)\n\t- [_update(balance0,balance1,_reserve0,_reserve1)](contracts/amm/TempleUniswapV2Pair.sol#L168)\n\t\t- [reserve0 = uint112(balance0)](contracts/amm/TempleUniswapV2Pair.sol#L89)\n\t[TempleUniswapV2Pair.reserve0](contracts/amm/TempleUniswapV2Pair.sol#L23) can be used in cross function reentrancies:\n\t- [TempleUniswapV2Pair._update(uint256,uint256,uint112,uint112)](contracts/amm/TempleUniswapV2Pair.sol#L80-L93)\n\t- [TempleUniswapV2Pair.getReserves()](contracts/amm/TempleUniswapV2Pair.sol#L43-L47)\n\t- [TempleUniswapV2Pair.skim(address)](contracts/amm/TempleUniswapV2Pair.sol#L173-L178)\n\t- [TempleUniswapV2Pair.sync()](contracts/amm/TempleUniswapV2Pair.sol#L181-L183)\n\t- [_update(balance0,balance1,_reserve0,_reserve1)](contracts/amm/TempleUniswapV2Pair.sol#L168)\n\t\t- [reserve1 = uint112(balance1)](contracts/amm/TempleUniswapV2Pair.sol#L90)\n\t[TempleUniswapV2Pair.reserve1](contracts/amm/TempleUniswapV2Pair.sol#L24) can be used in cross function reentrancies:\n\t- [TempleUniswapV2Pair._update(uint256,uint256,uint112,uint112)](contracts/amm/TempleUniswapV2Pair.sol#L80-L93)\n\t- [TempleUniswapV2Pair.getReserves()](contracts/amm/TempleUniswapV2Pair.sol#L43-L47)\n\t- [TempleUniswapV2Pair.skim(address)](contracts/amm/TempleUniswapV2Pair.sol#L173-L178)\n\t- [TempleUniswapV2Pair.sync()](contracts/amm/TempleUniswapV2Pair.sol#L181-L183)\n", - "first_markdown_element": "contracts/amm/TempleUniswapV2Pair.sol#L141-L170", - "id": "5cdaaff3e567de31630793ad7f06e2a605da21349f80f6007c70ec2bd319fbc0", - "check": "reentrancy-no-eth", + "description": "RamosStrategy._doShutdown(bytes) (contracts/v2/strategies/RamosStrategy.sol#250-263) ignores return value by ramos.removeLiquidity(params.requestData,params.bptAmount) (contracts/v2/strategies/RamosStrategy.sol#252)\n", + "markdown": "[RamosStrategy._doShutdown(bytes)](contracts/v2/strategies/RamosStrategy.sol#L250-L263) ignores return value by [ramos.removeLiquidity(params.requestData,params.bptAmount)](contracts/v2/strategies/RamosStrategy.sol#L252)\n", + "first_markdown_element": "contracts/v2/strategies/RamosStrategy.sol#L250-L263", + "id": "cab4a6d607fc52a73a76b47684750061e88667af7fd3a9cc5e85e235479031b6", + "check": "unused-return", "impact": "Medium", "confidence": "Medium" }, @@ -12665,18 +13107,17 @@ "elements": [ { "type": "function", - "name": "_burnDToken", + "name": "_addLiquidity", "source_mapping": { - "start": 29910, - "length": 1179, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 1756, + "length": 1076, + "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, "lines": [ - 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, - 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, - 700, 701, 702, 703, 704, 705, 706 + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83 ], "starting_column": 5, "ending_column": 6 @@ -12684,108 +13125,67 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "TempleStableAMMRouter", "source_mapping": { - "start": 2150, - "length": 31934, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 640, + "length": 8240, + "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, - 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, - 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, - 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, - 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, - 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, - 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, - 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, - 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, - 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, - 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, - 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, - 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, - 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, - 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, - 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, - 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, - 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, - 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, - 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, - 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, - 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, - 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, - 771, 772, 773, 774, 775, 776 + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" + "signature": "_addLiquidity(uint256,uint256,uint256,uint256,IUniswapV2Pair)" } }, { "type": "node", - "name": "_burnedAmount = tokenConfig.dToken.burn(strategy,toBurnAmount)", + "name": "(reserveA,reserveB) = pair.getReserves()", "source_mapping": { - "start": 30309, - "length": 71, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 1986, + "length": 52, + "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, - "lines": [685], + "lines": [68], "starting_column": 9, - "ending_column": 80 + "ending_column": 61 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_burnDToken", + "name": "_addLiquidity", "source_mapping": { - "start": 29910, - "length": 1179, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 1756, + "length": 1076, + "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, "lines": [ - 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, - 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, - 700, 701, 702, 703, 704, 705, 706 + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83 ], "starting_column": 5, "ending_column": 6 @@ -12793,211 +13193,177 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "TempleStableAMMRouter", "source_mapping": { - "start": 2150, - "length": 31934, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 640, + "length": 8240, + "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776 + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" + "signature": "_addLiquidity(uint256,uint256,uint256,uint256,IUniswapV2Pair)" } } - }, - "additional_fields": { "underlying_type": "external_calls" } - }, + } + } + ], + "description": "TempleStableAMMRouter._addLiquidity(uint256,uint256,uint256,uint256,IUniswapV2Pair) (contracts/amm/TempleStableAMMRouter.sol#61-83) ignores return value by (reserveA,reserveB) = pair.getReserves() (contracts/amm/TempleStableAMMRouter.sol#68)\n", + "markdown": "[TempleStableAMMRouter._addLiquidity(uint256,uint256,uint256,uint256,IUniswapV2Pair)](contracts/amm/TempleStableAMMRouter.sol#L61-L83) ignores return value by [(reserveA,reserveB) = pair.getReserves()](contracts/amm/TempleStableAMMRouter.sol#L68)\n", + "first_markdown_element": "contracts/amm/TempleStableAMMRouter.sol#L61-L83", + "id": "f24551aba47520a07ab79471d9ec9cfe2fe87cd09c197da35e42997dcded68a8", + "check": "unused-return", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ { - "type": "node", - "name": "_tokenCredits[token] = _creditBalance", + "type": "function", + "name": "swapExactStableForTempleQuote", "source_mapping": { - "start": 30934, - "length": 37, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 7556, + "length": 271, + "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, - "lines": [702], - "starting_column": 13, - "ending_column": 50 + "lines": [202, 203, 204, 205], + "starting_column": 5, + "ending_column": 6 }, "type_specific_fields": { "parent": { - "type": "function", - "name": "_burnDToken", + "type": "contract", + "name": "TempleStableAMMRouter", "source_mapping": { - "start": 29910, - "length": 1179, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 640, + "length": 8240, + "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, "lines": [ - 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, - 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, - 700, 701, 702, 703, 704, 705, 706 + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236 ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "swapExactStableForTempleQuote(address,uint256)" + } + }, + { + "type": "node", + "name": "(reserveTemple,reserveFrax) = IUniswapV2Pair(pair).getReserves()", + "source_mapping": { + "start": 7672, + "length": 76, + "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_short": "contracts/amm/TempleStableAMMRouter.sol", + "is_dependency": false, + "lines": [203], + "starting_column": 9, + "ending_column": 85 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "swapExactStableForTempleQuote", + "source_mapping": { + "start": 7556, + "length": 271, + "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_short": "contracts/amm/TempleStableAMMRouter.sol", + "is_dependency": false, + "lines": [202, 203, 204, 205], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "TempleStableAMMRouter", "source_mapping": { - "start": 2150, - "length": 31934, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 640, + "length": 8240, + "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776 + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" + "signature": "swapExactStableForTempleQuote(address,uint256)" } } - }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "strategyTokenCredits" } } ], - "description": "Reentrancy in TreasuryReservesVault._burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256) (contracts/v2/TreasuryReservesVault.sol#674-706):\n\tExternal calls:\n\t- _burnedAmount = tokenConfig.dToken.burn(strategy,toBurnAmount) (contracts/v2/TreasuryReservesVault.sol#685)\n\tState variables written after the call(s):\n\t- _tokenCredits[token] = _creditBalance (contracts/v2/TreasuryReservesVault.sol#702)\n\tTreasuryReservesVault.strategyTokenCredits (contracts/v2/TreasuryReservesVault.sol#78) can be used in cross function reentrancies:\n\t- TreasuryReservesVault._availableForStrategyToBorrow(address,ITreasuryReservesVault.StrategyConfig,IERC20,uint256) (contracts/v2/TreasuryReservesVault.sol#532-550)\n\t- TreasuryReservesVault._burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256) (contracts/v2/TreasuryReservesVault.sol#674-706)\n\t- TreasuryReservesVault._mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256) (contracts/v2/TreasuryReservesVault.sol#635-667)\n\t- TreasuryReservesVault.setStrategyDebtCeiling(address,IERC20,uint256) (contracts/v2/TreasuryReservesVault.sol#242-255)\n\t- TreasuryReservesVault.shutdown(address) (contracts/v2/TreasuryReservesVault.sol#283-318)\n\t- TreasuryReservesVault.strategyBalanceSheet(address) (contracts/v2/TreasuryReservesVault.sol#446-466)\n\t- TreasuryReservesVault.strategyTokenCredits (contracts/v2/TreasuryReservesVault.sol#78)\n", - "markdown": "Reentrancy in [TreasuryReservesVault._burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)](contracts/v2/TreasuryReservesVault.sol#L674-L706):\n\tExternal calls:\n\t- [_burnedAmount = tokenConfig.dToken.burn(strategy,toBurnAmount)](contracts/v2/TreasuryReservesVault.sol#L685)\n\tState variables written after the call(s):\n\t- [_tokenCredits[token] = _creditBalance](contracts/v2/TreasuryReservesVault.sol#L702)\n\t[TreasuryReservesVault.strategyTokenCredits](contracts/v2/TreasuryReservesVault.sol#L78) can be used in cross function reentrancies:\n\t- [TreasuryReservesVault._availableForStrategyToBorrow(address,ITreasuryReservesVault.StrategyConfig,IERC20,uint256)](contracts/v2/TreasuryReservesVault.sol#L532-L550)\n\t- [TreasuryReservesVault._burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)](contracts/v2/TreasuryReservesVault.sol#L674-L706)\n\t- [TreasuryReservesVault._mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)](contracts/v2/TreasuryReservesVault.sol#L635-L667)\n\t- [TreasuryReservesVault.setStrategyDebtCeiling(address,IERC20,uint256)](contracts/v2/TreasuryReservesVault.sol#L242-L255)\n\t- [TreasuryReservesVault.shutdown(address)](contracts/v2/TreasuryReservesVault.sol#L283-L318)\n\t- [TreasuryReservesVault.strategyBalanceSheet(address)](contracts/v2/TreasuryReservesVault.sol#L446-L466)\n\t- [TreasuryReservesVault.strategyTokenCredits](contracts/v2/TreasuryReservesVault.sol#L78)\n", - "first_markdown_element": "contracts/v2/TreasuryReservesVault.sol#L674-L706", - "id": "1923bf93f411ce47fa4143a56c5c748848cf65648477d1723f9258798b8bffd2", - "check": "reentrancy-no-eth", + "description": "TempleStableAMMRouter.swapExactStableForTempleQuote(address,uint256) (contracts/amm/TempleStableAMMRouter.sol#202-205) ignores return value by (reserveTemple,reserveFrax) = IUniswapV2Pair(pair).getReserves() (contracts/amm/TempleStableAMMRouter.sol#203)\n", + "markdown": "[TempleStableAMMRouter.swapExactStableForTempleQuote(address,uint256)](contracts/amm/TempleStableAMMRouter.sol#L202-L205) ignores return value by [(reserveTemple,reserveFrax) = IUniswapV2Pair(pair).getReserves()](contracts/amm/TempleStableAMMRouter.sol#L203)\n", + "first_markdown_element": "contracts/amm/TempleStableAMMRouter.sol#L202-L205", + "id": "bcaddbd83baa19b08f21d46eaa6d5040ec3da28323505b65de50fbfbd874521c", + "check": "unused-return", "impact": "Medium", "confidence": "Medium" }, @@ -13005,18 +13371,17 @@ "elements": [ { "type": "function", - "name": "_mintDToken", + "name": "swapExactTempleForStableQuote", "source_mapping": { - "start": 28444, - "length": 1205, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 7833, + "length": 639, + "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, "lines": [ - 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, - 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, - 661, 662, 663, 664, 665, 666, 667 + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221 ], "starting_column": 5, "ending_column": 6 @@ -13024,108 +13389,67 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "TempleStableAMMRouter", "source_mapping": { - "start": 2150, - "length": 31934, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 640, + "length": 8240, + "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, - 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, - 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, - 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, - 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, - 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, - 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, - 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, - 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, - 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, - 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, - 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, - 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, - 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, - 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, - 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, - 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, - 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, - 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, - 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, - 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, - 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, - 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, - 771, 772, 773, 774, 775, 776 + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" + "signature": "swapExactTempleForStableQuote(address,uint256)" } }, { "type": "node", - "name": "tokenConfig.dToken.mint(strategy,_newDebt)", + "name": "(reserveTemple,reserveFrax) = IUniswapV2Pair(pair).getReserves()", "source_mapping": { - "start": 29205, - "length": 43, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 7967, + "length": 76, + "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, - "lines": [654], - "starting_column": 13, - "ending_column": 56 + "lines": [208], + "starting_column": 9, + "ending_column": 85 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_mintDToken", + "name": "swapExactTempleForStableQuote", "source_mapping": { - "start": 28444, - "length": 1205, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 7833, + "length": 639, + "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, "lines": [ - 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, - 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, - 661, 662, 663, 664, 665, 666, 667 + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221 ], "starting_column": 5, "ending_column": 6 @@ -13133,115 +13457,125 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "TempleStableAMMRouter", "source_mapping": { - "start": 2150, - "length": 31934, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 640, + "length": 8240, + "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776 + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" + "signature": "swapExactTempleForStableQuote(address,uint256)" } } + } + } + ], + "description": "TempleStableAMMRouter.swapExactTempleForStableQuote(address,uint256) (contracts/amm/TempleStableAMMRouter.sol#207-221) ignores return value by (reserveTemple,reserveFrax) = IUniswapV2Pair(pair).getReserves() (contracts/amm/TempleStableAMMRouter.sol#208)\n", + "markdown": "[TempleStableAMMRouter.swapExactTempleForStableQuote(address,uint256)](contracts/amm/TempleStableAMMRouter.sol#L207-L221) ignores return value by [(reserveTemple,reserveFrax) = IUniswapV2Pair(pair).getReserves()](contracts/amm/TempleStableAMMRouter.sol#L208)\n", + "first_markdown_element": "contracts/amm/TempleStableAMMRouter.sol#L207-L221", + "id": "43ba957c0d22f3540a298f9bbbe3e7ef022879a661282996ee551c7d780c6394", + "check": "unused-return", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "rebalance", + "source_mapping": { + "start": 1808, + "length": 798, + "filename_relative": "contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", + "filename_short": "contracts/core/OpsManagerLib.sol", + "is_dependency": false, + "lines": [ + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72 + ], + "starting_column": 5, + "ending_column": 6 }, - "additional_fields": { "underlying_type": "external_calls" } + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "OpsManagerLib", + "source_mapping": { + "start": 158, + "length": 3905, + "filename_relative": "contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", + "filename_short": "contracts/core/OpsManagerLib.sol", + "is_dependency": false, + "lines": [ + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "rebalance(Vault,TreasuryFarmingRevenue)" + } }, { "type": "node", - "name": "_tokenCredits[token] = _creditBalance = 0", + "name": "(inWindow) = vault.inEnterExitWindow()", "source_mapping": { - "start": 29298, - "length": 41, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 1916, + "length": 45, + "filename_relative": "contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", + "filename_short": "contracts/core/OpsManagerLib.sol", "is_dependency": false, - "lines": [657], - "starting_column": 13, + "lines": [59], + "starting_column": 9, "ending_column": 54 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_mintDToken", + "name": "rebalance", "source_mapping": { - "start": 28444, - "length": 1205, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 1808, + "length": 798, + "filename_relative": "contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", + "filename_short": "contracts/core/OpsManagerLib.sol", "is_dependency": false, "lines": [ - 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, - 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, - 661, 662, 663, 664, 665, 666, 667 + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72 ], "starting_column": 5, "ending_column": 6 @@ -13249,95 +13583,39 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "OpsManagerLib", "source_mapping": { - "start": 2150, - "length": 31934, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 158, + "length": 3905, + "filename_relative": "contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", + "filename_short": "contracts/core/OpsManagerLib.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "_mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "rebalance(Vault,TreasuryFarmingRevenue)" } } - }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "strategyTokenCredits" } } ], - "description": "Reentrancy in TreasuryReservesVault._mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256) (contracts/v2/TreasuryReservesVault.sol#635-667):\n\tExternal calls:\n\t- tokenConfig.dToken.mint(strategy,_newDebt) (contracts/v2/TreasuryReservesVault.sol#654)\n\tState variables written after the call(s):\n\t- _tokenCredits[token] = _creditBalance = 0 (contracts/v2/TreasuryReservesVault.sol#657)\n\tTreasuryReservesVault.strategyTokenCredits (contracts/v2/TreasuryReservesVault.sol#78) can be used in cross function reentrancies:\n\t- TreasuryReservesVault._availableForStrategyToBorrow(address,ITreasuryReservesVault.StrategyConfig,IERC20,uint256) (contracts/v2/TreasuryReservesVault.sol#532-550)\n\t- TreasuryReservesVault._burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256) (contracts/v2/TreasuryReservesVault.sol#674-706)\n\t- TreasuryReservesVault._mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256) (contracts/v2/TreasuryReservesVault.sol#635-667)\n\t- TreasuryReservesVault.setStrategyDebtCeiling(address,IERC20,uint256) (contracts/v2/TreasuryReservesVault.sol#242-255)\n\t- TreasuryReservesVault.shutdown(address) (contracts/v2/TreasuryReservesVault.sol#283-318)\n\t- TreasuryReservesVault.strategyBalanceSheet(address) (contracts/v2/TreasuryReservesVault.sol#446-466)\n\t- TreasuryReservesVault.strategyTokenCredits (contracts/v2/TreasuryReservesVault.sol#78)\n", - "markdown": "Reentrancy in [TreasuryReservesVault._mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)](contracts/v2/TreasuryReservesVault.sol#L635-L667):\n\tExternal calls:\n\t- [tokenConfig.dToken.mint(strategy,_newDebt)](contracts/v2/TreasuryReservesVault.sol#L654)\n\tState variables written after the call(s):\n\t- [_tokenCredits[token] = _creditBalance = 0](contracts/v2/TreasuryReservesVault.sol#L657)\n\t[TreasuryReservesVault.strategyTokenCredits](contracts/v2/TreasuryReservesVault.sol#L78) can be used in cross function reentrancies:\n\t- [TreasuryReservesVault._availableForStrategyToBorrow(address,ITreasuryReservesVault.StrategyConfig,IERC20,uint256)](contracts/v2/TreasuryReservesVault.sol#L532-L550)\n\t- [TreasuryReservesVault._burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)](contracts/v2/TreasuryReservesVault.sol#L674-L706)\n\t- [TreasuryReservesVault._mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)](contracts/v2/TreasuryReservesVault.sol#L635-L667)\n\t- [TreasuryReservesVault.setStrategyDebtCeiling(address,IERC20,uint256)](contracts/v2/TreasuryReservesVault.sol#L242-L255)\n\t- [TreasuryReservesVault.shutdown(address)](contracts/v2/TreasuryReservesVault.sol#L283-L318)\n\t- [TreasuryReservesVault.strategyBalanceSheet(address)](contracts/v2/TreasuryReservesVault.sol#L446-L466)\n\t- [TreasuryReservesVault.strategyTokenCredits](contracts/v2/TreasuryReservesVault.sol#L78)\n", - "first_markdown_element": "contracts/v2/TreasuryReservesVault.sol#L635-L667", - "id": "85f34eb4843777ca1f85f15bf28fd8eb05b6636ac4a4449a68ff2fbfde30e176", - "check": "reentrancy-no-eth", + "description": "OpsManagerLib.rebalance(Vault,TreasuryFarmingRevenue) (contracts/core/OpsManagerLib.sol#55-72) ignores return value by (inWindow) = vault.inEnterExitWindow() (contracts/core/OpsManagerLib.sol#59)\n", + "markdown": "[OpsManagerLib.rebalance(Vault,TreasuryFarmingRevenue)](contracts/core/OpsManagerLib.sol#L55-L72) ignores return value by [(inWindow) = vault.inEnterExitWindow()](contracts/core/OpsManagerLib.sol#L59)\n", + "first_markdown_element": "contracts/core/OpsManagerLib.sol#L55-L72", + "id": "7e51402c4c3f903960137b695ab80a5a95e96c56eb93a4b7d980470911d0bde6", + "check": "unused-return", "impact": "Medium", "confidence": "Medium" }, @@ -13345,19 +13623,16 @@ "elements": [ { "type": "function", - "name": "batchLiquidate", + "name": "requiresRebalance", "source_mapping": { - "start": 13008, - "length": 1632, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 2821, + "length": 553, + "filename_relative": "contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", + "filename_short": "contracts/core/OpsManagerLib.sol", "is_dependency": false, "lines": [ - 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, - 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359 + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95 ], "starting_column": 5, "ending_column": 6 @@ -13365,118 +13640,58 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "OpsManagerLib", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 158, + "length": 3905, + "filename_relative": "contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", + "filename_short": "contracts/core/OpsManagerLib.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, - 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, - 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, - 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, - 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, - 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, - 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, - 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, - 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, - 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, - 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, - 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, - 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, - 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, - 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, - 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, - 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, - 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, - 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, - 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, - 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, - 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, - 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, - 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, - 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, - 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, - 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, - 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, - 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, - 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, - 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, - 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, - 874, 875, 876, 877, 878, 879, 880, 881, 882 + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "batchLiquidate(address[])" + "signature": "requiresRebalance(Vault[],TreasuryFarmingRevenue)" } }, { "type": "node", - "name": "templeToken.safeIncreaseAllowance(address(treasuryReservesVault),totalCollateralClaimed)", + "name": "(inWindow) = vaults[i].inEnterExitWindow()", "source_mapping": { - "start": 14242, - "length": 89, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 3101, + "length": 49, + "filename_relative": "contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", + "filename_short": "contracts/core/OpsManagerLib.sol", "is_dependency": false, - "lines": [350], + "lines": [86], "starting_column": 13, - "ending_column": 102 + "ending_column": 62 }, "type_specific_fields": { "parent": { "type": "function", - "name": "batchLiquidate", + "name": "requiresRebalance", "source_mapping": { - "start": 13008, - "length": 1632, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 2821, + "length": 553, + "filename_relative": "contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", + "filename_short": "contracts/core/OpsManagerLib.sol", "is_dependency": false, "lines": [ - 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, - 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359 + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95 ], "starting_column": 5, "ending_column": 6 @@ -13484,6581 +13699,764 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "OpsManagerLib", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 158, + "length": 3905, + "filename_relative": "contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", + "filename_short": "contracts/core/OpsManagerLib.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "batchLiquidate(address[])" + "signature": "requiresRebalance(Vault[],TreasuryFarmingRevenue)" } } - }, - "additional_fields": { "underlying_type": "external_calls" } - }, + } + } + ], + "description": "OpsManagerLib.requiresRebalance(Vault[],TreasuryFarmingRevenue) (contracts/core/OpsManagerLib.sol#79-95) ignores return value by (inWindow) = vaults[i].inEnterExitWindow() (contracts/core/OpsManagerLib.sol#86)\n", + "markdown": "[OpsManagerLib.requiresRebalance(Vault[],TreasuryFarmingRevenue)](contracts/core/OpsManagerLib.sol#L79-L95) ignores return value by [(inWindow) = vaults[i].inEnterExitWindow()](contracts/core/OpsManagerLib.sol#L86)\n", + "first_markdown_element": "contracts/core/OpsManagerLib.sol#L79-L95", + "id": "0d939f6443be831bd662e4b85b8b26b8ca9716b8fd984c5961f3bbf84c6a1301", + "check": "unused-return", + "impact": "Medium", + "confidence": "Medium" + }, + { + "elements": [ { - "type": "node", - "name": "treasuryReservesVault.repay(templeToken,totalCollateralClaimed,address(tlcStrategy))", + "type": "variable", + "name": "quoteToken", "source_mapping": { - "start": 14345, - "length": 86, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 4822, + "length": 18, + "filename_relative": "contracts/interfaces/amo/IRamos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/amo/IRamos.sol", + "filename_short": "contracts/interfaces/amo/IRamos.sol", "is_dependency": false, - "lines": [351], - "starting_column": 13, - "ending_column": 99 + "lines": [103], + "starting_column": 9, + "ending_column": 27 }, "type_specific_fields": { "parent": { "type": "function", - "name": "batchLiquidate", + "name": "maxRebalanceAmounts", "source_mapping": { - "start": 13008, - "length": 1632, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 4738, + "length": 140, + "filename_relative": "contracts/interfaces/amo/IRamos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/amo/IRamos.sol", + "filename_short": "contracts/interfaces/amo/IRamos.sol", "is_dependency": false, - "lines": [ - 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, - 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359 - ], + "lines": [101, 102, 103, 104, 105], "starting_column": 5, - "ending_column": 6 + "ending_column": 7 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "IRamos", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 1408, + "length": 10519, + "filename_relative": "contracts/interfaces/amo/IRamos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/amo/IRamos.sol", + "filename_short": "contracts/interfaces/amo/IRamos.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "batchLiquidate(address[])" + "signature": "maxRebalanceAmounts()" } } - }, - "additional_fields": { "underlying_type": "external_calls" } + } }, { - "type": "node", - "name": "_repayTotalDebt(_cache,totalDebtWiped)", + "type": "function", + "name": "quoteToken", "source_mapping": { - "start": 14584, - "length": 39, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 3767, + "length": 53, + "filename_relative": "contracts/interfaces/amo/IRamos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/amo/IRamos.sol", + "filename_short": "contracts/interfaces/amo/IRamos.sol", "is_dependency": false, - "lines": [357], - "starting_column": 13, - "ending_column": 52 + "lines": [80], + "starting_column": 5, + "ending_column": 58 }, "type_specific_fields": { "parent": { - "type": "function", - "name": "batchLiquidate", + "type": "contract", + "name": "IRamos", "source_mapping": { - "start": 13008, - "length": 1632, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 1408, + "length": 10519, + "filename_relative": "contracts/interfaces/amo/IRamos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/amo/IRamos.sol", + "filename_short": "contracts/interfaces/amo/IRamos.sol", "is_dependency": false, "lines": [ - 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, - 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359 + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276 ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "quoteToken()" + } + } + ], + "description": "IRamos.maxRebalanceAmounts().quoteToken (contracts/interfaces/amo/IRamos.sol#103) shadows:\n\t- IRamos.quoteToken() (contracts/interfaces/amo/IRamos.sol#80) (function)\n", + "markdown": "[IRamos.maxRebalanceAmounts().quoteToken](contracts/interfaces/amo/IRamos.sol#L103) shadows:\n\t- [IRamos.quoteToken()](contracts/interfaces/amo/IRamos.sol#L80) (function)\n", + "first_markdown_element": "contracts/interfaces/amo/IRamos.sol#L103", + "id": "a030cfdb07ff13cdfeb8487608a714d3b198ff28886a8ef272f9e70a87a70f0a", + "check": "shadowing-local", + "impact": "Low", + "confidence": "High" + }, + { + "elements": [ + { + "type": "variable", + "name": "protocolToken", + "source_mapping": { + "start": 4850, + "length": 21, + "filename_relative": "contracts/interfaces/amo/IRamos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/amo/IRamos.sol", + "filename_short": "contracts/interfaces/amo/IRamos.sol", + "is_dependency": false, + "lines": [104], + "starting_column": 9, + "ending_column": 30 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "maxRebalanceAmounts", + "source_mapping": { + "start": 4738, + "length": 140, + "filename_relative": "contracts/interfaces/amo/IRamos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/amo/IRamos.sol", + "filename_short": "contracts/interfaces/amo/IRamos.sol", + "is_dependency": false, + "lines": [101, 102, 103, 104, 105], "starting_column": 5, - "ending_column": 6 + "ending_column": 7 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "IRamos", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 1408, + "length": 10519, + "filename_relative": "contracts/interfaces/amo/IRamos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/amo/IRamos.sol", + "filename_short": "contracts/interfaces/amo/IRamos.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "batchLiquidate(address[])" + "signature": "maxRebalanceAmounts()" } } - }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "debtTokenData" } }, { - "type": "node", - "name": "debtTokenData.interestRate = _cache.interestRate = newInterestRate", + "type": "function", + "name": "protocolToken", "source_mapping": { - "start": 27090, - "length": 66, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 3567, + "length": 56, + "filename_relative": "contracts/interfaces/amo/IRamos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/amo/IRamos.sol", + "filename_short": "contracts/interfaces/amo/IRamos.sol", "is_dependency": false, - "lines": [695], - "starting_column": 13, - "ending_column": 79 + "lines": [76], + "starting_column": 5, + "ending_column": 61 }, "type_specific_fields": { "parent": { - "type": "function", - "name": "_updateInterestRates", + "type": "contract", + "name": "IRamos", "source_mapping": { - "start": 26678, - "length": 495, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 1408, + "length": 10519, + "filename_relative": "contracts/interfaces/amo/IRamos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/amo/IRamos.sol", + "filename_short": "contracts/interfaces/amo/IRamos.sol", "is_dependency": false, "lines": [ - 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697 + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276 ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleLineOfCredit", - "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "_updateInterestRates(TempleLineOfCredit.DebtTokenCache)" + "starting_column": 1, + "ending_column": 0 } - } - }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "debtTokenData" + }, + "signature": "protocolToken()" } - }, + } + ], + "description": "IRamos.maxRebalanceAmounts().protocolToken (contracts/interfaces/amo/IRamos.sol#104) shadows:\n\t- IRamos.protocolToken() (contracts/interfaces/amo/IRamos.sol#76) (function)\n", + "markdown": "[IRamos.maxRebalanceAmounts().protocolToken](contracts/interfaces/amo/IRamos.sol#L104) shadows:\n\t- [IRamos.protocolToken()](contracts/interfaces/amo/IRamos.sol#L76) (function)\n", + "first_markdown_element": "contracts/interfaces/amo/IRamos.sol#L104", + "id": "99988e8d4356d61dc22dc1203ce47d52bd194ee6c04869d1c08b03332a4a64b3", + "check": "shadowing-local", + "impact": "Low", + "confidence": "High" + }, + { + "elements": [ { - "type": "node", - "name": "debtTokenData.totalDebt = _cache.totalDebt = _newDebt", + "type": "variable", + "name": "baseShares", "source_mapping": { - "start": 29882, - "length": 53, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 3468, + "length": 18, + "filename_relative": "contracts/interfaces/v2/ITempleDebtToken.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/v2/ITempleDebtToken.sol", + "filename_short": "contracts/interfaces/v2/ITempleDebtToken.sol", "is_dependency": false, - "lines": [777], - "starting_column": 13, - "ending_column": 66 + "lines": [86], + "starting_column": 9, + "ending_column": 27 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_repayTotalDebt", + "name": "debtors", "source_mapping": { - "start": 29563, - "length": 498, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 3219, + "length": 737, + "filename_relative": "contracts/interfaces/v2/ITempleDebtToken.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/v2/ITempleDebtToken.sol", + "filename_short": "contracts/interfaces/v2/ITempleDebtToken.sol", "is_dependency": false, "lines": [ - 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, - 779, 780, 781, 782 + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97 ], "starting_column": 5, - "ending_column": 6 + "ending_column": 7 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "ITempleDebtToken", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 325, + "length": 8309, + "filename_relative": "contracts/interfaces/v2/ITempleDebtToken.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/v2/ITempleDebtToken.sol", + "filename_short": "contracts/interfaces/v2/ITempleDebtToken.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_repayTotalDebt(TempleLineOfCredit.DebtTokenCache,uint128)" + "signature": "debtors(address)" } } - }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "debtTokenData" } - } - ], - "description": "Reentrancy in TempleLineOfCredit.batchLiquidate(address[]) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#318-359):\n\tExternal calls:\n\t- templeToken.safeIncreaseAllowance(address(treasuryReservesVault),totalCollateralClaimed) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#350)\n\t- treasuryReservesVault.repay(templeToken,totalCollateralClaimed,address(tlcStrategy)) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#351)\n\tState variables written after the call(s):\n\t- _repayTotalDebt(_cache,totalDebtWiped) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#357)\n\t\t- debtTokenData.interestRate = _cache.interestRate = newInterestRate (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#695)\n\t\t- debtTokenData.totalDebt = _cache.totalDebt = _newDebt (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#777)\n\tTempleLineOfCredit.debtTokenData (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#74) can be used in cross function reentrancies:\n\t- TempleLineOfCredit._debtTokenCache() (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#661-669)\n\t- TempleLineOfCredit._initDebtTokenCache(TempleLineOfCredit.DebtTokenCache) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#619-655)\n\t- TempleLineOfCredit._repayTotalDebt(TempleLineOfCredit.DebtTokenCache,uint128) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#766-782)\n\t- TempleLineOfCredit._updateInterestRates(TempleLineOfCredit.DebtTokenCache) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#685-697)\n\t- TempleLineOfCredit.borrow(uint128,address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#205-242)\n\t- TempleLineOfCredit.constructor(address,address,address,address,address,uint256,address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#105-134)\n\t- TempleLineOfCredit.debtTokenDetails() (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#551-556)\n", - "markdown": "Reentrancy in [TempleLineOfCredit.batchLiquidate(address[])](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L318-L359):\n\tExternal calls:\n\t- [templeToken.safeIncreaseAllowance(address(treasuryReservesVault),totalCollateralClaimed)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L350)\n\t- [treasuryReservesVault.repay(templeToken,totalCollateralClaimed,address(tlcStrategy))](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L351)\n\tState variables written after the call(s):\n\t- [_repayTotalDebt(_cache,totalDebtWiped)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L357)\n\t\t- [debtTokenData.interestRate = _cache.interestRate = newInterestRate](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L695)\n\t\t- [debtTokenData.totalDebt = _cache.totalDebt = _newDebt](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L777)\n\t[TempleLineOfCredit.debtTokenData](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L74) can be used in cross function reentrancies:\n\t- [TempleLineOfCredit._debtTokenCache()](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L661-L669)\n\t- [TempleLineOfCredit._initDebtTokenCache(TempleLineOfCredit.DebtTokenCache)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L619-L655)\n\t- [TempleLineOfCredit._repayTotalDebt(TempleLineOfCredit.DebtTokenCache,uint128)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L766-L782)\n\t- [TempleLineOfCredit._updateInterestRates(TempleLineOfCredit.DebtTokenCache)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L685-L697)\n\t- [TempleLineOfCredit.borrow(uint128,address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L205-L242)\n\t- [TempleLineOfCredit.constructor(address,address,address,address,address,uint256,address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L105-L134)\n\t- [TempleLineOfCredit.debtTokenDetails()](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L551-L556)\n", - "first_markdown_element": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L318-L359", - "id": "d4fb88326ba105e0f6c95c1c5e208d2c28da9c869bff30fe3736aba82d30dc91", - "check": "reentrancy-no-eth", - "impact": "Medium", - "confidence": "Medium" - }, - { - "elements": [ + }, { "type": "function", - "name": "borrow", + "name": "baseShares", "source_mapping": { - "start": 8353, - "length": 1525, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 1667, + "length": 54, + "filename_relative": "contracts/interfaces/v2/ITempleDebtToken.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/v2/ITempleDebtToken.sol", + "filename_short": "contracts/interfaces/v2/ITempleDebtToken.sol", "is_dependency": false, - "lines": [ - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242 - ], + "lines": [42], "starting_column": 5, - "ending_column": 6 + "ending_column": 59 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "ITempleDebtToken", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 325, + "length": 8309, + "filename_relative": "contracts/interfaces/v2/ITempleDebtToken.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/v2/ITempleDebtToken.sol", + "filename_short": "contracts/interfaces/v2/ITempleDebtToken.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, - 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, - 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, - 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, - 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, - 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, - 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, - 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, - 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, - 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, - 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, - 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, - 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, - 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, - 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, - 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, - 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, - 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, - 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, - 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, - 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, - 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, - 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, - 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, - 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, - 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, - 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, - 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, - 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, - 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, - 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, - 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, - 874, 875, 876, 877, 878, 879, 880, 881, 882 + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "borrow(uint128,address)" + "signature": "baseShares()" } - }, + } + ], + "description": "ITempleDebtToken.debtors(address).baseShares (contracts/interfaces/v2/ITempleDebtToken.sol#86) shadows:\n\t- ITempleDebtToken.baseShares() (contracts/interfaces/v2/ITempleDebtToken.sol#42) (function)\n", + "markdown": "[ITempleDebtToken.debtors(address).baseShares](contracts/interfaces/v2/ITempleDebtToken.sol#L86) shadows:\n\t- [ITempleDebtToken.baseShares()](contracts/interfaces/v2/ITempleDebtToken.sol#L42) (function)\n", + "first_markdown_element": "contracts/interfaces/v2/ITempleDebtToken.sol#L86", + "id": "660d8ad3fe151743a4b6eac08ff790cbd92361508e6a7e1ac51d359fbd40579a", + "check": "shadowing-local", + "impact": "Low", + "confidence": "High" + }, + { + "elements": [ { - "type": "node", - "name": "circuitBreakerProxy.preCheck(address(daiToken),msg.sender,amount)", + "type": "variable", + "name": "borrow", "source_mapping": { - "start": 8827, - "length": 115, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 11494, + "length": 11, + "filename_relative": "contracts/interfaces/v2/ITreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/v2/ITreasuryReservesVault.sol", + "filename_short": "contracts/interfaces/v2/ITreasuryReservesVault.sol", "is_dependency": false, - "lines": [213, 214, 215, 216, 217], - "starting_column": 9, - "ending_column": 10 + "lines": [291], + "starting_column": 30, + "ending_column": 41 }, "type_specific_fields": { "parent": { "type": "function", - "name": "borrow", + "name": "setGlobalPaused", "source_mapping": { - "start": 8353, - "length": 1525, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 11469, + "length": 60, + "filename_relative": "contracts/interfaces/v2/ITreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/v2/ITreasuryReservesVault.sol", + "filename_short": "contracts/interfaces/v2/ITreasuryReservesVault.sol", "is_dependency": false, - "lines": [ - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242 - ], + "lines": [291], "starting_column": 5, - "ending_column": 6 + "ending_column": 65 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "ITreasuryReservesVault", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "borrow(uint128,address)" - } - } - }, - "additional_fields": { "underlying_type": "external_calls" } - }, - { - "type": "node", - "name": "_accountData.debtCheckpoint = _totalDebt", - "source_mapping": { - "start": 9285, - "length": 40, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [229], - "starting_column": 13, - "ending_column": 53 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "borrow", - "source_mapping": { - "start": 8353, - "length": 1525, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [ - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleLineOfCredit", - "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "borrow(uint128,address)" - } - } - }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "allAccountsData" - } - }, - { - "type": "node", - "name": "_accountData.interestAccumulator = _cache.interestAccumulator", - "source_mapping": { - "start": 9339, - "length": 61, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [230], - "starting_column": 13, - "ending_column": 74 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "borrow", - "source_mapping": { - "start": 8353, - "length": 1525, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [ - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleLineOfCredit", - "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "borrow(uint128,address)" - } - } - }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "allAccountsData" - } - }, - { - "type": "node", - "name": "debtTokenData.totalDebt = _cache.totalDebt = _cache.totalDebt + amount", - "source_mapping": { - "start": 9414, - "length": 70, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [231], - "starting_column": 13, - "ending_column": 83 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "borrow", - "source_mapping": { - "start": 8353, - "length": 1525, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [ - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleLineOfCredit", - "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "borrow(uint128,address)" - } - } - }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "debtTokenData" - } - }, - { - "type": "node", - "name": "_updateInterestRates(_cache)", - "source_mapping": { - "start": 9592, - "length": 28, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [234], - "starting_column": 13, - "ending_column": 41 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "borrow", - "source_mapping": { - "start": 8353, - "length": 1525, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [ - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleLineOfCredit", - "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "borrow(uint128,address)" - } - } - }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "debtTokenData" - } - }, - { - "type": "node", - "name": "debtTokenData.interestRate = _cache.interestRate = newInterestRate", - "source_mapping": { - "start": 27090, - "length": 66, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [695], - "starting_column": 13, - "ending_column": 79 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "_updateInterestRates", - "source_mapping": { - "start": 26678, - "length": 495, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [ - 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleLineOfCredit", - "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "_updateInterestRates(TempleLineOfCredit.DebtTokenCache)" - } - } - }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "debtTokenData" - } - } - ], - "description": "Reentrancy in TempleLineOfCredit.borrow(uint128,address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#205-242):\n\tExternal calls:\n\t- circuitBreakerProxy.preCheck(address(daiToken),msg.sender,amount) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#213-217)\n\tState variables written after the call(s):\n\t- _accountData.debtCheckpoint = _totalDebt (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#229)\n\tTempleLineOfCredit.allAccountsData (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#68) can be used in cross function reentrancies:\n\t- TempleLineOfCredit.accountData(address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#540-546)\n\t- TempleLineOfCredit.accountPosition(address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#484-503)\n\t- TempleLineOfCredit.addCollateral(uint128,address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#145-159)\n\t- TempleLineOfCredit.batchLiquidate(address[]) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#318-359)\n\t- TempleLineOfCredit.borrow(uint128,address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#205-242)\n\t- TempleLineOfCredit.computeLiquidity(address[]) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#523-535)\n\t- TempleLineOfCredit.removeCollateral(uint128,address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#166-190)\n\t- TempleLineOfCredit.repay(uint128,address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#253-280)\n\t- TempleLineOfCredit.repayAll(address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#287-305)\n\t- _accountData.interestAccumulator = _cache.interestAccumulator (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#230)\n\tTempleLineOfCredit.allAccountsData (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#68) can be used in cross function reentrancies:\n\t- TempleLineOfCredit.accountData(address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#540-546)\n\t- TempleLineOfCredit.accountPosition(address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#484-503)\n\t- TempleLineOfCredit.addCollateral(uint128,address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#145-159)\n\t- TempleLineOfCredit.batchLiquidate(address[]) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#318-359)\n\t- TempleLineOfCredit.borrow(uint128,address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#205-242)\n\t- TempleLineOfCredit.computeLiquidity(address[]) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#523-535)\n\t- TempleLineOfCredit.removeCollateral(uint128,address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#166-190)\n\t- TempleLineOfCredit.repay(uint128,address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#253-280)\n\t- TempleLineOfCredit.repayAll(address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#287-305)\n\t- debtTokenData.totalDebt = _cache.totalDebt = _cache.totalDebt + amount (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#231)\n\tTempleLineOfCredit.debtTokenData (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#74) can be used in cross function reentrancies:\n\t- TempleLineOfCredit._debtTokenCache() (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#661-669)\n\t- TempleLineOfCredit._initDebtTokenCache(TempleLineOfCredit.DebtTokenCache) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#619-655)\n\t- TempleLineOfCredit._repayTotalDebt(TempleLineOfCredit.DebtTokenCache,uint128) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#766-782)\n\t- TempleLineOfCredit._updateInterestRates(TempleLineOfCredit.DebtTokenCache) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#685-697)\n\t- TempleLineOfCredit.borrow(uint128,address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#205-242)\n\t- TempleLineOfCredit.constructor(address,address,address,address,address,uint256,address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#105-134)\n\t- TempleLineOfCredit.debtTokenDetails() (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#551-556)\n\t- _updateInterestRates(_cache) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#234)\n\t\t- debtTokenData.interestRate = _cache.interestRate = newInterestRate (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#695)\n\tTempleLineOfCredit.debtTokenData (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#74) can be used in cross function reentrancies:\n\t- TempleLineOfCredit._debtTokenCache() (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#661-669)\n\t- TempleLineOfCredit._initDebtTokenCache(TempleLineOfCredit.DebtTokenCache) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#619-655)\n\t- TempleLineOfCredit._repayTotalDebt(TempleLineOfCredit.DebtTokenCache,uint128) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#766-782)\n\t- TempleLineOfCredit._updateInterestRates(TempleLineOfCredit.DebtTokenCache) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#685-697)\n\t- TempleLineOfCredit.borrow(uint128,address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#205-242)\n\t- TempleLineOfCredit.constructor(address,address,address,address,address,uint256,address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#105-134)\n\t- TempleLineOfCredit.debtTokenDetails() (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#551-556)\n", - "markdown": "Reentrancy in [TempleLineOfCredit.borrow(uint128,address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L205-L242):\n\tExternal calls:\n\t- [circuitBreakerProxy.preCheck(address(daiToken),msg.sender,amount)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L213-L217)\n\tState variables written after the call(s):\n\t- [_accountData.debtCheckpoint = _totalDebt](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L229)\n\t[TempleLineOfCredit.allAccountsData](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L68) can be used in cross function reentrancies:\n\t- [TempleLineOfCredit.accountData(address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L540-L546)\n\t- [TempleLineOfCredit.accountPosition(address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L484-L503)\n\t- [TempleLineOfCredit.addCollateral(uint128,address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L145-L159)\n\t- [TempleLineOfCredit.batchLiquidate(address[])](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L318-L359)\n\t- [TempleLineOfCredit.borrow(uint128,address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L205-L242)\n\t- [TempleLineOfCredit.computeLiquidity(address[])](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L523-L535)\n\t- [TempleLineOfCredit.removeCollateral(uint128,address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L166-L190)\n\t- [TempleLineOfCredit.repay(uint128,address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L253-L280)\n\t- [TempleLineOfCredit.repayAll(address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L287-L305)\n\t- [_accountData.interestAccumulator = _cache.interestAccumulator](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L230)\n\t[TempleLineOfCredit.allAccountsData](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L68) can be used in cross function reentrancies:\n\t- [TempleLineOfCredit.accountData(address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L540-L546)\n\t- [TempleLineOfCredit.accountPosition(address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L484-L503)\n\t- [TempleLineOfCredit.addCollateral(uint128,address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L145-L159)\n\t- [TempleLineOfCredit.batchLiquidate(address[])](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L318-L359)\n\t- [TempleLineOfCredit.borrow(uint128,address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L205-L242)\n\t- [TempleLineOfCredit.computeLiquidity(address[])](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L523-L535)\n\t- [TempleLineOfCredit.removeCollateral(uint128,address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L166-L190)\n\t- [TempleLineOfCredit.repay(uint128,address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L253-L280)\n\t- [TempleLineOfCredit.repayAll(address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L287-L305)\n\t- [debtTokenData.totalDebt = _cache.totalDebt = _cache.totalDebt + amount](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L231)\n\t[TempleLineOfCredit.debtTokenData](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L74) can be used in cross function reentrancies:\n\t- [TempleLineOfCredit._debtTokenCache()](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L661-L669)\n\t- [TempleLineOfCredit._initDebtTokenCache(TempleLineOfCredit.DebtTokenCache)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L619-L655)\n\t- [TempleLineOfCredit._repayTotalDebt(TempleLineOfCredit.DebtTokenCache,uint128)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L766-L782)\n\t- [TempleLineOfCredit._updateInterestRates(TempleLineOfCredit.DebtTokenCache)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L685-L697)\n\t- [TempleLineOfCredit.borrow(uint128,address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L205-L242)\n\t- [TempleLineOfCredit.constructor(address,address,address,address,address,uint256,address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L105-L134)\n\t- [TempleLineOfCredit.debtTokenDetails()](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L551-L556)\n\t- [_updateInterestRates(_cache)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L234)\n\t\t- [debtTokenData.interestRate = _cache.interestRate = newInterestRate](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L695)\n\t[TempleLineOfCredit.debtTokenData](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L74) can be used in cross function reentrancies:\n\t- [TempleLineOfCredit._debtTokenCache()](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L661-L669)\n\t- [TempleLineOfCredit._initDebtTokenCache(TempleLineOfCredit.DebtTokenCache)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L619-L655)\n\t- [TempleLineOfCredit._repayTotalDebt(TempleLineOfCredit.DebtTokenCache,uint128)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L766-L782)\n\t- [TempleLineOfCredit._updateInterestRates(TempleLineOfCredit.DebtTokenCache)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L685-L697)\n\t- [TempleLineOfCredit.borrow(uint128,address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L205-L242)\n\t- [TempleLineOfCredit.constructor(address,address,address,address,address,uint256,address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L105-L134)\n\t- [TempleLineOfCredit.debtTokenDetails()](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L551-L556)\n", - "first_markdown_element": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L205-L242", - "id": "2ca8e8f2b40c6085bb2b4a0c20ae4e776d1fcad005ed38a0ed3548d408cf45b2", - "check": "reentrancy-no-eth", - "impact": "Medium", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "deployPayouts", - "source_mapping": { - "start": 2818, - "length": 1078, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", - "is_dependency": false, - "lines": [ - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleTeamPaymentsFactory", - "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", - "is_dependency": false, - "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" - } - }, - { - "type": "node", - "name": "paymentContract.initialize(_token)", - "source_mapping": { - "start": 3274, - "length": 34, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", - "is_dependency": false, - "lines": [89], - "starting_column": 9, - "ending_column": 43 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "deployPayouts", - "source_mapping": { - "start": 2818, - "length": 1078, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", - "is_dependency": false, - "lines": [ - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleTeamPaymentsFactory", - "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", - "is_dependency": false, - "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" - } - } - }, - "additional_fields": { "underlying_type": "external_calls" } - }, - { - "type": "node", - "name": "paymentContract.setAllocations(_dests,_allocations)", - "source_mapping": { - "start": 3318, - "length": 52, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", - "is_dependency": false, - "lines": [90], - "starting_column": 9, - "ending_column": 61 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "deployPayouts", - "source_mapping": { - "start": 2818, - "length": 1078, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", - "is_dependency": false, - "lines": [ - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleTeamPaymentsFactory", - "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", - "is_dependency": false, - "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" - } - } - }, - "additional_fields": { "underlying_type": "external_calls" } - }, - { - "type": "node", - "name": "paymentContract.transferOwnership(msg.sender)", - "source_mapping": { - "start": 3381, - "length": 45, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", - "is_dependency": false, - "lines": [92], - "starting_column": 9, - "ending_column": 54 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "deployPayouts", - "source_mapping": { - "start": 2818, - "length": 1078, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", - "is_dependency": false, - "lines": [ - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleTeamPaymentsFactory", - "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", - "is_dependency": false, - "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" - } - } - }, - "additional_fields": { "underlying_type": "external_calls" } - }, - { - "type": "node", - "name": "SafeERC20.safeTransferFrom(_token,msg.sender,address(paymentContract),_totalFunding)", - "source_mapping": { - "start": 3473, - "length": 165, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", - "is_dependency": false, - "lines": [95, 96, 97, 98, 99, 100], - "starting_column": 13, - "ending_column": 14 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "deployPayouts", - "source_mapping": { - "start": 2818, - "length": 1078, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", - "is_dependency": false, - "lines": [ - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleTeamPaymentsFactory", - "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", - "is_dependency": false, - "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" - } - } - }, - "additional_fields": { "underlying_type": "external_calls" } - }, - { - "type": "node", - "name": "incrementEpoch(address(paymentContract),_totalFunding)", - "source_mapping": { - "start": 3649, - "length": 55, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", - "is_dependency": false, - "lines": [102], - "starting_column": 9, - "ending_column": 64 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "deployPayouts", - "source_mapping": { - "start": 2818, - "length": 1078, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", - "is_dependency": false, - "lines": [ - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleTeamPaymentsFactory", - "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", - "is_dependency": false, - "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" - } - } - }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "lastPaidEpoch" - } - }, - { - "type": "node", - "name": "data = FundingData(address(_paymentContract),_totalFunding,lastPaidEpoch ++)", - "source_mapping": { - "start": 1542, - "length": 182, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", - "is_dependency": false, - "lines": [50, 51, 52, 53, 54], - "starting_column": 9, - "ending_column": 11 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "incrementEpoch", - "source_mapping": { - "start": 1428, - "length": 347, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", - "is_dependency": false, - "lines": [46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleTeamPaymentsFactory", - "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", - "is_dependency": false, - "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "incrementEpoch(address,uint256)" - } - } - }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "lastPaidEpoch" - } - } - ], - "description": "Reentrancy in TempleTeamPaymentsFactory.deployPayouts(IERC20,address[],uint256[],uint256) (contracts/admin/TempleTeamPaymentsFactory.sol#79-112):\n\tExternal calls:\n\t- paymentContract.initialize(_token) (contracts/admin/TempleTeamPaymentsFactory.sol#89)\n\t- paymentContract.setAllocations(_dests,_allocations) (contracts/admin/TempleTeamPaymentsFactory.sol#90)\n\t- paymentContract.transferOwnership(msg.sender) (contracts/admin/TempleTeamPaymentsFactory.sol#92)\n\t- SafeERC20.safeTransferFrom(_token,msg.sender,address(paymentContract),_totalFunding) (contracts/admin/TempleTeamPaymentsFactory.sol#95-100)\n\tState variables written after the call(s):\n\t- incrementEpoch(address(paymentContract),_totalFunding) (contracts/admin/TempleTeamPaymentsFactory.sol#102)\n\t\t- data = FundingData(address(_paymentContract),_totalFunding,lastPaidEpoch ++) (contracts/admin/TempleTeamPaymentsFactory.sol#50-54)\n\tTempleTeamPaymentsFactory.lastPaidEpoch (contracts/admin/TempleTeamPaymentsFactory.sol#23) can be used in cross function reentrancies:\n\t- TempleTeamPaymentsFactory.constructor(address,uint16) (contracts/admin/TempleTeamPaymentsFactory.sol#40-44)\n\t- TempleTeamPaymentsFactory.deployPayouts(IERC20,address[],uint256[],uint256) (contracts/admin/TempleTeamPaymentsFactory.sol#79-112)\n\t- TempleTeamPaymentsFactory.directPayouts(IERC20,address[],uint256[]) (contracts/admin/TempleTeamPaymentsFactory.sol#119-143)\n\t- TempleTeamPaymentsFactory.incrementEpoch(address,uint256) (contracts/admin/TempleTeamPaymentsFactory.sol#46-56)\n\t- TempleTeamPaymentsFactory.lastPaidEpoch (contracts/admin/TempleTeamPaymentsFactory.sol#23)\n", - "markdown": "Reentrancy in [TempleTeamPaymentsFactory.deployPayouts(IERC20,address[],uint256[],uint256)](contracts/admin/TempleTeamPaymentsFactory.sol#L79-L112):\n\tExternal calls:\n\t- [paymentContract.initialize(_token)](contracts/admin/TempleTeamPaymentsFactory.sol#L89)\n\t- [paymentContract.setAllocations(_dests,_allocations)](contracts/admin/TempleTeamPaymentsFactory.sol#L90)\n\t- [paymentContract.transferOwnership(msg.sender)](contracts/admin/TempleTeamPaymentsFactory.sol#L92)\n\t- [SafeERC20.safeTransferFrom(_token,msg.sender,address(paymentContract),_totalFunding)](contracts/admin/TempleTeamPaymentsFactory.sol#L95-L100)\n\tState variables written after the call(s):\n\t- [incrementEpoch(address(paymentContract),_totalFunding)](contracts/admin/TempleTeamPaymentsFactory.sol#L102)\n\t\t- [data = FundingData(address(_paymentContract),_totalFunding,lastPaidEpoch ++)](contracts/admin/TempleTeamPaymentsFactory.sol#L50-L54)\n\t[TempleTeamPaymentsFactory.lastPaidEpoch](contracts/admin/TempleTeamPaymentsFactory.sol#L23) can be used in cross function reentrancies:\n\t- [TempleTeamPaymentsFactory.constructor(address,uint16)](contracts/admin/TempleTeamPaymentsFactory.sol#L40-L44)\n\t- [TempleTeamPaymentsFactory.deployPayouts(IERC20,address[],uint256[],uint256)](contracts/admin/TempleTeamPaymentsFactory.sol#L79-L112)\n\t- [TempleTeamPaymentsFactory.directPayouts(IERC20,address[],uint256[])](contracts/admin/TempleTeamPaymentsFactory.sol#L119-L143)\n\t- [TempleTeamPaymentsFactory.incrementEpoch(address,uint256)](contracts/admin/TempleTeamPaymentsFactory.sol#L46-L56)\n\t- [TempleTeamPaymentsFactory.lastPaidEpoch](contracts/admin/TempleTeamPaymentsFactory.sol#L23)\n", - "first_markdown_element": "contracts/admin/TempleTeamPaymentsFactory.sol#L79-L112", - "id": "0ef60db91bf11fbb89d1b41ed0b890f7113302af0fa8946cb275b90a1c85d514", - "check": "reentrancy-no-eth", - "impact": "Medium", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "removeCollateral", - "source_mapping": { - "start": 6498, - "length": 1031, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [ - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleLineOfCredit", - "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, - 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, - 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, - 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, - 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, - 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, - 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, - 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, - 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, - 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, - 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, - 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, - 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, - 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, - 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, - 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, - 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, - 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, - 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, - 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, - 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, - 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, - 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, - 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, - 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, - 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, - 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, - 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, - 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, - 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, - 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, - 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, - 874, 875, 876, 877, 878, 879, 880, 881, 882 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "removeCollateral(uint128,address)" - } - }, - { - "type": "node", - "name": "circuitBreakerProxy.preCheck(address(templeToken),msg.sender,amount)", - "source_mapping": { - "start": 7012, - "length": 118, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [173, 174, 175, 176, 177], - "starting_column": 9, - "ending_column": 10 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "removeCollateral", - "source_mapping": { - "start": 6498, - "length": 1031, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [ - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleLineOfCredit", - "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "removeCollateral(uint128,address)" - } - } - }, - "additional_fields": { "underlying_type": "external_calls" } - }, - { - "type": "node", - "name": "_accountData.collateral = _collateral - amount", - "source_mapping": { - "start": 7229, - "length": 46, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [180], - "starting_column": 9, - "ending_column": 55 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "removeCollateral", - "source_mapping": { - "start": 6498, - "length": 1031, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [ - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleLineOfCredit", - "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "removeCollateral(uint128,address)" - } - } - }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "allAccountsData" - } - } - ], - "description": "Reentrancy in TempleLineOfCredit.removeCollateral(uint128,address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#166-190):\n\tExternal calls:\n\t- circuitBreakerProxy.preCheck(address(templeToken),msg.sender,amount) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#173-177)\n\tState variables written after the call(s):\n\t- _accountData.collateral = _collateral - amount (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#180)\n\tTempleLineOfCredit.allAccountsData (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#68) can be used in cross function reentrancies:\n\t- TempleLineOfCredit.accountData(address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#540-546)\n\t- TempleLineOfCredit.accountPosition(address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#484-503)\n\t- TempleLineOfCredit.addCollateral(uint128,address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#145-159)\n\t- TempleLineOfCredit.batchLiquidate(address[]) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#318-359)\n\t- TempleLineOfCredit.borrow(uint128,address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#205-242)\n\t- TempleLineOfCredit.computeLiquidity(address[]) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#523-535)\n\t- TempleLineOfCredit.removeCollateral(uint128,address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#166-190)\n\t- TempleLineOfCredit.repay(uint128,address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#253-280)\n\t- TempleLineOfCredit.repayAll(address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#287-305)\n", - "markdown": "Reentrancy in [TempleLineOfCredit.removeCollateral(uint128,address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L166-L190):\n\tExternal calls:\n\t- [circuitBreakerProxy.preCheck(address(templeToken),msg.sender,amount)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L173-L177)\n\tState variables written after the call(s):\n\t- [_accountData.collateral = _collateral - amount](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L180)\n\t[TempleLineOfCredit.allAccountsData](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L68) can be used in cross function reentrancies:\n\t- [TempleLineOfCredit.accountData(address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L540-L546)\n\t- [TempleLineOfCredit.accountPosition(address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L484-L503)\n\t- [TempleLineOfCredit.addCollateral(uint128,address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L145-L159)\n\t- [TempleLineOfCredit.batchLiquidate(address[])](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L318-L359)\n\t- [TempleLineOfCredit.borrow(uint128,address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L205-L242)\n\t- [TempleLineOfCredit.computeLiquidity(address[])](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L523-L535)\n\t- [TempleLineOfCredit.removeCollateral(uint128,address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L166-L190)\n\t- [TempleLineOfCredit.repay(uint128,address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L253-L280)\n\t- [TempleLineOfCredit.repayAll(address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L287-L305)\n", - "first_markdown_element": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L166-L190", - "id": "dffbe20bcc1c2f91394c175a10bd84f3964c2b4101e0079bbddcef08bf456d02", - "check": "reentrancy-no-eth", - "impact": "Medium", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "setTlcStrategy", - "source_mapping": { - "start": 15688, - "length": 875, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [ - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleLineOfCredit", - "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, - 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, - 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, - 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, - 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, - 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, - 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, - 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, - 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, - 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, - 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, - 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, - 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, - 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, - 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, - 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, - 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, - 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, - 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, - 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, - 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, - 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, - 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, - 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, - 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, - 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, - 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, - 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, - 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, - 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, - 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, - 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, - 874, 875, 876, 877, 878, 879, 880, 881, 882 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "setTlcStrategy(address)" - } - }, - { - "type": "node", - "name": "daiToken.safeApprove(previousTrv,0)", - "source_mapping": { - "start": 16002, - "length": 36, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [394], - "starting_column": 13, - "ending_column": 49 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "setTlcStrategy", - "source_mapping": { - "start": 15688, - "length": 875, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [ - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleLineOfCredit", - "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "setTlcStrategy(address)" - } - } - }, - "additional_fields": { "underlying_type": "external_calls" } - }, - { - "type": "node", - "name": "treasuryReservesVault = ITreasuryReservesVault(_trv)", - "source_mapping": { - "start": 16128, - "length": 52, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [398], - "starting_column": 9, - "ending_column": 61 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "setTlcStrategy", - "source_mapping": { - "start": 15688, - "length": 875, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [ - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleLineOfCredit", - "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "setTlcStrategy(address)" - } - } - }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "treasuryReservesVault" - } - } - ], - "description": "Reentrancy in TempleLineOfCredit.setTlcStrategy(address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#386-410):\n\tExternal calls:\n\t- daiToken.safeApprove(previousTrv,0) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#394)\n\tState variables written after the call(s):\n\t- treasuryReservesVault = ITreasuryReservesVault(_trv) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#398)\n\tTempleLineOfCredit.treasuryReservesVault (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#53) can be used in cross function reentrancies:\n\t- TempleLineOfCredit._initDebtTokenCache(TempleLineOfCredit.DebtTokenCache) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#619-655)\n\t- TempleLineOfCredit._repayToken(TempleLineOfCredit.DebtTokenCache,uint128,address,address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#702-718)\n\t- TempleLineOfCredit.batchLiquidate(address[]) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#318-359)\n\t- TempleLineOfCredit.setTlcStrategy(address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#386-410)\n\t- TempleLineOfCredit.treasuryReservesVault (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#53)\n", - "markdown": "Reentrancy in [TempleLineOfCredit.setTlcStrategy(address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L386-L410):\n\tExternal calls:\n\t- [daiToken.safeApprove(previousTrv,0)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L394)\n\tState variables written after the call(s):\n\t- [treasuryReservesVault = ITreasuryReservesVault(_trv)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L398)\n\t[TempleLineOfCredit.treasuryReservesVault](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L53) can be used in cross function reentrancies:\n\t- [TempleLineOfCredit._initDebtTokenCache(TempleLineOfCredit.DebtTokenCache)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L619-L655)\n\t- [TempleLineOfCredit._repayToken(TempleLineOfCredit.DebtTokenCache,uint128,address,address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L702-L718)\n\t- [TempleLineOfCredit.batchLiquidate(address[])](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L318-L359)\n\t- [TempleLineOfCredit.setTlcStrategy(address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L386-L410)\n\t- [TempleLineOfCredit.treasuryReservesVault](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L53)\n", - "first_markdown_element": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L386-L410", - "id": "45124547e30483595bf298aa091c92ce13c079404c993c2c8406499fd02de4c8", - "check": "reentrancy-no-eth", - "impact": "Medium", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "setTokenVault", - "source_mapping": { - "start": 7963, - "length": 749, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", - "is_dependency": false, - "lines": [ - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, - 202, 203, 204, 205, 206, 207, 208, 209 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "Ramos", - "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", - "is_dependency": false, - "lines": [ - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, - 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, - 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, - 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, - 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, - 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, - 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, - 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, - 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, - 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, - 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, - 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, - 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, - 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, - 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, - 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, - 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, - 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "setTokenVault(address)" - } - }, - { - "type": "node", - "name": "protocolToken.safeApprove(previousVault,0)", - "source_mapping": { - "start": 8231, - "length": 43, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", - "is_dependency": false, - "lines": [195], - "starting_column": 13, - "ending_column": 56 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "setTokenVault", - "source_mapping": { - "start": 7963, - "length": 749, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", - "is_dependency": false, - "lines": [ - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, - 202, 203, 204, 205, 206, 207, 208, 209 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "Ramos", - "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", - "is_dependency": false, - "lines": [ - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, - 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, - 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, - 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, - 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, - 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, - 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, - 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "setTokenVault(address)" - } - } - }, - "additional_fields": { "underlying_type": "external_calls" } - }, - { - "type": "node", - "name": "quoteToken.safeApprove(previousVault,0)", - "source_mapping": { - "start": 8288, - "length": 40, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", - "is_dependency": false, - "lines": [196], - "starting_column": 13, - "ending_column": 53 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "setTokenVault", - "source_mapping": { - "start": 7963, - "length": 749, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", - "is_dependency": false, - "lines": [ - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, - 202, 203, 204, 205, 206, 207, 208, 209 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "Ramos", - "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", - "is_dependency": false, - "lines": [ - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, - 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, - 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, - 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, - 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, - 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, - 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, - 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "setTokenVault(address)" - } - } - }, - "additional_fields": { "underlying_type": "external_calls" } - }, - { - "type": "node", - "name": "tokenVault = IRamosTokenVault(vault)", - "source_mapping": { - "start": 8349, - "length": 36, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", - "is_dependency": false, - "lines": [199], - "starting_column": 9, - "ending_column": 45 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "setTokenVault", - "source_mapping": { - "start": 7963, - "length": 749, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", - "is_dependency": false, - "lines": [ - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, - 202, 203, 204, 205, 206, 207, 208, 209 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "Ramos", - "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", - "is_dependency": false, - "lines": [ - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, - 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, - 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, - 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, - 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, - 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, - 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, - 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "setTokenVault(address)" - } - } - }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "tokenVault" - } - } - ], - "description": "Reentrancy in Ramos.setTokenVault(address) (contracts/amo/Ramos.sol#189-209):\n\tExternal calls:\n\t- protocolToken.safeApprove(previousVault,0) (contracts/amo/Ramos.sol#195)\n\t- quoteToken.safeApprove(previousVault,0) (contracts/amo/Ramos.sol#196)\n\tState variables written after the call(s):\n\t- tokenVault = IRamosTokenVault(vault) (contracts/amo/Ramos.sol#199)\n\tRamos.tokenVault (contracts/amo/Ramos.sol#78) can be used in cross function reentrancies:\n\t- Ramos.addLiquidity(IBalancerVault.JoinPoolRequest) (contracts/amo/Ramos.sol#464-513)\n\t- Ramos.rebalanceDownExit(uint256,uint256) (contracts/amo/Ramos.sol#334-364)\n\t- Ramos.rebalanceDownJoin(uint256,uint256) (contracts/amo/Ramos.sol#421-455)\n\t- Ramos.rebalanceUpExit(uint256,uint256) (contracts/amo/Ramos.sol#290-322)\n\t- Ramos.rebalanceUpJoin(uint256,uint256) (contracts/amo/Ramos.sol#376-409)\n\t- Ramos.removeLiquidity(IBalancerVault.ExitPoolRequest,uint256) (contracts/amo/Ramos.sol#522-559)\n\t- Ramos.setTokenVault(address) (contracts/amo/Ramos.sol#189-209)\n\t- Ramos.tokenVault (contracts/amo/Ramos.sol#78)\n", - "markdown": "Reentrancy in [Ramos.setTokenVault(address)](contracts/amo/Ramos.sol#L189-L209):\n\tExternal calls:\n\t- [protocolToken.safeApprove(previousVault,0)](contracts/amo/Ramos.sol#L195)\n\t- [quoteToken.safeApprove(previousVault,0)](contracts/amo/Ramos.sol#L196)\n\tState variables written after the call(s):\n\t- [tokenVault = IRamosTokenVault(vault)](contracts/amo/Ramos.sol#L199)\n\t[Ramos.tokenVault](contracts/amo/Ramos.sol#L78) can be used in cross function reentrancies:\n\t- [Ramos.addLiquidity(IBalancerVault.JoinPoolRequest)](contracts/amo/Ramos.sol#L464-L513)\n\t- [Ramos.rebalanceDownExit(uint256,uint256)](contracts/amo/Ramos.sol#L334-L364)\n\t- [Ramos.rebalanceDownJoin(uint256,uint256)](contracts/amo/Ramos.sol#L421-L455)\n\t- [Ramos.rebalanceUpExit(uint256,uint256)](contracts/amo/Ramos.sol#L290-L322)\n\t- [Ramos.rebalanceUpJoin(uint256,uint256)](contracts/amo/Ramos.sol#L376-L409)\n\t- [Ramos.removeLiquidity(IBalancerVault.ExitPoolRequest,uint256)](contracts/amo/Ramos.sol#L522-L559)\n\t- [Ramos.setTokenVault(address)](contracts/amo/Ramos.sol#L189-L209)\n\t- [Ramos.tokenVault](contracts/amo/Ramos.sol#L78)\n", - "first_markdown_element": "contracts/amo/Ramos.sol#L189-L209", - "id": "51c39733accdc5dde8af1e99214d3003e0a2be1fffb777f3eb06a7fc56a19db1", - "check": "reentrancy-no-eth", - "impact": "Medium", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "shutdown", - "source_mapping": { - "start": 11820, - "length": 1568, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", - "is_dependency": false, - "lines": [ - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TreasuryReservesVault", - "source_mapping": { - "start": 2150, - "length": 31934, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", - "is_dependency": false, - "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, - 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, - 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, - 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, - 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, - 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, - 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, - 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, - 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, - 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, - 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, - 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, - 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, - 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, - 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, - 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, - 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, - 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, - 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, - 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, - 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, - 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, - 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, - 771, 772, 773, 774, 775, 776 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "shutdown(address)" - } - }, - { - "type": "node", - "name": "_outstandingDebt = borrowTokens[_token].dToken.burnAll(strategy)", - "source_mapping": { - "start": 12497, - "length": 64, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", - "is_dependency": false, - "lines": [296], - "starting_column": 13, - "ending_column": 77 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "shutdown", - "source_mapping": { - "start": 11820, - "length": 1568, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", - "is_dependency": false, - "lines": [ - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TreasuryReservesVault", - "source_mapping": { - "start": 2150, - "length": 31934, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", - "is_dependency": false, - "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "shutdown(address)" - } - } - }, - "additional_fields": { "underlying_type": "external_calls" } - }, - { - "type": "node", - "name": "delete strategies[strategy]", - "source_mapping": { - "start": 13315, - "length": 27, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", - "is_dependency": false, - "lines": [316], - "starting_column": 9, - "ending_column": 36 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "shutdown", - "source_mapping": { - "start": 11820, - "length": 1568, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", - "is_dependency": false, - "lines": [ - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TreasuryReservesVault", - "source_mapping": { - "start": 2150, - "length": 31934, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", - "is_dependency": false, - "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "shutdown(address)" - } - } - }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "strategies" - } - } - ], - "description": "Reentrancy in TreasuryReservesVault.shutdown(address) (contracts/v2/TreasuryReservesVault.sol#283-318):\n\tExternal calls:\n\t- _outstandingDebt = borrowTokens[_token].dToken.burnAll(strategy) (contracts/v2/TreasuryReservesVault.sol#296)\n\tState variables written after the call(s):\n\t- delete strategies[strategy] (contracts/v2/TreasuryReservesVault.sol#316)\n\tTreasuryReservesVault.strategies (contracts/v2/TreasuryReservesVault.sol#55) can be used in cross function reentrancies:\n\t- TreasuryReservesVault._getStrategyConfig(address) (contracts/v2/TreasuryReservesVault.sol#708-711)\n\t- TreasuryReservesVault._withdrawFromBaseStrategy(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,address,uint256) (contracts/v2/TreasuryReservesVault.sol#581-629)\n\t- TreasuryReservesVault.addStrategy(address,int256,ITempleStrategy.AssetBalance[]) (contracts/v2/TreasuryReservesVault.sol#173-201)\n\t- TreasuryReservesVault.shutdown(address) (contracts/v2/TreasuryReservesVault.sol#283-318)\n\t- TreasuryReservesVault.strategies (contracts/v2/TreasuryReservesVault.sol#55)\n", - "markdown": "Reentrancy in [TreasuryReservesVault.shutdown(address)](contracts/v2/TreasuryReservesVault.sol#L283-L318):\n\tExternal calls:\n\t- [_outstandingDebt = borrowTokens[_token].dToken.burnAll(strategy)](contracts/v2/TreasuryReservesVault.sol#L296)\n\tState variables written after the call(s):\n\t- [delete strategies[strategy]](contracts/v2/TreasuryReservesVault.sol#L316)\n\t[TreasuryReservesVault.strategies](contracts/v2/TreasuryReservesVault.sol#L55) can be used in cross function reentrancies:\n\t- [TreasuryReservesVault._getStrategyConfig(address)](contracts/v2/TreasuryReservesVault.sol#L708-L711)\n\t- [TreasuryReservesVault._withdrawFromBaseStrategy(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,address,uint256)](contracts/v2/TreasuryReservesVault.sol#L581-L629)\n\t- [TreasuryReservesVault.addStrategy(address,int256,ITempleStrategy.AssetBalance[])](contracts/v2/TreasuryReservesVault.sol#L173-L201)\n\t- [TreasuryReservesVault.shutdown(address)](contracts/v2/TreasuryReservesVault.sol#L283-L318)\n\t- [TreasuryReservesVault.strategies](contracts/v2/TreasuryReservesVault.sol#L55)\n", - "first_markdown_element": "contracts/v2/TreasuryReservesVault.sol#L283-L318", - "id": "3a9b8a5844a786e9db5767a6618e69eb4ac70831de810164597f657544b7e8ae", - "check": "reentrancy-no-eth", - "impact": "Medium", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "decreaseShares", - "source_mapping": { - "start": 2355, - "length": 302, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", - "is_dependency": false, - "lines": [69, 70, 71, 72, 73, 74, 75, 76, 77], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TreasuryFarmingRevenue", - "source_mapping": { - "start": 547, - "length": 3059, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", - "is_dependency": false, - "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "decreaseShares(address,uint256)" - } - }, - { - "type": "node", - "name": "claimFor(account)", - "source_mapping": { - "start": 2441, - "length": 17, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", - "is_dependency": false, - "lines": [70], - "starting_column": 9, - "ending_column": 26 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "decreaseShares", - "source_mapping": { - "start": 2355, - "length": 302, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", - "is_dependency": false, - "lines": [69, 70, 71, 72, 73, 74, 75, 76, 77], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TreasuryFarmingRevenue", - "source_mapping": { - "start": 547, - "length": 3059, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", - "is_dependency": false, - "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "decreaseShares(address,uint256)" - } - } - }, - "additional_fields": { "underlying_type": "external_calls" } - }, - { - "type": "node", - "name": "exposure.mint(account,unclaimedScaled / SCALING_FACTOR)", - "source_mapping": { - "start": 3194, - "length": 56, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", - "is_dependency": false, - "lines": [91], - "starting_column": 9, - "ending_column": 65 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "claimFor", - "source_mapping": { - "start": 2718, - "length": 611, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", - "is_dependency": false, - "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TreasuryFarmingRevenue", - "source_mapping": { - "start": 547, - "length": 3059, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", - "is_dependency": false, - "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "claimFor(address)" - } - } - }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } - }, - { - "type": "node", - "name": "claimedByScaled[account] -= amount * lifetimeAccRevenueScaledByShare", - "source_mapping": { - "start": 2535, - "length": 68, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", - "is_dependency": false, - "lines": [74], - "starting_column": 9, - "ending_column": 77 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "decreaseShares", - "source_mapping": { - "start": 2355, - "length": 302, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", - "is_dependency": false, - "lines": [69, 70, 71, 72, 73, 74, 75, 76, 77], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TreasuryFarmingRevenue", - "source_mapping": { - "start": 547, - "length": 3059, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", - "is_dependency": false, - "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "decreaseShares(address,uint256)" - } - } - }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "claimedByScaled" - } - }, - { - "type": "node", - "name": "shares[account] -= amount", - "source_mapping": { - "start": 2469, - "length": 25, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", - "is_dependency": false, - "lines": [72], - "starting_column": 9, - "ending_column": 34 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "decreaseShares", - "source_mapping": { - "start": 2355, - "length": 302, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", - "is_dependency": false, - "lines": [69, 70, 71, 72, 73, 74, 75, 76, 77], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TreasuryFarmingRevenue", - "source_mapping": { - "start": 547, - "length": 3059, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", - "is_dependency": false, - "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "decreaseShares(address,uint256)" - } - } - }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "shares" - } - } - ], - "description": "Reentrancy in TreasuryFarmingRevenue.decreaseShares(address,uint256) (contracts/core/TreasuryFarmingRevenue.sol#69-77):\n\tExternal calls:\n\t- claimFor(account) (contracts/core/TreasuryFarmingRevenue.sol#70)\n\t\t- exposure.mint(account,unclaimedScaled / SCALING_FACTOR) (contracts/core/TreasuryFarmingRevenue.sol#91)\n\tState variables written after the call(s):\n\t- claimedByScaled[account] -= amount * lifetimeAccRevenueScaledByShare (contracts/core/TreasuryFarmingRevenue.sol#74)\n\tTreasuryFarmingRevenue.claimedByScaled (contracts/core/TreasuryFarmingRevenue.sol#30) can be used in cross function reentrancies:\n\t- TreasuryFarmingRevenue.claimFor(address) (contracts/core/TreasuryFarmingRevenue.sol#80-93)\n\t- TreasuryFarmingRevenue.claimedByScaled (contracts/core/TreasuryFarmingRevenue.sol#30)\n\t- TreasuryFarmingRevenue.decreaseShares(address,uint256) (contracts/core/TreasuryFarmingRevenue.sol#69-77)\n\t- TreasuryFarmingRevenue.increaseShares(address,uint256) (contracts/core/TreasuryFarmingRevenue.sol#56-64)\n\t- shares[account] -= amount (contracts/core/TreasuryFarmingRevenue.sol#72)\n\tTreasuryFarmingRevenue.shares (contracts/core/TreasuryFarmingRevenue.sol#24) can be used in cross function reentrancies:\n\t- TreasuryFarmingRevenue.claimFor(address) (contracts/core/TreasuryFarmingRevenue.sol#80-93)\n\t- TreasuryFarmingRevenue.decreaseShares(address,uint256) (contracts/core/TreasuryFarmingRevenue.sol#69-77)\n\t- TreasuryFarmingRevenue.increaseShares(address,uint256) (contracts/core/TreasuryFarmingRevenue.sol#56-64)\n\t- TreasuryFarmingRevenue.shares (contracts/core/TreasuryFarmingRevenue.sol#24)\n", - "markdown": "Reentrancy in [TreasuryFarmingRevenue.decreaseShares(address,uint256)](contracts/core/TreasuryFarmingRevenue.sol#L69-L77):\n\tExternal calls:\n\t- [claimFor(account)](contracts/core/TreasuryFarmingRevenue.sol#L70)\n\t\t- [exposure.mint(account,unclaimedScaled / SCALING_FACTOR)](contracts/core/TreasuryFarmingRevenue.sol#L91)\n\tState variables written after the call(s):\n\t- [claimedByScaled[account] -= amount * lifetimeAccRevenueScaledByShare](contracts/core/TreasuryFarmingRevenue.sol#L74)\n\t[TreasuryFarmingRevenue.claimedByScaled](contracts/core/TreasuryFarmingRevenue.sol#L30) can be used in cross function reentrancies:\n\t- [TreasuryFarmingRevenue.claimFor(address)](contracts/core/TreasuryFarmingRevenue.sol#L80-L93)\n\t- [TreasuryFarmingRevenue.claimedByScaled](contracts/core/TreasuryFarmingRevenue.sol#L30)\n\t- [TreasuryFarmingRevenue.decreaseShares(address,uint256)](contracts/core/TreasuryFarmingRevenue.sol#L69-L77)\n\t- [TreasuryFarmingRevenue.increaseShares(address,uint256)](contracts/core/TreasuryFarmingRevenue.sol#L56-L64)\n\t- [shares[account] -= amount](contracts/core/TreasuryFarmingRevenue.sol#L72)\n\t[TreasuryFarmingRevenue.shares](contracts/core/TreasuryFarmingRevenue.sol#L24) can be used in cross function reentrancies:\n\t- [TreasuryFarmingRevenue.claimFor(address)](contracts/core/TreasuryFarmingRevenue.sol#L80-L93)\n\t- [TreasuryFarmingRevenue.decreaseShares(address,uint256)](contracts/core/TreasuryFarmingRevenue.sol#L69-L77)\n\t- [TreasuryFarmingRevenue.increaseShares(address,uint256)](contracts/core/TreasuryFarmingRevenue.sol#L56-L64)\n\t- [TreasuryFarmingRevenue.shares](contracts/core/TreasuryFarmingRevenue.sol#L24)\n", - "first_markdown_element": "contracts/core/TreasuryFarmingRevenue.sol#L69-L77", - "id": "cc45c8f5d22793c2ba894c4d32e4043890c1184c0a94e5502d25b97876a95c86", - "check": "reentrancy-no-eth", - "impact": "Medium", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "increaseShares", - "source_mapping": { - "start": 1987, - "length": 302, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", - "is_dependency": false, - "lines": [56, 57, 58, 59, 60, 61, 62, 63, 64], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TreasuryFarmingRevenue", - "source_mapping": { - "start": 547, - "length": 3059, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", - "is_dependency": false, - "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "increaseShares(address,uint256)" - } - }, - { - "type": "node", - "name": "claimFor(account)", - "source_mapping": { - "start": 2073, - "length": 17, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", - "is_dependency": false, - "lines": [57], - "starting_column": 9, - "ending_column": 26 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "increaseShares", - "source_mapping": { - "start": 1987, - "length": 302, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", - "is_dependency": false, - "lines": [56, 57, 58, 59, 60, 61, 62, 63, 64], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TreasuryFarmingRevenue", - "source_mapping": { - "start": 547, - "length": 3059, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", - "is_dependency": false, - "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "increaseShares(address,uint256)" - } - } - }, - "additional_fields": { "underlying_type": "external_calls" } - }, - { - "type": "node", - "name": "exposure.mint(account,unclaimedScaled / SCALING_FACTOR)", - "source_mapping": { - "start": 3194, - "length": 56, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", - "is_dependency": false, - "lines": [91], - "starting_column": 9, - "ending_column": 65 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "claimFor", - "source_mapping": { - "start": 2718, - "length": 611, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", - "is_dependency": false, - "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TreasuryFarmingRevenue", - "source_mapping": { - "start": 547, - "length": 3059, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", - "is_dependency": false, - "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "claimFor(address)" - } - } - }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } - }, - { - "type": "node", - "name": "claimedByScaled[account] += amount * lifetimeAccRevenueScaledByShare", - "source_mapping": { - "start": 2167, - "length": 68, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", - "is_dependency": false, - "lines": [61], - "starting_column": 9, - "ending_column": 77 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "increaseShares", - "source_mapping": { - "start": 1987, - "length": 302, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", - "is_dependency": false, - "lines": [56, 57, 58, 59, 60, 61, 62, 63, 64], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TreasuryFarmingRevenue", - "source_mapping": { - "start": 547, - "length": 3059, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", - "is_dependency": false, - "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "increaseShares(address,uint256)" - } - } - }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "claimedByScaled" - } - }, - { - "type": "node", - "name": "shares[account] += amount", - "source_mapping": { - "start": 2101, - "length": 25, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", - "is_dependency": false, - "lines": [59], - "starting_column": 9, - "ending_column": 34 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "increaseShares", - "source_mapping": { - "start": 1987, - "length": 302, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", - "is_dependency": false, - "lines": [56, 57, 58, 59, 60, 61, 62, 63, 64], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TreasuryFarmingRevenue", - "source_mapping": { - "start": 547, - "length": 3059, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", - "is_dependency": false, - "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "increaseShares(address,uint256)" - } - } - }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "shares" - } - } - ], - "description": "Reentrancy in TreasuryFarmingRevenue.increaseShares(address,uint256) (contracts/core/TreasuryFarmingRevenue.sol#56-64):\n\tExternal calls:\n\t- claimFor(account) (contracts/core/TreasuryFarmingRevenue.sol#57)\n\t\t- exposure.mint(account,unclaimedScaled / SCALING_FACTOR) (contracts/core/TreasuryFarmingRevenue.sol#91)\n\tState variables written after the call(s):\n\t- claimedByScaled[account] += amount * lifetimeAccRevenueScaledByShare (contracts/core/TreasuryFarmingRevenue.sol#61)\n\tTreasuryFarmingRevenue.claimedByScaled (contracts/core/TreasuryFarmingRevenue.sol#30) can be used in cross function reentrancies:\n\t- TreasuryFarmingRevenue.claimFor(address) (contracts/core/TreasuryFarmingRevenue.sol#80-93)\n\t- TreasuryFarmingRevenue.claimedByScaled (contracts/core/TreasuryFarmingRevenue.sol#30)\n\t- TreasuryFarmingRevenue.decreaseShares(address,uint256) (contracts/core/TreasuryFarmingRevenue.sol#69-77)\n\t- TreasuryFarmingRevenue.increaseShares(address,uint256) (contracts/core/TreasuryFarmingRevenue.sol#56-64)\n\t- shares[account] += amount (contracts/core/TreasuryFarmingRevenue.sol#59)\n\tTreasuryFarmingRevenue.shares (contracts/core/TreasuryFarmingRevenue.sol#24) can be used in cross function reentrancies:\n\t- TreasuryFarmingRevenue.claimFor(address) (contracts/core/TreasuryFarmingRevenue.sol#80-93)\n\t- TreasuryFarmingRevenue.decreaseShares(address,uint256) (contracts/core/TreasuryFarmingRevenue.sol#69-77)\n\t- TreasuryFarmingRevenue.increaseShares(address,uint256) (contracts/core/TreasuryFarmingRevenue.sol#56-64)\n\t- TreasuryFarmingRevenue.shares (contracts/core/TreasuryFarmingRevenue.sol#24)\n", - "markdown": "Reentrancy in [TreasuryFarmingRevenue.increaseShares(address,uint256)](contracts/core/TreasuryFarmingRevenue.sol#L56-L64):\n\tExternal calls:\n\t- [claimFor(account)](contracts/core/TreasuryFarmingRevenue.sol#L57)\n\t\t- [exposure.mint(account,unclaimedScaled / SCALING_FACTOR)](contracts/core/TreasuryFarmingRevenue.sol#L91)\n\tState variables written after the call(s):\n\t- [claimedByScaled[account] += amount * lifetimeAccRevenueScaledByShare](contracts/core/TreasuryFarmingRevenue.sol#L61)\n\t[TreasuryFarmingRevenue.claimedByScaled](contracts/core/TreasuryFarmingRevenue.sol#L30) can be used in cross function reentrancies:\n\t- [TreasuryFarmingRevenue.claimFor(address)](contracts/core/TreasuryFarmingRevenue.sol#L80-L93)\n\t- [TreasuryFarmingRevenue.claimedByScaled](contracts/core/TreasuryFarmingRevenue.sol#L30)\n\t- [TreasuryFarmingRevenue.decreaseShares(address,uint256)](contracts/core/TreasuryFarmingRevenue.sol#L69-L77)\n\t- [TreasuryFarmingRevenue.increaseShares(address,uint256)](contracts/core/TreasuryFarmingRevenue.sol#L56-L64)\n\t- [shares[account] += amount](contracts/core/TreasuryFarmingRevenue.sol#L59)\n\t[TreasuryFarmingRevenue.shares](contracts/core/TreasuryFarmingRevenue.sol#L24) can be used in cross function reentrancies:\n\t- [TreasuryFarmingRevenue.claimFor(address)](contracts/core/TreasuryFarmingRevenue.sol#L80-L93)\n\t- [TreasuryFarmingRevenue.decreaseShares(address,uint256)](contracts/core/TreasuryFarmingRevenue.sol#L69-L77)\n\t- [TreasuryFarmingRevenue.increaseShares(address,uint256)](contracts/core/TreasuryFarmingRevenue.sol#L56-L64)\n\t- [TreasuryFarmingRevenue.shares](contracts/core/TreasuryFarmingRevenue.sol#L24)\n", - "first_markdown_element": "contracts/core/TreasuryFarmingRevenue.sol#L56-L64", - "id": "7136d46cea8f0cb4f10b428d075c61a8ad801ba9ca1ef8c90733aaa52034f6ed", - "check": "reentrancy-no-eth", - "impact": "Medium", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "variable", - "name": "shutdownParams", - "source_mapping": { - "start": 9140, - "length": 36, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", - "is_dependency": false, - "lines": [234], - "starting_column": 9, - "ending_column": 45 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "populateShutdownData", - "source_mapping": { - "start": 8860, - "length": 564, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", - "is_dependency": false, - "lines": [ - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "RamosStrategy", - "source_mapping": { - "start": 1131, - "length": 9158, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", - "is_dependency": false, - "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "populateShutdownData(bytes)" - } - } - } - } - ], - "description": "RamosStrategy.populateShutdownData(bytes).shutdownParams (contracts/v2/strategies/RamosStrategy.sol#234) is a local variable never initialized\n", - "markdown": "[RamosStrategy.populateShutdownData(bytes).shutdownParams](contracts/v2/strategies/RamosStrategy.sol#L234) is a local variable never initialized\n", - "first_markdown_element": "contracts/v2/strategies/RamosStrategy.sol#L234", - "id": "e3b0c7352e8da48d32a58f5b6962b6132c525566519d363234f70e52d4760882", - "check": "uninitialized-local", - "impact": "Medium", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "variable", - "name": "i", - "source_mapping": { - "start": 8362, - "length": 9, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", - "is_dependency": false, - "lines": [213], - "starting_column": 9, - "ending_column": 18 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "updateStrategyEnabledBorrowTokens", - "source_mapping": { - "start": 8065, - "length": 898, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", - "is_dependency": false, - "lines": [ - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TreasuryReservesVault", - "source_mapping": { - "start": 2150, - "length": 31934, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", - "is_dependency": false, - "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "updateStrategyEnabledBorrowTokens(address,IERC20[],IERC20[])" - } - } - } - } - ], - "description": "TreasuryReservesVault.updateStrategyEnabledBorrowTokens(address,IERC20[],IERC20[]).i (contracts/v2/TreasuryReservesVault.sol#213) is a local variable never initialized\n", - "markdown": "[TreasuryReservesVault.updateStrategyEnabledBorrowTokens(address,IERC20[],IERC20[]).i](contracts/v2/TreasuryReservesVault.sol#L213) is a local variable never initialized\n", - "first_markdown_element": "contracts/v2/TreasuryReservesVault.sol#L213", - "id": "ccb61a70ed00f67ef5318dfebba8dd5906b02a2b7022418f095ca6131f2e87a0", - "check": "uninitialized-local", - "impact": "Medium", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "variable", - "name": "baseStrategyAvailable", - "source_mapping": { - "start": 21023, - "length": 29, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", - "is_dependency": false, - "lines": [475], - "starting_column": 9, - "ending_column": 38 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "totalAvailable", - "source_mapping": { - "start": 20854, - "length": 877, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", - "is_dependency": false, - "lines": [ - 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, - 485, 486, 487, 488 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TreasuryReservesVault", - "source_mapping": { - "start": 2150, - "length": 31934, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", - "is_dependency": false, - "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "totalAvailable(IERC20)" - } - } - } - } - ], - "description": "TreasuryReservesVault.totalAvailable(IERC20).baseStrategyAvailable (contracts/v2/TreasuryReservesVault.sol#475) is a local variable never initialized\n", - "markdown": "[TreasuryReservesVault.totalAvailable(IERC20).baseStrategyAvailable](contracts/v2/TreasuryReservesVault.sol#L475) is a local variable never initialized\n", - "first_markdown_element": "contracts/v2/TreasuryReservesVault.sol#L475", - "id": "5a877bceafff56259a481e94173f69b6c70a20fc470647802278ccdef5ab0fcd", - "check": "uninitialized-local", - "impact": "Medium", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "depositAndStake", - "source_mapping": { - "start": 2874, - "length": 351, - "filename_relative": "contracts/amo/AuraStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/AuraStaking.sol", - "filename_short": "contracts/amo/AuraStaking.sol", - "is_dependency": false, - "lines": [79, 80, 81, 82, 83, 84, 85], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "AuraStaking", - "source_mapping": { - "start": 604, - "length": 5204, - "filename_relative": "contracts/amo/AuraStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/AuraStaking.sol", - "filename_short": "contracts/amo/AuraStaking.sol", - "is_dependency": false, - "lines": [ - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "depositAndStake(uint256)" - } - }, - { - "type": "node", - "name": "booster.deposit(auraPoolInfo.pId,amount,true)", - "source_mapping": { - "start": 3161, - "length": 47, - "filename_relative": "contracts/amo/AuraStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/AuraStaking.sol", - "filename_short": "contracts/amo/AuraStaking.sol", - "is_dependency": false, - "lines": [83], - "starting_column": 13, - "ending_column": 60 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "depositAndStake", - "source_mapping": { - "start": 2874, - "length": 351, - "filename_relative": "contracts/amo/AuraStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/AuraStaking.sol", - "filename_short": "contracts/amo/AuraStaking.sol", - "is_dependency": false, - "lines": [79, 80, 81, 82, 83, 84, 85], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "AuraStaking", - "source_mapping": { - "start": 604, - "length": 5204, - "filename_relative": "contracts/amo/AuraStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/AuraStaking.sol", - "filename_short": "contracts/amo/AuraStaking.sol", - "is_dependency": false, - "lines": [ - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "depositAndStake(uint256)" - } - } - } - } - ], - "description": "AuraStaking.depositAndStake(uint256) (contracts/amo/AuraStaking.sol#79-85) ignores return value by booster.deposit(auraPoolInfo.pId,amount,true) (contracts/amo/AuraStaking.sol#83)\n", - "markdown": "[AuraStaking.depositAndStake(uint256)](contracts/amo/AuraStaking.sol#L79-L85) ignores return value by [booster.deposit(auraPoolInfo.pId,amount,true)](contracts/amo/AuraStaking.sol#L83)\n", - "first_markdown_element": "contracts/amo/AuraStaking.sol#L79-L85", - "id": "df1bba2db758866958a0bd3d600869193c2a4c54635aeec3c0158683eb3c6bd1", - "check": "unused-return", - "impact": "Medium", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "withdrawAndUnwrap", - "source_mapping": { - "start": 3286, - "length": 634, - "filename_relative": "contracts/amo/AuraStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/AuraStaking.sol", - "filename_short": "contracts/amo/AuraStaking.sol", - "is_dependency": false, - "lines": [88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "AuraStaking", - "source_mapping": { - "start": 604, - "length": 5204, - "filename_relative": "contracts/amo/AuraStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/AuraStaking.sol", - "filename_short": "contracts/amo/AuraStaking.sol", - "is_dependency": false, - "lines": [ - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "withdrawAndUnwrap(uint256,bool,address)" - } - }, - { - "type": "node", - "name": "IAuraBaseRewardPool(auraPoolInfo.rewards).withdrawAndUnwrap(toUnstake,claim)", - "source_mapping": { - "start": 3680, - "length": 77, - "filename_relative": "contracts/amo/AuraStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/AuraStaking.sol", - "filename_short": "contracts/amo/AuraStaking.sol", - "is_dependency": false, - "lines": [93], - "starting_column": 13, - "ending_column": 90 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "withdrawAndUnwrap", - "source_mapping": { - "start": 3286, - "length": 634, - "filename_relative": "contracts/amo/AuraStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/AuraStaking.sol", - "filename_short": "contracts/amo/AuraStaking.sol", - "is_dependency": false, - "lines": [88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "AuraStaking", - "source_mapping": { - "start": 604, - "length": 5204, - "filename_relative": "contracts/amo/AuraStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/AuraStaking.sol", - "filename_short": "contracts/amo/AuraStaking.sol", - "is_dependency": false, - "lines": [ - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "withdrawAndUnwrap(uint256,bool,address)" - } - } - } - } - ], - "description": "AuraStaking.withdrawAndUnwrap(uint256,bool,address) (contracts/amo/AuraStaking.sol#88-100) ignores return value by IAuraBaseRewardPool(auraPoolInfo.rewards).withdrawAndUnwrap(toUnstake,claim) (contracts/amo/AuraStaking.sol#93)\n", - "markdown": "[AuraStaking.withdrawAndUnwrap(uint256,bool,address)](contracts/amo/AuraStaking.sol#L88-L100) ignores return value by [IAuraBaseRewardPool(auraPoolInfo.rewards).withdrawAndUnwrap(toUnstake,claim)](contracts/amo/AuraStaking.sol#L93)\n", - "first_markdown_element": "contracts/amo/AuraStaking.sol#L88-L100", - "id": "a3f11c21d94cc0286397b0f4acf966b2e7b4421bbb8026550ce5beae49adbf78", - "check": "unused-return", - "impact": "Medium", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "getReward", - "source_mapping": { - "start": 4291, - "length": 657, - "filename_relative": "contracts/amo/AuraStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/AuraStaking.sol", - "filename_short": "contracts/amo/AuraStaking.sol", - "is_dependency": false, - "lines": [ - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "AuraStaking", - "source_mapping": { - "start": 604, - "length": 5204, - "filename_relative": "contracts/amo/AuraStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/AuraStaking.sol", - "filename_short": "contracts/amo/AuraStaking.sol", - "is_dependency": false, - "lines": [ - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "getReward(bool)" - } - }, - { - "type": "node", - "name": "IAuraBaseRewardPool(auraPoolInfo.rewards).getReward(address(this),claimExtras)", - "source_mapping": { - "start": 4356, - "length": 79, - "filename_relative": "contracts/amo/AuraStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/AuraStaking.sol", - "filename_short": "contracts/amo/AuraStaking.sol", - "is_dependency": false, - "lines": [111], - "starting_column": 9, - "ending_column": 88 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "getReward", - "source_mapping": { - "start": 4291, - "length": 657, - "filename_relative": "contracts/amo/AuraStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/AuraStaking.sol", - "filename_short": "contracts/amo/AuraStaking.sol", - "is_dependency": false, - "lines": [ - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "AuraStaking", - "source_mapping": { - "start": 604, - "length": 5204, - "filename_relative": "contracts/amo/AuraStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/AuraStaking.sol", - "filename_short": "contracts/amo/AuraStaking.sol", - "is_dependency": false, - "lines": [ - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "getReward(bool)" - } - } - } - } - ], - "description": "AuraStaking.getReward(bool) (contracts/amo/AuraStaking.sol#110-125) ignores return value by IAuraBaseRewardPool(auraPoolInfo.rewards).getReward(address(this),claimExtras) (contracts/amo/AuraStaking.sol#111)\n", - "markdown": "[AuraStaking.getReward(bool)](contracts/amo/AuraStaking.sol#L110-L125) ignores return value by [IAuraBaseRewardPool(auraPoolInfo.rewards).getReward(address(this),claimExtras)](contracts/amo/AuraStaking.sol#L111)\n", - "first_markdown_element": "contracts/amo/AuraStaking.sol#L110-L125", - "id": "334cc08346f4acb06b750e6d7ca0bbba6ed0f1443127882a8bce2dba76eedff5", - "check": "unused-return", - "impact": "Medium", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "getBalances", - "source_mapping": { - "start": 2079, - "length": 154, - "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", - "is_dependency": false, - "lines": [55, 56, 57], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "BalancerPoolHelper", - "source_mapping": { - "start": 739, - "length": 19014, - "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", - "is_dependency": false, - "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, - 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, - 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, - 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, - 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, - 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, - 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, - 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "getBalances()" - } - }, - { - "type": "node", - "name": "(None,balances,None) = balancerVault.getPoolTokens(balancerPoolId)", - "source_mapping": { - "start": 2167, - "length": 59, - "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", - "is_dependency": false, - "lines": [56], - "starting_column": 7, - "ending_column": 66 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "getBalances", - "source_mapping": { - "start": 2079, - "length": 154, - "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", - "is_dependency": false, - "lines": [55, 56, 57], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "BalancerPoolHelper", - "source_mapping": { - "start": 739, - "length": 19014, - "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", - "is_dependency": false, - "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "getBalances()" - } - } - } - } - ], - "description": "BalancerPoolHelper.getBalances() (contracts/amo/helpers/BalancerPoolHelper.sol#55-57) ignores return value by (None,balances,None) = balancerVault.getPoolTokens(balancerPoolId) (contracts/amo/helpers/BalancerPoolHelper.sol#56)\n", - "markdown": "[BalancerPoolHelper.getBalances()](contracts/amo/helpers/BalancerPoolHelper.sol#L55-L57) ignores return value by [(None,balances,None) = balancerVault.getPoolTokens(balancerPoolId)](contracts/amo/helpers/BalancerPoolHelper.sol#L56)\n", - "first_markdown_element": "contracts/amo/helpers/BalancerPoolHelper.sol#L55-L57", - "id": "97630a6a935fd6fa31a1e214fdb8582cf37cbb5ba228037742cc7ccc77486019", - "check": "unused-return", - "impact": "Medium", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "proportionalAddLiquidityQuote", - "source_mapping": { - "start": 15567, - "length": 1930, - "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", - "is_dependency": false, - "lines": [ - 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, - 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "BalancerPoolHelper", - "source_mapping": { - "start": 739, - "length": 19014, - "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", - "is_dependency": false, - "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, - 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, - 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, - 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, - 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, - 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, - 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, - 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "proportionalAddLiquidityQuote(uint256,uint256)" - } - }, - { - "type": "node", - "name": "(expectedBptAmount,None) = balancerHelpers.queryJoin(balancerPoolId,amo,amo,requestData)", - "source_mapping": { - "start": 17103, - "length": 88, - "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", - "is_dependency": false, - "lines": [374], - "starting_column": 9, - "ending_column": 97 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "proportionalAddLiquidityQuote", - "source_mapping": { - "start": 15567, - "length": 1930, - "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", - "is_dependency": false, - "lines": [ - 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, - 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "BalancerPoolHelper", - "source_mapping": { - "start": 739, - "length": 19014, - "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", - "is_dependency": false, - "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "proportionalAddLiquidityQuote(uint256,uint256)" - } - } - } - } - ], - "description": "BalancerPoolHelper.proportionalAddLiquidityQuote(uint256,uint256) (contracts/amo/helpers/BalancerPoolHelper.sol#348-380) ignores return value by (expectedBptAmount,None) = balancerHelpers.queryJoin(balancerPoolId,amo,amo,requestData) (contracts/amo/helpers/BalancerPoolHelper.sol#374)\n", - "markdown": "[BalancerPoolHelper.proportionalAddLiquidityQuote(uint256,uint256)](contracts/amo/helpers/BalancerPoolHelper.sol#L348-L380) ignores return value by [(expectedBptAmount,None) = balancerHelpers.queryJoin(balancerPoolId,amo,amo,requestData)](contracts/amo/helpers/BalancerPoolHelper.sol#L374)\n", - "first_markdown_element": "contracts/amo/helpers/BalancerPoolHelper.sol#L348-L380", - "id": "44982b3b03e18740f01aed72e03f5657be31a18422cec5c4f5a8d53b084f8256", - "check": "unused-return", - "impact": "Medium", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "proportionalRemoveLiquidityQuote", - "source_mapping": { - "start": 17648, - "length": 1775, - "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", - "is_dependency": false, - "lines": [ - 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, - 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "BalancerPoolHelper", - "source_mapping": { - "start": 739, - "length": 19014, - "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", - "is_dependency": false, - "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, - 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, - 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, - 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, - 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, - 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, - 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, - 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, - 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "proportionalRemoveLiquidityQuote(uint256,uint256)" - } - }, - { - "type": "node", - "name": "(None,requestData.minAmountsOut) = balancerHelpers.queryExit(balancerPoolId,amo,amo,requestData)", - "source_mapping": { - "start": 18569, - "length": 96, - "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", - "is_dependency": false, - "lines": [405], - "starting_column": 9, - "ending_column": 105 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "proportionalRemoveLiquidityQuote", - "source_mapping": { - "start": 17648, - "length": 1775, - "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", - "is_dependency": false, - "lines": [ - 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, - 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "BalancerPoolHelper", - "source_mapping": { - "start": 739, - "length": 19014, - "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", - "is_dependency": false, - "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "proportionalRemoveLiquidityQuote(uint256,uint256)" - } - } - } - } - ], - "description": "BalancerPoolHelper.proportionalRemoveLiquidityQuote(uint256,uint256) (contracts/amo/helpers/BalancerPoolHelper.sol#384-416) ignores return value by (None,requestData.minAmountsOut) = balancerHelpers.queryExit(balancerPoolId,amo,amo,requestData) (contracts/amo/helpers/BalancerPoolHelper.sol#405)\n", - "markdown": "[BalancerPoolHelper.proportionalRemoveLiquidityQuote(uint256,uint256)](contracts/amo/helpers/BalancerPoolHelper.sol#L384-L416) ignores return value by [(None,requestData.minAmountsOut) = balancerHelpers.queryExit(balancerPoolId,amo,amo,requestData)](contracts/amo/helpers/BalancerPoolHelper.sol#L405)\n", - "first_markdown_element": "contracts/amo/helpers/BalancerPoolHelper.sol#L384-L416", - "id": "08b9be6d43268a91c87113facf1f93ba28159d15047c9ef6e2a5e42a2a791c97", - "check": "unused-return", - "impact": "Medium", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "setBorrowToken", - "source_mapping": { - "start": 4145, - "length": 1025, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", - "is_dependency": false, - "lines": [ - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TreasuryReservesVault", - "source_mapping": { - "start": 2150, - "length": 31934, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", - "is_dependency": false, - "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, - 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, - 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, - 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, - 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, - 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, - 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, - 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, - 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, - 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, - 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, - 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, - 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, - 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, - 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, - 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, - 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, - 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, - 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, - 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, - 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, - 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, - 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, - 771, 772, 773, 774, 775, 776 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "setBorrowToken(IERC20,address,uint256,uint256,address)" - } - }, - { - "type": "node", - "name": "_borrowTokenSet.add(address(token))", - "source_mapping": { - "start": 5128, - "length": 35, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", - "is_dependency": false, - "lines": [126], - "starting_column": 9, - "ending_column": 44 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "setBorrowToken", - "source_mapping": { - "start": 4145, - "length": 1025, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", - "is_dependency": false, - "lines": [ - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TreasuryReservesVault", - "source_mapping": { - "start": 2150, - "length": 31934, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", - "is_dependency": false, - "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "setBorrowToken(IERC20,address,uint256,uint256,address)" - } - } - } - } - ], - "description": "TreasuryReservesVault.setBorrowToken(IERC20,address,uint256,uint256,address) (contracts/v2/TreasuryReservesVault.sol#108-127) ignores return value by _borrowTokenSet.add(address(token)) (contracts/v2/TreasuryReservesVault.sol#126)\n", - "markdown": "[TreasuryReservesVault.setBorrowToken(IERC20,address,uint256,uint256,address)](contracts/v2/TreasuryReservesVault.sol#L108-L127) ignores return value by [_borrowTokenSet.add(address(token))](contracts/v2/TreasuryReservesVault.sol#L126)\n", - "first_markdown_element": "contracts/v2/TreasuryReservesVault.sol#L108-L127", - "id": "5cf78f34e420dc046a400c32810667b772002358e964fa3e56b9b0a68b28a33f", - "check": "unused-return", - "impact": "Medium", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "removeBorrowToken", - "source_mapping": { - "start": 5247, - "length": 319, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", - "is_dependency": false, - "lines": [132, 133, 134, 135, 136, 137, 138, 139], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TreasuryReservesVault", - "source_mapping": { - "start": 2150, - "length": 31934, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", - "is_dependency": false, - "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, - 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, - 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, - 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, - 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, - 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, - 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, - 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, - 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, - 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, - 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, - 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, - 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, - 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, - 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, - 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, - 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, - 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, - 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, - 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, - 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, - 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, - 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, - 771, 772, 773, 774, 775, 776 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "removeBorrowToken(IERC20)" - } - }, - { - "type": "node", - "name": "_borrowTokenSet.remove(address(token))", - "source_mapping": { - "start": 5521, - "length": 38, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", - "is_dependency": false, - "lines": [138], - "starting_column": 9, - "ending_column": 47 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "removeBorrowToken", - "source_mapping": { - "start": 5247, - "length": 319, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", - "is_dependency": false, - "lines": [132, 133, 134, 135, 136, 137, 138, 139], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TreasuryReservesVault", - "source_mapping": { - "start": 2150, - "length": 31934, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", - "is_dependency": false, - "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "removeBorrowToken(IERC20)" - } - } - } - } - ], - "description": "TreasuryReservesVault.removeBorrowToken(IERC20) (contracts/v2/TreasuryReservesVault.sol#132-139) ignores return value by _borrowTokenSet.remove(address(token)) (contracts/v2/TreasuryReservesVault.sol#138)\n", - "markdown": "[TreasuryReservesVault.removeBorrowToken(IERC20)](contracts/v2/TreasuryReservesVault.sol#L132-L139) ignores return value by [_borrowTokenSet.remove(address(token))](contracts/v2/TreasuryReservesVault.sol#L138)\n", - "first_markdown_element": "contracts/v2/TreasuryReservesVault.sol#L132-L139", - "id": "5474dfbc0dfd2144f1d3592aebc4e72de5fca48cbeb8ec28a4e82aa1c1ea096c", - "check": "unused-return", - "impact": "Medium", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "shutdown", - "source_mapping": { - "start": 11820, - "length": 1568, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", - "is_dependency": false, - "lines": [ - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TreasuryReservesVault", - "source_mapping": { - "start": 2150, - "length": 31934, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", - "is_dependency": false, - "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, - 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, - 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, - 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, - 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, - 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, - 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, - 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, - 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, - 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, - 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, - 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, - 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, - 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, - 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, - 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, - 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, - 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, - 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, - 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, - 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, - 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, - 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, - 771, 772, 773, 774, 775, 776 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "shutdown(address)" - } - }, - { - "type": "node", - "name": "_strategySet.remove(strategy)", - "source_mapping": { - "start": 13352, - "length": 29, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", - "is_dependency": false, - "lines": [317], - "starting_column": 9, - "ending_column": 38 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "shutdown", - "source_mapping": { - "start": 11820, - "length": 1568, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", - "is_dependency": false, - "lines": [ - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TreasuryReservesVault", - "source_mapping": { - "start": 2150, - "length": 31934, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", - "is_dependency": false, - "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "shutdown(address)" - } - } - } - } - ], - "description": "TreasuryReservesVault.shutdown(address) (contracts/v2/TreasuryReservesVault.sol#283-318) ignores return value by _strategySet.remove(strategy) (contracts/v2/TreasuryReservesVault.sol#317)\n", - "markdown": "[TreasuryReservesVault.shutdown(address)](contracts/v2/TreasuryReservesVault.sol#L283-L318) ignores return value by [_strategySet.remove(strategy)](contracts/v2/TreasuryReservesVault.sol#L317)\n", - "first_markdown_element": "contracts/v2/TreasuryReservesVault.sol#L283-L318", - "id": "cb5fe7252e5c561a67cd507680b959a6b306dddaf42dfefb358c7a213837ac1a", - "check": "unused-return", - "impact": "Medium", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "setIdentifierForCaller", - "source_mapping": { - "start": 1967, - "length": 555, - "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol", - "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol", - "is_dependency": false, - "lines": [47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleCircuitBreakerProxy", - "source_mapping": { - "start": 808, - "length": 3156, - "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol", - "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol", - "is_dependency": false, - "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "setIdentifierForCaller(address,string)" - } - }, - { - "type": "node", - "name": "_identifiers.add(_identifier)", - "source_mapping": { - "start": 2409, - "length": 29, - "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol", - "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol", - "is_dependency": false, - "lines": [56], - "starting_column": 9, - "ending_column": 38 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "setIdentifierForCaller", - "source_mapping": { - "start": 1967, - "length": 555, - "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol", - "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol", - "is_dependency": false, - "lines": [47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleCircuitBreakerProxy", - "source_mapping": { - "start": 808, - "length": 3156, - "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol", - "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol", - "is_dependency": false, - "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "setIdentifierForCaller(address,string)" - } - } - } - } - ], - "description": "TempleCircuitBreakerProxy.setIdentifierForCaller(address,string) (contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol#47-59) ignores return value by _identifiers.add(_identifier) (contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol#56)\n", - "markdown": "[TempleCircuitBreakerProxy.setIdentifierForCaller(address,string)](contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol#L47-L59) ignores return value by [_identifiers.add(_identifier)](contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol#L56)\n", - "first_markdown_element": "contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol#L47-L59", - "id": "e72127f3ec266630bd01282f5d373e9eadb2fa635a529f17decfa267707680e0", - "check": "unused-return", - "impact": "Medium", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "latestAssetBalances", - "source_mapping": { - "start": 5827, - "length": 403, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", - "is_dependency": false, - "lines": [144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "RamosStrategy", - "source_mapping": { - "start": 1131, - "length": 9158, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", - "is_dependency": false, - "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "latestAssetBalances()" - } - }, - { - "type": "node", - "name": "(quoteTokenBalance) = ramos.positions()", - "source_mapping": { - "start": 5992, - "length": 50, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", - "is_dependency": false, - "lines": [148], - "starting_column": 9, - "ending_column": 59 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "latestAssetBalances", - "source_mapping": { - "start": 5827, - "length": 403, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", - "is_dependency": false, - "lines": [ - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "RamosStrategy", - "source_mapping": { - "start": 1131, - "length": 9158, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 1896, + "length": 12436, + "filename_relative": "contracts/interfaces/v2/ITreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/v2/ITreasuryReservesVault.sol", + "filename_short": "contracts/interfaces/v2/ITreasuryReservesVault.sol", "is_dependency": false, "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261 + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "latestAssetBalances()" + "signature": "setGlobalPaused(bool,bool)" } } } - } - ], - "description": "RamosStrategy.latestAssetBalances() (contracts/v2/strategies/RamosStrategy.sol#144-155) ignores return value by (quoteTokenBalance) = ramos.positions() (contracts/v2/strategies/RamosStrategy.sol#148)\n", - "markdown": "[RamosStrategy.latestAssetBalances()](contracts/v2/strategies/RamosStrategy.sol#L144-L155) ignores return value by [(quoteTokenBalance) = ramos.positions()](contracts/v2/strategies/RamosStrategy.sol#L148)\n", - "first_markdown_element": "contracts/v2/strategies/RamosStrategy.sol#L144-L155", - "id": "4ffbf443a9a0d8bcc2e22d2fd2c31972e60cbb82912f552a2d250c6d433caf0c", - "check": "unused-return", - "impact": "Medium", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "proportionalAddLiquidityQuote", - "source_mapping": { - "start": 6407, - "length": 393, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", - "is_dependency": false, - "lines": [161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "RamosStrategy", - "source_mapping": { - "start": 1131, - "length": 9158, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", - "is_dependency": false, - "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "proportionalAddLiquidityQuote(uint256,uint256)" - } }, - { - "type": "node", - "name": "ramos.poolHelper().proportionalAddLiquidityQuote(_quoteTokenAmount,_slippageBps)", - "source_mapping": { - "start": 6705, - "length": 88, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", - "is_dependency": false, - "lines": [170], - "starting_column": 9, - "ending_column": 97 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "proportionalAddLiquidityQuote", - "source_mapping": { - "start": 6407, - "length": 393, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", - "is_dependency": false, - "lines": [161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "RamosStrategy", - "source_mapping": { - "start": 1131, - "length": 9158, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", - "is_dependency": false, - "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "proportionalAddLiquidityQuote(uint256,uint256)" - } - } - } - } - ], - "description": "RamosStrategy.proportionalAddLiquidityQuote(uint256,uint256) (contracts/v2/strategies/RamosStrategy.sol#161-171) ignores return value by ramos.poolHelper().proportionalAddLiquidityQuote(_quoteTokenAmount,_slippageBps) (contracts/v2/strategies/RamosStrategy.sol#170)\n", - "markdown": "[RamosStrategy.proportionalAddLiquidityQuote(uint256,uint256)](contracts/v2/strategies/RamosStrategy.sol#L161-L171) ignores return value by [ramos.poolHelper().proportionalAddLiquidityQuote(_quoteTokenAmount,_slippageBps)](contracts/v2/strategies/RamosStrategy.sol#L170)\n", - "first_markdown_element": "contracts/v2/strategies/RamosStrategy.sol#L161-L171", - "id": "736915aa318331f292f9d3b06c55cbb7975f5dc13bbe30fea0e9bd5284f4d292", - "check": "unused-return", - "impact": "Medium", - "confidence": "Medium" - }, - { - "elements": [ { "type": "function", - "name": "proportionalRemoveLiquidityQuote", + "name": "borrow", "source_mapping": { - "start": 7425, - "length": 438, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 13392, + "length": 80, + "filename_relative": "contracts/interfaces/v2/ITreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/v2/ITreasuryReservesVault.sol", + "filename_short": "contracts/interfaces/v2/ITreasuryReservesVault.sol", "is_dependency": false, - "lines": [188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199], + "lines": [336], "starting_column": 5, - "ending_column": 6 + "ending_column": 85 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "RamosStrategy", + "name": "ITreasuryReservesVault", "source_mapping": { - "start": 1131, - "length": 9158, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 1896, + "length": 12436, + "filename_relative": "contracts/interfaces/v2/ITreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/v2/ITreasuryReservesVault.sol", + "filename_short": "contracts/interfaces/v2/ITreasuryReservesVault.sol", "is_dependency": false, "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261 + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, + 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, + 352, 353, 354, 355, 356, 357 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "proportionalRemoveLiquidityQuote(uint256,uint256)" - } - }, - { - "type": "node", - "name": "ramos.poolHelper().proportionalRemoveLiquidityQuote(_bptAmount,_slippageBps)", - "source_mapping": { - "start": 7772, - "length": 84, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", - "is_dependency": false, - "lines": [198], - "starting_column": 9, - "ending_column": 93 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "proportionalRemoveLiquidityQuote", - "source_mapping": { - "start": 7425, - "length": 438, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", - "is_dependency": false, - "lines": [ - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "RamosStrategy", - "source_mapping": { - "start": 1131, - "length": 9158, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", - "is_dependency": false, - "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "proportionalRemoveLiquidityQuote(uint256,uint256)" - } - } + "signature": "borrow(IERC20,uint256,address)" } } ], - "description": "RamosStrategy.proportionalRemoveLiquidityQuote(uint256,uint256) (contracts/v2/strategies/RamosStrategy.sol#188-199) ignores return value by ramos.poolHelper().proportionalRemoveLiquidityQuote(_bptAmount,_slippageBps) (contracts/v2/strategies/RamosStrategy.sol#198)\n", - "markdown": "[RamosStrategy.proportionalRemoveLiquidityQuote(uint256,uint256)](contracts/v2/strategies/RamosStrategy.sol#L188-L199) ignores return value by [ramos.poolHelper().proportionalRemoveLiquidityQuote(_bptAmount,_slippageBps)](contracts/v2/strategies/RamosStrategy.sol#L198)\n", - "first_markdown_element": "contracts/v2/strategies/RamosStrategy.sol#L188-L199", - "id": "558d53bd32a56dc4a459a1d0df8796f5b93c3e70deb722f1847d3672b90d0224", - "check": "unused-return", - "impact": "Medium", - "confidence": "Medium" + "description": "ITreasuryReservesVault.setGlobalPaused(bool,bool).borrow (contracts/interfaces/v2/ITreasuryReservesVault.sol#291) shadows:\n\t- ITreasuryReservesVault.borrow(IERC20,uint256,address) (contracts/interfaces/v2/ITreasuryReservesVault.sol#336) (function)\n", + "markdown": "[ITreasuryReservesVault.setGlobalPaused(bool,bool).borrow](contracts/interfaces/v2/ITreasuryReservesVault.sol#L291) shadows:\n\t- [ITreasuryReservesVault.borrow(IERC20,uint256,address)](contracts/interfaces/v2/ITreasuryReservesVault.sol#L336) (function)\n", + "first_markdown_element": "contracts/interfaces/v2/ITreasuryReservesVault.sol#L291", + "id": "ee178bdb812ac154f4b12235ea96012285731106c401b64ca146c3171f9f2b58", + "check": "shadowing-local", + "impact": "Low", + "confidence": "High" }, { "elements": [ { - "type": "function", - "name": "populateShutdownData", - "source_mapping": { - "start": 8860, - "length": 564, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", - "is_dependency": false, - "lines": [228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "RamosStrategy", - "source_mapping": { - "start": 1131, - "length": 9158, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", - "is_dependency": false, - "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "populateShutdownData(bytes)" - } - }, - { - "type": "node", - "name": "(shutdownParams.bptAmount,None,None) = ramos.positions()", + "type": "variable", + "name": "borrow", "source_mapping": { - "start": 9187, - "length": 48, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 11679, + "length": 11, + "filename_relative": "contracts/interfaces/v2/ITreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/v2/ITreasuryReservesVault.sol", + "filename_short": "contracts/interfaces/v2/ITreasuryReservesVault.sol", "is_dependency": false, - "lines": [236], - "starting_column": 9, - "ending_column": 57 + "lines": [296], + "starting_column": 50, + "ending_column": 61 }, "type_specific_fields": { "parent": { "type": "function", - "name": "populateShutdownData", + "name": "setStrategyPaused", "source_mapping": { - "start": 8860, - "length": 564, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 11634, + "length": 80, + "filename_relative": "contracts/interfaces/v2/ITreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/v2/ITreasuryReservesVault.sol", + "filename_short": "contracts/interfaces/v2/ITreasuryReservesVault.sol", "is_dependency": false, - "lines": [ - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239 - ], + "lines": [296], "starting_column": 5, - "ending_column": 6 + "ending_column": 85 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "RamosStrategy", + "name": "ITreasuryReservesVault", "source_mapping": { - "start": 1131, - "length": 9158, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", - "is_dependency": false, - "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261 + "start": 1896, + "length": 12436, + "filename_relative": "contracts/interfaces/v2/ITreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/v2/ITreasuryReservesVault.sol", + "filename_short": "contracts/interfaces/v2/ITreasuryReservesVault.sol", + "is_dependency": false, + "lines": [ + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "populateShutdownData(bytes)" + "signature": "setStrategyPaused(address,bool,bool)" } } } - } - ], - "description": "RamosStrategy.populateShutdownData(bytes) (contracts/v2/strategies/RamosStrategy.sol#228-239) ignores return value by (shutdownParams.bptAmount,None,None) = ramos.positions() (contracts/v2/strategies/RamosStrategy.sol#236)\n", - "markdown": "[RamosStrategy.populateShutdownData(bytes)](contracts/v2/strategies/RamosStrategy.sol#L228-L239) ignores return value by [(shutdownParams.bptAmount,None,None) = ramos.positions()](contracts/v2/strategies/RamosStrategy.sol#L236)\n", - "first_markdown_element": "contracts/v2/strategies/RamosStrategy.sol#L228-L239", - "id": "7fe3f6b1fdb7368465bd801bcc75d565de6d1b6f45c5acbd1f28dcb40e06efd1", - "check": "unused-return", - "impact": "Medium", - "confidence": "Medium" - }, - { - "elements": [ + }, { "type": "function", - "name": "_doShutdown", + "name": "borrow", "source_mapping": { - "start": 9656, - "length": 631, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 13392, + "length": 80, + "filename_relative": "contracts/interfaces/v2/ITreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/v2/ITreasuryReservesVault.sol", + "filename_short": "contracts/interfaces/v2/ITreasuryReservesVault.sol", "is_dependency": false, - "lines": [ - 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259 - ], + "lines": [336], "starting_column": 5, - "ending_column": 6 + "ending_column": 85 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "RamosStrategy", + "name": "ITreasuryReservesVault", "source_mapping": { - "start": 1131, - "length": 9158, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 1896, + "length": 12436, + "filename_relative": "contracts/interfaces/v2/ITreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/v2/ITreasuryReservesVault.sol", + "filename_short": "contracts/interfaces/v2/ITreasuryReservesVault.sol", "is_dependency": false, "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261 + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, + 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, + 352, 353, 354, 355, 356, 357 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_doShutdown(bytes)" + "signature": "borrow(IERC20,uint256,address)" } - }, + } + ], + "description": "ITreasuryReservesVault.setStrategyPaused(address,bool,bool).borrow (contracts/interfaces/v2/ITreasuryReservesVault.sol#296) shadows:\n\t- ITreasuryReservesVault.borrow(IERC20,uint256,address) (contracts/interfaces/v2/ITreasuryReservesVault.sol#336) (function)\n", + "markdown": "[ITreasuryReservesVault.setStrategyPaused(address,bool,bool).borrow](contracts/interfaces/v2/ITreasuryReservesVault.sol#L296) shadows:\n\t- [ITreasuryReservesVault.borrow(IERC20,uint256,address)](contracts/interfaces/v2/ITreasuryReservesVault.sol#L336) (function)\n", + "first_markdown_element": "contracts/interfaces/v2/ITreasuryReservesVault.sol#L296", + "id": "1f2b144fa0b8083ee1a1ca697a2403bf2d85ddb7223aae096e89a677da991192", + "check": "shadowing-local", + "impact": "Low", + "confidence": "High" + }, + { + "elements": [ { - "type": "node", - "name": "ramos.removeLiquidity(params.requestData,params.bptAmount)", + "type": "variable", + "name": "amountOut_scope_0", "source_mapping": { - "start": 9827, - "length": 59, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 4835, + "length": 62, + "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, - "lines": [248], + "lines": [133], "starting_column": 9, - "ending_column": 68 + "ending_column": 71 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_doShutdown", + "name": "swapExactStableForTemple", "source_mapping": { - "start": 9656, - "length": 631, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 4485, + "length": 687, + "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, "lines": [ - 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259 + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139 ], "starting_column": 5, "ending_column": 6 @@ -20066,13 +14464,13 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "RamosStrategy", + "name": "TempleStableAMMRouter", "source_mapping": { - "start": 1131, - "length": 9158, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 640, + "length": 8240, + "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, "lines": [ 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, @@ -20091,111 +14489,45 @@ 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261 + 229, 230, 231, 232, 233, 234, 235, 236 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_doShutdown(bytes)" + "signature": "swapExactStableForTemple(uint256,uint256,address,address,uint256)" } } } - } - ], - "description": "RamosStrategy._doShutdown(bytes) (contracts/v2/strategies/RamosStrategy.sol#246-259) ignores return value by ramos.removeLiquidity(params.requestData,params.bptAmount) (contracts/v2/strategies/RamosStrategy.sol#248)\n", - "markdown": "[RamosStrategy._doShutdown(bytes)](contracts/v2/strategies/RamosStrategy.sol#L246-L259) ignores return value by [ramos.removeLiquidity(params.requestData,params.bptAmount)](contracts/v2/strategies/RamosStrategy.sol#L248)\n", - "first_markdown_element": "contracts/v2/strategies/RamosStrategy.sol#L246-L259", - "id": "65fc2538c47ec306ad7c77d04c7df2c107cfbba3f5a3910f681208337d10e0d5", - "check": "unused-return", - "impact": "Medium", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "_addLiquidity", - "source_mapping": { - "start": 1756, - "length": 1076, - "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", - "filename_short": "contracts/amm/TempleStableAMMRouter.sol", - "is_dependency": false, - "lines": [ - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleStableAMMRouter", - "source_mapping": { - "start": 640, - "length": 8240, - "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", - "filename_short": "contracts/amm/TempleStableAMMRouter.sol", - "is_dependency": false, - "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "_addLiquidity(uint256,uint256,uint256,uint256,IUniswapV2Pair)" - } }, { - "type": "node", - "name": "(reserveA,reserveB) = pair.getReserves()", + "type": "variable", + "name": "amountOut", "source_mapping": { - "start": 1986, - "length": 52, + "start": 4685, + "length": 14, "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, - "lines": [68], - "starting_column": 9, - "ending_column": 61 + "lines": [128], + "starting_column": 50, + "ending_column": 64 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_addLiquidity", + "name": "swapExactStableForTemple", "source_mapping": { - "start": 1756, - "length": 1076, + "start": 4485, + "length": 687, "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, "lines": [ - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83 + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139 ], "starting_column": 5, "ending_column": 6 @@ -20208,7 +14540,7 @@ "start": 640, "length": 8240, "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, "lines": [ @@ -20234,98 +14566,40 @@ "ending_column": 0 } }, - "signature": "_addLiquidity(uint256,uint256,uint256,uint256,IUniswapV2Pair)" + "signature": "swapExactStableForTemple(uint256,uint256,address,address,uint256)" } } } - } - ], - "description": "TempleStableAMMRouter._addLiquidity(uint256,uint256,uint256,uint256,IUniswapV2Pair) (contracts/amm/TempleStableAMMRouter.sol#61-83) ignores return value by (reserveA,reserveB) = pair.getReserves() (contracts/amm/TempleStableAMMRouter.sol#68)\n", - "markdown": "[TempleStableAMMRouter._addLiquidity(uint256,uint256,uint256,uint256,IUniswapV2Pair)](contracts/amm/TempleStableAMMRouter.sol#L61-L83) ignores return value by [(reserveA,reserveB) = pair.getReserves()](contracts/amm/TempleStableAMMRouter.sol#L68)\n", - "first_markdown_element": "contracts/amm/TempleStableAMMRouter.sol#L61-L83", - "id": "f24551aba47520a07ab79471d9ec9cfe2fe87cd09c197da35e42997dcded68a8", - "check": "unused-return", - "impact": "Medium", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "swapExactStableForTempleQuote", - "source_mapping": { - "start": 7556, - "length": 271, - "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", - "filename_short": "contracts/amm/TempleStableAMMRouter.sol", - "is_dependency": false, - "lines": [202, 203, 204, 205], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleStableAMMRouter", - "source_mapping": { - "start": 640, - "length": 8240, - "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", - "filename_short": "contracts/amm/TempleStableAMMRouter.sol", - "is_dependency": false, - "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "swapExactStableForTempleQuote(address,uint256)" - } }, { - "type": "node", - "name": "(reserveTemple,reserveFrax) = IUniswapV2Pair(pair).getReserves()", + "type": "variable", + "name": "amountOut", "source_mapping": { - "start": 7672, - "length": 76, + "start": 4685, + "length": 14, "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, - "lines": [203], - "starting_column": 9, - "ending_column": 85 + "lines": [128], + "starting_column": 50, + "ending_column": 64 }, "type_specific_fields": { "parent": { "type": "function", - "name": "swapExactStableForTempleQuote", + "name": "swapExactStableForTemple", "source_mapping": { - "start": 7556, - "length": 271, + "start": 4485, + "length": 687, "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, - "lines": [202, 203, 204, 205], + "lines": [ + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139 + ], "starting_column": 5, "ending_column": 6 }, @@ -20337,7 +14611,7 @@ "start": 640, "length": 8240, "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, "lines": [ @@ -20363,103 +14637,39 @@ "ending_column": 0 } }, - "signature": "swapExactStableForTempleQuote(address,uint256)" + "signature": "swapExactStableForTemple(uint256,uint256,address,address,uint256)" } } } - } - ], - "description": "TempleStableAMMRouter.swapExactStableForTempleQuote(address,uint256) (contracts/amm/TempleStableAMMRouter.sol#202-205) ignores return value by (reserveTemple,reserveFrax) = IUniswapV2Pair(pair).getReserves() (contracts/amm/TempleStableAMMRouter.sol#203)\n", - "markdown": "[TempleStableAMMRouter.swapExactStableForTempleQuote(address,uint256)](contracts/amm/TempleStableAMMRouter.sol#L202-L205) ignores return value by [(reserveTemple,reserveFrax) = IUniswapV2Pair(pair).getReserves()](contracts/amm/TempleStableAMMRouter.sol#L203)\n", - "first_markdown_element": "contracts/amm/TempleStableAMMRouter.sol#L202-L205", - "id": "bcaddbd83baa19b08f21d46eaa6d5040ec3da28323505b65de50fbfbd874521c", - "check": "unused-return", - "impact": "Medium", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "swapExactTempleForStableQuote", - "source_mapping": { - "start": 7833, - "length": 639, - "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", - "filename_short": "contracts/amm/TempleStableAMMRouter.sol", - "is_dependency": false, - "lines": [ - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 220, 221 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleStableAMMRouter", - "source_mapping": { - "start": 640, - "length": 8240, - "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", - "filename_short": "contracts/amm/TempleStableAMMRouter.sol", - "is_dependency": false, - "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "swapExactTempleForStableQuote(address,uint256)" - } }, { - "type": "node", - "name": "(reserveTemple,reserveFrax) = IUniswapV2Pair(pair).getReserves()", + "type": "variable", + "name": "amountOut", "source_mapping": { - "start": 7967, - "length": 76, + "start": 4685, + "length": 14, "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, - "lines": [208], - "starting_column": 9, - "ending_column": 85 + "lines": [128], + "starting_column": 50, + "ending_column": 64 }, "type_specific_fields": { "parent": { "type": "function", - "name": "swapExactTempleForStableQuote", + "name": "swapExactStableForTemple", "source_mapping": { - "start": 7833, - "length": 639, + "start": 4485, + "length": 687, "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, "lines": [ - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 220, 221 + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139 ], "starting_column": 5, "ending_column": 6 @@ -20472,7 +14682,7 @@ "start": 640, "length": 8240, "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, "lines": [ @@ -20498,975 +14708,1084 @@ "ending_column": 0 } }, - "signature": "swapExactTempleForStableQuote(address,uint256)" + "signature": "swapExactStableForTemple(uint256,uint256,address,address,uint256)" } } } } ], - "description": "TempleStableAMMRouter.swapExactTempleForStableQuote(address,uint256) (contracts/amm/TempleStableAMMRouter.sol#207-221) ignores return value by (reserveTemple,reserveFrax) = IUniswapV2Pair(pair).getReserves() (contracts/amm/TempleStableAMMRouter.sol#208)\n", - "markdown": "[TempleStableAMMRouter.swapExactTempleForStableQuote(address,uint256)](contracts/amm/TempleStableAMMRouter.sol#L207-L221) ignores return value by [(reserveTemple,reserveFrax) = IUniswapV2Pair(pair).getReserves()](contracts/amm/TempleStableAMMRouter.sol#L208)\n", - "first_markdown_element": "contracts/amm/TempleStableAMMRouter.sol#L207-L221", - "id": "43ba957c0d22f3540a298f9bbbe3e7ef022879a661282996ee551c7d780c6394", - "check": "unused-return", - "impact": "Medium", - "confidence": "Medium" + "description": "TempleStableAMMRouter.swapExactStableForTemple(uint256,uint256,address,address,uint256).amountOut_scope_0 (contracts/amm/TempleStableAMMRouter.sol#133) shadows:\n\t- TempleStableAMMRouter.swapExactStableForTemple(uint256,uint256,address,address,uint256).amountOut (contracts/amm/TempleStableAMMRouter.sol#128) (return variable)\n\t- TempleStableAMMRouter.swapExactStableForTemple(uint256,uint256,address,address,uint256).amountOut (contracts/amm/TempleStableAMMRouter.sol#128) (return variable)\n\t- TempleStableAMMRouter.swapExactStableForTemple(uint256,uint256,address,address,uint256).amountOut (contracts/amm/TempleStableAMMRouter.sol#128) (return variable)\n", + "markdown": "[TempleStableAMMRouter.swapExactStableForTemple(uint256,uint256,address,address,uint256).amountOut_scope_0](contracts/amm/TempleStableAMMRouter.sol#L133) shadows:\n\t- [TempleStableAMMRouter.swapExactStableForTemple(uint256,uint256,address,address,uint256).amountOut](contracts/amm/TempleStableAMMRouter.sol#L128) (return variable)\n\t- [TempleStableAMMRouter.swapExactStableForTemple(uint256,uint256,address,address,uint256).amountOut](contracts/amm/TempleStableAMMRouter.sol#L128) (return variable)\n\t- [TempleStableAMMRouter.swapExactStableForTemple(uint256,uint256,address,address,uint256).amountOut](contracts/amm/TempleStableAMMRouter.sol#L128) (return variable)\n", + "first_markdown_element": "contracts/amm/TempleStableAMMRouter.sol#L133", + "id": "dfcbde91a2b5ed5d0d5ed22c62f0b14c024b922a48014a11601682bab0c693fa", + "check": "shadowing-local", + "impact": "Low", + "confidence": "High" }, { "elements": [ { "type": "function", - "name": "rebalance", + "name": "setEpy", "source_mapping": { - "start": 1808, - "length": 798, - "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", - "filename_short": "contracts/core/OpsManagerLib.sol", + "start": 2547, + "length": 212, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, - "lines": [ - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72 - ], + "lines": [72, 73, 74, 75], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "OpsManagerLib", + "name": "TempleStaking", "source_mapping": { - "start": 158, - "length": 3905, - "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", - "filename_short": "contracts/core/OpsManagerLib.sol", + "start": 464, + "length": 6184, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, "lines": [ - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111 + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "rebalance(Vault,TreasuryFarmingRevenue)" + "signature": "setEpy(uint256,uint256)" } }, { "type": "node", - "name": "(inWindow) = vault.inEnterExitWindow()", + "name": "epy = ABDKMath64x64.fromUInt(1).add(ABDKMath64x64.divu(_numerator,_denominator))", "source_mapping": { - "start": 1916, - "length": 45, - "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", - "filename_short": "contracts/core/OpsManagerLib.sol", + "start": 2671, + "length": 81, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, - "lines": [59], + "lines": [74], "starting_column": 9, - "ending_column": 54 + "ending_column": 90 }, "type_specific_fields": { "parent": { "type": "function", - "name": "rebalance", + "name": "setEpy", "source_mapping": { - "start": 1808, - "length": 798, - "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", - "filename_short": "contracts/core/OpsManagerLib.sol", + "start": 2547, + "length": 212, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, - "lines": [ - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72 - ], + "lines": [72, 73, 74, 75], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "OpsManagerLib", - "source_mapping": { - "start": 158, - "length": 3905, - "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", - "filename_short": "contracts/core/OpsManagerLib.sol", + "name": "TempleStaking", + "source_mapping": { + "start": 464, + "length": 6184, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, "lines": [ - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111 + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "rebalance(Vault,TreasuryFarmingRevenue)" + "signature": "setEpy(uint256,uint256)" } } } } ], - "description": "OpsManagerLib.rebalance(Vault,TreasuryFarmingRevenue) (contracts/core/OpsManagerLib.sol#55-72) ignores return value by (inWindow) = vault.inEnterExitWindow() (contracts/core/OpsManagerLib.sol#59)\n", - "markdown": "[OpsManagerLib.rebalance(Vault,TreasuryFarmingRevenue)](contracts/core/OpsManagerLib.sol#L55-L72) ignores return value by [(inWindow) = vault.inEnterExitWindow()](contracts/core/OpsManagerLib.sol#L59)\n", - "first_markdown_element": "contracts/core/OpsManagerLib.sol#L55-L72", - "id": "7e51402c4c3f903960137b695ab80a5a95e96c56eb93a4b7d980470911d0bde6", - "check": "unused-return", - "impact": "Medium", + "description": "TempleStaking.setEpy(uint256,uint256) (contracts/deprecated/TempleStaking.sol#72-75) should emit an event for: \n\t- epy = ABDKMath64x64.fromUInt(1).add(ABDKMath64x64.divu(_numerator,_denominator)) (contracts/deprecated/TempleStaking.sol#74) \n", + "markdown": "[TempleStaking.setEpy(uint256,uint256)](contracts/deprecated/TempleStaking.sol#L72-L75) should emit an event for: \n\t- [epy = ABDKMath64x64.fromUInt(1).add(ABDKMath64x64.divu(_numerator,_denominator))](contracts/deprecated/TempleStaking.sol#L74) \n", + "first_markdown_element": "contracts/deprecated/TempleStaking.sol#L72-L75", + "id": "66bcff6498cebf5796c64af18f0c23c346a69b2f3379e2371869c68331d2d460", + "check": "events-maths", + "impact": "Low", "confidence": "Medium" }, { "elements": [ { - "type": "function", - "name": "requiresRebalance", + "type": "variable", + "name": "_owner", "source_mapping": { - "start": 2821, - "length": 553, - "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", - "filename_short": "contracts/core/OpsManagerLib.sol", + "start": 2665, + "length": 14, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [ - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95 - ], - "starting_column": 5, - "ending_column": 6 + "lines": [67], + "starting_column": 17, + "ending_column": 31 }, "type_specific_fields": { "parent": { - "type": "contract", - "name": "OpsManagerLib", + "type": "function", + "name": "constructor", "source_mapping": { - "start": 158, - "length": 3905, - "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", - "filename_short": "contracts/core/OpsManagerLib.sol", + "start": 2653, + "length": 152, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [ - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111 - ], - "starting_column": 1, - "ending_column": 0 + "lines": [67, 68, 69, 70, 71], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleUniswapV2Pair", + "source_mapping": { + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "is_dependency": false, + "lines": [ + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "constructor(address,address,address)" } - }, - "signature": "requiresRebalance(Vault[],TreasuryFarmingRevenue)" + } } }, { "type": "node", - "name": "(inWindow) = vaults[i].inEnterExitWindow()", + "name": "owner = _owner", "source_mapping": { - "start": 3101, - "length": 49, - "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", - "filename_short": "contracts/core/OpsManagerLib.sol", + "start": 2732, + "length": 14, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [86], - "starting_column": 13, - "ending_column": 62 + "lines": [68], + "starting_column": 9, + "ending_column": 23 }, "type_specific_fields": { "parent": { "type": "function", - "name": "requiresRebalance", + "name": "constructor", "source_mapping": { - "start": 2821, - "length": 553, - "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", - "filename_short": "contracts/core/OpsManagerLib.sol", + "start": 2653, + "length": 152, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [ - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95 - ], + "lines": [67, 68, 69, 70, 71], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "OpsManagerLib", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 158, - "length": 3905, - "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", - "filename_short": "contracts/core/OpsManagerLib.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "requiresRebalance(Vault[],TreasuryFarmingRevenue)" + "signature": "constructor(address,address,address)" } } } } ], - "description": "OpsManagerLib.requiresRebalance(Vault[],TreasuryFarmingRevenue) (contracts/core/OpsManagerLib.sol#79-95) ignores return value by (inWindow) = vaults[i].inEnterExitWindow() (contracts/core/OpsManagerLib.sol#86)\n", - "markdown": "[OpsManagerLib.requiresRebalance(Vault[],TreasuryFarmingRevenue)](contracts/core/OpsManagerLib.sol#L79-L95) ignores return value by [(inWindow) = vaults[i].inEnterExitWindow()](contracts/core/OpsManagerLib.sol#L86)\n", - "first_markdown_element": "contracts/core/OpsManagerLib.sol#L79-L95", - "id": "0d939f6443be831bd662e4b85b8b26b8ca9716b8fd984c5961f3bbf84c6a1301", - "check": "unused-return", - "impact": "Medium", + "description": "TempleUniswapV2Pair.constructor(address,address,address)._owner (contracts/amm/TempleUniswapV2Pair.sol#67) lacks a zero-check on :\n\t\t- owner = _owner (contracts/amm/TempleUniswapV2Pair.sol#68)\n", + "markdown": "[TempleUniswapV2Pair.constructor(address,address,address)._owner](contracts/amm/TempleUniswapV2Pair.sol#L67) lacks a zero-check on :\n\t\t- [owner = _owner](contracts/amm/TempleUniswapV2Pair.sol#L68)\n", + "first_markdown_element": "contracts/amm/TempleUniswapV2Pair.sol#L67", + "id": "957fa8fd60f70987f3ddecb1cc94bcc42a04d5732b7d1fd612e14be458618171", + "check": "missing-zero-check", + "impact": "Low", "confidence": "Medium" }, { "elements": [ { "type": "variable", - "name": "quoteToken", + "name": "_token0", "source_mapping": { - "start": 4822, - "length": 18, - "filename_relative": "contracts/interfaces/amo/IRamos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/amo/IRamos.sol", - "filename_short": "contracts/interfaces/amo/IRamos.sol", + "start": 2681, + "length": 15, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [103], - "starting_column": 9, - "ending_column": 27 + "lines": [67], + "starting_column": 33, + "ending_column": 48 }, "type_specific_fields": { "parent": { "type": "function", - "name": "maxRebalanceAmounts", + "name": "constructor", "source_mapping": { - "start": 4738, - "length": 140, - "filename_relative": "contracts/interfaces/amo/IRamos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/amo/IRamos.sol", - "filename_short": "contracts/interfaces/amo/IRamos.sol", + "start": 2653, + "length": 152, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [101, 102, 103, 104, 105], + "lines": [67, 68, 69, 70, 71], "starting_column": 5, - "ending_column": 7 + "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "IRamos", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 1408, - "length": 10519, - "filename_relative": "contracts/interfaces/amo/IRamos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/amo/IRamos.sol", - "filename_short": "contracts/interfaces/amo/IRamos.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, - 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, - 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "maxRebalanceAmounts()" + "signature": "constructor(address,address,address)" } } } }, { - "type": "function", - "name": "quoteToken", + "type": "node", + "name": "token0 = _token0", "source_mapping": { - "start": 3767, - "length": 53, - "filename_relative": "contracts/interfaces/amo/IRamos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/amo/IRamos.sol", - "filename_short": "contracts/interfaces/amo/IRamos.sol", + "start": 2756, + "length": 16, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [80], - "starting_column": 5, - "ending_column": 58 + "lines": [69], + "starting_column": 9, + "ending_column": 25 }, "type_specific_fields": { "parent": { - "type": "contract", - "name": "IRamos", + "type": "function", + "name": "constructor", "source_mapping": { - "start": 1408, - "length": 10519, - "filename_relative": "contracts/interfaces/amo/IRamos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/amo/IRamos.sol", - "filename_short": "contracts/interfaces/amo/IRamos.sol", + "start": 2653, + "length": 152, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [ - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, - 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, - 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276 - ], - "starting_column": 1, - "ending_column": 0 + "lines": [67, 68, 69, 70, 71], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleUniswapV2Pair", + "source_mapping": { + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "is_dependency": false, + "lines": [ + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "constructor(address,address,address)" } - }, - "signature": "quoteToken()" + } } } ], - "description": "IRamos.maxRebalanceAmounts().quoteToken (contracts/interfaces/amo/IRamos.sol#103) shadows:\n\t- IRamos.quoteToken() (contracts/interfaces/amo/IRamos.sol#80) (function)\n", - "markdown": "[IRamos.maxRebalanceAmounts().quoteToken](contracts/interfaces/amo/IRamos.sol#L103) shadows:\n\t- [IRamos.quoteToken()](contracts/interfaces/amo/IRamos.sol#L80) (function)\n", - "first_markdown_element": "contracts/interfaces/amo/IRamos.sol#L103", - "id": "a030cfdb07ff13cdfeb8487608a714d3b198ff28886a8ef272f9e70a87a70f0a", - "check": "shadowing-local", + "description": "TempleUniswapV2Pair.constructor(address,address,address)._token0 (contracts/amm/TempleUniswapV2Pair.sol#67) lacks a zero-check on :\n\t\t- token0 = _token0 (contracts/amm/TempleUniswapV2Pair.sol#69)\n", + "markdown": "[TempleUniswapV2Pair.constructor(address,address,address)._token0](contracts/amm/TempleUniswapV2Pair.sol#L67) lacks a zero-check on :\n\t\t- [token0 = _token0](contracts/amm/TempleUniswapV2Pair.sol#L69)\n", + "first_markdown_element": "contracts/amm/TempleUniswapV2Pair.sol#L67", + "id": "89b68064543393a53cb614749cb260c4fb872797867021adbebf53b5a0362b2f", + "check": "missing-zero-check", "impact": "Low", - "confidence": "High" + "confidence": "Medium" }, { "elements": [ { "type": "variable", - "name": "protocolToken", + "name": "_token1", "source_mapping": { - "start": 4850, - "length": 21, - "filename_relative": "contracts/interfaces/amo/IRamos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/amo/IRamos.sol", - "filename_short": "contracts/interfaces/amo/IRamos.sol", + "start": 2698, + "length": 15, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [104], - "starting_column": 9, - "ending_column": 30 + "lines": [67], + "starting_column": 50, + "ending_column": 65 }, "type_specific_fields": { "parent": { "type": "function", - "name": "maxRebalanceAmounts", + "name": "constructor", "source_mapping": { - "start": 4738, - "length": 140, - "filename_relative": "contracts/interfaces/amo/IRamos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/amo/IRamos.sol", - "filename_short": "contracts/interfaces/amo/IRamos.sol", + "start": 2653, + "length": 152, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [101, 102, 103, 104, 105], + "lines": [67, 68, 69, 70, 71], "starting_column": 5, - "ending_column": 7 + "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "IRamos", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 1408, - "length": 10519, - "filename_relative": "contracts/interfaces/amo/IRamos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/amo/IRamos.sol", - "filename_short": "contracts/interfaces/amo/IRamos.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, - 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, - 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "maxRebalanceAmounts()" + "signature": "constructor(address,address,address)" } } } }, { - "type": "function", - "name": "protocolToken", + "type": "node", + "name": "token1 = _token1", "source_mapping": { - "start": 3567, - "length": 56, - "filename_relative": "contracts/interfaces/amo/IRamos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/amo/IRamos.sol", - "filename_short": "contracts/interfaces/amo/IRamos.sol", + "start": 2782, + "length": 16, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [76], - "starting_column": 5, - "ending_column": 61 + "lines": [70], + "starting_column": 9, + "ending_column": 25 }, "type_specific_fields": { "parent": { - "type": "contract", - "name": "IRamos", + "type": "function", + "name": "constructor", "source_mapping": { - "start": 1408, - "length": 10519, - "filename_relative": "contracts/interfaces/amo/IRamos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/amo/IRamos.sol", - "filename_short": "contracts/interfaces/amo/IRamos.sol", + "start": 2653, + "length": 152, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [ - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, - 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, - 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, - 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276 - ], - "starting_column": 1, - "ending_column": 0 + "lines": [67, 68, 69, 70, 71], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleUniswapV2Pair", + "source_mapping": { + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "is_dependency": false, + "lines": [ + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "constructor(address,address,address)" } - }, - "signature": "protocolToken()" + } } } ], - "description": "IRamos.maxRebalanceAmounts().protocolToken (contracts/interfaces/amo/IRamos.sol#104) shadows:\n\t- IRamos.protocolToken() (contracts/interfaces/amo/IRamos.sol#76) (function)\n", - "markdown": "[IRamos.maxRebalanceAmounts().protocolToken](contracts/interfaces/amo/IRamos.sol#L104) shadows:\n\t- [IRamos.protocolToken()](contracts/interfaces/amo/IRamos.sol#L76) (function)\n", - "first_markdown_element": "contracts/interfaces/amo/IRamos.sol#L104", - "id": "99988e8d4356d61dc22dc1203ce47d52bd194ee6c04869d1c08b03332a4a64b3", - "check": "shadowing-local", + "description": "TempleUniswapV2Pair.constructor(address,address,address)._token1 (contracts/amm/TempleUniswapV2Pair.sol#67) lacks a zero-check on :\n\t\t- token1 = _token1 (contracts/amm/TempleUniswapV2Pair.sol#70)\n", + "markdown": "[TempleUniswapV2Pair.constructor(address,address,address)._token1](contracts/amm/TempleUniswapV2Pair.sol#L67) lacks a zero-check on :\n\t\t- [token1 = _token1](contracts/amm/TempleUniswapV2Pair.sol#L70)\n", + "first_markdown_element": "contracts/amm/TempleUniswapV2Pair.sol#L67", + "id": "690db18543951330bfe14086929ed1a80aa7c5c43d413a52b921411451479889", + "check": "missing-zero-check", "impact": "Low", - "confidence": "High" + "confidence": "Medium" }, { "elements": [ { "type": "variable", - "name": "baseShares", + "name": "_router", "source_mapping": { - "start": 3468, - "length": 18, - "filename_relative": "contracts/interfaces/v2/ITempleDebtToken.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/v2/ITempleDebtToken.sol", - "filename_short": "contracts/interfaces/v2/ITempleDebtToken.sol", + "start": 2904, + "length": 15, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [86], - "starting_column": 9, - "ending_column": 27 + "lines": [74], + "starting_column": 24, + "ending_column": 39 }, "type_specific_fields": { "parent": { "type": "function", - "name": "debtors", + "name": "setRouter", "source_mapping": { - "start": 3219, - "length": 737, - "filename_relative": "contracts/interfaces/v2/ITempleDebtToken.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/v2/ITempleDebtToken.sol", - "filename_short": "contracts/interfaces/v2/ITempleDebtToken.sol", + "start": 2885, + "length": 140, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [ - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97 - ], + "lines": [74, 75, 76, 77], "starting_column": 5, - "ending_column": 7 + "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "ITempleDebtToken", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 325, - "length": 8309, - "filename_relative": "contracts/interfaces/v2/ITempleDebtToken.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/v2/ITempleDebtToken.sol", - "filename_short": "contracts/interfaces/v2/ITempleDebtToken.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "debtors(address)" + "signature": "setRouter(address)" } } } }, { - "type": "function", - "name": "baseShares", + "type": "node", + "name": "router = _router", "source_mapping": { - "start": 1667, - "length": 54, - "filename_relative": "contracts/interfaces/v2/ITempleDebtToken.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/v2/ITempleDebtToken.sol", - "filename_short": "contracts/interfaces/v2/ITempleDebtToken.sol", + "start": 3002, + "length": 16, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [42], - "starting_column": 5, - "ending_column": 59 + "lines": [76], + "starting_column": 9, + "ending_column": 25 }, "type_specific_fields": { "parent": { - "type": "contract", - "name": "ITempleDebtToken", + "type": "function", + "name": "setRouter", "source_mapping": { - "start": 325, - "length": 8309, - "filename_relative": "contracts/interfaces/v2/ITempleDebtToken.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/v2/ITempleDebtToken.sol", - "filename_short": "contracts/interfaces/v2/ITempleDebtToken.sol", + "start": 2885, + "length": 140, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [ - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210 - ], - "starting_column": 1, - "ending_column": 0 + "lines": [74, 75, 76, 77], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleUniswapV2Pair", + "source_mapping": { + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "is_dependency": false, + "lines": [ + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "setRouter(address)" } - }, - "signature": "baseShares()" + } } } ], - "description": "ITempleDebtToken.debtors(address).baseShares (contracts/interfaces/v2/ITempleDebtToken.sol#86) shadows:\n\t- ITempleDebtToken.baseShares() (contracts/interfaces/v2/ITempleDebtToken.sol#42) (function)\n", - "markdown": "[ITempleDebtToken.debtors(address).baseShares](contracts/interfaces/v2/ITempleDebtToken.sol#L86) shadows:\n\t- [ITempleDebtToken.baseShares()](contracts/interfaces/v2/ITempleDebtToken.sol#L42) (function)\n", - "first_markdown_element": "contracts/interfaces/v2/ITempleDebtToken.sol#L86", - "id": "660d8ad3fe151743a4b6eac08ff790cbd92361508e6a7e1ac51d359fbd40579a", - "check": "shadowing-local", + "description": "TempleUniswapV2Pair.setRouter(address)._router (contracts/amm/TempleUniswapV2Pair.sol#74) lacks a zero-check on :\n\t\t- router = _router (contracts/amm/TempleUniswapV2Pair.sol#76)\n", + "markdown": "[TempleUniswapV2Pair.setRouter(address)._router](contracts/amm/TempleUniswapV2Pair.sol#L74) lacks a zero-check on :\n\t\t- [router = _router](contracts/amm/TempleUniswapV2Pair.sol#L76)\n", + "first_markdown_element": "contracts/amm/TempleUniswapV2Pair.sol#L74", + "id": "65b7f26867d221829e7395a702a30581f77ebb909c900aa9dc269f7dd15923d0", + "check": "missing-zero-check", "impact": "Low", - "confidence": "High" + "confidence": "Medium" }, { "elements": [ { "type": "variable", - "name": "borrow", + "name": "_recipient", "source_mapping": { - "start": 11494, - "length": 11, - "filename_relative": "contracts/interfaces/v2/ITreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/v2/ITreasuryReservesVault.sol", - "filename_short": "contracts/interfaces/v2/ITreasuryReservesVault.sol", + "start": 1683, + "length": 18, + "filename_relative": "contracts/amo/AuraStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/AuraStaking.sol", + "filename_short": "contracts/amo/AuraStaking.sol", "is_dependency": false, - "lines": [291], - "starting_column": 30, - "ending_column": 41 + "lines": [48], + "starting_column": 34, + "ending_column": 52 }, "type_specific_fields": { "parent": { "type": "function", - "name": "setGlobalPaused", + "name": "setRewardsRecipient", "source_mapping": { - "start": 11469, - "length": 60, - "filename_relative": "contracts/interfaces/v2/ITreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/v2/ITreasuryReservesVault.sol", - "filename_short": "contracts/interfaces/v2/ITreasuryReservesVault.sol", + "start": 1654, + "length": 179, + "filename_relative": "contracts/amo/AuraStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/AuraStaking.sol", + "filename_short": "contracts/amo/AuraStaking.sol", "is_dependency": false, - "lines": [291], + "lines": [48, 49, 50, 51, 52], "starting_column": 5, - "ending_column": 65 + "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "ITreasuryReservesVault", + "name": "AuraStaking", "source_mapping": { - "start": 1896, - "length": 12436, - "filename_relative": "contracts/interfaces/v2/ITreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/v2/ITreasuryReservesVault.sol", - "filename_short": "contracts/interfaces/v2/ITreasuryReservesVault.sol", + "start": 604, + "length": 5204, + "filename_relative": "contracts/amo/AuraStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/AuraStaking.sol", + "filename_short": "contracts/amo/AuraStaking.sol", "is_dependency": false, "lines": [ - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, - 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, - 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, - 353, 354, 355, 356, 357 + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "setGlobalPaused(bool,bool)" + "signature": "setRewardsRecipient(address)" } } } }, { - "type": "function", - "name": "borrow", + "type": "node", + "name": "rewardsRecipient = _recipient", "source_mapping": { - "start": 13392, - "length": 80, - "filename_relative": "contracts/interfaces/v2/ITreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/v2/ITreasuryReservesVault.sol", - "filename_short": "contracts/interfaces/v2/ITreasuryReservesVault.sol", + "start": 1750, + "length": 29, + "filename_relative": "contracts/amo/AuraStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/AuraStaking.sol", + "filename_short": "contracts/amo/AuraStaking.sol", "is_dependency": false, - "lines": [336], - "starting_column": 5, - "ending_column": 85 + "lines": [49], + "starting_column": 9, + "ending_column": 38 }, "type_specific_fields": { "parent": { - "type": "contract", - "name": "ITreasuryReservesVault", + "type": "function", + "name": "setRewardsRecipient", "source_mapping": { - "start": 1896, - "length": 12436, - "filename_relative": "contracts/interfaces/v2/ITreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/v2/ITreasuryReservesVault.sol", - "filename_short": "contracts/interfaces/v2/ITreasuryReservesVault.sol", + "start": 1654, + "length": 179, + "filename_relative": "contracts/amo/AuraStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/AuraStaking.sol", + "filename_short": "contracts/amo/AuraStaking.sol", "is_dependency": false, - "lines": [ - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, - 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, - 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, - 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, - 352, 353, 354, 355, 356, 357 - ], - "starting_column": 1, - "ending_column": 0 + "lines": [48, 49, 50, 51, 52], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "AuraStaking", + "source_mapping": { + "start": 604, + "length": 5204, + "filename_relative": "contracts/amo/AuraStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/AuraStaking.sol", + "filename_short": "contracts/amo/AuraStaking.sol", + "is_dependency": false, + "lines": [ + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "setRewardsRecipient(address)" } - }, - "signature": "borrow(IERC20,uint256,address)" + } } } ], - "description": "ITreasuryReservesVault.setGlobalPaused(bool,bool).borrow (contracts/interfaces/v2/ITreasuryReservesVault.sol#291) shadows:\n\t- ITreasuryReservesVault.borrow(IERC20,uint256,address) (contracts/interfaces/v2/ITreasuryReservesVault.sol#336) (function)\n", - "markdown": "[ITreasuryReservesVault.setGlobalPaused(bool,bool).borrow](contracts/interfaces/v2/ITreasuryReservesVault.sol#L291) shadows:\n\t- [ITreasuryReservesVault.borrow(IERC20,uint256,address)](contracts/interfaces/v2/ITreasuryReservesVault.sol#L336) (function)\n", - "first_markdown_element": "contracts/interfaces/v2/ITreasuryReservesVault.sol#L291", - "id": "ee178bdb812ac154f4b12235ea96012285731106c401b64ca146c3171f9f2b58", - "check": "shadowing-local", + "description": "AuraStaking.setRewardsRecipient(address)._recipient (contracts/amo/AuraStaking.sol#48) lacks a zero-check on :\n\t\t- rewardsRecipient = _recipient (contracts/amo/AuraStaking.sol#49)\n", + "markdown": "[AuraStaking.setRewardsRecipient(address)._recipient](contracts/amo/AuraStaking.sol#L48) lacks a zero-check on :\n\t\t- [rewardsRecipient = _recipient](contracts/amo/AuraStaking.sol#L49)\n", + "first_markdown_element": "contracts/amo/AuraStaking.sol#L48", + "id": "5563fec2719988c18a09b1c9b98748a0700c5a09c84dd2f6ec51e7b0796b0c80", + "check": "missing-zero-check", "impact": "Low", - "confidence": "High" + "confidence": "Medium" }, { "elements": [ { "type": "variable", - "name": "borrow", + "name": "_feeCollector", "source_mapping": { - "start": 11679, - "length": 11, - "filename_relative": "contracts/interfaces/v2/ITreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/v2/ITreasuryReservesVault.sol", - "filename_short": "contracts/interfaces/v2/ITreasuryReservesVault.sol", + "start": 4831, + "length": 21, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [296], - "starting_column": 50, - "ending_column": 61 + "lines": [113], + "starting_column": 9, + "ending_column": 30 }, "type_specific_fields": { "parent": { "type": "function", - "name": "setStrategyPaused", + "name": "constructor", "source_mapping": { - "start": 11634, - "length": 80, - "filename_relative": "contracts/interfaces/v2/ITreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/v2/ITreasuryReservesVault.sol", - "filename_short": "contracts/interfaces/v2/ITreasuryReservesVault.sol", + "start": 4519, + "length": 995, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [296], + "lines": [ + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129 + ], "starting_column": 5, - "ending_column": 85 + "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "ITreasuryReservesVault", + "name": "Ramos", "source_mapping": { - "start": 1896, - "length": 12436, - "filename_relative": "contracts/interfaces/v2/ITreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/v2/ITreasuryReservesVault.sol", - "filename_short": "contracts/interfaces/v2/ITreasuryReservesVault.sol", + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, - 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, - 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, - 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, - 353, 354, 355, 356, 357 + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, + 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, + 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, + 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, + 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, + 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, + 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "setStrategyPaused(address,bool,bool)" + "signature": "constructor(address,address,address,address,address,address,address,uint64,bytes32,address,uint256)" } } } }, { - "type": "function", - "name": "borrow", + "type": "node", + "name": "feeCollector = _feeCollector", "source_mapping": { - "start": 13392, - "length": 80, - "filename_relative": "contracts/interfaces/v2/ITreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/v2/ITreasuryReservesVault.sol", - "filename_short": "contracts/interfaces/v2/ITreasuryReservesVault.sol", + "start": 5312, + "length": 28, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [336], - "starting_column": 5, - "ending_column": 85 + "lines": [123], + "starting_column": 9, + "ending_column": 37 }, "type_specific_fields": { "parent": { - "type": "contract", - "name": "ITreasuryReservesVault", + "type": "function", + "name": "constructor", "source_mapping": { - "start": 1896, - "length": 12436, - "filename_relative": "contracts/interfaces/v2/ITreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/v2/ITreasuryReservesVault.sol", - "filename_short": "contracts/interfaces/v2/ITreasuryReservesVault.sol", + "start": 4519, + "length": 995, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, - 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, - 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, - 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, - 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, - 352, 353, 354, 355, 356, 357 + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129 ], - "starting_column": 1, - "ending_column": 0 + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Ramos", + "source_mapping": { + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", + "is_dependency": false, + "lines": [ + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, + 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, + 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, + 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, + 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, + 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, + 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "constructor(address,address,address,address,address,address,address,uint64,bytes32,address,uint256)" } - }, - "signature": "borrow(IERC20,uint256,address)" + } } } ], - "description": "ITreasuryReservesVault.setStrategyPaused(address,bool,bool).borrow (contracts/interfaces/v2/ITreasuryReservesVault.sol#296) shadows:\n\t- ITreasuryReservesVault.borrow(IERC20,uint256,address) (contracts/interfaces/v2/ITreasuryReservesVault.sol#336) (function)\n", - "markdown": "[ITreasuryReservesVault.setStrategyPaused(address,bool,bool).borrow](contracts/interfaces/v2/ITreasuryReservesVault.sol#L296) shadows:\n\t- [ITreasuryReservesVault.borrow(IERC20,uint256,address)](contracts/interfaces/v2/ITreasuryReservesVault.sol#L336) (function)\n", - "first_markdown_element": "contracts/interfaces/v2/ITreasuryReservesVault.sol#L296", - "id": "1f2b144fa0b8083ee1a1ca697a2403bf2d85ddb7223aae096e89a677da991192", - "check": "shadowing-local", + "description": "Ramos.constructor(address,address,address,address,address,address,address,uint64,bytes32,address,uint256)._feeCollector (contracts/amo/Ramos.sol#113) lacks a zero-check on :\n\t\t- feeCollector = _feeCollector (contracts/amo/Ramos.sol#123)\n", + "markdown": "[Ramos.constructor(address,address,address,address,address,address,address,uint64,bytes32,address,uint256)._feeCollector](contracts/amo/Ramos.sol#L113) lacks a zero-check on :\n\t\t- [feeCollector = _feeCollector](contracts/amo/Ramos.sol#L123)\n", + "first_markdown_element": "contracts/amo/Ramos.sol#L113", + "id": "d859e385f8bd8eca35f31a74169347836938cb1a82d4c8321f358ad5363d6ed4", + "check": "missing-zero-check", "impact": "Low", - "confidence": "High" + "confidence": "Medium" }, { "elements": [ { "type": "variable", - "name": "amountOut_scope_0", + "name": "_amo", "source_mapping": { - "start": 4835, - "length": 62, - "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", - "filename_short": "contracts/amm/TempleStableAMMRouter.sol", + "start": 1614, + "length": 12, + "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", "is_dependency": false, - "lines": [133], - "starting_column": 9, - "ending_column": 71 + "lines": [41], + "starting_column": 7, + "ending_column": 19 }, "type_specific_fields": { "parent": { "type": "function", - "name": "swapExactStableForTemple", + "name": "constructor", "source_mapping": { - "start": 4485, - "length": 687, - "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", - "filename_short": "contracts/amm/TempleStableAMMRouter.sol", + "start": 1451, + "length": 622, + "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", "is_dependency": false, "lines": [ - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139 + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53 ], "starting_column": 5, "ending_column": 6 @@ -21474,70 +15793,87 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleStableAMMRouter", + "name": "BalancerPoolHelper", "source_mapping": { - "start": 640, - "length": 8240, - "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", - "filename_short": "contracts/amm/TempleStableAMMRouter.sol", + "start": 739, + "length": 19014, + "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", "is_dependency": false, "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, + 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, + 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "swapExactStableForTemple(uint256,uint256,address,address,uint256)" + "signature": "constructor(address,address,address,address,address,address,uint64,bytes32)" } } } }, { - "type": "variable", - "name": "amountOut", + "type": "node", + "name": "amo = _amo", "source_mapping": { - "start": 4685, - "length": 14, - "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", - "filename_short": "contracts/amm/TempleStableAMMRouter.sol", + "start": 1988, + "length": 10, + "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", "is_dependency": false, - "lines": [128], - "starting_column": 50, - "ending_column": 64 + "lines": [51], + "starting_column": 7, + "ending_column": 17 }, "type_specific_fields": { "parent": { "type": "function", - "name": "swapExactStableForTemple", + "name": "constructor", "source_mapping": { - "start": 4485, - "length": 687, - "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", - "filename_short": "contracts/amm/TempleStableAMMRouter.sol", + "start": 1451, + "length": 622, + "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", "is_dependency": false, "lines": [ - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139 + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53 ], "starting_column": 5, "ending_column": 6 @@ -21545,70 +15881,98 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleStableAMMRouter", + "name": "BalancerPoolHelper", "source_mapping": { - "start": 640, - "length": 8240, - "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", - "filename_short": "contracts/amm/TempleStableAMMRouter.sol", + "start": 739, + "length": 19014, + "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", "is_dependency": false, "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, + 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, + 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "swapExactStableForTemple(uint256,uint256,address,address,uint256)" + "signature": "constructor(address,address,address,address,address,address,uint64,bytes32)" } } } - }, + } + ], + "description": "BalancerPoolHelper.constructor(address,address,address,address,address,address,uint64,bytes32)._amo (contracts/amo/helpers/BalancerPoolHelper.sol#41) lacks a zero-check on :\n\t\t- amo = _amo (contracts/amo/helpers/BalancerPoolHelper.sol#51)\n", + "markdown": "[BalancerPoolHelper.constructor(address,address,address,address,address,address,uint64,bytes32)._amo](contracts/amo/helpers/BalancerPoolHelper.sol#L41) lacks a zero-check on :\n\t\t- [amo = _amo](contracts/amo/helpers/BalancerPoolHelper.sol#L51)\n", + "first_markdown_element": "contracts/amo/helpers/BalancerPoolHelper.sol#L41", + "id": "1a4d31b221d02b3c425c477d2b7e4c6dc1e41557697509c8e152170c2f1f7986", + "check": "missing-zero-check", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ { "type": "variable", - "name": "amountOut", + "name": "_fundsOwner", "source_mapping": { - "start": 4685, - "length": 14, - "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", - "filename_short": "contracts/amm/TempleStableAMMRouter.sol", + "start": 3149, + "length": 19, + "filename_relative": "contracts/core/OtcOffer.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OtcOffer.sol", + "filename_short": "contracts/core/OtcOffer.sol", "is_dependency": false, - "lines": [128], - "starting_column": 50, - "ending_column": 64 + "lines": [72], + "starting_column": 9, + "ending_column": 28 }, "type_specific_fields": { "parent": { "type": "function", - "name": "swapExactStableForTemple", + "name": "constructor", "source_mapping": { - "start": 4485, - "length": 687, - "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", - "filename_short": "contracts/amm/TempleStableAMMRouter.sol", + "start": 3065, + "length": 1117, + "filename_relative": "contracts/core/OtcOffer.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OtcOffer.sol", + "filename_short": "contracts/core/OtcOffer.sol", "is_dependency": false, "lines": [ - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139 + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95 ], "starting_column": 5, "ending_column": 6 @@ -21616,70 +15980,64 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleStableAMMRouter", + "name": "OtcOffer", "source_mapping": { - "start": 640, - "length": 8240, - "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", - "filename_short": "contracts/amm/TempleStableAMMRouter.sol", + "start": 847, + "length": 6468, + "filename_relative": "contracts/core/OtcOffer.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OtcOffer.sol", + "filename_short": "contracts/core/OtcOffer.sol", "is_dependency": false, "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236 + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "swapExactStableForTemple(uint256,uint256,address,address,uint256)" + "signature": "constructor(address,address,address,uint256,OtcOffer.OfferPricingToken,uint128,uint128)" } } } }, { - "type": "variable", - "name": "amountOut", + "type": "node", + "name": "fundsOwner = _fundsOwner", "source_mapping": { - "start": 4685, - "length": 14, - "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", - "filename_short": "contracts/amm/TempleStableAMMRouter.sol", + "start": 3444, + "length": 24, + "filename_relative": "contracts/core/OtcOffer.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OtcOffer.sol", + "filename_short": "contracts/core/OtcOffer.sol", "is_dependency": false, - "lines": [128], - "starting_column": 50, - "ending_column": 64 + "lines": [80], + "starting_column": 9, + "ending_column": 33 }, "type_specific_fields": { "parent": { "type": "function", - "name": "swapExactStableForTemple", + "name": "constructor", "source_mapping": { - "start": 4485, - "length": 687, - "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", - "filename_short": "contracts/amm/TempleStableAMMRouter.sol", + "start": 3065, + "length": 1117, + "filename_relative": "contracts/core/OtcOffer.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OtcOffer.sol", + "filename_short": "contracts/core/OtcOffer.sol", "is_dependency": false, "lines": [ - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139 + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95 ], "starting_column": 5, "ending_column": 6 @@ -21687,166 +16045,163 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleStableAMMRouter", + "name": "OtcOffer", "source_mapping": { - "start": 640, - "length": 8240, - "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", - "filename_short": "contracts/amm/TempleStableAMMRouter.sol", + "start": 847, + "length": 6468, + "filename_relative": "contracts/core/OtcOffer.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OtcOffer.sol", + "filename_short": "contracts/core/OtcOffer.sol", "is_dependency": false, "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236 + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "swapExactStableForTemple(uint256,uint256,address,address,uint256)" + "signature": "constructor(address,address,address,uint256,OtcOffer.OfferPricingToken,uint128,uint128)" } } } } ], - "description": "TempleStableAMMRouter.swapExactStableForTemple(uint256,uint256,address,address,uint256).amountOut_scope_0 (contracts/amm/TempleStableAMMRouter.sol#133) shadows:\n\t- TempleStableAMMRouter.swapExactStableForTemple(uint256,uint256,address,address,uint256).amountOut (contracts/amm/TempleStableAMMRouter.sol#128) (return variable)\n\t- TempleStableAMMRouter.swapExactStableForTemple(uint256,uint256,address,address,uint256).amountOut (contracts/amm/TempleStableAMMRouter.sol#128) (return variable)\n\t- TempleStableAMMRouter.swapExactStableForTemple(uint256,uint256,address,address,uint256).amountOut (contracts/amm/TempleStableAMMRouter.sol#128) (return variable)\n", - "markdown": "[TempleStableAMMRouter.swapExactStableForTemple(uint256,uint256,address,address,uint256).amountOut_scope_0](contracts/amm/TempleStableAMMRouter.sol#L133) shadows:\n\t- [TempleStableAMMRouter.swapExactStableForTemple(uint256,uint256,address,address,uint256).amountOut](contracts/amm/TempleStableAMMRouter.sol#L128) (return variable)\n\t- [TempleStableAMMRouter.swapExactStableForTemple(uint256,uint256,address,address,uint256).amountOut](contracts/amm/TempleStableAMMRouter.sol#L128) (return variable)\n\t- [TempleStableAMMRouter.swapExactStableForTemple(uint256,uint256,address,address,uint256).amountOut](contracts/amm/TempleStableAMMRouter.sol#L128) (return variable)\n", - "first_markdown_element": "contracts/amm/TempleStableAMMRouter.sol#L133", - "id": "dfcbde91a2b5ed5d0d5ed22c62f0b14c024b922a48014a11601682bab0c693fa", - "check": "shadowing-local", + "description": "OtcOffer.constructor(address,address,address,uint256,OtcOffer.OfferPricingToken,uint128,uint128)._fundsOwner (contracts/core/OtcOffer.sol#72) lacks a zero-check on :\n\t\t- fundsOwner = _fundsOwner (contracts/core/OtcOffer.sol#80)\n", + "markdown": "[OtcOffer.constructor(address,address,address,uint256,OtcOffer.OfferPricingToken,uint128,uint128)._fundsOwner](contracts/core/OtcOffer.sol#L72) lacks a zero-check on :\n\t\t- [fundsOwner = _fundsOwner](contracts/core/OtcOffer.sol#L80)\n", + "first_markdown_element": "contracts/core/OtcOffer.sol#L72", + "id": "318c72045beea63d39db91e2c64959d93dbfe0e966ec4e74e6cbf32f20a24e68", + "check": "missing-zero-check", "impact": "Low", - "confidence": "High" + "confidence": "Medium" }, { "elements": [ { - "type": "function", - "name": "setEpy", + "type": "variable", + "name": "_sacrificedTokenRecipient", "source_mapping": { - "start": 2547, - "length": 212, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", + "start": 1050, + "length": 33, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, - "lines": [72, 73, 74, 75], - "starting_column": 5, - "ending_column": 6 + "lines": [25], + "starting_column": 9, + "ending_column": 42 }, "type_specific_fields": { "parent": { - "type": "contract", - "name": "TempleStaking", + "type": "function", + "name": "constructor", "source_mapping": { - "start": 464, - "length": 6184, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", + "start": 981, + "length": 304, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, - "lines": [ - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163 - ], - "starting_column": 1, - "ending_column": 0 + "lines": [22, 23, 24, 25, 26, 27, 28, 29, 30, 31], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleSacrifice", + "source_mapping": { + "start": 594, + "length": 1743, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", + "is_dependency": false, + "lines": [ + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "constructor(address,address,address,address)" } - }, - "signature": "setEpy(uint256,uint256)" + } } }, { "type": "node", - "name": "epy = ABDKMath64x64.fromUInt(1).add(ABDKMath64x64.divu(_numerator,_denominator))", + "name": "sacrificedTokenRecipient = _sacrificedTokenRecipient", "source_mapping": { - "start": 2671, - "length": 81, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", + "start": 1226, + "length": 52, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, - "lines": [74], + "lines": [30], "starting_column": 9, - "ending_column": 90 + "ending_column": 61 }, "type_specific_fields": { "parent": { "type": "function", - "name": "setEpy", + "name": "constructor", "source_mapping": { - "start": 2547, - "length": 212, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", + "start": 981, + "length": 304, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, - "lines": [72, 73, 74, 75], + "lines": [22, 23, 24, 25, 26, 27, 28, 29, 30, 31], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleStaking", + "name": "TempleSacrifice", "source_mapping": { - "start": 464, - "length": 6184, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", + "start": 594, + "length": 1743, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, "lines": [ - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163 + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "setEpy(uint256,uint256)" + "signature": "constructor(address,address,address,address)" } } } } ], - "description": "TempleStaking.setEpy(uint256,uint256) (contracts/deprecated/TempleStaking.sol#72-75) should emit an event for: \n\t- epy = ABDKMath64x64.fromUInt(1).add(ABDKMath64x64.divu(_numerator,_denominator)) (contracts/deprecated/TempleStaking.sol#74) \n", - "markdown": "[TempleStaking.setEpy(uint256,uint256)](contracts/deprecated/TempleStaking.sol#L72-L75) should emit an event for: \n\t- [epy = ABDKMath64x64.fromUInt(1).add(ABDKMath64x64.divu(_numerator,_denominator))](contracts/deprecated/TempleStaking.sol#L74) \n", - "first_markdown_element": "contracts/deprecated/TempleStaking.sol#L72-L75", - "id": "66bcff6498cebf5796c64af18f0c23c346a69b2f3379e2371869c68331d2d460", - "check": "events-maths", + "description": "TempleSacrifice.constructor(address,address,address,address)._sacrificedTokenRecipient (contracts/nexus/TempleSacrifice.sol#25) lacks a zero-check on :\n\t\t- sacrificedTokenRecipient = _sacrificedTokenRecipient (contracts/nexus/TempleSacrifice.sol#30)\n", + "markdown": "[TempleSacrifice.constructor(address,address,address,address)._sacrificedTokenRecipient](contracts/nexus/TempleSacrifice.sol#L25) lacks a zero-check on :\n\t\t- [sacrificedTokenRecipient = _sacrificedTokenRecipient](contracts/nexus/TempleSacrifice.sol#L30)\n", + "first_markdown_element": "contracts/nexus/TempleSacrifice.sol#L25", + "id": "7e8da7ca00ae17a77aa99991b51d5e8f49737986855791ed42b0664eed2a6e96", + "check": "missing-zero-check", "impact": "Low", "confidence": "Medium" }, @@ -21854,43 +16209,43 @@ "elements": [ { "type": "variable", - "name": "_owner", + "name": "_gnosisSafeWallet", "source_mapping": { - "start": 2665, - "length": 14, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1642, + "length": 25, + "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/GnosisStrategy.sol", + "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", "is_dependency": false, - "lines": [67], - "starting_column": 17, - "ending_column": 31 + "lines": [41], + "starting_column": 9, + "ending_column": 34 }, "type_specific_fields": { "parent": { "type": "function", "name": "constructor", "source_mapping": { - "start": 2653, - "length": 152, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1477, + "length": 459, + "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/GnosisStrategy.sol", + "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", "is_dependency": false, - "lines": [67, 68, 69, 70, 71], + "lines": [36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "GnosisStrategy", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 584, + "length": 6684, + "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/GnosisStrategy.sol", + "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", "is_dependency": false, "lines": [ 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, @@ -21906,56 +16261,56 @@ 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 185, 186, 187, 188, 189, 190, 191 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "constructor(address,address,address)" + "signature": "constructor(address,address,string,address,address,address)" } } } }, { "type": "node", - "name": "owner = _owner", + "name": "gnosisSafeWallet = _gnosisSafeWallet", "source_mapping": { - "start": 2732, - "length": 14, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1813, + "length": 36, + "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/GnosisStrategy.sol", + "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", "is_dependency": false, - "lines": [68], + "lines": [44], "starting_column": 9, - "ending_column": 23 + "ending_column": 45 }, "type_specific_fields": { "parent": { "type": "function", "name": "constructor", "source_mapping": { - "start": 2653, - "length": 152, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1477, + "length": 459, + "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/GnosisStrategy.sol", + "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", "is_dependency": false, - "lines": [67, 68, 69, 70, 71], + "lines": [36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "GnosisStrategy", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 584, + "length": 6684, + "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/GnosisStrategy.sol", + "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", "is_dependency": false, "lines": [ 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, @@ -21971,22 +16326,22 @@ 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 185, 186, 187, 188, 189, 190, 191 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "constructor(address,address,address)" + "signature": "constructor(address,address,string,address,address,address)" } } } } ], - "description": "TempleUniswapV2Pair.constructor(address,address,address)._owner (contracts/amm/TempleUniswapV2Pair.sol#67) lacks a zero-check on :\n\t\t- owner = _owner (contracts/amm/TempleUniswapV2Pair.sol#68)\n", - "markdown": "[TempleUniswapV2Pair.constructor(address,address,address)._owner](contracts/amm/TempleUniswapV2Pair.sol#L67) lacks a zero-check on :\n\t\t- [owner = _owner](contracts/amm/TempleUniswapV2Pair.sol#L68)\n", - "first_markdown_element": "contracts/amm/TempleUniswapV2Pair.sol#L67", - "id": "957fa8fd60f70987f3ddecb1cc94bcc42a04d5732b7d1fd612e14be458618171", + "description": "GnosisStrategy.constructor(address,address,string,address,address,address)._gnosisSafeWallet (contracts/v2/strategies/GnosisStrategy.sol#41) lacks a zero-check on :\n\t\t- gnosisSafeWallet = _gnosisSafeWallet (contracts/v2/strategies/GnosisStrategy.sol#44)\n", + "markdown": "[GnosisStrategy.constructor(address,address,string,address,address,address)._gnosisSafeWallet](contracts/v2/strategies/GnosisStrategy.sol#L41) lacks a zero-check on :\n\t\t- [gnosisSafeWallet = _gnosisSafeWallet](contracts/v2/strategies/GnosisStrategy.sol#L44)\n", + "first_markdown_element": "contracts/v2/strategies/GnosisStrategy.sol#L41", + "id": "35341096e7cc1cb2d71fe6962d37434197ec4866db8dda0c2c8cd05c17585e33", "check": "missing-zero-check", "impact": "Low", "confidence": "Medium" @@ -21995,139 +16350,131 @@ "elements": [ { "type": "variable", - "name": "_token0", + "name": "_implementation", "source_mapping": { - "start": 2681, - "length": 15, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1224, + "length": 23, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [67], - "starting_column": 33, - "ending_column": 48 + "lines": [40], + "starting_column": 17, + "ending_column": 40 }, "type_specific_fields": { "parent": { "type": "function", "name": "constructor", "source_mapping": { - "start": 2653, - "length": 152, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1212, + "length": 210, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [67, 68, 69, 70, 71], + "lines": [40, 41, 42, 43, 44], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "TempleTeamPaymentsFactory", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 279, + "length": 4653, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "constructor(address,address,address)" + "signature": "constructor(address,uint16)" } } } }, { "type": "node", - "name": "token0 = _token0", + "name": "templeTeamPaymentsImplementation = _implementation", "source_mapping": { - "start": 2756, - "length": 16, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1282, + "length": 50, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [69], + "lines": [41], "starting_column": 9, - "ending_column": 25 + "ending_column": 59 }, "type_specific_fields": { "parent": { "type": "function", "name": "constructor", "source_mapping": { - "start": 2653, - "length": 152, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1212, + "length": 210, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [67, 68, 69, 70, 71], + "lines": [40, 41, 42, 43, 44], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "TempleTeamPaymentsFactory", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 279, + "length": 4653, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "constructor(address,address,address)" + "signature": "constructor(address,uint16)" } } } } ], - "description": "TempleUniswapV2Pair.constructor(address,address,address)._token0 (contracts/amm/TempleUniswapV2Pair.sol#67) lacks a zero-check on :\n\t\t- token0 = _token0 (contracts/amm/TempleUniswapV2Pair.sol#69)\n", - "markdown": "[TempleUniswapV2Pair.constructor(address,address,address)._token0](contracts/amm/TempleUniswapV2Pair.sol#L67) lacks a zero-check on :\n\t\t- [token0 = _token0](contracts/amm/TempleUniswapV2Pair.sol#L69)\n", - "first_markdown_element": "contracts/amm/TempleUniswapV2Pair.sol#L67", - "id": "89b68064543393a53cb614749cb260c4fb872797867021adbebf53b5a0362b2f", + "description": "TempleTeamPaymentsFactory.constructor(address,uint16)._implementation (contracts/admin/TempleTeamPaymentsFactory.sol#40) lacks a zero-check on :\n\t\t- templeTeamPaymentsImplementation = _implementation (contracts/admin/TempleTeamPaymentsFactory.sol#41)\n", + "markdown": "[TempleTeamPaymentsFactory.constructor(address,uint16)._implementation](contracts/admin/TempleTeamPaymentsFactory.sol#L40) lacks a zero-check on :\n\t\t- [templeTeamPaymentsImplementation = _implementation](contracts/admin/TempleTeamPaymentsFactory.sol#L41)\n", + "first_markdown_element": "contracts/admin/TempleTeamPaymentsFactory.sol#L40", + "id": "da87c5c8c1b8544472d505a239a86c8fd5eef6af865588f2c95eaae614f5b72a", "check": "missing-zero-check", "impact": "Low", "confidence": "Medium" @@ -22136,139 +16483,145 @@ "elements": [ { "type": "variable", - "name": "_token1", + "name": "_defendStable", "source_mapping": { - "start": 2698, - "length": 15, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1200, + "length": 22, + "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, - "lines": [67], - "starting_column": 50, - "ending_column": 65 + "lines": [40], + "starting_column": 13, + "ending_column": 35 }, "type_specific_fields": { "parent": { "type": "function", "name": "constructor", "source_mapping": { - "start": 2653, - "length": 152, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1091, + "length": 271, + "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, - "lines": [67, 68, 69, 70, 71], + "lines": [37, 38, 39, 40, 41, 42, 43, 44, 45, 46], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "TempleStableAMMRouter", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 640, + "length": 8240, + "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "constructor(address,address,address)" + "signature": "constructor(TempleERC20Token,ITreasuryIV,address)" } } } }, { "type": "node", - "name": "token1 = _token1", + "name": "defendStable = _defendStable", "source_mapping": { - "start": 2782, - "length": 16, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1326, + "length": 29, + "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, - "lines": [70], + "lines": [45], "starting_column": 9, - "ending_column": 25 + "ending_column": 38 }, "type_specific_fields": { "parent": { "type": "function", "name": "constructor", "source_mapping": { - "start": 2653, - "length": 152, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1091, + "length": 271, + "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, - "lines": [67, 68, 69, 70, 71], + "lines": [37, 38, 39, 40, 41, 42, 43, 44, 45, 46], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "TempleStableAMMRouter", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 640, + "length": 8240, + "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "constructor(address,address,address)" + "signature": "constructor(TempleERC20Token,ITreasuryIV,address)" } } } } ], - "description": "TempleUniswapV2Pair.constructor(address,address,address)._token1 (contracts/amm/TempleUniswapV2Pair.sol#67) lacks a zero-check on :\n\t\t- token1 = _token1 (contracts/amm/TempleUniswapV2Pair.sol#70)\n", - "markdown": "[TempleUniswapV2Pair.constructor(address,address,address)._token1](contracts/amm/TempleUniswapV2Pair.sol#L67) lacks a zero-check on :\n\t\t- [token1 = _token1](contracts/amm/TempleUniswapV2Pair.sol#L70)\n", - "first_markdown_element": "contracts/amm/TempleUniswapV2Pair.sol#L67", - "id": "690db18543951330bfe14086929ed1a80aa7c5c43d413a52b921411451479889", + "description": "TempleStableAMMRouter.constructor(TempleERC20Token,ITreasuryIV,address)._defendStable (contracts/amm/TempleStableAMMRouter.sol#40) lacks a zero-check on :\n\t\t- defendStable = _defendStable (contracts/amm/TempleStableAMMRouter.sol#45)\n", + "markdown": "[TempleStableAMMRouter.constructor(TempleERC20Token,ITreasuryIV,address)._defendStable](contracts/amm/TempleStableAMMRouter.sol#L40) lacks a zero-check on :\n\t\t- [defendStable = _defendStable](contracts/amm/TempleStableAMMRouter.sol#L45)\n", + "first_markdown_element": "contracts/amm/TempleStableAMMRouter.sol#L40", + "id": "8e8b46a3e001386612a0920cae43f3178af46f175ae977aa5f36adc5662d1cda", "check": "missing-zero-check", "impact": "Low", "confidence": "Medium" @@ -22277,139 +16630,145 @@ "elements": [ { "type": "variable", - "name": "_router", + "name": "_defendStable", "source_mapping": { - "start": 2904, - "length": 15, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1632, + "length": 21, + "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, - "lines": [74], - "starting_column": 24, - "ending_column": 39 + "lines": [56], + "starting_column": 30, + "ending_column": 51 }, "type_specific_fields": { "parent": { "type": "function", - "name": "setRouter", + "name": "setDefendStable", "source_mapping": { - "start": 2885, - "length": 140, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1607, + "length": 112, + "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, - "lines": [74, 75, 76, 77], + "lines": [56, 57, 58], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", - "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", - "is_dependency": false, - "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + "name": "TempleStableAMMRouter", + "source_mapping": { + "start": 640, + "length": 8240, + "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_short": "contracts/amm/TempleStableAMMRouter.sol", + "is_dependency": false, + "lines": [ + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "setRouter(address)" + "signature": "setDefendStable(address)" } } } }, { "type": "node", - "name": "router = _router", + "name": "defendStable = _defendStable", "source_mapping": { - "start": 3002, - "length": 16, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1684, + "length": 28, + "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, - "lines": [76], + "lines": [57], "starting_column": 9, - "ending_column": 25 + "ending_column": 37 }, "type_specific_fields": { "parent": { "type": "function", - "name": "setRouter", + "name": "setDefendStable", "source_mapping": { - "start": 2885, - "length": 140, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1607, + "length": 112, + "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, - "lines": [74, 75, 76, 77], + "lines": [56, 57, 58], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "TempleStableAMMRouter", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 640, + "length": 8240, + "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "setRouter(address)" + "signature": "setDefendStable(address)" } } } } ], - "description": "TempleUniswapV2Pair.setRouter(address)._router (contracts/amm/TempleUniswapV2Pair.sol#74) lacks a zero-check on :\n\t\t- router = _router (contracts/amm/TempleUniswapV2Pair.sol#76)\n", - "markdown": "[TempleUniswapV2Pair.setRouter(address)._router](contracts/amm/TempleUniswapV2Pair.sol#L74) lacks a zero-check on :\n\t\t- [router = _router](contracts/amm/TempleUniswapV2Pair.sol#L76)\n", - "first_markdown_element": "contracts/amm/TempleUniswapV2Pair.sol#L74", - "id": "65b7f26867d221829e7395a702a30581f77ebb909c900aa9dc269f7dd15923d0", + "description": "TempleStableAMMRouter.setDefendStable(address)._defendStable (contracts/amm/TempleStableAMMRouter.sol#56) lacks a zero-check on :\n\t\t- defendStable = _defendStable (contracts/amm/TempleStableAMMRouter.sol#57)\n", + "markdown": "[TempleStableAMMRouter.setDefendStable(address)._defendStable](contracts/amm/TempleStableAMMRouter.sol#L56) lacks a zero-check on :\n\t\t- [defendStable = _defendStable](contracts/amm/TempleStableAMMRouter.sol#L57)\n", + "first_markdown_element": "contracts/amm/TempleStableAMMRouter.sol#L56", + "id": "de02254c0f567ff1a6e8223d4826abf485c07990091f962338f7c0fa067431d5", "check": "missing-zero-check", "impact": "Low", "confidence": "Medium" @@ -22418,131 +16777,149 @@ "elements": [ { "type": "variable", - "name": "_implementation", + "name": "_vaultedTempleAccount", "source_mapping": { - "start": 1224, - "length": 23, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 2796, + "length": 29, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, - "lines": [40], - "starting_column": 17, - "ending_column": 40 + "lines": [69], + "starting_column": 9, + "ending_column": 38 }, "type_specific_fields": { "parent": { "type": "function", "name": "constructor", "source_mapping": { - "start": 1212, - "length": 210, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 2647, + "length": 819, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, - "lines": [40, 41, 42, 43, 44], + "lines": [ + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleTeamPaymentsFactory", + "name": "Vault", "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 1161, + "length": 7823, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233 ], "starting_column": 1, "ending_column": 2 } }, - "signature": "constructor(address,uint16)" + "signature": "constructor(string,string,IERC20,Exposure,address,uint256,uint256,Rational,JoiningFee,uint256)" } } } }, { "type": "node", - "name": "templeTeamPaymentsImplementation = _implementation", + "name": "vaultedTempleAccount = _vaultedTempleAccount", "source_mapping": { - "start": 1282, - "length": 50, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 3167, + "length": 44, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, - "lines": [41], + "lines": [78], "starting_column": 9, - "ending_column": 59 + "ending_column": 53 }, "type_specific_fields": { "parent": { "type": "function", "name": "constructor", "source_mapping": { - "start": 1212, - "length": 210, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 2647, + "length": 819, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, - "lines": [40, 41, 42, 43, 44], + "lines": [ + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleTeamPaymentsFactory", + "name": "Vault", "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 1161, + "length": 7823, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233 ], "starting_column": 1, "ending_column": 2 } }, - "signature": "constructor(address,uint16)" + "signature": "constructor(string,string,IERC20,Exposure,address,uint256,uint256,Rational,JoiningFee,uint256)" } } } } ], - "description": "TempleTeamPaymentsFactory.constructor(address,uint16)._implementation (contracts/admin/TempleTeamPaymentsFactory.sol#40) lacks a zero-check on :\n\t\t- templeTeamPaymentsImplementation = _implementation (contracts/admin/TempleTeamPaymentsFactory.sol#41)\n", - "markdown": "[TempleTeamPaymentsFactory.constructor(address,uint16)._implementation](contracts/admin/TempleTeamPaymentsFactory.sol#L40) lacks a zero-check on :\n\t\t- [templeTeamPaymentsImplementation = _implementation](contracts/admin/TempleTeamPaymentsFactory.sol#L41)\n", - "first_markdown_element": "contracts/admin/TempleTeamPaymentsFactory.sol#L40", - "id": "da87c5c8c1b8544472d505a239a86c8fd5eef6af865588f2c95eaae614f5b72a", + "description": "Vault.constructor(string,string,IERC20,Exposure,address,uint256,uint256,Rational,JoiningFee,uint256)._vaultedTempleAccount (contracts/core/Vault.sol#69) lacks a zero-check on :\n\t\t- vaultedTempleAccount = _vaultedTempleAccount (contracts/core/Vault.sol#78)\n", + "markdown": "[Vault.constructor(string,string,IERC20,Exposure,address,uint256,uint256,Rational,JoiningFee,uint256)._vaultedTempleAccount](contracts/core/Vault.sol#L69) lacks a zero-check on :\n\t\t- [vaultedTempleAccount = _vaultedTempleAccount](contracts/core/Vault.sol#L78)\n", + "first_markdown_element": "contracts/core/Vault.sol#L69", + "id": "222c440a9dfe634640e1dbd4fff56612fe2321415f49dc4ec16114fa6ec260ed", "check": "missing-zero-check", "impact": "Low", "confidence": "Medium" @@ -22551,133 +16928,115 @@ "elements": [ { "type": "variable", - "name": "_recipient", + "name": "_templeExposure", "source_mapping": { - "start": 1683, - "length": 18, - "filename_relative": "contracts/amo/AuraStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/AuraStaking.sol", - "filename_short": "contracts/amo/AuraStaking.sol", + "start": 1380, + "length": 23, + "filename_relative": "contracts/core/VaultedTemple.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultedTemple.sol", + "filename_short": "contracts/core/VaultedTemple.sol", "is_dependency": false, - "lines": [48], - "starting_column": 34, - "ending_column": 52 + "lines": [39], + "starting_column": 38, + "ending_column": 61 }, "type_specific_fields": { "parent": { "type": "function", - "name": "setRewardsRecipient", + "name": "constructor", "source_mapping": { - "start": 1654, - "length": 179, - "filename_relative": "contracts/amo/AuraStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/AuraStaking.sol", - "filename_short": "contracts/amo/AuraStaking.sol", + "start": 1347, + "length": 143, + "filename_relative": "contracts/core/VaultedTemple.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultedTemple.sol", + "filename_short": "contracts/core/VaultedTemple.sol", "is_dependency": false, - "lines": [48, 49, 50, 51, 52], + "lines": [39, 40, 41, 42], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "AuraStaking", + "name": "VaultedTemple", "source_mapping": { - "start": 604, - "length": 5204, - "filename_relative": "contracts/amo/AuraStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/AuraStaking.sol", - "filename_short": "contracts/amo/AuraStaking.sol", + "start": 1207, + "length": 1005, + "filename_relative": "contracts/core/VaultedTemple.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultedTemple.sol", + "filename_short": "contracts/core/VaultedTemple.sol", "is_dependency": false, "lines": [ - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151 + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "setRewardsRecipient(address)" + "signature": "constructor(IERC20,address)" } } } }, { "type": "node", - "name": "rewardsRecipient = _recipient", + "name": "templeExposure = _templeExposure", "source_mapping": { - "start": 1750, - "length": 29, - "filename_relative": "contracts/amo/AuraStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/AuraStaking.sol", - "filename_short": "contracts/amo/AuraStaking.sol", + "start": 1451, + "length": 32, + "filename_relative": "contracts/core/VaultedTemple.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultedTemple.sol", + "filename_short": "contracts/core/VaultedTemple.sol", "is_dependency": false, - "lines": [49], + "lines": [41], "starting_column": 9, - "ending_column": 38 + "ending_column": 41 }, "type_specific_fields": { "parent": { "type": "function", - "name": "setRewardsRecipient", + "name": "constructor", "source_mapping": { - "start": 1654, - "length": 179, - "filename_relative": "contracts/amo/AuraStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/AuraStaking.sol", - "filename_short": "contracts/amo/AuraStaking.sol", + "start": 1347, + "length": 143, + "filename_relative": "contracts/core/VaultedTemple.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultedTemple.sol", + "filename_short": "contracts/core/VaultedTemple.sol", "is_dependency": false, - "lines": [48, 49, 50, 51, 52], + "lines": [39, 40, 41, 42], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "AuraStaking", + "name": "VaultedTemple", "source_mapping": { - "start": 604, - "length": 5204, - "filename_relative": "contracts/amo/AuraStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/AuraStaking.sol", - "filename_short": "contracts/amo/AuraStaking.sol", + "start": 1207, + "length": 1005, + "filename_relative": "contracts/core/VaultedTemple.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultedTemple.sol", + "filename_short": "contracts/core/VaultedTemple.sol", "is_dependency": false, "lines": [ - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151 + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "setRewardsRecipient(address)" + "signature": "constructor(IERC20,address)" } } } } ], - "description": "AuraStaking.setRewardsRecipient(address)._recipient (contracts/amo/AuraStaking.sol#48) lacks a zero-check on :\n\t\t- rewardsRecipient = _recipient (contracts/amo/AuraStaking.sol#49)\n", - "markdown": "[AuraStaking.setRewardsRecipient(address)._recipient](contracts/amo/AuraStaking.sol#L48) lacks a zero-check on :\n\t\t- [rewardsRecipient = _recipient](contracts/amo/AuraStaking.sol#L49)\n", - "first_markdown_element": "contracts/amo/AuraStaking.sol#L48", - "id": "5563fec2719988c18a09b1c9b98748a0700c5a09c84dd2f6ec51e7b0796b0c80", + "description": "VaultedTemple.constructor(IERC20,address)._templeExposure (contracts/core/VaultedTemple.sol#39) lacks a zero-check on :\n\t\t- templeExposure = _templeExposure (contracts/core/VaultedTemple.sol#41)\n", + "markdown": "[VaultedTemple.constructor(IERC20,address)._templeExposure](contracts/core/VaultedTemple.sol#L39) lacks a zero-check on :\n\t\t- [templeExposure = _templeExposure](contracts/core/VaultedTemple.sol#L41)\n", + "first_markdown_element": "contracts/core/VaultedTemple.sol#L39", + "id": "2fcc44b40158b30b8b0d1614ffa673ffe544de75b922fdda079eea29dca64415", "check": "missing-zero-check", "impact": "Low", "confidence": "Medium" @@ -22685,250 +17044,251 @@ { "elements": [ { - "type": "variable", - "name": "_feeCollector", + "type": "function", + "name": "getReward", "source_mapping": { - "start": 4831, - "length": 21, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 4291, + "length": 657, + "filename_relative": "contracts/amo/AuraStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/AuraStaking.sol", + "filename_short": "contracts/amo/AuraStaking.sol", "is_dependency": false, - "lines": [113], - "starting_column": 9, - "ending_column": 30 + "lines": [ + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125 + ], + "starting_column": 5, + "ending_column": 6 }, "type_specific_fields": { "parent": { - "type": "function", - "name": "constructor", + "type": "contract", + "name": "AuraStaking", "source_mapping": { - "start": 4519, - "length": 995, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 604, + "length": 5204, + "filename_relative": "contracts/amo/AuraStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/AuraStaking.sol", + "filename_short": "contracts/amo/AuraStaking.sol", "is_dependency": false, "lines": [ - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129 + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151 ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "Ramos", - "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", - "is_dependency": false, - "lines": [ - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, - 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, - 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, - 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, - 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, - 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, - 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, - 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "constructor(address,address,address,address,address,address,address,uint64,bytes32,address,uint256)" + "starting_column": 1, + "ending_column": 0 } - } + }, + "signature": "getReward(bool)" } }, { "type": "node", - "name": "feeCollector = _feeCollector", + "name": "balance = rewardToken.balanceOf(address(this))", "source_mapping": { - "start": 5312, - "length": 28, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 4735, + "length": 54, + "filename_relative": "contracts/amo/AuraStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/AuraStaking.sol", + "filename_short": "contracts/amo/AuraStaking.sol", "is_dependency": false, - "lines": [123], - "starting_column": 9, - "ending_column": 37 + "lines": [118], + "starting_column": 17, + "ending_column": 71 }, "type_specific_fields": { "parent": { "type": "function", - "name": "constructor", + "name": "getReward", "source_mapping": { - "start": 4519, - "length": 995, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 4291, + "length": 657, + "filename_relative": "contracts/amo/AuraStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/AuraStaking.sol", + "filename_short": "contracts/amo/AuraStaking.sol", "is_dependency": false, "lines": [ - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129 + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125 ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { - "type": "contract", - "name": "Ramos", - "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "type": "contract", + "name": "AuraStaking", + "source_mapping": { + "start": 604, + "length": 5204, + "filename_relative": "contracts/amo/AuraStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/AuraStaking.sol", + "filename_short": "contracts/amo/AuraStaking.sol", "is_dependency": false, "lines": [ - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, - 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, - 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, - 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, - 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, - 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, - 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, - 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621 + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "constructor(address,address,address,address,address,address,address,uint64,bytes32,address,uint256)" + "signature": "getReward(bool)" } } } } ], - "description": "Ramos.constructor(address,address,address,address,address,address,address,uint64,bytes32,address,uint256)._feeCollector (contracts/amo/Ramos.sol#113) lacks a zero-check on :\n\t\t- feeCollector = _feeCollector (contracts/amo/Ramos.sol#123)\n", - "markdown": "[Ramos.constructor(address,address,address,address,address,address,address,uint64,bytes32,address,uint256)._feeCollector](contracts/amo/Ramos.sol#L113) lacks a zero-check on :\n\t\t- [feeCollector = _feeCollector](contracts/amo/Ramos.sol#L123)\n", - "first_markdown_element": "contracts/amo/Ramos.sol#L113", - "id": "d859e385f8bd8eca35f31a74169347836938cb1a82d4c8321f358ad5363d6ed4", - "check": "missing-zero-check", + "description": "AuraStaking.getReward(bool) (contracts/amo/AuraStaking.sol#110-125) has external calls inside a loop: balance = rewardToken.balanceOf(address(this)) (contracts/amo/AuraStaking.sol#118)\n", + "markdown": "[AuraStaking.getReward(bool)](contracts/amo/AuraStaking.sol#L110-L125) has external calls inside a loop: [balance = rewardToken.balanceOf(address(this))](contracts/amo/AuraStaking.sol#L118)\n", + "first_markdown_element": "contracts/amo/AuraStaking.sol#L110-L125", + "id": "dab641382da7356da589d9f335e183a99e5e9d0e41793c5d48158d07f1c57272", + "check": "calls-loop", "impact": "Low", "confidence": "Medium" }, { "elements": [ { - "type": "variable", - "name": "_amo", + "type": "function", + "name": "shutdown", "source_mapping": { - "start": 1614, - "length": 12, - "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", + "start": 11822, + "length": 1632, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [41], - "starting_column": 7, - "ending_column": 19 + "lines": [ + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TreasuryReservesVault", + "source_mapping": { + "start": 2150, + "length": 32023, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "is_dependency": false, + "lines": [ + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, + 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, + 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, + 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, + 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, + 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, + 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, + 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, + 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, + 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, + 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, + 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, + 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, + 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, + 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, + 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, + 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, + 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, + 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, + 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, + 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, + 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, + 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, + 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, + 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, + 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, + 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, + 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, + 771, 772, 773, 774, 775, 776, 777, 778, 779 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "shutdown(address)" + } + }, + { + "type": "node", + "name": "_outstandingDebt = borrowTokens[_token].dToken.burnAll(strategy)", + "source_mapping": { + "start": 12499, + "length": 64, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "is_dependency": false, + "lines": [296], + "starting_column": 13, + "ending_column": 77 }, "type_specific_fields": { "parent": { "type": "function", - "name": "constructor", + "name": "shutdown", "source_mapping": { - "start": 1451, - "length": 622, - "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", + "start": 11822, + "length": 1632, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, "lines": [ - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53 + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319 ], "starting_column": 5, "ending_column": 6 @@ -22936,21 +17296,19 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "BalancerPoolHelper", + "name": "TreasuryReservesVault", "source_mapping": { - "start": 739, - "length": 19014, - "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", + "start": 2150, + "length": 32023, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, @@ -22978,45 +17336,178 @@ 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429 + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, + 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, + 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, + 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, + 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, + 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, + 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, + 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, + 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, + 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, + 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, + 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, + 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, + 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, + 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, + 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, + 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, + 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, + 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, + 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, + 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, + 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, + 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, + 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, + 777, 778, 779 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "constructor(address,address,address,address,address,address,uint64,bytes32)" + "signature": "shutdown(address)" } } } + } + ], + "description": "TreasuryReservesVault.shutdown(address) (contracts/v2/TreasuryReservesVault.sol#283-319) has external calls inside a loop: _outstandingDebt = borrowTokens[_token].dToken.burnAll(strategy) (contracts/v2/TreasuryReservesVault.sol#296)\n", + "markdown": "[TreasuryReservesVault.shutdown(address)](contracts/v2/TreasuryReservesVault.sol#L283-L319) has external calls inside a loop: [_outstandingDebt = borrowTokens[_token].dToken.burnAll(strategy)](contracts/v2/TreasuryReservesVault.sol#L296)\n", + "first_markdown_element": "contracts/v2/TreasuryReservesVault.sol#L283-L319", + "id": "319ffc2aa8a4b776f15de07870a0d4d5abe0125bc3d87d10222a70895adf8bba", + "check": "calls-loop", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "strategyBalanceSheet", + "source_mapping": { + "start": 19539, + "length": 1196, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "is_dependency": false, + "lines": [ + 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, + 460, 461, 462, 463, 464, 465, 466, 467 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TreasuryReservesVault", + "source_mapping": { + "start": 2150, + "length": 32023, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "is_dependency": false, + "lines": [ + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, + 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, + 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, + 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, + 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, + 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, + 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, + 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, + 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, + 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, + 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, + 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, + 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, + 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, + 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, + 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, + 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, + 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, + 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, + 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, + 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, + 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, + 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, + 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, + 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, + 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, + 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, + 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, + 771, 772, 773, 774, 775, 776, 777, 778, 779 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "strategyBalanceSheet(address)" + } }, { "type": "node", - "name": "amo = _amo", + "name": "dTokenBalances[i] = ITempleStrategy.AssetBalance(_token,borrowTokens[IERC20(_token)].dToken.balanceOf(strategy))", "source_mapping": { - "start": 1988, - "length": 10, - "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", + "start": 20490, + "length": 113, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [51], - "starting_column": 7, - "ending_column": 17 + "lines": [464], + "starting_column": 13, + "ending_column": 126 }, "type_specific_fields": { "parent": { "type": "function", - "name": "constructor", + "name": "strategyBalanceSheet", "source_mapping": { - "start": 1451, - "length": 622, - "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", + "start": 19539, + "length": 1196, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, "lines": [ - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53 + 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, + 460, 461, 462, 463, 464, 465, 466, 467 ], "starting_column": 5, "ending_column": 6 @@ -23024,21 +17515,19 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "BalancerPoolHelper", + "name": "TreasuryReservesVault", "source_mapping": { - "start": 739, - "length": 19014, - "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", + "start": 2150, + "length": 32023, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, @@ -23066,119 +17555,136 @@ 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429 + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, + 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, + 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, + 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, + 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, + 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, + 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, + 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, + 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, + 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, + 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, + 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, + 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, + 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, + 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, + 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, + 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, + 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, + 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, + 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, + 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, + 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, + 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, + 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, + 777, 778, 779 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "constructor(address,address,address,address,address,address,uint64,bytes32)" + "signature": "strategyBalanceSheet(address)" } } } } ], - "description": "BalancerPoolHelper.constructor(address,address,address,address,address,address,uint64,bytes32)._amo (contracts/amo/helpers/BalancerPoolHelper.sol#41) lacks a zero-check on :\n\t\t- amo = _amo (contracts/amo/helpers/BalancerPoolHelper.sol#51)\n", - "markdown": "[BalancerPoolHelper.constructor(address,address,address,address,address,address,uint64,bytes32)._amo](contracts/amo/helpers/BalancerPoolHelper.sol#L41) lacks a zero-check on :\n\t\t- [amo = _amo](contracts/amo/helpers/BalancerPoolHelper.sol#L51)\n", - "first_markdown_element": "contracts/amo/helpers/BalancerPoolHelper.sol#L41", - "id": "1a4d31b221d02b3c425c477d2b7e4c6dc1e41557697509c8e152170c2f1f7986", - "check": "missing-zero-check", + "description": "TreasuryReservesVault.strategyBalanceSheet(address) (contracts/v2/TreasuryReservesVault.sol#447-467) has external calls inside a loop: dTokenBalances[i] = ITempleStrategy.AssetBalance(_token,borrowTokens[IERC20(_token)].dToken.balanceOf(strategy)) (contracts/v2/TreasuryReservesVault.sol#464)\n", + "markdown": "[TreasuryReservesVault.strategyBalanceSheet(address)](contracts/v2/TreasuryReservesVault.sol#L447-L467) has external calls inside a loop: [dTokenBalances[i] = ITempleStrategy.AssetBalance(_token,borrowTokens[IERC20(_token)].dToken.balanceOf(strategy))](contracts/v2/TreasuryReservesVault.sol#L464)\n", + "first_markdown_element": "contracts/v2/TreasuryReservesVault.sol#L447-L467", + "id": "20bcad4f9996938c51c34e640ba88b7c6f2e553a9bfd34b0e170bf1b1904292b", + "check": "calls-loop", "impact": "Low", "confidence": "Medium" }, { "elements": [ { - "type": "variable", - "name": "_gnosisSafeWallet", + "type": "function", + "name": "latestAssetBalances", "source_mapping": { - "start": 1642, - "length": 25, + "start": 6069, + "length": 754, "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/GnosisStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/GnosisStrategy.sol", "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", "is_dependency": false, - "lines": [41], - "starting_column": 9, - "ending_column": 34 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "constructor", - "source_mapping": { - "start": 1477, - "length": 459, - "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/GnosisStrategy.sol", - "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", - "is_dependency": false, - "lines": [36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "GnosisStrategy", - "source_mapping": { - "start": 584, - "length": 6684, - "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/GnosisStrategy.sol", - "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", - "is_dependency": false, - "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "constructor(address,address,string,address,address,address)" + "lines": [ + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "GnosisStrategy", + "source_mapping": { + "start": 584, + "length": 6684, + "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/GnosisStrategy.sol", + "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", + "is_dependency": false, + "lines": [ + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191 + ], + "starting_column": 1, + "ending_column": 0 } - } + }, + "signature": "latestAssetBalances()" } }, { "type": "node", - "name": "gnosisSafeWallet = _gnosisSafeWallet", + "name": "_gnosisBalance = (IERC20(_asset).balanceOf(gnosisSafeWallet) + IERC20(_asset).balanceOf(address(this)))", "source_mapping": { - "start": 1813, - "length": 36, + "start": 6422, + "length": 250, "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/GnosisStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/GnosisStrategy.sol", "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", "is_dependency": false, - "lines": [44], - "starting_column": 9, - "ending_column": 45 + "lines": [165, 166, 167, 168, 169, 170], + "starting_column": 13, + "ending_column": 18 }, "type_specific_fields": { "parent": { "type": "function", - "name": "constructor", + "name": "latestAssetBalances", "source_mapping": { - "start": 1477, - "length": 459, + "start": 6069, + "length": 754, "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/GnosisStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/GnosisStrategy.sol", "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", "is_dependency": false, - "lines": [36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46], + "lines": [ + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177 + ], "starting_column": 5, "ending_column": 6 }, @@ -23190,7 +17696,7 @@ "start": 584, "length": 6684, "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/GnosisStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/GnosisStrategy.sol", "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", "is_dependency": false, "lines": [ @@ -23213,414 +17719,337 @@ "ending_column": 0 } }, - "signature": "constructor(address,address,string,address,address,address)" + "signature": "latestAssetBalances()" } } } } ], - "description": "GnosisStrategy.constructor(address,address,string,address,address,address)._gnosisSafeWallet (contracts/v2/strategies/GnosisStrategy.sol#41) lacks a zero-check on :\n\t\t- gnosisSafeWallet = _gnosisSafeWallet (contracts/v2/strategies/GnosisStrategy.sol#44)\n", - "markdown": "[GnosisStrategy.constructor(address,address,string,address,address,address)._gnosisSafeWallet](contracts/v2/strategies/GnosisStrategy.sol#L41) lacks a zero-check on :\n\t\t- [gnosisSafeWallet = _gnosisSafeWallet](contracts/v2/strategies/GnosisStrategy.sol#L44)\n", - "first_markdown_element": "contracts/v2/strategies/GnosisStrategy.sol#L41", - "id": "35341096e7cc1cb2d71fe6962d37434197ec4866db8dda0c2c8cd05c17585e33", - "check": "missing-zero-check", + "description": "GnosisStrategy.latestAssetBalances() (contracts/v2/strategies/GnosisStrategy.sol#155-177) has external calls inside a loop: _gnosisBalance = (IERC20(_asset).balanceOf(gnosisSafeWallet) + IERC20(_asset).balanceOf(address(this))) (contracts/v2/strategies/GnosisStrategy.sol#165-170)\n", + "markdown": "[GnosisStrategy.latestAssetBalances()](contracts/v2/strategies/GnosisStrategy.sol#L155-L177) has external calls inside a loop: [_gnosisBalance = (IERC20(_asset).balanceOf(gnosisSafeWallet) + IERC20(_asset).balanceOf(address(this)))](contracts/v2/strategies/GnosisStrategy.sol#L165-L170)\n", + "first_markdown_element": "contracts/v2/strategies/GnosisStrategy.sol#L155-L177", + "id": "303fe06184eefb239bc471a22808ec3f7ce192673117af8e628268271f896623", + "check": "calls-loop", "impact": "Low", "confidence": "Medium" }, { "elements": [ { - "type": "variable", - "name": "_defendStable", + "type": "function", + "name": "addRevenue", "source_mapping": { - "start": 1200, - "length": 22, - "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", - "filename_short": "contracts/amm/TempleStableAMMRouter.sol", + "start": 3615, + "length": 351, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, - "lines": [40], - "starting_column": 13, - "ending_column": 35 + "lines": [110, 111, 112, 113, 114, 115, 116], + "starting_column": 5, + "ending_column": 6 }, "type_specific_fields": { "parent": { - "type": "function", - "name": "constructor", + "type": "contract", + "name": "OpsManager", "source_mapping": { - "start": 1091, - "length": 271, - "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", - "filename_short": "contracts/amm/TempleStableAMMRouter.sol", + "start": 388, + "length": 6435, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, - "lines": [37, 38, 39, 40, 41, 42, 43, 44, 45, 46], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleStableAMMRouter", - "source_mapping": { - "start": 640, - "length": 8240, - "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", - "filename_short": "contracts/amm/TempleStableAMMRouter.sol", - "is_dependency": false, - "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "constructor(TempleERC20Token,ITreasuryIV,address)" + "lines": [ + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184 + ], + "starting_column": 1, + "ending_column": 2 } - } + }, + "signature": "addRevenue(IERC20[],uint256[])" } }, { "type": "node", - "name": "defendStable = _defendStable", + "name": "pools[exposureTokens[i]].addRevenue(amounts[i])", "source_mapping": { - "start": 1326, - "length": 29, - "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", - "filename_short": "contracts/amm/TempleStableAMMRouter.sol", + "start": 3902, + "length": 47, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, - "lines": [45], - "starting_column": 9, - "ending_column": 38 + "lines": [114], + "starting_column": 13, + "ending_column": 60 }, "type_specific_fields": { "parent": { "type": "function", - "name": "constructor", + "name": "addRevenue", "source_mapping": { - "start": 1091, - "length": 271, - "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", - "filename_short": "contracts/amm/TempleStableAMMRouter.sol", + "start": 3615, + "length": 351, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, - "lines": [37, 38, 39, 40, 41, 42, 43, 44, 45, 46], + "lines": [110, 111, 112, 113, 114, 115, 116], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleStableAMMRouter", + "name": "OpsManager", "source_mapping": { - "start": 640, - "length": 8240, - "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", - "filename_short": "contracts/amm/TempleStableAMMRouter.sol", + "start": 388, + "length": 6435, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "constructor(TempleERC20Token,ITreasuryIV,address)" + "signature": "addRevenue(IERC20[],uint256[])" } } } } ], - "description": "TempleStableAMMRouter.constructor(TempleERC20Token,ITreasuryIV,address)._defendStable (contracts/amm/TempleStableAMMRouter.sol#40) lacks a zero-check on :\n\t\t- defendStable = _defendStable (contracts/amm/TempleStableAMMRouter.sol#45)\n", - "markdown": "[TempleStableAMMRouter.constructor(TempleERC20Token,ITreasuryIV,address)._defendStable](contracts/amm/TempleStableAMMRouter.sol#L40) lacks a zero-check on :\n\t\t- [defendStable = _defendStable](contracts/amm/TempleStableAMMRouter.sol#L45)\n", - "first_markdown_element": "contracts/amm/TempleStableAMMRouter.sol#L40", - "id": "8e8b46a3e001386612a0920cae43f3178af46f175ae977aa5f36adc5662d1cda", - "check": "missing-zero-check", + "description": "OpsManager.addRevenue(IERC20[],uint256[]) (contracts/core/OpsManager.sol#110-116) has external calls inside a loop: pools[exposureTokens[i]].addRevenue(amounts[i]) (contracts/core/OpsManager.sol#114)\n", + "markdown": "[OpsManager.addRevenue(IERC20[],uint256[])](contracts/core/OpsManager.sol#L110-L116) has external calls inside a loop: [pools[exposureTokens[i]].addRevenue(amounts[i])](contracts/core/OpsManager.sol#L114)\n", + "first_markdown_element": "contracts/core/OpsManager.sol#L110-L116", + "id": "5665a1327173172c99a94790114d41a7287eb453518635edd48056ecba261fa4", + "check": "calls-loop", "impact": "Low", "confidence": "Medium" }, { "elements": [ { - "type": "variable", - "name": "_defendStable", + "type": "function", + "name": "increaseVaultTemple", "source_mapping": { - "start": 1632, - "length": 21, - "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", - "filename_short": "contracts/amm/TempleStableAMMRouter.sol", + "start": 4395, + "length": 447, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, - "lines": [56], - "starting_column": 30, - "ending_column": 51 + "lines": [130, 131, 132, 133, 134, 135, 136, 137], + "starting_column": 5, + "ending_column": 6 }, "type_specific_fields": { "parent": { - "type": "function", - "name": "setDefendStable", + "type": "contract", + "name": "OpsManager", "source_mapping": { - "start": 1607, - "length": 112, - "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", - "filename_short": "contracts/amm/TempleStableAMMRouter.sol", + "start": 388, + "length": 6435, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, - "lines": [56, 57, 58], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleStableAMMRouter", - "source_mapping": { - "start": 640, - "length": 8240, - "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", - "filename_short": "contracts/amm/TempleStableAMMRouter.sol", - "is_dependency": false, - "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "setDefendStable(address)" + "lines": [ + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184 + ], + "starting_column": 1, + "ending_column": 2 } - } + }, + "signature": "increaseVaultTemple(Vault[],uint256[])" } }, { "type": "node", - "name": "defendStable = _defendStable", + "name": "templeExposure.mint(address(vaults[i]),amountsTemple[i])", "source_mapping": { - "start": 1684, - "length": 28, - "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", - "filename_short": "contracts/amm/TempleStableAMMRouter.sol", + "start": 4768, + "length": 57, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, - "lines": [57], - "starting_column": 9, - "ending_column": 37 + "lines": [135], + "starting_column": 13, + "ending_column": 70 }, "type_specific_fields": { "parent": { "type": "function", - "name": "setDefendStable", + "name": "increaseVaultTemple", "source_mapping": { - "start": 1607, - "length": 112, - "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", - "filename_short": "contracts/amm/TempleStableAMMRouter.sol", + "start": 4395, + "length": 447, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, - "lines": [56, 57, 58], + "lines": [130, 131, 132, 133, 134, 135, 136, 137], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleStableAMMRouter", + "name": "OpsManager", "source_mapping": { - "start": 640, - "length": 8240, - "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", - "filename_short": "contracts/amm/TempleStableAMMRouter.sol", + "start": 388, + "length": 6435, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "setDefendStable(address)" + "signature": "increaseVaultTemple(Vault[],uint256[])" } } } } ], - "description": "TempleStableAMMRouter.setDefendStable(address)._defendStable (contracts/amm/TempleStableAMMRouter.sol#56) lacks a zero-check on :\n\t\t- defendStable = _defendStable (contracts/amm/TempleStableAMMRouter.sol#57)\n", - "markdown": "[TempleStableAMMRouter.setDefendStable(address)._defendStable](contracts/amm/TempleStableAMMRouter.sol#L56) lacks a zero-check on :\n\t\t- [defendStable = _defendStable](contracts/amm/TempleStableAMMRouter.sol#L57)\n", - "first_markdown_element": "contracts/amm/TempleStableAMMRouter.sol#L56", - "id": "de02254c0f567ff1a6e8223d4826abf485c07990091f962338f7c0fa067431d5", - "check": "missing-zero-check", + "description": "OpsManager.increaseVaultTemple(Vault[],uint256[]) (contracts/core/OpsManager.sol#130-137) has external calls inside a loop: templeExposure.mint(address(vaults[i]),amountsTemple[i]) (contracts/core/OpsManager.sol#135)\n", + "markdown": "[OpsManager.increaseVaultTemple(Vault[],uint256[])](contracts/core/OpsManager.sol#L130-L137) has external calls inside a loop: [templeExposure.mint(address(vaults[i]),amountsTemple[i])](contracts/core/OpsManager.sol#L135)\n", + "first_markdown_element": "contracts/core/OpsManager.sol#L130-L137", + "id": "73ad477fce052d6df52f4050312b09c115d39ab6a4163386fdb2d902cdf8d2a5", + "check": "calls-loop", "impact": "Low", "confidence": "Medium" }, { "elements": [ { - "type": "variable", - "name": "_vaultedTempleAccount", + "type": "function", + "name": "liquidateExposures", "source_mapping": { - "start": 2796, - "length": 29, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 5038, + "length": 531, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, - "lines": [69], - "starting_column": 9, - "ending_column": 38 + "lines": [144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155], + "starting_column": 5, + "ending_column": 6 }, "type_specific_fields": { "parent": { - "type": "function", - "name": "constructor", + "type": "contract", + "name": "OpsManager", "source_mapping": { - "start": 2647, - "length": 819, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 388, + "length": 6435, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, "lines": [ - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184 ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "Vault", - "source_mapping": { - "start": 1161, - "length": 7823, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", - "is_dependency": false, - "lines": [ - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "constructor(string,string,IERC20,Exposure,address,uint256,uint256,Rational,JoiningFee,uint256)" + "starting_column": 1, + "ending_column": 2 } - } + }, + "signature": "liquidateExposures(Vault[],IERC20[])" } }, { "type": "node", - "name": "vaultedTempleAccount = _vaultedTempleAccount", + "name": "exposures[i] = pools[exposureTokens[i]].exposure()", "source_mapping": { - "start": 3167, - "length": 44, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 5294, + "length": 50, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, - "lines": [78], - "starting_column": 9, - "ending_column": 53 + "lines": [148], + "starting_column": 13, + "ending_column": 63 }, "type_specific_fields": { "parent": { "type": "function", - "name": "constructor", + "name": "liquidateExposures", "source_mapping": { - "start": 2647, - "length": 819, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 5038, + "length": 531, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, "lines": [ - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85 + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155 ], "starting_column": 5, "ending_column": 6 @@ -23628,164 +18057,167 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "Vault", + "name": "OpsManager", "source_mapping": { - "start": 1161, - "length": 7823, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 388, + "length": 6435, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, "lines": [ - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184 ], "starting_column": 1, "ending_column": 2 } }, - "signature": "constructor(string,string,IERC20,Exposure,address,uint256,uint256,Rational,JoiningFee,uint256)" + "signature": "liquidateExposures(Vault[],IERC20[])" } } } } ], - "description": "Vault.constructor(string,string,IERC20,Exposure,address,uint256,uint256,Rational,JoiningFee,uint256)._vaultedTempleAccount (contracts/core/Vault.sol#69) lacks a zero-check on :\n\t\t- vaultedTempleAccount = _vaultedTempleAccount (contracts/core/Vault.sol#78)\n", - "markdown": "[Vault.constructor(string,string,IERC20,Exposure,address,uint256,uint256,Rational,JoiningFee,uint256)._vaultedTempleAccount](contracts/core/Vault.sol#L69) lacks a zero-check on :\n\t\t- [vaultedTempleAccount = _vaultedTempleAccount](contracts/core/Vault.sol#L78)\n", - "first_markdown_element": "contracts/core/Vault.sol#L69", - "id": "222c440a9dfe634640e1dbd4fff56612fe2321415f49dc4ec16114fa6ec260ed", - "check": "missing-zero-check", + "description": "OpsManager.liquidateExposures(Vault[],IERC20[]) (contracts/core/OpsManager.sol#144-155) has external calls inside a loop: exposures[i] = pools[exposureTokens[i]].exposure() (contracts/core/OpsManager.sol#148)\n", + "markdown": "[OpsManager.liquidateExposures(Vault[],IERC20[])](contracts/core/OpsManager.sol#L144-L155) has external calls inside a loop: [exposures[i] = pools[exposureTokens[i]].exposure()](contracts/core/OpsManager.sol#L148)\n", + "first_markdown_element": "contracts/core/OpsManager.sol#L144-L155", + "id": "ead7d436da8a29569022b48ffddbfceb808c4dd315ce7ca9d743dc5226a168dc", + "check": "calls-loop", "impact": "Low", "confidence": "Medium" }, { "elements": [ { - "type": "variable", - "name": "_templeExposure", + "type": "function", + "name": "liquidateExposures", "source_mapping": { - "start": 1380, - "length": 23, - "filename_relative": "contracts/core/VaultedTemple.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultedTemple.sol", - "filename_short": "contracts/core/VaultedTemple.sol", + "start": 5038, + "length": 531, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, - "lines": [39], - "starting_column": 38, - "ending_column": 61 + "lines": [144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155], + "starting_column": 5, + "ending_column": 6 }, "type_specific_fields": { "parent": { - "type": "function", - "name": "constructor", + "type": "contract", + "name": "OpsManager", "source_mapping": { - "start": 1347, - "length": 143, - "filename_relative": "contracts/core/VaultedTemple.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultedTemple.sol", - "filename_short": "contracts/core/VaultedTemple.sol", + "start": 388, + "length": 6435, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, - "lines": [39, 40, 41, 42], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "VaultedTemple", - "source_mapping": { - "start": 1207, - "length": 1005, - "filename_relative": "contracts/core/VaultedTemple.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultedTemple.sol", - "filename_short": "contracts/core/VaultedTemple.sol", - "is_dependency": false, - "lines": [ - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "constructor(IERC20,address)" + "lines": [ + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184 + ], + "starting_column": 1, + "ending_column": 2 } - } + }, + "signature": "liquidateExposures(Vault[],IERC20[])" } }, { "type": "node", - "name": "templeExposure = _templeExposure", + "name": "vaults[i_scope_0].redeemExposures(exposures)", "source_mapping": { - "start": 1451, - "length": 32, - "filename_relative": "contracts/core/VaultedTemple.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultedTemple.sol", - "filename_short": "contracts/core/VaultedTemple.sol", + "start": 5516, + "length": 36, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, - "lines": [41], - "starting_column": 9, - "ending_column": 41 + "lines": [153], + "starting_column": 13, + "ending_column": 49 }, "type_specific_fields": { "parent": { "type": "function", - "name": "constructor", + "name": "liquidateExposures", "source_mapping": { - "start": 1347, - "length": 143, - "filename_relative": "contracts/core/VaultedTemple.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultedTemple.sol", - "filename_short": "contracts/core/VaultedTemple.sol", + "start": 5038, + "length": 531, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, - "lines": [39, 40, 41, 42], + "lines": [ + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "VaultedTemple", + "name": "OpsManager", "source_mapping": { - "start": 1207, - "length": 1005, - "filename_relative": "contracts/core/VaultedTemple.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultedTemple.sol", - "filename_short": "contracts/core/VaultedTemple.sol", + "start": 388, + "length": 6435, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, "lines": [ - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "constructor(IERC20,address)" + "signature": "liquidateExposures(Vault[],IERC20[])" } } } } ], - "description": "VaultedTemple.constructor(IERC20,address)._templeExposure (contracts/core/VaultedTemple.sol#39) lacks a zero-check on :\n\t\t- templeExposure = _templeExposure (contracts/core/VaultedTemple.sol#41)\n", - "markdown": "[VaultedTemple.constructor(IERC20,address)._templeExposure](contracts/core/VaultedTemple.sol#L39) lacks a zero-check on :\n\t\t- [templeExposure = _templeExposure](contracts/core/VaultedTemple.sol#L41)\n", - "first_markdown_element": "contracts/core/VaultedTemple.sol#L39", - "id": "2fcc44b40158b30b8b0d1614ffa673ffe544de75b922fdda079eea29dca64415", - "check": "missing-zero-check", + "description": "OpsManager.liquidateExposures(Vault[],IERC20[]) (contracts/core/OpsManager.sol#144-155) has external calls inside a loop: vaults[i_scope_0].redeemExposures(exposures) (contracts/core/OpsManager.sol#153)\n", + "markdown": "[OpsManager.liquidateExposures(Vault[],IERC20[])](contracts/core/OpsManager.sol#L144-L155) has external calls inside a loop: [vaults[i_scope_0].redeemExposures(exposures)](contracts/core/OpsManager.sol#L153)\n", + "first_markdown_element": "contracts/core/OpsManager.sol#L144-L155", + "id": "03a21ffca7a3586cab7fab91c4d3c7df01b444412ef9a937d63e8d95d7ef5075", + "check": "calls-loop", "impact": "Low", "confidence": "Medium" }, @@ -23793,17 +18225,16 @@ "elements": [ { "type": "function", - "name": "getReward", + "name": "requiresRebalance", "source_mapping": { - "start": 4291, - "length": 657, - "filename_relative": "contracts/amo/AuraStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/AuraStaking.sol", - "filename_short": "contracts/amo/AuraStaking.sol", + "start": 2821, + "length": 553, + "filename_relative": "contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", + "filename_short": "contracts/core/OpsManagerLib.sol", "is_dependency": false, "lines": [ - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125 + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95 ], "starting_column": 5, "ending_column": 6 @@ -23811,61 +18242,58 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "AuraStaking", + "name": "OpsManagerLib", "source_mapping": { - "start": 604, - "length": 5204, - "filename_relative": "contracts/amo/AuraStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/AuraStaking.sol", - "filename_short": "contracts/amo/AuraStaking.sol", + "start": 158, + "length": 3905, + "filename_relative": "contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", + "filename_short": "contracts/core/OpsManagerLib.sol", "is_dependency": false, "lines": [ - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151 + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "getReward(bool)" + "signature": "requiresRebalance(Vault[],TreasuryFarmingRevenue)" } }, { "type": "node", - "name": "balance = rewardToken.balanceOf(address(this))", + "name": "(inWindow) = vaults[i].inEnterExitWindow()", "source_mapping": { - "start": 4735, - "length": 54, - "filename_relative": "contracts/amo/AuraStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/AuraStaking.sol", - "filename_short": "contracts/amo/AuraStaking.sol", + "start": 3101, + "length": 49, + "filename_relative": "contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", + "filename_short": "contracts/core/OpsManagerLib.sol", "is_dependency": false, - "lines": [118], - "starting_column": 17, - "ending_column": 71 + "lines": [86], + "starting_column": 13, + "ending_column": 62 }, "type_specific_fields": { "parent": { "type": "function", - "name": "getReward", + "name": "requiresRebalance", "source_mapping": { - "start": 4291, - "length": 657, - "filename_relative": "contracts/amo/AuraStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/AuraStaking.sol", - "filename_short": "contracts/amo/AuraStaking.sol", + "start": 2821, + "length": 553, + "filename_relative": "contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", + "filename_short": "contracts/core/OpsManagerLib.sol", "is_dependency": false, "lines": [ - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125 + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95 ], "starting_column": 5, "ending_column": 6 @@ -23873,41 +18301,38 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "AuraStaking", + "name": "OpsManagerLib", "source_mapping": { - "start": 604, - "length": 5204, - "filename_relative": "contracts/amo/AuraStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/AuraStaking.sol", - "filename_short": "contracts/amo/AuraStaking.sol", + "start": 158, + "length": 3905, + "filename_relative": "contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", + "filename_short": "contracts/core/OpsManagerLib.sol", "is_dependency": false, "lines": [ - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151 + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "getReward(bool)" + "signature": "requiresRebalance(Vault[],TreasuryFarmingRevenue)" } } } } ], - "description": "AuraStaking.getReward(bool) (contracts/amo/AuraStaking.sol#110-125) has external calls inside a loop: balance = rewardToken.balanceOf(address(this)) (contracts/amo/AuraStaking.sol#118)\n", - "markdown": "[AuraStaking.getReward(bool)](contracts/amo/AuraStaking.sol#L110-L125) has external calls inside a loop: [balance = rewardToken.balanceOf(address(this))](contracts/amo/AuraStaking.sol#L118)\n", - "first_markdown_element": "contracts/amo/AuraStaking.sol#L110-L125", - "id": "dab641382da7356da589d9f335e183a99e5e9d0e41793c5d48158d07f1c57272", + "description": "OpsManagerLib.requiresRebalance(Vault[],TreasuryFarmingRevenue) (contracts/core/OpsManagerLib.sol#79-95) has external calls inside a loop: (inWindow) = vaults[i].inEnterExitWindow() (contracts/core/OpsManagerLib.sol#86)\n", + "markdown": "[OpsManagerLib.requiresRebalance(Vault[],TreasuryFarmingRevenue)](contracts/core/OpsManagerLib.sol#L79-L95) has external calls inside a loop: [(inWindow) = vaults[i].inEnterExitWindow()](contracts/core/OpsManagerLib.sol#L86)\n", + "first_markdown_element": "contracts/core/OpsManagerLib.sol#L79-L95", + "id": "33abe3219d901465ec0025ed3b5cee25a23e8e043748dac853f60e352579796c", "check": "calls-loop", "impact": "Low", "confidence": "Medium" @@ -23916,18 +18341,16 @@ "elements": [ { "type": "function", - "name": "shutdown", + "name": "requiresRebalance", "source_mapping": { - "start": 11820, - "length": 1568, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 2821, + "length": 553, + "filename_relative": "contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", + "filename_short": "contracts/core/OpsManagerLib.sol", "is_dependency": false, "lines": [ - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318 + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95 ], "starting_column": 5, "ending_column": 6 @@ -23935,108 +18358,58 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "OpsManagerLib", "source_mapping": { - "start": 2150, - "length": 31934, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 158, + "length": 3905, + "filename_relative": "contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", + "filename_short": "contracts/core/OpsManagerLib.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, - 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, - 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, - 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, - 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, - 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, - 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, - 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, - 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, - 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, - 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, - 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, - 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, - 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, - 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, - 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, - 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, - 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, - 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, - 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, - 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, - 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, - 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, - 771, 772, 773, 774, 775, 776 + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "shutdown(address)" + "signature": "requiresRebalance(Vault[],TreasuryFarmingRevenue)" } }, { "type": "node", - "name": "_outstandingDebt = borrowTokens[_token].dToken.burnAll(strategy)", + "name": "requiresUpdate[i] = farmingPool.shares(address(vaults[i])) != vaults[i].targetRevenueShare()", "source_mapping": { - "start": 12497, - "length": 64, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 3233, + "length": 92, + "filename_relative": "contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", + "filename_short": "contracts/core/OpsManagerLib.sol", "is_dependency": false, - "lines": [296], + "lines": [91], "starting_column": 13, - "ending_column": 77 + "ending_column": 105 }, "type_specific_fields": { "parent": { "type": "function", - "name": "shutdown", + "name": "requiresRebalance", "source_mapping": { - "start": 11820, - "length": 1568, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 2821, + "length": 553, + "filename_relative": "contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", + "filename_short": "contracts/core/OpsManagerLib.sol", "is_dependency": false, "lines": [ - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318 + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95 ], "starting_column": 5, "ending_column": 6 @@ -24044,90 +18417,38 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "OpsManagerLib", "source_mapping": { - "start": 2150, - "length": 31934, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 158, + "length": 3905, + "filename_relative": "contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", + "filename_short": "contracts/core/OpsManagerLib.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776 + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "shutdown(address)" + "signature": "requiresRebalance(Vault[],TreasuryFarmingRevenue)" } } } } ], - "description": "TreasuryReservesVault.shutdown(address) (contracts/v2/TreasuryReservesVault.sol#283-318) has external calls inside a loop: _outstandingDebt = borrowTokens[_token].dToken.burnAll(strategy) (contracts/v2/TreasuryReservesVault.sol#296)\n", - "markdown": "[TreasuryReservesVault.shutdown(address)](contracts/v2/TreasuryReservesVault.sol#L283-L318) has external calls inside a loop: [_outstandingDebt = borrowTokens[_token].dToken.burnAll(strategy)](contracts/v2/TreasuryReservesVault.sol#L296)\n", - "first_markdown_element": "contracts/v2/TreasuryReservesVault.sol#L283-L318", - "id": "319ffc2aa8a4b776f15de07870a0d4d5abe0125bc3d87d10222a70895adf8bba", + "description": "OpsManagerLib.requiresRebalance(Vault[],TreasuryFarmingRevenue) (contracts/core/OpsManagerLib.sol#79-95) has external calls inside a loop: requiresUpdate[i] = farmingPool.shares(address(vaults[i])) != vaults[i].targetRevenueShare() (contracts/core/OpsManagerLib.sol#91)\n", + "markdown": "[OpsManagerLib.requiresRebalance(Vault[],TreasuryFarmingRevenue)](contracts/core/OpsManagerLib.sol#L79-L95) has external calls inside a loop: [requiresUpdate[i] = farmingPool.shares(address(vaults[i])) != vaults[i].targetRevenueShare()](contracts/core/OpsManagerLib.sol#L91)\n", + "first_markdown_element": "contracts/core/OpsManagerLib.sol#L79-L95", + "id": "291eba1d32cb690e10f4480f7b32b2bae6d005ffbf40558ffd08cf8b0ce6ee4d", "check": "calls-loop", "impact": "Low", "confidence": "Medium" @@ -24136,17 +18457,16 @@ "elements": [ { "type": "function", - "name": "strategyBalanceSheet", + "name": "updateExposureReval", "source_mapping": { - "start": 19473, - "length": 1196, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 3380, + "length": 681, + "filename_relative": "contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", + "filename_short": "contracts/core/OpsManagerLib.sol", "is_dependency": false, "lines": [ - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, - 459, 460, 461, 462, 463, 464, 465, 466 + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109 ], "starting_column": 5, "ending_column": 6 @@ -24154,107 +18474,57 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "OpsManagerLib", "source_mapping": { - "start": 2150, - "length": 31934, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 158, + "length": 3905, + "filename_relative": "contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", + "filename_short": "contracts/core/OpsManagerLib.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, - 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, - 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, - 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, - 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, - 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, - 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, - 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, - 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, - 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, - 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, - 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, - 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, - 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, - 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, - 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, - 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, - 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, - 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, - 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, - 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, - 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, - 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, - 771, 772, 773, 774, 775, 776 + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "strategyBalanceSheet(address)" + "signature": "updateExposureReval(IERC20[],uint256[],mapping(IERC20 => TreasuryFarmingRevenue))" } }, { "type": "node", - "name": "dTokenBalances[i] = ITempleStrategy.AssetBalance(_token,borrowTokens[IERC20(_token)].dToken.balanceOf(strategy))", + "name": "exposure = pools[exposureTokens[i]].exposure()", "source_mapping": { - "start": 20424, - "length": 113, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 3725, + "length": 55, + "filename_relative": "contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", + "filename_short": "contracts/core/OpsManagerLib.sol", "is_dependency": false, - "lines": [463], + "lines": [101], "starting_column": 13, - "ending_column": 126 + "ending_column": 68 }, "type_specific_fields": { "parent": { "type": "function", - "name": "strategyBalanceSheet", + "name": "updateExposureReval", "source_mapping": { - "start": 19473, - "length": 1196, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 3380, + "length": 681, + "filename_relative": "contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", + "filename_short": "contracts/core/OpsManagerLib.sol", "is_dependency": false, "lines": [ - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, - 459, 460, 461, 462, 463, 464, 465, 466 + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109 ], "starting_column": 5, "ending_column": 6 @@ -24262,90 +18532,38 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "OpsManagerLib", "source_mapping": { - "start": 2150, - "length": 31934, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 158, + "length": 3905, + "filename_relative": "contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", + "filename_short": "contracts/core/OpsManagerLib.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776 + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "strategyBalanceSheet(address)" + "signature": "updateExposureReval(IERC20[],uint256[],mapping(IERC20 => TreasuryFarmingRevenue))" } } } } ], - "description": "TreasuryReservesVault.strategyBalanceSheet(address) (contracts/v2/TreasuryReservesVault.sol#446-466) has external calls inside a loop: dTokenBalances[i] = ITempleStrategy.AssetBalance(_token,borrowTokens[IERC20(_token)].dToken.balanceOf(strategy)) (contracts/v2/TreasuryReservesVault.sol#463)\n", - "markdown": "[TreasuryReservesVault.strategyBalanceSheet(address)](contracts/v2/TreasuryReservesVault.sol#L446-L466) has external calls inside a loop: [dTokenBalances[i] = ITempleStrategy.AssetBalance(_token,borrowTokens[IERC20(_token)].dToken.balanceOf(strategy))](contracts/v2/TreasuryReservesVault.sol#L463)\n", - "first_markdown_element": "contracts/v2/TreasuryReservesVault.sol#L446-L466", - "id": "a6c0852390f7d83e3c8ca19381f77586b2790fc9c4fdf83e5bb04c80f01f746d", + "description": "OpsManagerLib.updateExposureReval(IERC20[],uint256[],mapping(IERC20 => TreasuryFarmingRevenue)) (contracts/core/OpsManagerLib.sol#97-109) has external calls inside a loop: exposure = pools[exposureTokens[i]].exposure() (contracts/core/OpsManagerLib.sol#101)\n", + "markdown": "[OpsManagerLib.updateExposureReval(IERC20[],uint256[],mapping(IERC20 => TreasuryFarmingRevenue))](contracts/core/OpsManagerLib.sol#L97-L109) has external calls inside a loop: [exposure = pools[exposureTokens[i]].exposure()](contracts/core/OpsManagerLib.sol#L101)\n", + "first_markdown_element": "contracts/core/OpsManagerLib.sol#L97-L109", + "id": "29cef7ed2793cf3d146be2fdec55418a2cdf263801d54510013749346bac88f3", "check": "calls-loop", "impact": "Low", "confidence": "Medium" @@ -24354,17 +18572,16 @@ "elements": [ { "type": "function", - "name": "latestAssetBalances", + "name": "updateExposureReval", "source_mapping": { - "start": 6069, - "length": 754, - "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/GnosisStrategy.sol", - "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", + "start": 3380, + "length": 681, + "filename_relative": "contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", + "filename_short": "contracts/core/OpsManagerLib.sol", "is_dependency": false, "lines": [ - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177 + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109 ], "starting_column": 5, "ending_column": 6 @@ -24372,64 +18589,57 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "GnosisStrategy", + "name": "OpsManagerLib", "source_mapping": { - "start": 584, - "length": 6684, - "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/GnosisStrategy.sol", - "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", + "start": 158, + "length": 3905, + "filename_relative": "contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", + "filename_short": "contracts/core/OpsManagerLib.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191 + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "latestAssetBalances()" + "signature": "updateExposureReval(IERC20[],uint256[],mapping(IERC20 => TreasuryFarmingRevenue))" } }, { "type": "node", - "name": "_gnosisBalance = (IERC20(_asset).balanceOf(gnosisSafeWallet) + IERC20(_asset).balanceOf(address(this)))", + "name": "currentReval = exposure.reval()", "source_mapping": { - "start": 6422, - "length": 250, - "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/GnosisStrategy.sol", - "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", + "start": 3794, + "length": 39, + "filename_relative": "contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", + "filename_short": "contracts/core/OpsManagerLib.sol", "is_dependency": false, - "lines": [165, 166, 167, 168, 169, 170], + "lines": [102], "starting_column": 13, - "ending_column": 18 + "ending_column": 52 }, "type_specific_fields": { "parent": { "type": "function", - "name": "latestAssetBalances", + "name": "updateExposureReval", "source_mapping": { - "start": 6069, - "length": 754, - "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/GnosisStrategy.sol", - "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", + "start": 3380, + "length": 681, + "filename_relative": "contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", + "filename_short": "contracts/core/OpsManagerLib.sol", "is_dependency": false, "lines": [ - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177 + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109 ], "starting_column": 5, "ending_column": 6 @@ -24437,44 +18647,38 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "GnosisStrategy", + "name": "OpsManagerLib", "source_mapping": { - "start": 584, - "length": 6684, - "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/GnosisStrategy.sol", - "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", + "start": 158, + "length": 3905, + "filename_relative": "contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", + "filename_short": "contracts/core/OpsManagerLib.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191 + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "latestAssetBalances()" + "signature": "updateExposureReval(IERC20[],uint256[],mapping(IERC20 => TreasuryFarmingRevenue))" } } } } ], - "description": "GnosisStrategy.latestAssetBalances() (contracts/v2/strategies/GnosisStrategy.sol#155-177) has external calls inside a loop: _gnosisBalance = (IERC20(_asset).balanceOf(gnosisSafeWallet) + IERC20(_asset).balanceOf(address(this))) (contracts/v2/strategies/GnosisStrategy.sol#165-170)\n", - "markdown": "[GnosisStrategy.latestAssetBalances()](contracts/v2/strategies/GnosisStrategy.sol#L155-L177) has external calls inside a loop: [_gnosisBalance = (IERC20(_asset).balanceOf(gnosisSafeWallet) + IERC20(_asset).balanceOf(address(this)))](contracts/v2/strategies/GnosisStrategy.sol#L165-L170)\n", - "first_markdown_element": "contracts/v2/strategies/GnosisStrategy.sol#L155-L177", - "id": "303fe06184eefb239bc471a22808ec3f7ce192673117af8e628268271f896623", + "description": "OpsManagerLib.updateExposureReval(IERC20[],uint256[],mapping(IERC20 => TreasuryFarmingRevenue)) (contracts/core/OpsManagerLib.sol#97-109) has external calls inside a loop: currentReval = exposure.reval() (contracts/core/OpsManagerLib.sol#102)\n", + "markdown": "[OpsManagerLib.updateExposureReval(IERC20[],uint256[],mapping(IERC20 => TreasuryFarmingRevenue))](contracts/core/OpsManagerLib.sol#L97-L109) has external calls inside a loop: [currentReval = exposure.reval()](contracts/core/OpsManagerLib.sol#L102)\n", + "first_markdown_element": "contracts/core/OpsManagerLib.sol#L97-L109", + "id": "4b9ed20c5dffb0bb937e8e35bc5da6f0e0de33bda4b92ca4b5f843554466cbbc", "check": "calls-loop", "impact": "Low", "confidence": "Medium" @@ -24483,119 +18687,113 @@ "elements": [ { "type": "function", - "name": "addRevenue", + "name": "updateExposureReval", "source_mapping": { - "start": 3615, - "length": 351, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 3380, + "length": 681, + "filename_relative": "contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", + "filename_short": "contracts/core/OpsManagerLib.sol", "is_dependency": false, - "lines": [110, 111, 112, 113, 114, 115, 116], + "lines": [ + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "OpsManager", + "name": "OpsManagerLib", "source_mapping": { - "start": 388, - "length": 6435, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 158, + "length": 3905, + "filename_relative": "contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", + "filename_short": "contracts/core/OpsManagerLib.sol", "is_dependency": false, "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184 + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "addRevenue(IERC20[],uint256[])" + "signature": "updateExposureReval(IERC20[],uint256[],mapping(IERC20 => TreasuryFarmingRevenue))" } }, { "type": "node", - "name": "pools[exposureTokens[i]].addRevenue(amounts[i])", + "name": "exposure.decreaseReval(currentReval - revals[i])", "source_mapping": { - "start": 3902, - "length": 47, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 3895, + "length": 48, + "filename_relative": "contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", + "filename_short": "contracts/core/OpsManagerLib.sol", "is_dependency": false, - "lines": [114], - "starting_column": 13, - "ending_column": 60 + "lines": [104], + "starting_column": 17, + "ending_column": 65 }, "type_specific_fields": { "parent": { "type": "function", - "name": "addRevenue", + "name": "updateExposureReval", "source_mapping": { - "start": 3615, - "length": 351, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 3380, + "length": 681, + "filename_relative": "contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", + "filename_short": "contracts/core/OpsManagerLib.sol", "is_dependency": false, - "lines": [110, 111, 112, 113, 114, 115, 116], + "lines": [ + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "OpsManager", + "name": "OpsManagerLib", "source_mapping": { - "start": 388, - "length": 6435, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 158, + "length": 3905, + "filename_relative": "contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", + "filename_short": "contracts/core/OpsManagerLib.sol", "is_dependency": false, "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184 + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "addRevenue(IERC20[],uint256[])" + "signature": "updateExposureReval(IERC20[],uint256[],mapping(IERC20 => TreasuryFarmingRevenue))" } } } } ], - "description": "OpsManager.addRevenue(IERC20[],uint256[]) (contracts/core/OpsManager.sol#110-116) has external calls inside a loop: pools[exposureTokens[i]].addRevenue(amounts[i]) (contracts/core/OpsManager.sol#114)\n", - "markdown": "[OpsManager.addRevenue(IERC20[],uint256[])](contracts/core/OpsManager.sol#L110-L116) has external calls inside a loop: [pools[exposureTokens[i]].addRevenue(amounts[i])](contracts/core/OpsManager.sol#L114)\n", - "first_markdown_element": "contracts/core/OpsManager.sol#L110-L116", - "id": "5665a1327173172c99a94790114d41a7287eb453518635edd48056ecba261fa4", + "description": "OpsManagerLib.updateExposureReval(IERC20[],uint256[],mapping(IERC20 => TreasuryFarmingRevenue)) (contracts/core/OpsManagerLib.sol#97-109) has external calls inside a loop: exposure.decreaseReval(currentReval - revals[i]) (contracts/core/OpsManagerLib.sol#104)\n", + "markdown": "[OpsManagerLib.updateExposureReval(IERC20[],uint256[],mapping(IERC20 => TreasuryFarmingRevenue))](contracts/core/OpsManagerLib.sol#L97-L109) has external calls inside a loop: [exposure.decreaseReval(currentReval - revals[i])](contracts/core/OpsManagerLib.sol#L104)\n", + "first_markdown_element": "contracts/core/OpsManagerLib.sol#L97-L109", + "id": "2a8d232e2a9bf6e56bf39af5ffd6e5e36613e5a9aa77a6691551c45c0092abf8", "check": "calls-loop", "impact": "Low", "confidence": "Medium" @@ -24604,119 +18802,113 @@ "elements": [ { "type": "function", - "name": "increaseVaultTemple", + "name": "updateExposureReval", "source_mapping": { - "start": 4395, - "length": 447, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 3380, + "length": 681, + "filename_relative": "contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", + "filename_short": "contracts/core/OpsManagerLib.sol", "is_dependency": false, - "lines": [130, 131, 132, 133, 134, 135, 136, 137], + "lines": [ + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "OpsManager", + "name": "OpsManagerLib", "source_mapping": { - "start": 388, - "length": 6435, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 158, + "length": 3905, + "filename_relative": "contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", + "filename_short": "contracts/core/OpsManagerLib.sol", "is_dependency": false, "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184 + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "increaseVaultTemple(Vault[],uint256[])" + "signature": "updateExposureReval(IERC20[],uint256[],mapping(IERC20 => TreasuryFarmingRevenue))" } }, { "type": "node", - "name": "templeExposure.mint(address(vaults[i]),amountsTemple[i])", + "name": "exposure.increaseReval(revals[i] - currentReval)", "source_mapping": { - "start": 4768, - "length": 57, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 3982, + "length": 48, + "filename_relative": "contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", + "filename_short": "contracts/core/OpsManagerLib.sol", "is_dependency": false, - "lines": [135], - "starting_column": 13, - "ending_column": 70 + "lines": [106], + "starting_column": 17, + "ending_column": 65 }, "type_specific_fields": { "parent": { "type": "function", - "name": "increaseVaultTemple", + "name": "updateExposureReval", "source_mapping": { - "start": 4395, - "length": 447, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 3380, + "length": 681, + "filename_relative": "contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", + "filename_short": "contracts/core/OpsManagerLib.sol", "is_dependency": false, - "lines": [130, 131, 132, 133, 134, 135, 136, 137], + "lines": [ + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "OpsManager", + "name": "OpsManagerLib", "source_mapping": { - "start": 388, - "length": 6435, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", - "is_dependency": false, - "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184 + "start": 158, + "length": 3905, + "filename_relative": "contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", + "filename_short": "contracts/core/OpsManagerLib.sol", + "is_dependency": false, + "lines": [ + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "increaseVaultTemple(Vault[],uint256[])" + "signature": "updateExposureReval(IERC20[],uint256[],mapping(IERC20 => TreasuryFarmingRevenue))" } } } } ], - "description": "OpsManager.increaseVaultTemple(Vault[],uint256[]) (contracts/core/OpsManager.sol#130-137) has external calls inside a loop: templeExposure.mint(address(vaults[i]),amountsTemple[i]) (contracts/core/OpsManager.sol#135)\n", - "markdown": "[OpsManager.increaseVaultTemple(Vault[],uint256[])](contracts/core/OpsManager.sol#L130-L137) has external calls inside a loop: [templeExposure.mint(address(vaults[i]),amountsTemple[i])](contracts/core/OpsManager.sol#L135)\n", - "first_markdown_element": "contracts/core/OpsManager.sol#L130-L137", - "id": "73ad477fce052d6df52f4050312b09c115d39ab6a4163386fdb2d902cdf8d2a5", + "description": "OpsManagerLib.updateExposureReval(IERC20[],uint256[],mapping(IERC20 => TreasuryFarmingRevenue)) (contracts/core/OpsManagerLib.sol#97-109) has external calls inside a loop: exposure.increaseReval(revals[i] - currentReval) (contracts/core/OpsManagerLib.sol#106)\n", + "markdown": "[OpsManagerLib.updateExposureReval(IERC20[],uint256[],mapping(IERC20 => TreasuryFarmingRevenue))](contracts/core/OpsManagerLib.sol#L97-L109) has external calls inside a loop: [exposure.increaseReval(revals[i] - currentReval)](contracts/core/OpsManagerLib.sol#L106)\n", + "first_markdown_element": "contracts/core/OpsManagerLib.sol#L97-L109", + "id": "02b2b95f67586f3365a9cc8e6b95fd4d48a424694b15f84a5b362f195ca5b007", "check": "calls-loop", "impact": "Low", "confidence": "Medium" @@ -24725,121 +18917,125 @@ "elements": [ { "type": "function", - "name": "liquidateExposures", + "name": "redeemExposures", "source_mapping": { - "start": 5038, - "length": 531, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 4724, + "length": 251, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, - "lines": [144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155], + "lines": [117, 118, 119, 120, 121, 122, 123], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "OpsManager", + "name": "Vault", "source_mapping": { - "start": 388, - "length": 6435, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 1161, + "length": 7823, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184 + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233 ], "starting_column": 1, "ending_column": 2 } }, - "signature": "liquidateExposures(Vault[],IERC20[])" + "signature": "redeemExposures(Exposure[])" } }, { "type": "node", - "name": "exposures[i] = pools[exposureTokens[i]].exposure()", + "name": "exposures[i].redeem()", "source_mapping": { - "start": 5294, - "length": 50, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 4868, + "length": 21, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, - "lines": [148], + "lines": [119], "starting_column": 13, - "ending_column": 63 + "ending_column": 34 }, "type_specific_fields": { "parent": { "type": "function", - "name": "liquidateExposures", + "name": "redeemExposures", "source_mapping": { - "start": 5038, - "length": 531, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 4724, + "length": 251, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, - "lines": [ - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155 - ], + "lines": [117, 118, 119, 120, 121, 122, 123], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "OpsManager", + "name": "Vault", "source_mapping": { - "start": 388, - "length": 6435, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 1161, + "length": 7823, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184 + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233 ], "starting_column": 1, "ending_column": 2 } }, - "signature": "liquidateExposures(Vault[],IERC20[])" + "signature": "redeemExposures(Exposure[])" } } } } ], - "description": "OpsManager.liquidateExposures(Vault[],IERC20[]) (contracts/core/OpsManager.sol#144-155) has external calls inside a loop: exposures[i] = pools[exposureTokens[i]].exposure() (contracts/core/OpsManager.sol#148)\n", - "markdown": "[OpsManager.liquidateExposures(Vault[],IERC20[])](contracts/core/OpsManager.sol#L144-L155) has external calls inside a loop: [exposures[i] = pools[exposureTokens[i]].exposure()](contracts/core/OpsManager.sol#L148)\n", - "first_markdown_element": "contracts/core/OpsManager.sol#L144-L155", - "id": "ead7d436da8a29569022b48ffddbfceb808c4dd315ce7ca9d743dc5226a168dc", + "description": "Vault.redeemExposures(Exposure[]) (contracts/core/Vault.sol#117-123) has external calls inside a loop: exposures[i].redeem() (contracts/core/Vault.sol#119)\n", + "markdown": "[Vault.redeemExposures(Exposure[])](contracts/core/Vault.sol#L117-L123) has external calls inside a loop: [exposures[i].redeem()](contracts/core/Vault.sol#L119)\n", + "first_markdown_element": "contracts/core/Vault.sol#L117-L123", + "id": "fb0eb1701c9d5262a84b7e53dfc4632c0ca1d6292b4e39447df4f40eaf369003", "check": "calls-loop", "impact": "Low", "confidence": "Medium" @@ -24848,77 +19044,82 @@ "elements": [ { "type": "function", - "name": "liquidateExposures", + "name": "burn", "source_mapping": { - "start": 5038, - "length": 531, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 5241, + "length": 1294, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155], + "lines": [ + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "OpsManager", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 388, - "length": 6435, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "liquidateExposures(Vault[],IERC20[])" + "signature": "burn(address)" } }, { "type": "node", - "name": "vaults[i_scope_0].redeemExposures(exposures)", + "name": "_safeTransfer(_token0,to,amount0)", "source_mapping": { - "start": 5516, - "length": 36, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 6213, + "length": 35, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [153], - "starting_column": 13, - "ending_column": 49 + "lines": [131], + "starting_column": 9, + "ending_column": 44 }, "type_specific_fields": { "parent": { "type": "function", - "name": "liquidateExposures", + "name": "burn", "source_mapping": { - "start": 5038, - "length": 531, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 5241, + "length": 1294, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155 + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138 ], "starting_column": 5, "ending_column": 6 @@ -24926,120 +19127,134 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "OpsManager", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 388, - "length": 6435, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "liquidateExposures(Vault[],IERC20[])" + "signature": "burn(address)" } } - } - } - ], - "description": "OpsManager.liquidateExposures(Vault[],IERC20[]) (contracts/core/OpsManager.sol#144-155) has external calls inside a loop: vaults[i_scope_0].redeemExposures(exposures) (contracts/core/OpsManager.sol#153)\n", - "markdown": "[OpsManager.liquidateExposures(Vault[],IERC20[])](contracts/core/OpsManager.sol#L144-L155) has external calls inside a loop: [vaults[i_scope_0].redeemExposures(exposures)](contracts/core/OpsManager.sol#L153)\n", - "first_markdown_element": "contracts/core/OpsManager.sol#L144-L155", - "id": "03a21ffca7a3586cab7fab91c4d3c7df01b444412ef9a937d63e8d95d7ef5075", - "check": "calls-loop", - "impact": "Low", - "confidence": "Medium" - }, - { - "elements": [ + }, + "additional_fields": { "underlying_type": "external_calls" } + }, { - "type": "function", - "name": "requiresRebalance", + "type": "node", + "name": "(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))", "source_mapping": { - "start": 2821, - "length": 553, - "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", - "filename_short": "contracts/core/OpsManagerLib.sol", + "start": 1972, + "length": 91, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [ - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95 - ], - "starting_column": 5, - "ending_column": 6 + "lines": [50], + "starting_column": 9, + "ending_column": 100 }, "type_specific_fields": { "parent": { - "type": "contract", - "name": "OpsManagerLib", + "type": "function", + "name": "_safeTransfer", "source_mapping": { - "start": 158, - "length": 3905, - "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", - "filename_short": "contracts/core/OpsManagerLib.sol", + "start": 1892, + "length": 284, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [ - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111 - ], - "starting_column": 1, - "ending_column": 0 + "lines": [49, 50, 51, 52], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleUniswapV2Pair", + "source_mapping": { + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "is_dependency": false, + "lines": [ + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "_safeTransfer(address,address,uint256)" } - }, - "signature": "requiresRebalance(Vault[],TreasuryFarmingRevenue)" - } + } + }, + "additional_fields": { "underlying_type": "external_calls_sending_eth" } }, { "type": "node", - "name": "(inWindow) = vaults[i].inEnterExitWindow()", + "name": "_safeTransfer(_token1,to,amount1)", "source_mapping": { - "start": 3101, - "length": 49, - "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", - "filename_short": "contracts/core/OpsManagerLib.sol", + "start": 6258, + "length": 35, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [86], - "starting_column": 13, - "ending_column": 62 + "lines": [132], + "starting_column": 9, + "ending_column": 44 }, "type_specific_fields": { "parent": { "type": "function", - "name": "requiresRebalance", + "name": "burn", "source_mapping": { - "start": 2821, - "length": 553, - "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", - "filename_short": "contracts/core/OpsManagerLib.sol", + "start": 5241, + "length": 1294, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95 + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138 ], "starting_column": 5, "ending_column": 6 @@ -25047,115 +19262,134 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "OpsManagerLib", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 158, - "length": 3905, - "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", - "filename_short": "contracts/core/OpsManagerLib.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "requiresRebalance(Vault[],TreasuryFarmingRevenue)" + "signature": "burn(address)" } } - } - } - ], - "description": "OpsManagerLib.requiresRebalance(Vault[],TreasuryFarmingRevenue) (contracts/core/OpsManagerLib.sol#79-95) has external calls inside a loop: (inWindow) = vaults[i].inEnterExitWindow() (contracts/core/OpsManagerLib.sol#86)\n", - "markdown": "[OpsManagerLib.requiresRebalance(Vault[],TreasuryFarmingRevenue)](contracts/core/OpsManagerLib.sol#L79-L95) has external calls inside a loop: [(inWindow) = vaults[i].inEnterExitWindow()](contracts/core/OpsManagerLib.sol#L86)\n", - "first_markdown_element": "contracts/core/OpsManagerLib.sol#L79-L95", - "id": "33abe3219d901465ec0025ed3b5cee25a23e8e043748dac853f60e352579796c", - "check": "calls-loop", - "impact": "Low", - "confidence": "Medium" - }, - { - "elements": [ + }, + "additional_fields": { "underlying_type": "external_calls" } + }, { - "type": "function", - "name": "requiresRebalance", + "type": "node", + "name": "(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))", "source_mapping": { - "start": 2821, - "length": 553, - "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", - "filename_short": "contracts/core/OpsManagerLib.sol", + "start": 1972, + "length": 91, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [ - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95 - ], - "starting_column": 5, - "ending_column": 6 + "lines": [50], + "starting_column": 9, + "ending_column": 100 }, "type_specific_fields": { "parent": { - "type": "contract", - "name": "OpsManagerLib", + "type": "function", + "name": "_safeTransfer", "source_mapping": { - "start": 158, - "length": 3905, - "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", - "filename_short": "contracts/core/OpsManagerLib.sol", + "start": 1892, + "length": 284, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [ - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111 - ], - "starting_column": 1, - "ending_column": 0 + "lines": [49, 50, 51, 52], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleUniswapV2Pair", + "source_mapping": { + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "is_dependency": false, + "lines": [ + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "_safeTransfer(address,address,uint256)" } - }, - "signature": "requiresRebalance(Vault[],TreasuryFarmingRevenue)" - } + } + }, + "additional_fields": { "underlying_type": "external_calls_sending_eth" } }, { "type": "node", - "name": "requiresUpdate[i] = farmingPool.shares(address(vaults[i])) != vaults[i].targetRevenueShare()", + "name": "_safeTransfer(_token0,to,amount0)", "source_mapping": { - "start": 3233, - "length": 92, - "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", - "filename_short": "contracts/core/OpsManagerLib.sol", + "start": 6213, + "length": 35, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [91], - "starting_column": 13, - "ending_column": 105 + "lines": [131], + "starting_column": 9, + "ending_column": 44 }, "type_specific_fields": { "parent": { "type": "function", - "name": "requiresRebalance", + "name": "burn", "source_mapping": { - "start": 2821, - "length": 553, - "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", - "filename_short": "contracts/core/OpsManagerLib.sol", + "start": 5241, + "length": 1294, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95 + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138 ], "starting_column": 5, "ending_column": 6 @@ -25163,229 +19397,134 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "OpsManagerLib", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 158, - "length": 3905, - "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", - "filename_short": "contracts/core/OpsManagerLib.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "requiresRebalance(Vault[],TreasuryFarmingRevenue)" + "signature": "burn(address)" } } - } - } - ], - "description": "OpsManagerLib.requiresRebalance(Vault[],TreasuryFarmingRevenue) (contracts/core/OpsManagerLib.sol#79-95) has external calls inside a loop: requiresUpdate[i] = farmingPool.shares(address(vaults[i])) != vaults[i].targetRevenueShare() (contracts/core/OpsManagerLib.sol#91)\n", - "markdown": "[OpsManagerLib.requiresRebalance(Vault[],TreasuryFarmingRevenue)](contracts/core/OpsManagerLib.sol#L79-L95) has external calls inside a loop: [requiresUpdate[i] = farmingPool.shares(address(vaults[i])) != vaults[i].targetRevenueShare()](contracts/core/OpsManagerLib.sol#L91)\n", - "first_markdown_element": "contracts/core/OpsManagerLib.sol#L79-L95", - "id": "291eba1d32cb690e10f4480f7b32b2bae6d005ffbf40558ffd08cf8b0ce6ee4d", - "check": "calls-loop", - "impact": "Low", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "updateExposureReval", - "source_mapping": { - "start": 3380, - "length": 681, - "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", - "filename_short": "contracts/core/OpsManagerLib.sol", - "is_dependency": false, - "lines": [ - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109 - ], - "starting_column": 5, - "ending_column": 6 }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "OpsManagerLib", - "source_mapping": { - "start": 158, - "length": 3905, - "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", - "filename_short": "contracts/core/OpsManagerLib.sol", - "is_dependency": false, - "lines": [ - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "updateExposureReval(IERC20[],uint256[],mapping(IERC20 => TreasuryFarmingRevenue))" - } + "additional_fields": { "underlying_type": "external_calls_sending_eth" } }, { "type": "node", - "name": "exposure = pools[exposureTokens[i]].exposure()", + "name": "(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))", "source_mapping": { - "start": 3725, - "length": 55, - "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", - "filename_short": "contracts/core/OpsManagerLib.sol", + "start": 1972, + "length": 91, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [101], - "starting_column": 13, - "ending_column": 68 + "lines": [50], + "starting_column": 9, + "ending_column": 100 }, "type_specific_fields": { "parent": { "type": "function", - "name": "updateExposureReval", + "name": "_safeTransfer", "source_mapping": { - "start": 3380, - "length": 681, - "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", - "filename_short": "contracts/core/OpsManagerLib.sol", + "start": 1892, + "length": 284, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [ - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109 - ], + "lines": [49, 50, 51, 52], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "OpsManagerLib", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 158, - "length": 3905, - "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", - "filename_short": "contracts/core/OpsManagerLib.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "updateExposureReval(IERC20[],uint256[],mapping(IERC20 => TreasuryFarmingRevenue))" + "signature": "_safeTransfer(address,address,uint256)" } } - } - } - ], - "description": "OpsManagerLib.updateExposureReval(IERC20[],uint256[],mapping(IERC20 => TreasuryFarmingRevenue)) (contracts/core/OpsManagerLib.sol#97-109) has external calls inside a loop: exposure = pools[exposureTokens[i]].exposure() (contracts/core/OpsManagerLib.sol#101)\n", - "markdown": "[OpsManagerLib.updateExposureReval(IERC20[],uint256[],mapping(IERC20 => TreasuryFarmingRevenue))](contracts/core/OpsManagerLib.sol#L97-L109) has external calls inside a loop: [exposure = pools[exposureTokens[i]].exposure()](contracts/core/OpsManagerLib.sol#L101)\n", - "first_markdown_element": "contracts/core/OpsManagerLib.sol#L97-L109", - "id": "29cef7ed2793cf3d146be2fdec55418a2cdf263801d54510013749346bac88f3", - "check": "calls-loop", - "impact": "Low", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "updateExposureReval", - "source_mapping": { - "start": 3380, - "length": 681, - "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", - "filename_short": "contracts/core/OpsManagerLib.sol", - "is_dependency": false, - "lines": [ - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109 - ], - "starting_column": 5, - "ending_column": 6 }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "OpsManagerLib", - "source_mapping": { - "start": 158, - "length": 3905, - "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", - "filename_short": "contracts/core/OpsManagerLib.sol", - "is_dependency": false, - "lines": [ - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "updateExposureReval(IERC20[],uint256[],mapping(IERC20 => TreasuryFarmingRevenue))" - } + "additional_fields": { "underlying_type": "external_calls_sending_eth" } }, { "type": "node", - "name": "currentReval = exposure.reval()", + "name": "_safeTransfer(_token1,to,amount1)", "source_mapping": { - "start": 3794, - "length": 39, - "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", - "filename_short": "contracts/core/OpsManagerLib.sol", + "start": 6258, + "length": 35, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [102], - "starting_column": 13, - "ending_column": 52 + "lines": [132], + "starting_column": 9, + "ending_column": 44 }, "type_specific_fields": { "parent": { "type": "function", - "name": "updateExposureReval", + "name": "burn", "source_mapping": { - "start": 3380, - "length": 681, - "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", - "filename_short": "contracts/core/OpsManagerLib.sol", + "start": 5241, + "length": 1294, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109 + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138 ], "starting_column": 5, "ending_column": 6 @@ -25393,396 +19532,394 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "OpsManagerLib", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 158, - "length": 3905, - "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", - "filename_short": "contracts/core/OpsManagerLib.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "updateExposureReval(IERC20[],uint256[],mapping(IERC20 => TreasuryFarmingRevenue))" + "signature": "burn(address)" } } - } - } - ], - "description": "OpsManagerLib.updateExposureReval(IERC20[],uint256[],mapping(IERC20 => TreasuryFarmingRevenue)) (contracts/core/OpsManagerLib.sol#97-109) has external calls inside a loop: currentReval = exposure.reval() (contracts/core/OpsManagerLib.sol#102)\n", - "markdown": "[OpsManagerLib.updateExposureReval(IERC20[],uint256[],mapping(IERC20 => TreasuryFarmingRevenue))](contracts/core/OpsManagerLib.sol#L97-L109) has external calls inside a loop: [currentReval = exposure.reval()](contracts/core/OpsManagerLib.sol#L102)\n", - "first_markdown_element": "contracts/core/OpsManagerLib.sol#L97-L109", - "id": "4b9ed20c5dffb0bb937e8e35bc5da6f0e0de33bda4b92ca4b5f843554466cbbc", - "check": "calls-loop", - "impact": "Low", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "updateExposureReval", - "source_mapping": { - "start": 3380, - "length": 681, - "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", - "filename_short": "contracts/core/OpsManagerLib.sol", - "is_dependency": false, - "lines": [ - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109 - ], - "starting_column": 5, - "ending_column": 6 }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "OpsManagerLib", - "source_mapping": { - "start": 158, - "length": 3905, - "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", - "filename_short": "contracts/core/OpsManagerLib.sol", - "is_dependency": false, - "lines": [ - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "updateExposureReval(IERC20[],uint256[],mapping(IERC20 => TreasuryFarmingRevenue))" - } + "additional_fields": { "underlying_type": "external_calls_sending_eth" } }, { "type": "node", - "name": "exposure.decreaseReval(currentReval - revals[i])", + "name": "(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))", "source_mapping": { - "start": 3895, - "length": 48, - "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", - "filename_short": "contracts/core/OpsManagerLib.sol", + "start": 1972, + "length": 91, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [104], - "starting_column": 17, - "ending_column": 65 + "lines": [50], + "starting_column": 9, + "ending_column": 100 }, "type_specific_fields": { "parent": { "type": "function", - "name": "updateExposureReval", + "name": "_safeTransfer", "source_mapping": { - "start": 3380, - "length": 681, - "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", - "filename_short": "contracts/core/OpsManagerLib.sol", + "start": 1892, + "length": 284, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [ - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109 - ], + "lines": [49, 50, 51, 52], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "OpsManagerLib", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 158, - "length": 3905, - "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", - "filename_short": "contracts/core/OpsManagerLib.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "updateExposureReval(IERC20[],uint256[],mapping(IERC20 => TreasuryFarmingRevenue))" + "signature": "_safeTransfer(address,address,uint256)" } } - } - } - ], - "description": "OpsManagerLib.updateExposureReval(IERC20[],uint256[],mapping(IERC20 => TreasuryFarmingRevenue)) (contracts/core/OpsManagerLib.sol#97-109) has external calls inside a loop: exposure.decreaseReval(currentReval - revals[i]) (contracts/core/OpsManagerLib.sol#104)\n", - "markdown": "[OpsManagerLib.updateExposureReval(IERC20[],uint256[],mapping(IERC20 => TreasuryFarmingRevenue))](contracts/core/OpsManagerLib.sol#L97-L109) has external calls inside a loop: [exposure.decreaseReval(currentReval - revals[i])](contracts/core/OpsManagerLib.sol#L104)\n", - "first_markdown_element": "contracts/core/OpsManagerLib.sol#L97-L109", - "id": "2a8d232e2a9bf6e56bf39af5ffd6e5e36613e5a9aa77a6691551c45c0092abf8", - "check": "calls-loop", - "impact": "Low", - "confidence": "Medium" - }, - { - "elements": [ + }, + "additional_fields": { "underlying_type": "external_calls_sending_eth" } + }, { - "type": "function", - "name": "updateExposureReval", + "type": "node", + "name": "_update(balance0,balance1,_reserve0,_reserve1)", "source_mapping": { - "start": 3380, - "length": 681, - "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", - "filename_short": "contracts/core/OpsManagerLib.sol", + "start": 6426, + "length": 49, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [ - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109 - ], - "starting_column": 5, - "ending_column": 6 + "lines": [136], + "starting_column": 9, + "ending_column": 58 }, "type_specific_fields": { "parent": { - "type": "contract", - "name": "OpsManagerLib", + "type": "function", + "name": "burn", "source_mapping": { - "start": 158, - "length": 3905, - "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", - "filename_short": "contracts/core/OpsManagerLib.sol", + "start": 5241, + "length": 1294, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111 + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138 ], - "starting_column": 1, - "ending_column": 0 + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleUniswapV2Pair", + "source_mapping": { + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "is_dependency": false, + "lines": [ + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "burn(address)" } - }, - "signature": "updateExposureReval(IERC20[],uint256[],mapping(IERC20 => TreasuryFarmingRevenue))" + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "price0CumulativeLast" } }, { "type": "node", - "name": "exposure.increaseReval(revals[i] - currentReval)", + "name": "price0CumulativeLast += uint256(UQ112x112.encode(_reserve1).uqdiv(_reserve0)) * timeElapsed", "source_mapping": { - "start": 3982, - "length": 48, - "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", - "filename_short": "contracts/core/OpsManagerLib.sol", + "start": 3587, + "length": 88, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [106], - "starting_column": 17, - "ending_column": 65 + "lines": [86], + "starting_column": 13, + "ending_column": 101 }, "type_specific_fields": { "parent": { "type": "function", - "name": "updateExposureReval", + "name": "_update", "source_mapping": { - "start": 3380, - "length": 681, - "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", - "filename_short": "contracts/core/OpsManagerLib.sol", + "start": 3107, + "length": 847, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [ - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109 - ], + "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "OpsManagerLib", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 158, - "length": 3905, - "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", - "filename_short": "contracts/core/OpsManagerLib.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "updateExposureReval(IERC20[],uint256[],mapping(IERC20 => TreasuryFarmingRevenue))" + "signature": "_update(uint256,uint256,uint112,uint112)" } } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "price0CumulativeLast" } - } - ], - "description": "OpsManagerLib.updateExposureReval(IERC20[],uint256[],mapping(IERC20 => TreasuryFarmingRevenue)) (contracts/core/OpsManagerLib.sol#97-109) has external calls inside a loop: exposure.increaseReval(revals[i] - currentReval) (contracts/core/OpsManagerLib.sol#106)\n", - "markdown": "[OpsManagerLib.updateExposureReval(IERC20[],uint256[],mapping(IERC20 => TreasuryFarmingRevenue))](contracts/core/OpsManagerLib.sol#L97-L109) has external calls inside a loop: [exposure.increaseReval(revals[i] - currentReval)](contracts/core/OpsManagerLib.sol#L106)\n", - "first_markdown_element": "contracts/core/OpsManagerLib.sol#L97-L109", - "id": "02b2b95f67586f3365a9cc8e6b95fd4d48a424694b15f84a5b362f195ca5b007", - "check": "calls-loop", - "impact": "Low", - "confidence": "Medium" - }, - { - "elements": [ + }, { - "type": "function", - "name": "redeemExposures", + "type": "node", + "name": "_update(balance0,balance1,_reserve0,_reserve1)", "source_mapping": { - "start": 4724, - "length": 251, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 6426, + "length": 49, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [117, 118, 119, 120, 121, 122, 123], - "starting_column": 5, - "ending_column": 6 + "lines": [136], + "starting_column": 9, + "ending_column": 58 }, "type_specific_fields": { "parent": { - "type": "contract", - "name": "Vault", + "type": "function", + "name": "burn", "source_mapping": { - "start": 1161, - "length": 7823, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 5241, + "length": 1294, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233 + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138 ], - "starting_column": 1, - "ending_column": 2 + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleUniswapV2Pair", + "source_mapping": { + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "is_dependency": false, + "lines": [ + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "burn(address)" } - }, - "signature": "redeemExposures(Exposure[])" + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "price1CumulativeLast" } }, { "type": "node", - "name": "exposures[i].redeem()", + "name": "price1CumulativeLast += uint256(UQ112x112.encode(_reserve0).uqdiv(_reserve1)) * timeElapsed", "source_mapping": { - "start": 4868, - "length": 21, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 3689, + "length": 88, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [119], + "lines": [87], "starting_column": 13, - "ending_column": 34 + "ending_column": 101 }, "type_specific_fields": { "parent": { "type": "function", - "name": "redeemExposures", + "name": "_update", "source_mapping": { - "start": 4724, - "length": 251, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 3107, + "length": 847, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [117, 118, 119, 120, 121, 122, 123], + "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "Vault", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 1161, - "length": 7823, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "redeemExposures(Exposure[])" + "signature": "_update(uint256,uint256,uint112,uint112)" } } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "price1CumulativeLast" } } ], - "description": "Vault.redeemExposures(Exposure[]) (contracts/core/Vault.sol#117-123) has external calls inside a loop: exposures[i].redeem() (contracts/core/Vault.sol#119)\n", - "markdown": "[Vault.redeemExposures(Exposure[])](contracts/core/Vault.sol#L117-L123) has external calls inside a loop: [exposures[i].redeem()](contracts/core/Vault.sol#L119)\n", - "first_markdown_element": "contracts/core/Vault.sol#L117-L123", - "id": "fb0eb1701c9d5262a84b7e53dfc4632c0ca1d6292b4e39447df4f40eaf369003", - "check": "calls-loop", + "description": "Reentrancy in TempleUniswapV2Pair.burn(address) (contracts/amm/TempleUniswapV2Pair.sol#118-138):\n\tExternal calls:\n\t- _safeTransfer(_token0,to,amount0) (contracts/amm/TempleUniswapV2Pair.sol#131)\n\t\t- (success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value)) (contracts/amm/TempleUniswapV2Pair.sol#50)\n\t- _safeTransfer(_token1,to,amount1) (contracts/amm/TempleUniswapV2Pair.sol#132)\n\t\t- (success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value)) (contracts/amm/TempleUniswapV2Pair.sol#50)\n\tState variables written after the call(s):\n\t- _update(balance0,balance1,_reserve0,_reserve1) (contracts/amm/TempleUniswapV2Pair.sol#136)\n\t\t- price0CumulativeLast += uint256(UQ112x112.encode(_reserve1).uqdiv(_reserve0)) * timeElapsed (contracts/amm/TempleUniswapV2Pair.sol#86)\n\t- _update(balance0,balance1,_reserve0,_reserve1) (contracts/amm/TempleUniswapV2Pair.sol#136)\n\t\t- price1CumulativeLast += uint256(UQ112x112.encode(_reserve0).uqdiv(_reserve1)) * timeElapsed (contracts/amm/TempleUniswapV2Pair.sol#87)\n", + "markdown": "Reentrancy in [TempleUniswapV2Pair.burn(address)](contracts/amm/TempleUniswapV2Pair.sol#L118-L138):\n\tExternal calls:\n\t- [_safeTransfer(_token0,to,amount0)](contracts/amm/TempleUniswapV2Pair.sol#L131)\n\t\t- [(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))](contracts/amm/TempleUniswapV2Pair.sol#L50)\n\t- [_safeTransfer(_token1,to,amount1)](contracts/amm/TempleUniswapV2Pair.sol#L132)\n\t\t- [(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))](contracts/amm/TempleUniswapV2Pair.sol#L50)\n\tState variables written after the call(s):\n\t- [_update(balance0,balance1,_reserve0,_reserve1)](contracts/amm/TempleUniswapV2Pair.sol#L136)\n\t\t- [price0CumulativeLast += uint256(UQ112x112.encode(_reserve1).uqdiv(_reserve0)) * timeElapsed](contracts/amm/TempleUniswapV2Pair.sol#L86)\n\t- [_update(balance0,balance1,_reserve0,_reserve1)](contracts/amm/TempleUniswapV2Pair.sol#L136)\n\t\t- [price1CumulativeLast += uint256(UQ112x112.encode(_reserve0).uqdiv(_reserve1)) * timeElapsed](contracts/amm/TempleUniswapV2Pair.sol#L87)\n", + "first_markdown_element": "contracts/amm/TempleUniswapV2Pair.sol#L118-L138", + "id": "d6f7e9923264688e14af684f9180e869a190d782f4a8ab55d1efa22ac6b2ec72", + "check": "reentrancy-benign", "impact": "Low", "confidence": "Medium" }, @@ -25790,17 +19927,18 @@ "elements": [ { "type": "function", - "name": "burn", + "name": "swap", "source_mapping": { - "start": 5241, - "length": 1294, + "start": 6644, + "length": 1950, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138 + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170 ], "starting_column": 5, "ending_column": 6 @@ -25813,7 +19951,7 @@ "start": 440, "length": 8733, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ @@ -25835,37 +19973,38 @@ "ending_column": 0 } }, - "signature": "burn(address)" + "signature": "swap(uint256,uint256,address,bytes)" } }, { "type": "node", - "name": "_safeTransfer(_token0,to,amount0)", + "name": "_safeTransfer(_token0,to,amount0Out)", "source_mapping": { - "start": 6213, - "length": 35, + "start": 7388, + "length": 38, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [131], - "starting_column": 9, - "ending_column": 44 + "lines": [153], + "starting_column": 29, + "ending_column": 67 }, "type_specific_fields": { "parent": { "type": "function", - "name": "burn", + "name": "swap", "source_mapping": { - "start": 5241, - "length": 1294, + "start": 6644, + "length": 1950, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138 + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170 ], "starting_column": 5, "ending_column": 6 @@ -25878,7 +20017,7 @@ "start": 440, "length": 8733, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ @@ -25901,7 +20040,7 @@ "ending_column": 0 } }, - "signature": "burn(address)" + "signature": "swap(uint256,uint256,address,bytes)" } } }, @@ -25914,7 +20053,7 @@ "start": 1972, "length": 91, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [50], @@ -25929,7 +20068,7 @@ "start": 1892, "length": 284, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [49, 50, 51, 52], @@ -25944,7 +20083,7 @@ "start": 440, "length": 8733, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ @@ -25975,32 +20114,33 @@ }, { "type": "node", - "name": "_safeTransfer(_token1,to,amount1)", + "name": "_safeTransfer(_token1,to,amount1Out)", "source_mapping": { - "start": 6258, - "length": 35, + "start": 7490, + "length": 38, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [132], - "starting_column": 9, - "ending_column": 44 + "lines": [154], + "starting_column": 29, + "ending_column": 67 }, "type_specific_fields": { "parent": { "type": "function", - "name": "burn", + "name": "swap", "source_mapping": { - "start": 5241, - "length": 1294, + "start": 6644, + "length": 1950, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138 + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170 ], "starting_column": 5, "ending_column": 6 @@ -26013,7 +20153,7 @@ "start": 440, "length": 8733, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ @@ -26036,7 +20176,7 @@ "ending_column": 0 } }, - "signature": "burn(address)" + "signature": "swap(uint256,uint256,address,bytes)" } } }, @@ -26049,7 +20189,7 @@ "start": 1972, "length": 91, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [50], @@ -26064,7 +20204,7 @@ "start": 1892, "length": 284, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [49, 50, 51, 52], @@ -26079,7 +20219,7 @@ "start": 440, "length": 8733, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ @@ -26110,32 +20250,33 @@ }, { "type": "node", - "name": "_safeTransfer(_token0,to,amount0)", + "name": "IUniswapV2Callee(to).uniswapV2Call(msg.sender,amount0Out,amount1Out,data)", "source_mapping": { - "start": 6213, - "length": 35, + "start": 7593, + "length": 76, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [131], - "starting_column": 9, - "ending_column": 44 + "lines": [155], + "starting_column": 30, + "ending_column": 106 }, "type_specific_fields": { "parent": { "type": "function", - "name": "burn", + "name": "swap", "source_mapping": { - "start": 5241, - "length": 1294, + "start": 6644, + "length": 1950, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138 + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170 ], "starting_column": 5, "ending_column": 6 @@ -26148,7 +20289,7 @@ "start": 440, "length": 8733, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ @@ -26171,7 +20312,77 @@ "ending_column": 0 } }, - "signature": "burn(address)" + "signature": "swap(uint256,uint256,address,bytes)" + } + } + }, + "additional_fields": { "underlying_type": "external_calls" } + }, + { + "type": "node", + "name": "_safeTransfer(_token0,to,amount0Out)", + "source_mapping": { + "start": 7388, + "length": 38, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "is_dependency": false, + "lines": [153], + "starting_column": 29, + "ending_column": 67 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "swap", + "source_mapping": { + "start": 6644, + "length": 1950, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "is_dependency": false, + "lines": [ + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleUniswapV2Pair", + "source_mapping": { + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "is_dependency": false, + "lines": [ + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "swap(uint256,uint256,address,bytes)" } } }, @@ -26184,7 +20395,7 @@ "start": 1972, "length": 91, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [50], @@ -26199,7 +20410,7 @@ "start": 1892, "length": 284, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [49, 50, 51, 52], @@ -26214,7 +20425,7 @@ "start": 440, "length": 8733, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ @@ -26245,33 +20456,100 @@ }, { "type": "node", - "name": "_safeTransfer(_token1,to,amount1)", + "name": "_safeTransfer(_token1,to,amount1Out)", "source_mapping": { - "start": 6258, - "length": 35, + "start": 7490, + "length": 38, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "is_dependency": false, + "lines": [154], + "starting_column": 29, + "ending_column": 67 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "swap", + "source_mapping": { + "start": 6644, + "length": 1950, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "is_dependency": false, + "lines": [ + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleUniswapV2Pair", + "source_mapping": { + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "is_dependency": false, + "lines": [ + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "swap(uint256,uint256,address,bytes)" + } + } + }, + "additional_fields": { "underlying_type": "external_calls_sending_eth" } + }, + { + "type": "node", + "name": "(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))", + "source_mapping": { + "start": 1972, + "length": 91, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [132], + "lines": [50], "starting_column": 9, - "ending_column": 44 + "ending_column": 100 }, "type_specific_fields": { "parent": { "type": "function", - "name": "burn", + "name": "_safeTransfer", "source_mapping": { - "start": 5241, - "length": 1294, + "start": 1892, + "length": 284, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [ - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138 - ], + "lines": [49, 50, 51, 52], "starting_column": 5, "ending_column": 6 }, @@ -26283,7 +20561,7 @@ "start": 440, "length": 8733, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ @@ -26306,7 +20584,7 @@ "ending_column": 0 } }, - "signature": "burn(address)" + "signature": "_safeTransfer(address,address,uint256)" } } }, @@ -26314,30 +20592,34 @@ }, { "type": "node", - "name": "(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))", + "name": "IUniswapV2Callee(to).uniswapV2Call(msg.sender,amount0Out,amount1Out,data)", "source_mapping": { - "start": 1972, - "length": 91, + "start": 7593, + "length": 76, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [50], - "starting_column": 9, - "ending_column": 100 + "lines": [155], + "starting_column": 30, + "ending_column": 106 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_safeTransfer", + "name": "swap", "source_mapping": { - "start": 1892, - "length": 284, + "start": 6644, + "length": 1950, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [49, 50, 51, 52], + "lines": [ + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170 + ], "starting_column": 5, "ending_column": 6 }, @@ -26349,7 +20631,7 @@ "start": 440, "length": 8733, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ @@ -26372,7 +20654,7 @@ "ending_column": 0 } }, - "signature": "_safeTransfer(address,address,uint256)" + "signature": "swap(uint256,uint256,address,bytes)" } } }, @@ -26382,30 +20664,31 @@ "type": "node", "name": "_update(balance0,balance1,_reserve0,_reserve1)", "source_mapping": { - "start": 6426, + "start": 8457, "length": 49, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [136], + "lines": [168], "starting_column": 9, "ending_column": 58 }, "type_specific_fields": { "parent": { "type": "function", - "name": "burn", + "name": "swap", "source_mapping": { - "start": 5241, - "length": 1294, + "start": 6644, + "length": 1950, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138 + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170 ], "starting_column": 5, "ending_column": 6 @@ -26418,7 +20701,7 @@ "start": 440, "length": 8733, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ @@ -26441,7 +20724,7 @@ "ending_column": 0 } }, - "signature": "burn(address)" + "signature": "swap(uint256,uint256,address,bytes)" } } }, @@ -26457,7 +20740,7 @@ "start": 3587, "length": 88, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [86], @@ -26472,7 +20755,7 @@ "start": 3107, "length": 847, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], @@ -26487,7 +20770,7 @@ "start": 440, "length": 8733, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ @@ -26523,30 +20806,31 @@ "type": "node", "name": "_update(balance0,balance1,_reserve0,_reserve1)", "source_mapping": { - "start": 6426, + "start": 8457, "length": 49, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [136], + "lines": [168], "starting_column": 9, "ending_column": 58 }, "type_specific_fields": { "parent": { "type": "function", - "name": "burn", + "name": "swap", "source_mapping": { - "start": 5241, - "length": 1294, + "start": 6644, + "length": 1950, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138 + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170 ], "starting_column": 5, "ending_column": 6 @@ -26559,7 +20843,7 @@ "start": 440, "length": 8733, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ @@ -26582,7 +20866,7 @@ "ending_column": 0 } }, - "signature": "burn(address)" + "signature": "swap(uint256,uint256,address,bytes)" } } }, @@ -26598,7 +20882,7 @@ "start": 3689, "length": 88, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [87], @@ -26613,7 +20897,7 @@ "start": 3107, "length": 847, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], @@ -26628,7 +20912,7 @@ "start": 440, "length": 8733, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ @@ -26651,106 +20935,702 @@ "ending_column": 0 } }, - "signature": "_update(uint256,uint256,uint112,uint112)" + "signature": "_update(uint256,uint256,uint112,uint112)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "price1CumulativeLast" + } + } + ], + "description": "Reentrancy in TempleUniswapV2Pair.swap(uint256,uint256,address,bytes) (contracts/amm/TempleUniswapV2Pair.sol#141-170):\n\tExternal calls:\n\t- _safeTransfer(_token0,to,amount0Out) (contracts/amm/TempleUniswapV2Pair.sol#153)\n\t\t- (success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value)) (contracts/amm/TempleUniswapV2Pair.sol#50)\n\t- _safeTransfer(_token1,to,amount1Out) (contracts/amm/TempleUniswapV2Pair.sol#154)\n\t\t- (success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value)) (contracts/amm/TempleUniswapV2Pair.sol#50)\n\t- IUniswapV2Callee(to).uniswapV2Call(msg.sender,amount0Out,amount1Out,data) (contracts/amm/TempleUniswapV2Pair.sol#155)\n\tState variables written after the call(s):\n\t- _update(balance0,balance1,_reserve0,_reserve1) (contracts/amm/TempleUniswapV2Pair.sol#168)\n\t\t- price0CumulativeLast += uint256(UQ112x112.encode(_reserve1).uqdiv(_reserve0)) * timeElapsed (contracts/amm/TempleUniswapV2Pair.sol#86)\n\t- _update(balance0,balance1,_reserve0,_reserve1) (contracts/amm/TempleUniswapV2Pair.sol#168)\n\t\t- price1CumulativeLast += uint256(UQ112x112.encode(_reserve0).uqdiv(_reserve1)) * timeElapsed (contracts/amm/TempleUniswapV2Pair.sol#87)\n", + "markdown": "Reentrancy in [TempleUniswapV2Pair.swap(uint256,uint256,address,bytes)](contracts/amm/TempleUniswapV2Pair.sol#L141-L170):\n\tExternal calls:\n\t- [_safeTransfer(_token0,to,amount0Out)](contracts/amm/TempleUniswapV2Pair.sol#L153)\n\t\t- [(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))](contracts/amm/TempleUniswapV2Pair.sol#L50)\n\t- [_safeTransfer(_token1,to,amount1Out)](contracts/amm/TempleUniswapV2Pair.sol#L154)\n\t\t- [(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))](contracts/amm/TempleUniswapV2Pair.sol#L50)\n\t- [IUniswapV2Callee(to).uniswapV2Call(msg.sender,amount0Out,amount1Out,data)](contracts/amm/TempleUniswapV2Pair.sol#L155)\n\tState variables written after the call(s):\n\t- [_update(balance0,balance1,_reserve0,_reserve1)](contracts/amm/TempleUniswapV2Pair.sol#L168)\n\t\t- [price0CumulativeLast += uint256(UQ112x112.encode(_reserve1).uqdiv(_reserve0)) * timeElapsed](contracts/amm/TempleUniswapV2Pair.sol#L86)\n\t- [_update(balance0,balance1,_reserve0,_reserve1)](contracts/amm/TempleUniswapV2Pair.sol#L168)\n\t\t- [price1CumulativeLast += uint256(UQ112x112.encode(_reserve0).uqdiv(_reserve1)) * timeElapsed](contracts/amm/TempleUniswapV2Pair.sol#L87)\n", + "first_markdown_element": "contracts/amm/TempleUniswapV2Pair.sol#L141-L170", + "id": "4009158fb72c6a7f799d45778765abe734e526aff7ec82c4bb4384d474895f3f", + "check": "reentrancy-benign", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "batchEquipShards", + "source_mapping": { + "start": 16421, + "length": 1032, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", + "is_dependency": false, + "lines": [ + 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Relic", + "source_mapping": { + "start": 1674, + "length": 24655, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", + "is_dependency": false, + "lines": [ + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, + 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, + 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, + 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, + 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, + 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, + 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, + 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, + 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, + 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, + 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, + 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, + 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, + 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, + 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, + 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, + 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, + 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, + 652, 653, 654, 655 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "batchEquipShards(uint256,uint256[],uint256[])" + } + }, + { + "type": "node", + "name": "shard.safeBatchTransferFrom(msg.sender,address(this),shardIds,amounts,ZERO_BYTES)", + "source_mapping": { + "start": 16818, + "length": 85, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", + "is_dependency": false, + "lines": [405], + "starting_column": 9, + "ending_column": 94 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "batchEquipShards", + "source_mapping": { + "start": 16421, + "length": 1032, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", + "is_dependency": false, + "lines": [ + 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Relic", + "source_mapping": { + "start": 1674, + "length": 24655, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", + "is_dependency": false, + "lines": [ + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, + 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, + 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, + 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, + 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, + 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, + 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, + 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, + 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, + 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, + 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, + 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, + 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, + 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, + 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, + 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, + 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, + 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, + 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, + 654, 655 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "batchEquipShards(uint256,uint256[],uint256[])" + } + } + }, + "additional_fields": { "underlying_type": "external_calls" } + }, + { + "type": "node", + "name": "shard.safeBatchTransferFrom(msg.sender,address(this),shardIds,amounts,ZERO_BYTES)", + "source_mapping": { + "start": 16818, + "length": 85, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", + "is_dependency": false, + "lines": [405], + "starting_column": 9, + "ending_column": 94 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "batchEquipShards", + "source_mapping": { + "start": 16421, + "length": 1032, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", + "is_dependency": false, + "lines": [ + 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Relic", + "source_mapping": { + "start": 1674, + "length": 24655, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", + "is_dependency": false, + "lines": [ + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, + 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, + 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, + 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, + 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, + 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, + 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, + 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, + 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, + 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, + 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, + 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, + 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, + 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, + 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, + 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, + 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, + 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, + 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, + 654, 655 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "batchEquipShards(uint256,uint256[],uint256[])" + } + } + }, + "additional_fields": { "underlying_type": "external_calls_sending_eth" } + }, + { + "type": "node", + "name": "relicInfo.equippedShards[shardId] += amount", + "source_mapping": { + "start": 17131, + "length": 43, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", + "is_dependency": false, + "lines": [412], + "starting_column": 13, + "ending_column": 56 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "batchEquipShards", + "source_mapping": { + "start": 16421, + "length": 1032, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", + "is_dependency": false, + "lines": [ + 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Relic", + "source_mapping": { + "start": 1674, + "length": 24655, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", + "is_dependency": false, + "lines": [ + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, + 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, + 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, + 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, + 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, + 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, + 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, + 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, + 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, + 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, + 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, + 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, + 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, + 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, + 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, + 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, + 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, + 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, + 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, + 654, 655 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "batchEquipShards(uint256,uint256[],uint256[])" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "relicInfos" + } + } + ], + "description": "Reentrancy in Relic.batchEquipShards(uint256,uint256[],uint256[]) (contracts/nexus/Relic.sol#397-422):\n\tExternal calls:\n\t- shard.safeBatchTransferFrom(msg.sender,address(this),shardIds,amounts,ZERO_BYTES) (contracts/nexus/Relic.sol#405)\n\tState variables written after the call(s):\n\t- relicInfo.equippedShards[shardId] += amount (contracts/nexus/Relic.sol#412)\n", + "markdown": "Reentrancy in [Relic.batchEquipShards(uint256,uint256[],uint256[])](contracts/nexus/Relic.sol#L397-L422):\n\tExternal calls:\n\t- [shard.safeBatchTransferFrom(msg.sender,address(this),shardIds,amounts,ZERO_BYTES)](contracts/nexus/Relic.sol#L405)\n\tState variables written after the call(s):\n\t- [relicInfo.equippedShards[shardId] += amount](contracts/nexus/Relic.sol#L412)\n", + "first_markdown_element": "contracts/nexus/Relic.sol#L397-L422", + "id": "e3860ba1302081aacc56b1ceef80f718c42377b7fd407b7b0ffd912c6b716ba5", + "check": "reentrancy-benign", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "removeCollateral", + "source_mapping": { + "start": 6498, + "length": 1031, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "is_dependency": false, + "lines": [ + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleLineOfCredit", + "source_mapping": { + "start": 1433, + "length": 31753, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "is_dependency": false, + "lines": [ + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, + 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, + 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, + 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, + 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, + 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, + 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, + 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, + 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, + 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, + 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, + 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, + 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, + 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, + 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, + 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, + 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, + 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, + 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, + 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, + 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, + 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, + 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, + 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, + 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, + 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, + 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, + 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, + 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, + 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, + 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, + 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, + 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, + 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, + 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, + 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, + 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, + 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "removeCollateral(uint128,address)" + } + }, + { + "type": "node", + "name": "circuitBreakerProxy.preCheck(address(templeToken),msg.sender,amount)", + "source_mapping": { + "start": 7012, + "length": 118, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "is_dependency": false, + "lines": [173, 174, 175, 176, 177], + "starting_column": 9, + "ending_column": 10 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "removeCollateral", + "source_mapping": { + "start": 6498, + "length": 1031, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "is_dependency": false, + "lines": [ + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleLineOfCredit", + "source_mapping": { + "start": 1433, + "length": 31753, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "is_dependency": false, + "lines": [ + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, + 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, + 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, + 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, + 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, + 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, + 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, + 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, + 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, + 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, + 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, + 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, + 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, + 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, + 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, + 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, + 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, + 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, + 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, + 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, + 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, + 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, + 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, + 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, + 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, + 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, + 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, + 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, + 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, + 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, + 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, + 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, + 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, + 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, + 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, + 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, + 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, + 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, + 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, + 883, 884, 885 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "removeCollateral(uint128,address)" } } }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "price1CumulativeLast" - } - } - ], - "description": "Reentrancy in TempleUniswapV2Pair.burn(address) (contracts/amm/TempleUniswapV2Pair.sol#118-138):\n\tExternal calls:\n\t- _safeTransfer(_token0,to,amount0) (contracts/amm/TempleUniswapV2Pair.sol#131)\n\t\t- (success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value)) (contracts/amm/TempleUniswapV2Pair.sol#50)\n\t- _safeTransfer(_token1,to,amount1) (contracts/amm/TempleUniswapV2Pair.sol#132)\n\t\t- (success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value)) (contracts/amm/TempleUniswapV2Pair.sol#50)\n\tState variables written after the call(s):\n\t- _update(balance0,balance1,_reserve0,_reserve1) (contracts/amm/TempleUniswapV2Pair.sol#136)\n\t\t- price0CumulativeLast += uint256(UQ112x112.encode(_reserve1).uqdiv(_reserve0)) * timeElapsed (contracts/amm/TempleUniswapV2Pair.sol#86)\n\t- _update(balance0,balance1,_reserve0,_reserve1) (contracts/amm/TempleUniswapV2Pair.sol#136)\n\t\t- price1CumulativeLast += uint256(UQ112x112.encode(_reserve0).uqdiv(_reserve1)) * timeElapsed (contracts/amm/TempleUniswapV2Pair.sol#87)\n", - "markdown": "Reentrancy in [TempleUniswapV2Pair.burn(address)](contracts/amm/TempleUniswapV2Pair.sol#L118-L138):\n\tExternal calls:\n\t- [_safeTransfer(_token0,to,amount0)](contracts/amm/TempleUniswapV2Pair.sol#L131)\n\t\t- [(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))](contracts/amm/TempleUniswapV2Pair.sol#L50)\n\t- [_safeTransfer(_token1,to,amount1)](contracts/amm/TempleUniswapV2Pair.sol#L132)\n\t\t- [(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))](contracts/amm/TempleUniswapV2Pair.sol#L50)\n\tState variables written after the call(s):\n\t- [_update(balance0,balance1,_reserve0,_reserve1)](contracts/amm/TempleUniswapV2Pair.sol#L136)\n\t\t- [price0CumulativeLast += uint256(UQ112x112.encode(_reserve1).uqdiv(_reserve0)) * timeElapsed](contracts/amm/TempleUniswapV2Pair.sol#L86)\n\t- [_update(balance0,balance1,_reserve0,_reserve1)](contracts/amm/TempleUniswapV2Pair.sol#L136)\n\t\t- [price1CumulativeLast += uint256(UQ112x112.encode(_reserve0).uqdiv(_reserve1)) * timeElapsed](contracts/amm/TempleUniswapV2Pair.sol#L87)\n", - "first_markdown_element": "contracts/amm/TempleUniswapV2Pair.sol#L118-L138", - "id": "d6f7e9923264688e14af684f9180e869a190d782f4a8ab55d1efa22ac6b2ec72", - "check": "reentrancy-benign", - "impact": "Low", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "swap", - "source_mapping": { - "start": 6644, - "length": 1950, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", - "is_dependency": false, - "lines": [ - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleUniswapV2Pair", - "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", - "is_dependency": false, - "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "swap(uint256,uint256,address,bytes)" - } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "_safeTransfer(_token0,to,amount0Out)", + "name": "circuitBreakerProxy.preCheck(address(templeToken),msg.sender,amount)", "source_mapping": { - "start": 7388, - "length": 38, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 7012, + "length": 118, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, - "lines": [153], - "starting_column": 29, - "ending_column": 67 + "lines": [173, 174, 175, 176, 177], + "starting_column": 9, + "ending_column": 10 }, "type_specific_fields": { "parent": { "type": "function", - "name": "swap", + "name": "removeCollateral", "source_mapping": { - "start": 6644, - "length": 1950, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 6498, + "length": 1031, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, "lines": [ - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170 + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190 ], "starting_column": 5, "ending_column": 6 @@ -26758,171 +21638,343 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "TempleLineOfCredit", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1433, + "length": 31753, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, + 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, + 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, + 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, + 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, + 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, + 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, + 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, + 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, + 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, + 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, + 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, + 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, + 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, + 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, + 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, + 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, + 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, + 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, + 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, + 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, + 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, + 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, + 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, + 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, + 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, + 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, + 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, + 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, + 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, + 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, + 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, + 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, + 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, + 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, + 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, + 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, + 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, + 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, + 883, 884, 885 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "swap(uint256,uint256,address,bytes)" + "signature": "removeCollateral(uint128,address)" } } }, - "additional_fields": { "underlying_type": "external_calls" } + "additional_fields": { "underlying_type": "external_calls_sending_eth" } }, { "type": "node", - "name": "(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))", + "name": "totalCollateral -= amount", "source_mapping": { - "start": 1972, - "length": 91, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 7285, + "length": 25, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, - "lines": [50], + "lines": [181], "starting_column": 9, - "ending_column": 100 + "ending_column": 34 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_safeTransfer", + "name": "removeCollateral", "source_mapping": { - "start": 1892, - "length": 284, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 6498, + "length": 1031, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, - "lines": [49, 50, 51, 52], + "lines": [ + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "TempleLineOfCredit", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1433, + "length": 31753, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, + 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, + 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, + 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, + 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, + 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, + 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, + 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, + 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, + 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, + 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, + 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, + 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, + 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, + 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, + 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, + 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, + 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, + 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, + 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, + 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, + 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, + 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, + 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, + 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, + 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, + 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, + 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, + 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, + 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, + 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, + 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, + 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, + 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, + 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, + 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, + 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, + 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, + 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, + 883, 884, 885 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_safeTransfer(address,address,uint256)" + "signature": "removeCollateral(uint128,address)" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "totalCollateral" + } + } + ], + "description": "Reentrancy in TempleLineOfCredit.removeCollateral(uint128,address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#166-190):\n\tExternal calls:\n\t- circuitBreakerProxy.preCheck(address(templeToken),msg.sender,amount) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#173-177)\n\tState variables written after the call(s):\n\t- totalCollateral -= amount (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#181)\n", + "markdown": "Reentrancy in [TempleLineOfCredit.removeCollateral(uint128,address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L166-L190):\n\tExternal calls:\n\t- [circuitBreakerProxy.preCheck(address(templeToken),msg.sender,amount)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L173-L177)\n\tState variables written after the call(s):\n\t- [totalCollateral -= amount](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L181)\n", + "first_markdown_element": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L166-L190", + "id": "7e54b77ff600dbf6c2607432f645013fef59227e4ff7c91d2c9c62ef8ddf1980", + "check": "reentrancy-benign", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "createExposure", + "source_mapping": { + "start": 1322, + "length": 415, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", + "is_dependency": false, + "lines": [45, 46, 47, 48, 49, 50, 51, 52, 53, 54], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "OpsManager", + "source_mapping": { + "start": 388, + "length": 6435, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", + "is_dependency": false, + "lines": [ + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "createExposure(string,string,IERC20)" + } }, { "type": "node", - "name": "_safeTransfer(_token1,to,amount1Out)", + "name": "exposure = OpsManagerLib.createExposure(name,symbol,revalToken,pools)", "source_mapping": { - "start": 7490, - "length": 38, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1526, + "length": 81, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, - "lines": [154], - "starting_column": 29, - "ending_column": 67 + "lines": [51], + "starting_column": 9, + "ending_column": 90 }, "type_specific_fields": { "parent": { "type": "function", - "name": "swap", + "name": "createExposure", "source_mapping": { - "start": 6644, - "length": 1950, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1322, + "length": 415, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, - "lines": [ - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170 - ], + "lines": [45, 46, 47, 48, 49, 50, 51, 52, 53, 54], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "OpsManager", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 388, + "length": 6435, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "swap(uint256,uint256,address,bytes)" + "signature": "createExposure(string,string,IERC20)" } } }, @@ -26930,65 +21982,64 @@ }, { "type": "node", - "name": "(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))", + "name": "exposure = OpsManagerLib.createExposure(name,symbol,revalToken,pools)", "source_mapping": { - "start": 1972, - "length": 91, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1526, + "length": 81, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, - "lines": [50], + "lines": [51], "starting_column": 9, - "ending_column": 100 + "ending_column": 90 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_safeTransfer", + "name": "createExposure", "source_mapping": { - "start": 1892, - "length": 284, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1322, + "length": 415, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, - "lines": [49, 50, 51, 52], + "lines": [45, 46, 47, 48, 49, 50, 51, 52, 53, 54], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "OpsManager", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 388, + "length": 6435, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "_safeTransfer(address,address,uint256)" + "signature": "createExposure(string,string,IERC20)" } } }, @@ -26996,205 +22047,234 @@ }, { "type": "node", - "name": "IUniswapV2Callee(to).uniswapV2Call(msg.sender,amount0Out,amount1Out,data)", + "name": "revalTokens.push(address(revalToken))", "source_mapping": { - "start": 7593, - "length": 76, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1617, + "length": 37, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, - "lines": [155], - "starting_column": 30, - "ending_column": 106 + "lines": [52], + "starting_column": 9, + "ending_column": 46 }, "type_specific_fields": { "parent": { "type": "function", - "name": "swap", + "name": "createExposure", "source_mapping": { - "start": 6644, - "length": 1950, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1322, + "length": 415, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, - "lines": [ - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170 - ], + "lines": [45, 46, 47, 48, 49, 50, 51, 52, 53, 54], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "OpsManager", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 388, + "length": 6435, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "swap(uint256,uint256,address,bytes)" + "signature": "createExposure(string,string,IERC20)" } } }, - "additional_fields": { "underlying_type": "external_calls" } + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "revalTokens" + } + } + ], + "description": "Reentrancy in OpsManager.createExposure(string,string,IERC20) (contracts/core/OpsManager.sol#45-54):\n\tExternal calls:\n\t- exposure = OpsManagerLib.createExposure(name,symbol,revalToken,pools) (contracts/core/OpsManager.sol#51)\n\tState variables written after the call(s):\n\t- revalTokens.push(address(revalToken)) (contracts/core/OpsManager.sol#52)\n", + "markdown": "Reentrancy in [OpsManager.createExposure(string,string,IERC20)](contracts/core/OpsManager.sol#L45-L54):\n\tExternal calls:\n\t- [exposure = OpsManagerLib.createExposure(name,symbol,revalToken,pools)](contracts/core/OpsManager.sol#L51)\n\tState variables written after the call(s):\n\t- [revalTokens.push(address(revalToken))](contracts/core/OpsManager.sol#L52)\n", + "first_markdown_element": "contracts/core/OpsManager.sol#L45-L54", + "id": "51556a077db66dfc3240e846360a26235f1360662907e56d0702b662359b5526", + "check": "reentrancy-benign", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "decreaseShares", + "source_mapping": { + "start": 2355, + "length": 302, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "is_dependency": false, + "lines": [69, 70, 71, 72, 73, 74, 75, 76, 77], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TreasuryFarmingRevenue", + "source_mapping": { + "start": 547, + "length": 3059, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "is_dependency": false, + "lines": [ + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "decreaseShares(address,uint256)" + } }, { "type": "node", - "name": "_safeTransfer(_token0,to,amount0Out)", + "name": "claimFor(account)", "source_mapping": { - "start": 7388, - "length": 38, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 2441, + "length": 17, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [153], - "starting_column": 29, - "ending_column": 67 + "lines": [70], + "starting_column": 9, + "ending_column": 26 }, "type_specific_fields": { "parent": { "type": "function", - "name": "swap", + "name": "decreaseShares", "source_mapping": { - "start": 6644, - "length": 1950, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 2355, + "length": 302, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [ - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170 - ], + "lines": [69, 70, 71, 72, 73, 74, 75, 76, 77], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "TreasuryFarmingRevenue", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 547, + "length": 3059, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "swap(uint256,uint256,address,bytes)" + "signature": "decreaseShares(address,uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))", + "name": "exposure.mint(account,unclaimedScaled / SCALING_FACTOR)", "source_mapping": { - "start": 1972, - "length": 91, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 3194, + "length": 56, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [50], + "lines": [91], "starting_column": 9, - "ending_column": 100 + "ending_column": 65 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_safeTransfer", + "name": "claimFor", "source_mapping": { - "start": 1892, - "length": 284, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 2718, + "length": 611, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [49, 50, 51, 52], + "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "TreasuryFarmingRevenue", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 547, + "length": 3059, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_safeTransfer(address,address,uint256)" + "signature": "claimFor(address)" } } }, @@ -27202,69 +22282,57 @@ }, { "type": "node", - "name": "_safeTransfer(_token1,to,amount1Out)", + "name": "claimFor(account)", "source_mapping": { - "start": 7490, - "length": 38, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 2441, + "length": 17, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [154], - "starting_column": 29, - "ending_column": 67 + "lines": [70], + "starting_column": 9, + "ending_column": 26 }, "type_specific_fields": { "parent": { "type": "function", - "name": "swap", + "name": "decreaseShares", "source_mapping": { - "start": 6644, - "length": 1950, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 2355, + "length": 302, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [ - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170 - ], + "lines": [69, 70, 71, 72, 73, 74, 75, 76, 77], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "TreasuryFarmingRevenue", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 547, + "length": 3059, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "swap(uint256,uint256,address,bytes)" + "signature": "decreaseShares(address,uint256)" } } }, @@ -27272,65 +22340,57 @@ }, { "type": "node", - "name": "(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))", + "name": "exposure.mint(account,unclaimedScaled / SCALING_FACTOR)", "source_mapping": { - "start": 1972, - "length": 91, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 3194, + "length": 56, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [50], + "lines": [91], "starting_column": 9, - "ending_column": 100 + "ending_column": 65 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_safeTransfer", + "name": "claimFor", "source_mapping": { - "start": 1892, - "length": 284, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 2718, + "length": 611, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [49, 50, 51, 52], + "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "TreasuryFarmingRevenue", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 547, + "length": 3059, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_safeTransfer(address,address,uint256)" + "signature": "claimFor(address)" } } }, @@ -27338,103 +22398,153 @@ }, { "type": "node", - "name": "IUniswapV2Callee(to).uniswapV2Call(msg.sender,amount0Out,amount1Out,data)", + "name": "totalShares -= amount", "source_mapping": { - "start": 7593, - "length": 76, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 2504, + "length": 21, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [155], - "starting_column": 30, - "ending_column": 106 + "lines": [73], + "starting_column": 9, + "ending_column": 30 }, "type_specific_fields": { "parent": { "type": "function", - "name": "swap", + "name": "decreaseShares", "source_mapping": { - "start": 6644, - "length": 1950, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 2355, + "length": 302, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [ - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170 - ], + "lines": [69, 70, 71, 72, 73, 74, 75, 76, 77], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "TreasuryFarmingRevenue", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 547, + "length": 3059, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "swap(uint256,uint256,address,bytes)" + "signature": "decreaseShares(address,uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "totalShares" + } + } + ], + "description": "Reentrancy in TreasuryFarmingRevenue.decreaseShares(address,uint256) (contracts/core/TreasuryFarmingRevenue.sol#69-77):\n\tExternal calls:\n\t- claimFor(account) (contracts/core/TreasuryFarmingRevenue.sol#70)\n\t\t- exposure.mint(account,unclaimedScaled / SCALING_FACTOR) (contracts/core/TreasuryFarmingRevenue.sol#91)\n\tState variables written after the call(s):\n\t- totalShares -= amount (contracts/core/TreasuryFarmingRevenue.sol#73)\n", + "markdown": "Reentrancy in [TreasuryFarmingRevenue.decreaseShares(address,uint256)](contracts/core/TreasuryFarmingRevenue.sol#L69-L77):\n\tExternal calls:\n\t- [claimFor(account)](contracts/core/TreasuryFarmingRevenue.sol#L70)\n\t\t- [exposure.mint(account,unclaimedScaled / SCALING_FACTOR)](contracts/core/TreasuryFarmingRevenue.sol#L91)\n\tState variables written after the call(s):\n\t- [totalShares -= amount](contracts/core/TreasuryFarmingRevenue.sol#L73)\n", + "first_markdown_element": "contracts/core/TreasuryFarmingRevenue.sol#L69-L77", + "id": "0b0602eac2622c580688b404d63d57f1596371f95c0951d2b30d3754c6a94161", + "check": "reentrancy-benign", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "deployPayouts", + "source_mapping": { + "start": 2818, + "length": 1078, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "is_dependency": false, + "lines": [ + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleTeamPaymentsFactory", + "source_mapping": { + "start": 279, + "length": 4653, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "is_dependency": false, + "lines": [ + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" + } }, { "type": "node", - "name": "_update(balance0,balance1,_reserve0,_reserve1)", + "name": "paymentContract.initialize(_token)", "source_mapping": { - "start": 8457, - "length": 49, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 3274, + "length": 34, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [168], + "lines": [89], "starting_column": 9, - "ending_column": 58 + "ending_column": 43 }, "type_specific_fields": { "parent": { "type": "function", - "name": "swap", + "name": "deployPayouts", "source_mapping": { - "start": 6644, - "length": 1950, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 2818, + "length": 1078, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170 + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112 ], "starting_column": 5, "ending_column": 6 @@ -27442,141 +22552,131 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "TempleTeamPaymentsFactory", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 279, + "length": 4653, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "swap(uint256,uint256,address,bytes)" + "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" } } }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "price0CumulativeLast" - } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "price0CumulativeLast += uint256(UQ112x112.encode(_reserve1).uqdiv(_reserve0)) * timeElapsed", + "name": "paymentContract.setAllocations(_dests,_allocations)", "source_mapping": { - "start": 3587, - "length": 88, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 3318, + "length": 52, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [86], - "starting_column": 13, - "ending_column": 101 + "lines": [90], + "starting_column": 9, + "ending_column": 61 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_update", + "name": "deployPayouts", "source_mapping": { - "start": 3107, - "length": 847, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 2818, + "length": 1078, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], + "lines": [ + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "TempleTeamPaymentsFactory", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 279, + "length": 4653, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "_update(uint256,uint256,uint112,uint112)" + "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" } } }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "price0CumulativeLast" - } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "_update(balance0,balance1,_reserve0,_reserve1)", + "name": "paymentContract.transferOwnership(msg.sender)", "source_mapping": { - "start": 8457, - "length": 49, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 3381, + "length": 45, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [168], + "lines": [92], "starting_column": 9, - "ending_column": 58 + "ending_column": 54 }, "type_specific_fields": { "parent": { "type": "function", - "name": "swap", + "name": "deployPayouts", "source_mapping": { - "start": 6644, - "length": 1950, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 2818, + "length": 1078, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170 + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112 ], "starting_column": 5, "ending_column": 6 @@ -27584,257 +22684,131 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "TempleTeamPaymentsFactory", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 279, + "length": 4653, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "swap(uint256,uint256,address,bytes)" + "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" } } }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "price1CumulativeLast" - } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "price1CumulativeLast += uint256(UQ112x112.encode(_reserve0).uqdiv(_reserve1)) * timeElapsed", + "name": "SafeERC20.safeTransferFrom(_token,msg.sender,address(paymentContract),_totalFunding)", "source_mapping": { - "start": 3689, - "length": 88, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 3473, + "length": 165, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [87], + "lines": [95, 96, 97, 98, 99, 100], "starting_column": 13, - "ending_column": 101 + "ending_column": 14 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_update", + "name": "deployPayouts", "source_mapping": { - "start": 3107, - "length": 847, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 2818, + "length": 1078, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], + "lines": [ + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "TempleTeamPaymentsFactory", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 279, + "length": 4653, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "_update(uint256,uint256,uint112,uint112)" + "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" } } }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "price1CumulativeLast" - } - } - ], - "description": "Reentrancy in TempleUniswapV2Pair.swap(uint256,uint256,address,bytes) (contracts/amm/TempleUniswapV2Pair.sol#141-170):\n\tExternal calls:\n\t- _safeTransfer(_token0,to,amount0Out) (contracts/amm/TempleUniswapV2Pair.sol#153)\n\t\t- (success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value)) (contracts/amm/TempleUniswapV2Pair.sol#50)\n\t- _safeTransfer(_token1,to,amount1Out) (contracts/amm/TempleUniswapV2Pair.sol#154)\n\t\t- (success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value)) (contracts/amm/TempleUniswapV2Pair.sol#50)\n\t- IUniswapV2Callee(to).uniswapV2Call(msg.sender,amount0Out,amount1Out,data) (contracts/amm/TempleUniswapV2Pair.sol#155)\n\tState variables written after the call(s):\n\t- _update(balance0,balance1,_reserve0,_reserve1) (contracts/amm/TempleUniswapV2Pair.sol#168)\n\t\t- price0CumulativeLast += uint256(UQ112x112.encode(_reserve1).uqdiv(_reserve0)) * timeElapsed (contracts/amm/TempleUniswapV2Pair.sol#86)\n\t- _update(balance0,balance1,_reserve0,_reserve1) (contracts/amm/TempleUniswapV2Pair.sol#168)\n\t\t- price1CumulativeLast += uint256(UQ112x112.encode(_reserve0).uqdiv(_reserve1)) * timeElapsed (contracts/amm/TempleUniswapV2Pair.sol#87)\n", - "markdown": "Reentrancy in [TempleUniswapV2Pair.swap(uint256,uint256,address,bytes)](contracts/amm/TempleUniswapV2Pair.sol#L141-L170):\n\tExternal calls:\n\t- [_safeTransfer(_token0,to,amount0Out)](contracts/amm/TempleUniswapV2Pair.sol#L153)\n\t\t- [(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))](contracts/amm/TempleUniswapV2Pair.sol#L50)\n\t- [_safeTransfer(_token1,to,amount1Out)](contracts/amm/TempleUniswapV2Pair.sol#L154)\n\t\t- [(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))](contracts/amm/TempleUniswapV2Pair.sol#L50)\n\t- [IUniswapV2Callee(to).uniswapV2Call(msg.sender,amount0Out,amount1Out,data)](contracts/amm/TempleUniswapV2Pair.sol#L155)\n\tState variables written after the call(s):\n\t- [_update(balance0,balance1,_reserve0,_reserve1)](contracts/amm/TempleUniswapV2Pair.sol#L168)\n\t\t- [price0CumulativeLast += uint256(UQ112x112.encode(_reserve1).uqdiv(_reserve0)) * timeElapsed](contracts/amm/TempleUniswapV2Pair.sol#L86)\n\t- [_update(balance0,balance1,_reserve0,_reserve1)](contracts/amm/TempleUniswapV2Pair.sol#L168)\n\t\t- [price1CumulativeLast += uint256(UQ112x112.encode(_reserve0).uqdiv(_reserve1)) * timeElapsed](contracts/amm/TempleUniswapV2Pair.sol#L87)\n", - "first_markdown_element": "contracts/amm/TempleUniswapV2Pair.sol#L141-L170", - "id": "4009158fb72c6a7f799d45778765abe734e526aff7ec82c4bb4384d474895f3f", - "check": "reentrancy-benign", - "impact": "Low", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "batchLiquidate", - "source_mapping": { - "start": 13008, - "length": 1632, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [ - 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, - 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleLineOfCredit", - "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, - 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, - 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, - 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, - 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, - 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, - 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, - 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, - 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, - 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, - 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, - 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, - 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, - 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, - 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, - 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, - 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, - 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, - 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, - 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, - 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, - 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, - 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, - 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, - 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, - 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, - 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, - 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, - 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, - 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, - 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, - 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, - 874, 875, 876, 877, 878, 879, 880, 881, 882 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "batchLiquidate(address[])" - } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "templeToken.safeIncreaseAllowance(address(treasuryReservesVault),totalCollateralClaimed)", + "name": "paymentContract.initialize(_token)", "source_mapping": { - "start": 14242, - "length": 89, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 3274, + "length": 34, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [350], - "starting_column": 13, - "ending_column": 102 + "lines": [89], + "starting_column": 9, + "ending_column": 43 }, "type_specific_fields": { "parent": { "type": "function", - "name": "batchLiquidate", + "name": "deployPayouts", "source_mapping": { - "start": 13008, - "length": 1632, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 2818, + "length": 1078, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, - 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359 + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112 ], "starting_column": 5, "ending_column": 6 @@ -27842,126 +22816,65 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "TempleTeamPaymentsFactory", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 + "start": 279, + "length": 4653, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "is_dependency": false, + "lines": [ + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "batchLiquidate(address[])" + "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls" } + "additional_fields": { "underlying_type": "external_calls_sending_eth" } }, { "type": "node", - "name": "treasuryReservesVault.repay(templeToken,totalCollateralClaimed,address(tlcStrategy))", + "name": "paymentContract.setAllocations(_dests,_allocations)", "source_mapping": { - "start": 14345, - "length": 86, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 3318, + "length": 52, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [351], - "starting_column": 13, - "ending_column": 99 + "lines": [90], + "starting_column": 9, + "ending_column": 61 }, "type_specific_fields": { "parent": { "type": "function", - "name": "batchLiquidate", + "name": "deployPayouts", "source_mapping": { - "start": 13008, - "length": 1632, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 2818, + "length": 1078, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, - 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359 + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112 ], "starting_column": 5, "ending_column": 6 @@ -27969,126 +22882,65 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "TempleTeamPaymentsFactory", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 279, + "length": 4653, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "batchLiquidate(address[])" + "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls" } + "additional_fields": { "underlying_type": "external_calls_sending_eth" } }, { "type": "node", - "name": "templeToken.safeIncreaseAllowance(address(treasuryReservesVault),totalCollateralClaimed)", + "name": "paymentContract.transferOwnership(msg.sender)", "source_mapping": { - "start": 14242, - "length": 89, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 3381, + "length": 45, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [350], - "starting_column": 13, - "ending_column": 102 + "lines": [92], + "starting_column": 9, + "ending_column": 54 }, "type_specific_fields": { "parent": { "type": "function", - "name": "batchLiquidate", + "name": "deployPayouts", "source_mapping": { - "start": 13008, - "length": 1632, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 2818, + "length": 1078, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, - 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359 + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112 ], "starting_column": 5, "ending_column": 6 @@ -28096,91 +22948,31 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "TempleTeamPaymentsFactory", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 279, + "length": 4653, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "batchLiquidate(address[])" + "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" } } }, @@ -28188,34 +22980,33 @@ }, { "type": "node", - "name": "treasuryReservesVault.repay(templeToken,totalCollateralClaimed,address(tlcStrategy))", + "name": "SafeERC20.safeTransferFrom(_token,msg.sender,address(paymentContract),_totalFunding)", "source_mapping": { - "start": 14345, - "length": 86, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 3473, + "length": 165, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [351], + "lines": [95, 96, 97, 98, 99, 100], "starting_column": 13, - "ending_column": 99 + "ending_column": 14 }, "type_specific_fields": { "parent": { "type": "function", - "name": "batchLiquidate", + "name": "deployPayouts", "source_mapping": { - "start": 13008, - "length": 1632, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 2818, + "length": 1078, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, - 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359 + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112 ], "starting_column": 5, "ending_column": 6 @@ -28223,91 +23014,31 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "TempleTeamPaymentsFactory", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 279, + "length": 4653, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "batchLiquidate(address[])" + "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" } } }, @@ -28315,34 +23046,33 @@ }, { "type": "node", - "name": "totalCollateral -= totalCollateralClaimed", + "name": "incrementEpoch(address(paymentContract),_totalFunding)", "source_mapping": { - "start": 14445, - "length": 41, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 3649, + "length": 55, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [352], - "starting_column": 13, - "ending_column": 54 + "lines": [102], + "starting_column": 9, + "ending_column": 64 }, "type_specific_fields": { "parent": { "type": "function", - "name": "batchLiquidate", + "name": "deployPayouts", "source_mapping": { - "start": 13008, - "length": 1632, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 2818, + "length": 1078, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, - 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359 + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112 ], "starting_column": 5, "ending_column": 6 @@ -28350,104 +23080,109 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "TempleTeamPaymentsFactory", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 279, + "length": 4653, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "epochsFunded" + } + }, + { + "type": "node", + "name": "epochsFunded[lastPaidEpoch] = data", + "source_mapping": { + "start": 1734, + "length": 34, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "is_dependency": false, + "lines": [55], + "starting_column": 9, + "ending_column": 43 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "incrementEpoch", + "source_mapping": { + "start": 1428, + "length": 347, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "is_dependency": false, + "lines": [46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleTeamPaymentsFactory", + "source_mapping": { + "start": 279, + "length": 4653, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "is_dependency": false, + "lines": [ + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "batchLiquidate(address[])" + "signature": "incrementEpoch(address,uint256)" } } }, "additional_fields": { "underlying_type": "variables_written", - "variable_name": "totalCollateral" + "variable_name": "epochsFunded" } } ], - "description": "Reentrancy in TempleLineOfCredit.batchLiquidate(address[]) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#318-359):\n\tExternal calls:\n\t- templeToken.safeIncreaseAllowance(address(treasuryReservesVault),totalCollateralClaimed) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#350)\n\t- treasuryReservesVault.repay(templeToken,totalCollateralClaimed,address(tlcStrategy)) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#351)\n\tState variables written after the call(s):\n\t- totalCollateral -= totalCollateralClaimed (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#352)\n", - "markdown": "Reentrancy in [TempleLineOfCredit.batchLiquidate(address[])](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L318-L359):\n\tExternal calls:\n\t- [templeToken.safeIncreaseAllowance(address(treasuryReservesVault),totalCollateralClaimed)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L350)\n\t- [treasuryReservesVault.repay(templeToken,totalCollateralClaimed,address(tlcStrategy))](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L351)\n\tState variables written after the call(s):\n\t- [totalCollateral -= totalCollateralClaimed](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L352)\n", - "first_markdown_element": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L318-L359", - "id": "1fe3191cb99f71069088f7029ec1df900073f36699e5cfbf9e12e6582676f0ba", + "description": "Reentrancy in TempleTeamPaymentsFactory.deployPayouts(IERC20,address[],uint256[],uint256) (contracts/admin/TempleTeamPaymentsFactory.sol#79-112):\n\tExternal calls:\n\t- paymentContract.initialize(_token) (contracts/admin/TempleTeamPaymentsFactory.sol#89)\n\t- paymentContract.setAllocations(_dests,_allocations) (contracts/admin/TempleTeamPaymentsFactory.sol#90)\n\t- paymentContract.transferOwnership(msg.sender) (contracts/admin/TempleTeamPaymentsFactory.sol#92)\n\t- SafeERC20.safeTransferFrom(_token,msg.sender,address(paymentContract),_totalFunding) (contracts/admin/TempleTeamPaymentsFactory.sol#95-100)\n\tState variables written after the call(s):\n\t- incrementEpoch(address(paymentContract),_totalFunding) (contracts/admin/TempleTeamPaymentsFactory.sol#102)\n\t\t- epochsFunded[lastPaidEpoch] = data (contracts/admin/TempleTeamPaymentsFactory.sol#55)\n", + "markdown": "Reentrancy in [TempleTeamPaymentsFactory.deployPayouts(IERC20,address[],uint256[],uint256)](contracts/admin/TempleTeamPaymentsFactory.sol#L79-L112):\n\tExternal calls:\n\t- [paymentContract.initialize(_token)](contracts/admin/TempleTeamPaymentsFactory.sol#L89)\n\t- [paymentContract.setAllocations(_dests,_allocations)](contracts/admin/TempleTeamPaymentsFactory.sol#L90)\n\t- [paymentContract.transferOwnership(msg.sender)](contracts/admin/TempleTeamPaymentsFactory.sol#L92)\n\t- [SafeERC20.safeTransferFrom(_token,msg.sender,address(paymentContract),_totalFunding)](contracts/admin/TempleTeamPaymentsFactory.sol#L95-L100)\n\tState variables written after the call(s):\n\t- [incrementEpoch(address(paymentContract),_totalFunding)](contracts/admin/TempleTeamPaymentsFactory.sol#L102)\n\t\t- [epochsFunded[lastPaidEpoch] = data](contracts/admin/TempleTeamPaymentsFactory.sol#L55)\n", + "first_markdown_element": "contracts/admin/TempleTeamPaymentsFactory.sol#L79-L112", + "id": "38547e1ee698a66798b081a9551aa0d534f4641810a5486cd31cdbdd25f55313", "check": "reentrancy-benign", "impact": "Low", "confidence": "Medium" @@ -28456,18 +23191,17 @@ "elements": [ { "type": "function", - "name": "deployPayouts", + "name": "directPayouts", "source_mapping": { - "start": 2818, - "length": 1078, + "start": 4101, + "length": 829, "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112 + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143 ], "starting_column": 5, "ending_column": 6 @@ -28480,7 +23214,7 @@ "start": 279, "length": 4653, "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ @@ -28499,38 +23233,37 @@ "ending_column": 2 } }, - "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" + "signature": "directPayouts(IERC20,address[],uint256[])" } }, { "type": "node", - "name": "paymentContract.initialize(_token)", + "name": "SafeERC20.safeTransferFrom(_token,msg.sender,dest,value)", "source_mapping": { - "start": 3274, - "length": 34, + "start": 4642, + "length": 59, "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [89], - "starting_column": 9, - "ending_column": 43 + "lines": [133], + "starting_column": 13, + "ending_column": 72 }, "type_specific_fields": { "parent": { "type": "function", - "name": "deployPayouts", + "name": "directPayouts", "source_mapping": { - "start": 2818, - "length": 1078, + "start": 4101, + "length": 829, "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112 + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143 ], "starting_column": 5, "ending_column": 6 @@ -28543,7 +23276,7 @@ "start": 279, "length": 4653, "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ @@ -28562,7 +23295,7 @@ "ending_column": 2 } }, - "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" + "signature": "directPayouts(IERC20,address[],uint256[])" } } }, @@ -28570,33 +23303,32 @@ }, { "type": "node", - "name": "paymentContract.setAllocations(_dests,_allocations)", + "name": "SafeERC20.safeTransferFrom(_token,msg.sender,dest,value)", "source_mapping": { - "start": 3318, - "length": 52, + "start": 4642, + "length": 59, "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [90], - "starting_column": 9, - "ending_column": 61 + "lines": [133], + "starting_column": 13, + "ending_column": 72 }, "type_specific_fields": { "parent": { "type": "function", - "name": "deployPayouts", + "name": "directPayouts", "source_mapping": { - "start": 2818, - "length": 1078, + "start": 4101, + "length": 829, "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112 + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143 ], "starting_column": 5, "ending_column": 6 @@ -28609,7 +23341,7 @@ "start": 279, "length": 4653, "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ @@ -28628,41 +23360,40 @@ "ending_column": 2 } }, - "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" + "signature": "directPayouts(IERC20,address[],uint256[])" } } }, - "additional_fields": { "underlying_type": "external_calls" } + "additional_fields": { "underlying_type": "external_calls_sending_eth" } }, { "type": "node", - "name": "paymentContract.transferOwnership(msg.sender)", + "name": "incrementEpoch(address(this),totalFunding)", "source_mapping": { - "start": 3381, - "length": 45, + "start": 4816, + "length": 43, "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [92], + "lines": [140], "starting_column": 9, - "ending_column": 54 + "ending_column": 52 }, "type_specific_fields": { "parent": { "type": "function", - "name": "deployPayouts", + "name": "directPayouts", "source_mapping": { - "start": 2818, - "length": 1078, + "start": 4101, + "length": 829, "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112 + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143 ], "starting_column": 5, "ending_column": 6 @@ -28675,7 +23406,7 @@ "start": 279, "length": 4653, "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ @@ -28694,42 +23425,41 @@ "ending_column": 2 } }, - "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" + "signature": "directPayouts(IERC20,address[],uint256[])" } } }, - "additional_fields": { "underlying_type": "external_calls" } + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "epochsFunded" + } }, { "type": "node", - "name": "SafeERC20.safeTransferFrom(_token,msg.sender,address(paymentContract),_totalFunding)", + "name": "epochsFunded[lastPaidEpoch] = data", "source_mapping": { - "start": 3473, - "length": 165, + "start": 1734, + "length": 34, "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [95, 96, 97, 98, 99, 100], - "starting_column": 13, - "ending_column": 14 + "lines": [55], + "starting_column": 9, + "ending_column": 43 }, "type_specific_fields": { "parent": { "type": "function", - "name": "deployPayouts", + "name": "incrementEpoch", "source_mapping": { - "start": 2818, - "length": 1078, + "start": 1428, + "length": 347, "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [ - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112 - ], + "lines": [46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56], "starting_column": 5, "ending_column": 6 }, @@ -28741,7 +23471,7 @@ "start": 279, "length": 4653, "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ @@ -28760,41 +23490,43 @@ "ending_column": 2 } }, - "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" + "signature": "incrementEpoch(address,uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls" } + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "epochsFunded" + } }, { "type": "node", - "name": "paymentContract.initialize(_token)", + "name": "incrementEpoch(address(this),totalFunding)", "source_mapping": { - "start": 3274, - "length": 34, + "start": 4816, + "length": 43, "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [89], + "lines": [140], "starting_column": 9, - "ending_column": 43 + "ending_column": 52 }, "type_specific_fields": { "parent": { "type": "function", - "name": "deployPayouts", + "name": "directPayouts", "source_mapping": { - "start": 2818, - "length": 1078, + "start": 4101, + "length": 829, "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112 + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143 ], "starting_column": 5, "ending_column": 6 @@ -28807,7 +23539,7 @@ "start": 279, "length": 4653, "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ @@ -28826,73 +23558,358 @@ "ending_column": 2 } }, - "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" + "signature": "directPayouts(IERC20,address[],uint256[])" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "lastPaidEpoch" + } }, { "type": "node", - "name": "paymentContract.setAllocations(_dests,_allocations)", + "name": "data = FundingData({paymentContract:address(_paymentContract),totalFunding:_totalFunding,epoch:lastPaidEpoch ++})", "source_mapping": { - "start": 3318, - "length": 52, + "start": 1542, + "length": 182, "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [90], + "lines": [50, 51, 52, 53, 54], "starting_column": 9, - "ending_column": 61 + "ending_column": 11 }, "type_specific_fields": { "parent": { "type": "function", - "name": "deployPayouts", + "name": "incrementEpoch", "source_mapping": { - "start": 2818, - "length": 1078, + "start": 1428, + "length": 347, "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, + "lines": [46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleTeamPaymentsFactory", + "source_mapping": { + "start": 279, + "length": 4653, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "is_dependency": false, + "lines": [ + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "incrementEpoch(address,uint256)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "lastPaidEpoch" + } + } + ], + "description": "Reentrancy in TempleTeamPaymentsFactory.directPayouts(IERC20,address[],uint256[]) (contracts/admin/TempleTeamPaymentsFactory.sol#119-143):\n\tExternal calls:\n\t- SafeERC20.safeTransferFrom(_token,msg.sender,dest,value) (contracts/admin/TempleTeamPaymentsFactory.sol#133)\n\tState variables written after the call(s):\n\t- incrementEpoch(address(this),totalFunding) (contracts/admin/TempleTeamPaymentsFactory.sol#140)\n\t\t- epochsFunded[lastPaidEpoch] = data (contracts/admin/TempleTeamPaymentsFactory.sol#55)\n\t- incrementEpoch(address(this),totalFunding) (contracts/admin/TempleTeamPaymentsFactory.sol#140)\n\t\t- data = FundingData({paymentContract:address(_paymentContract),totalFunding:_totalFunding,epoch:lastPaidEpoch ++}) (contracts/admin/TempleTeamPaymentsFactory.sol#50-54)\n", + "markdown": "Reentrancy in [TempleTeamPaymentsFactory.directPayouts(IERC20,address[],uint256[])](contracts/admin/TempleTeamPaymentsFactory.sol#L119-L143):\n\tExternal calls:\n\t- [SafeERC20.safeTransferFrom(_token,msg.sender,dest,value)](contracts/admin/TempleTeamPaymentsFactory.sol#L133)\n\tState variables written after the call(s):\n\t- [incrementEpoch(address(this),totalFunding)](contracts/admin/TempleTeamPaymentsFactory.sol#L140)\n\t\t- [epochsFunded[lastPaidEpoch] = data](contracts/admin/TempleTeamPaymentsFactory.sol#L55)\n\t- [incrementEpoch(address(this),totalFunding)](contracts/admin/TempleTeamPaymentsFactory.sol#L140)\n\t\t- [data = FundingData({paymentContract:address(_paymentContract),totalFunding:_totalFunding,epoch:lastPaidEpoch ++})](contracts/admin/TempleTeamPaymentsFactory.sol#L50-L54)\n", + "first_markdown_element": "contracts/admin/TempleTeamPaymentsFactory.sol#L119-L143", + "id": "e7d7cc7383e1682a576694bbc276f3a8cb1f5f6783434f8f5336ea3b0d9bf554", + "check": "reentrancy-benign", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "increaseShares", + "source_mapping": { + "start": 1987, + "length": 302, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "is_dependency": false, + "lines": [56, 57, 58, 59, 60, 61, 62, 63, 64], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TreasuryFarmingRevenue", + "source_mapping": { + "start": 547, + "length": 3059, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "is_dependency": false, "lines": [ - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100 ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "increaseShares(address,uint256)" + } + }, + { + "type": "node", + "name": "claimFor(account)", + "source_mapping": { + "start": 2073, + "length": 17, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "is_dependency": false, + "lines": [57], + "starting_column": 9, + "ending_column": 26 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "increaseShares", + "source_mapping": { + "start": 1987, + "length": 302, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "is_dependency": false, + "lines": [56, 57, 58, 59, 60, 61, 62, 63, 64], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TreasuryFarmingRevenue", + "source_mapping": { + "start": 547, + "length": 3059, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "is_dependency": false, + "lines": [ + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "increaseShares(address,uint256)" + } + } + }, + "additional_fields": { "underlying_type": "external_calls" } + }, + { + "type": "node", + "name": "exposure.mint(account,unclaimedScaled / SCALING_FACTOR)", + "source_mapping": { + "start": 3194, + "length": 56, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "is_dependency": false, + "lines": [91], + "starting_column": 9, + "ending_column": 65 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "claimFor", + "source_mapping": { + "start": 2718, + "length": 611, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "is_dependency": false, + "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TreasuryFarmingRevenue", + "source_mapping": { + "start": 547, + "length": 3059, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "is_dependency": false, + "lines": [ + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "claimFor(address)" + } + } + }, + "additional_fields": { "underlying_type": "external_calls_sending_eth" } + }, + { + "type": "node", + "name": "claimFor(account)", + "source_mapping": { + "start": 2073, + "length": 17, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "is_dependency": false, + "lines": [57], + "starting_column": 9, + "ending_column": 26 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "increaseShares", + "source_mapping": { + "start": 1987, + "length": 302, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "is_dependency": false, + "lines": [56, 57, 58, 59, 60, 61, 62, 63, 64], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TreasuryFarmingRevenue", + "source_mapping": { + "start": 547, + "length": 3059, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "is_dependency": false, + "lines": [ + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "increaseShares(address,uint256)" + } + } + }, + "additional_fields": { "underlying_type": "external_calls_sending_eth" } + }, + { + "type": "node", + "name": "exposure.mint(account,unclaimedScaled / SCALING_FACTOR)", + "source_mapping": { + "start": 3194, + "length": 56, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "is_dependency": false, + "lines": [91], + "starting_column": 9, + "ending_column": 65 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "claimFor", + "source_mapping": { + "start": 2718, + "length": 611, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "is_dependency": false, + "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleTeamPaymentsFactory", + "name": "TreasuryFarmingRevenue", "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 547, + "length": 3059, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" + "signature": "claimFor(address)" } } }, @@ -28900,99 +23917,154 @@ }, { "type": "node", - "name": "paymentContract.transferOwnership(msg.sender)", + "name": "totalShares += amount", "source_mapping": { - "start": 3381, - "length": 45, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 2136, + "length": 21, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [92], + "lines": [60], "starting_column": 9, - "ending_column": 54 + "ending_column": 30 }, "type_specific_fields": { "parent": { "type": "function", - "name": "deployPayouts", + "name": "increaseShares", "source_mapping": { - "start": 2818, - "length": 1078, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 1987, + "length": 302, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [ - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112 - ], + "lines": [56, 57, 58, 59, 60, 61, 62, 63, 64], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleTeamPaymentsFactory", + "name": "TreasuryFarmingRevenue", "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 547, + "length": 3059, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" + "signature": "increaseShares(address,uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "totalShares" + } + } + ], + "description": "Reentrancy in TreasuryFarmingRevenue.increaseShares(address,uint256) (contracts/core/TreasuryFarmingRevenue.sol#56-64):\n\tExternal calls:\n\t- claimFor(account) (contracts/core/TreasuryFarmingRevenue.sol#57)\n\t\t- exposure.mint(account,unclaimedScaled / SCALING_FACTOR) (contracts/core/TreasuryFarmingRevenue.sol#91)\n\tState variables written after the call(s):\n\t- totalShares += amount (contracts/core/TreasuryFarmingRevenue.sol#60)\n", + "markdown": "Reentrancy in [TreasuryFarmingRevenue.increaseShares(address,uint256)](contracts/core/TreasuryFarmingRevenue.sol#L56-L64):\n\tExternal calls:\n\t- [claimFor(account)](contracts/core/TreasuryFarmingRevenue.sol#L57)\n\t\t- [exposure.mint(account,unclaimedScaled / SCALING_FACTOR)](contracts/core/TreasuryFarmingRevenue.sol#L91)\n\tState variables written after the call(s):\n\t- [totalShares += amount](contracts/core/TreasuryFarmingRevenue.sol#L60)\n", + "first_markdown_element": "contracts/core/TreasuryFarmingRevenue.sol#L56-L64", + "id": "842e91df89a71525a6459c0d1291885967545da62e3f06975364172343f78737", + "check": "reentrancy-benign", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "burn", + "source_mapping": { + "start": 5241, + "length": 1294, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "is_dependency": false, + "lines": [ + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleUniswapV2Pair", + "source_mapping": { + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "is_dependency": false, + "lines": [ + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "burn(address)" + } }, { "type": "node", - "name": "SafeERC20.safeTransferFrom(_token,msg.sender,address(paymentContract),_totalFunding)", + "name": "_safeTransfer(_token0,to,amount0)", "source_mapping": { - "start": 3473, - "length": 165, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 6213, + "length": 35, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [95, 96, 97, 98, 99, 100], - "starting_column": 13, - "ending_column": 14 + "lines": [131], + "starting_column": 9, + "ending_column": 44 }, "type_specific_fields": { "parent": { "type": "function", - "name": "deployPayouts", + "name": "burn", "source_mapping": { - "start": 2818, - "length": 1078, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 5241, + "length": 1294, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112 + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138 ], "starting_column": 5, "ending_column": 6 @@ -29000,321 +24072,269 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleTeamPaymentsFactory", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" + "signature": "burn(address)" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "incrementEpoch(address(paymentContract),_totalFunding)", + "name": "(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))", "source_mapping": { - "start": 3649, - "length": 55, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 1972, + "length": 91, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [102], + "lines": [50], "starting_column": 9, - "ending_column": 64 + "ending_column": 100 }, "type_specific_fields": { "parent": { "type": "function", - "name": "deployPayouts", + "name": "_safeTransfer", "source_mapping": { - "start": 2818, - "length": 1078, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 1892, + "length": 284, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [ - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112 - ], + "lines": [49, 50, 51, 52], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleTeamPaymentsFactory", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" + "signature": "_safeTransfer(address,address,uint256)" } } }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "epochsFunded" - } + "additional_fields": { "underlying_type": "external_calls_sending_eth" } }, { "type": "node", - "name": "epochsFunded[lastPaidEpoch] = data", + "name": "_safeTransfer(_token1,to,amount1)", "source_mapping": { - "start": 1734, - "length": 34, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 6258, + "length": 35, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [55], + "lines": [132], "starting_column": 9, - "ending_column": 43 + "ending_column": 44 }, "type_specific_fields": { "parent": { "type": "function", - "name": "incrementEpoch", + "name": "burn", "source_mapping": { - "start": 1428, - "length": 347, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 5241, + "length": 1294, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56], + "lines": [ + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleTeamPaymentsFactory", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "incrementEpoch(address,uint256)" + "signature": "burn(address)" } } }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "epochsFunded" - } - } - ], - "description": "Reentrancy in TempleTeamPaymentsFactory.deployPayouts(IERC20,address[],uint256[],uint256) (contracts/admin/TempleTeamPaymentsFactory.sol#79-112):\n\tExternal calls:\n\t- paymentContract.initialize(_token) (contracts/admin/TempleTeamPaymentsFactory.sol#89)\n\t- paymentContract.setAllocations(_dests,_allocations) (contracts/admin/TempleTeamPaymentsFactory.sol#90)\n\t- paymentContract.transferOwnership(msg.sender) (contracts/admin/TempleTeamPaymentsFactory.sol#92)\n\t- SafeERC20.safeTransferFrom(_token,msg.sender,address(paymentContract),_totalFunding) (contracts/admin/TempleTeamPaymentsFactory.sol#95-100)\n\tState variables written after the call(s):\n\t- incrementEpoch(address(paymentContract),_totalFunding) (contracts/admin/TempleTeamPaymentsFactory.sol#102)\n\t\t- epochsFunded[lastPaidEpoch] = data (contracts/admin/TempleTeamPaymentsFactory.sol#55)\n", - "markdown": "Reentrancy in [TempleTeamPaymentsFactory.deployPayouts(IERC20,address[],uint256[],uint256)](contracts/admin/TempleTeamPaymentsFactory.sol#L79-L112):\n\tExternal calls:\n\t- [paymentContract.initialize(_token)](contracts/admin/TempleTeamPaymentsFactory.sol#L89)\n\t- [paymentContract.setAllocations(_dests,_allocations)](contracts/admin/TempleTeamPaymentsFactory.sol#L90)\n\t- [paymentContract.transferOwnership(msg.sender)](contracts/admin/TempleTeamPaymentsFactory.sol#L92)\n\t- [SafeERC20.safeTransferFrom(_token,msg.sender,address(paymentContract),_totalFunding)](contracts/admin/TempleTeamPaymentsFactory.sol#L95-L100)\n\tState variables written after the call(s):\n\t- [incrementEpoch(address(paymentContract),_totalFunding)](contracts/admin/TempleTeamPaymentsFactory.sol#L102)\n\t\t- [epochsFunded[lastPaidEpoch] = data](contracts/admin/TempleTeamPaymentsFactory.sol#L55)\n", - "first_markdown_element": "contracts/admin/TempleTeamPaymentsFactory.sol#L79-L112", - "id": "38547e1ee698a66798b081a9551aa0d534f4641810a5486cd31cdbdd25f55313", - "check": "reentrancy-benign", - "impact": "Low", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "directPayouts", - "source_mapping": { - "start": 4101, - "length": 829, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", - "is_dependency": false, - "lines": [ - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleTeamPaymentsFactory", - "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", - "is_dependency": false, - "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "directPayouts(IERC20,address[],uint256[])" - } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "SafeERC20.safeTransferFrom(_token,msg.sender,dest,value)", + "name": "(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))", "source_mapping": { - "start": 4642, - "length": 59, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 1972, + "length": 91, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [133], - "starting_column": 13, - "ending_column": 72 + "lines": [50], + "starting_column": 9, + "ending_column": 100 }, "type_specific_fields": { "parent": { "type": "function", - "name": "directPayouts", + "name": "_safeTransfer", "source_mapping": { - "start": 4101, - "length": 829, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 1892, + "length": 284, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [ - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143 - ], + "lines": [49, 50, 51, 52], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleTeamPaymentsFactory", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "directPayouts(IERC20,address[],uint256[])" + "signature": "_safeTransfer(address,address,uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls" } + "additional_fields": { "underlying_type": "external_calls_sending_eth" } }, { "type": "node", - "name": "SafeERC20.safeTransferFrom(_token,msg.sender,dest,value)", + "name": "Burn(msg.sender,amount0,amount1,to)", "source_mapping": { - "start": 4642, - "length": 59, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 6485, + "length": 43, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [133], - "starting_column": 13, - "ending_column": 72 + "lines": [137], + "starting_column": 9, + "ending_column": 52 }, "type_specific_fields": { "parent": { "type": "function", - "name": "directPayouts", + "name": "burn", "source_mapping": { - "start": 4101, - "length": 829, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 5241, + "length": 1294, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143 + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138 ], "starting_column": 5, "ending_column": 6 @@ -29322,197 +24342,266 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleTeamPaymentsFactory", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "directPayouts(IERC20,address[],uint256[])" + "signature": "burn(address)" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + "additional_fields": { "underlying_type": "event" } }, { "type": "node", - "name": "incrementEpoch(address(this),totalFunding)", + "name": "Sync(reserve0,reserve1)", "source_mapping": { - "start": 4816, - "length": 43, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 3918, + "length": 29, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [140], + "lines": [92], "starting_column": 9, - "ending_column": 52 + "ending_column": 38 }, "type_specific_fields": { "parent": { "type": "function", - "name": "directPayouts", + "name": "_update", "source_mapping": { - "start": 4101, - "length": 829, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 3107, + "length": 847, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [ - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143 - ], + "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleTeamPaymentsFactory", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "directPayouts(IERC20,address[],uint256[])" + "signature": "_update(uint256,uint256,uint112,uint112)" } } }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "epochsFunded" - } + "additional_fields": { "underlying_type": "event" } }, { "type": "node", - "name": "epochsFunded[lastPaidEpoch] = data", + "name": "_update(balance0,balance1,_reserve0,_reserve1)", "source_mapping": { - "start": 1734, - "length": 34, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 6426, + "length": 49, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [55], + "lines": [136], "starting_column": 9, - "ending_column": 43 + "ending_column": 58 }, "type_specific_fields": { "parent": { "type": "function", - "name": "incrementEpoch", + "name": "burn", "source_mapping": { - "start": 1428, - "length": 347, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 5241, + "length": 1294, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56], + "lines": [ + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleTeamPaymentsFactory", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "incrementEpoch(address,uint256)" + "signature": "burn(address)" } } }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "epochsFunded" + "additional_fields": { "underlying_type": "event" } + } + ], + "description": "Reentrancy in TempleUniswapV2Pair.burn(address) (contracts/amm/TempleUniswapV2Pair.sol#118-138):\n\tExternal calls:\n\t- _safeTransfer(_token0,to,amount0) (contracts/amm/TempleUniswapV2Pair.sol#131)\n\t\t- (success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value)) (contracts/amm/TempleUniswapV2Pair.sol#50)\n\t- _safeTransfer(_token1,to,amount1) (contracts/amm/TempleUniswapV2Pair.sol#132)\n\t\t- (success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value)) (contracts/amm/TempleUniswapV2Pair.sol#50)\n\tEvent emitted after the call(s):\n\t- Burn(msg.sender,amount0,amount1,to) (contracts/amm/TempleUniswapV2Pair.sol#137)\n\t- Sync(reserve0,reserve1) (contracts/amm/TempleUniswapV2Pair.sol#92)\n\t\t- _update(balance0,balance1,_reserve0,_reserve1) (contracts/amm/TempleUniswapV2Pair.sol#136)\n", + "markdown": "Reentrancy in [TempleUniswapV2Pair.burn(address)](contracts/amm/TempleUniswapV2Pair.sol#L118-L138):\n\tExternal calls:\n\t- [_safeTransfer(_token0,to,amount0)](contracts/amm/TempleUniswapV2Pair.sol#L131)\n\t\t- [(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))](contracts/amm/TempleUniswapV2Pair.sol#L50)\n\t- [_safeTransfer(_token1,to,amount1)](contracts/amm/TempleUniswapV2Pair.sol#L132)\n\t\t- [(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))](contracts/amm/TempleUniswapV2Pair.sol#L50)\n\tEvent emitted after the call(s):\n\t- [Burn(msg.sender,amount0,amount1,to)](contracts/amm/TempleUniswapV2Pair.sol#L137)\n\t- [Sync(reserve0,reserve1)](contracts/amm/TempleUniswapV2Pair.sol#L92)\n\t\t- [_update(balance0,balance1,_reserve0,_reserve1)](contracts/amm/TempleUniswapV2Pair.sol#L136)\n", + "first_markdown_element": "contracts/amm/TempleUniswapV2Pair.sol#L118-L138", + "id": "127a57c69604f2ba16f4cd02c712486dff1968238a1c69ead2035920584207c2", + "check": "reentrancy-events", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "swap", + "source_mapping": { + "start": 6644, + "length": 1950, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "is_dependency": false, + "lines": [ + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleUniswapV2Pair", + "source_mapping": { + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "is_dependency": false, + "lines": [ + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "swap(uint256,uint256,address,bytes)" } }, { "type": "node", - "name": "incrementEpoch(address(this),totalFunding)", + "name": "_safeTransfer(_token0,to,amount0Out)", "source_mapping": { - "start": 4816, - "length": 43, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 7388, + "length": 38, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [140], - "starting_column": 9, - "ending_column": 52 + "lines": [153], + "starting_column": 29, + "ending_column": 67 }, "type_specific_fields": { "parent": { "type": "function", - "name": "directPayouts", + "name": "swap", "source_mapping": { - "start": 4101, - "length": 829, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 6644, + "length": 1950, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143 + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170 ], "starting_column": 5, "ending_column": 6 @@ -29520,245 +24609,135 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleTeamPaymentsFactory", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "directPayouts(IERC20,address[],uint256[])" + "signature": "swap(uint256,uint256,address,bytes)" } } }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "lastPaidEpoch" - } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "data = FundingData(address(_paymentContract),_totalFunding,lastPaidEpoch ++)", + "name": "(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))", "source_mapping": { - "start": 1542, - "length": 182, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 1972, + "length": 91, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [50, 51, 52, 53, 54], + "lines": [50], "starting_column": 9, - "ending_column": 11 + "ending_column": 100 }, "type_specific_fields": { "parent": { "type": "function", - "name": "incrementEpoch", + "name": "_safeTransfer", "source_mapping": { - "start": 1428, - "length": 347, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 1892, + "length": 284, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56], + "lines": [49, 50, 51, 52], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleTeamPaymentsFactory", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "incrementEpoch(address,uint256)" + "signature": "_safeTransfer(address,address,uint256)" } } }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "lastPaidEpoch" - } - } - ], - "description": "Reentrancy in TempleTeamPaymentsFactory.directPayouts(IERC20,address[],uint256[]) (contracts/admin/TempleTeamPaymentsFactory.sol#119-143):\n\tExternal calls:\n\t- SafeERC20.safeTransferFrom(_token,msg.sender,dest,value) (contracts/admin/TempleTeamPaymentsFactory.sol#133)\n\tState variables written after the call(s):\n\t- incrementEpoch(address(this),totalFunding) (contracts/admin/TempleTeamPaymentsFactory.sol#140)\n\t\t- epochsFunded[lastPaidEpoch] = data (contracts/admin/TempleTeamPaymentsFactory.sol#55)\n\t- incrementEpoch(address(this),totalFunding) (contracts/admin/TempleTeamPaymentsFactory.sol#140)\n\t\t- data = FundingData(address(_paymentContract),_totalFunding,lastPaidEpoch ++) (contracts/admin/TempleTeamPaymentsFactory.sol#50-54)\n", - "markdown": "Reentrancy in [TempleTeamPaymentsFactory.directPayouts(IERC20,address[],uint256[])](contracts/admin/TempleTeamPaymentsFactory.sol#L119-L143):\n\tExternal calls:\n\t- [SafeERC20.safeTransferFrom(_token,msg.sender,dest,value)](contracts/admin/TempleTeamPaymentsFactory.sol#L133)\n\tState variables written after the call(s):\n\t- [incrementEpoch(address(this),totalFunding)](contracts/admin/TempleTeamPaymentsFactory.sol#L140)\n\t\t- [epochsFunded[lastPaidEpoch] = data](contracts/admin/TempleTeamPaymentsFactory.sol#L55)\n\t- [incrementEpoch(address(this),totalFunding)](contracts/admin/TempleTeamPaymentsFactory.sol#L140)\n\t\t- [data = FundingData(address(_paymentContract),_totalFunding,lastPaidEpoch ++)](contracts/admin/TempleTeamPaymentsFactory.sol#L50-L54)\n", - "first_markdown_element": "contracts/admin/TempleTeamPaymentsFactory.sol#L119-L143", - "id": "5eabd281d87db8735d97b970645b7a1dc8bae7d3639697ec45eb7d11d11479b7", - "check": "reentrancy-benign", - "impact": "Low", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "removeCollateral", - "source_mapping": { - "start": 6498, - "length": 1031, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [ - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleLineOfCredit", - "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, - 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, - 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, - 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, - 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, - 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, - 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, - 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, - 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, - 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, - 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, - 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, - 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, - 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, - 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, - 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, - 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, - 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, - 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, - 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, - 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, - 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, - 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, - 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, - 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, - 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, - 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, - 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, - 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, - 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, - 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, - 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, - 874, 875, 876, 877, 878, 879, 880, 881, 882 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "removeCollateral(uint128,address)" - } + "additional_fields": { "underlying_type": "external_calls_sending_eth" } }, { - "type": "node", - "name": "circuitBreakerProxy.preCheck(address(templeToken),msg.sender,amount)", - "source_mapping": { - "start": 7012, - "length": 118, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "type": "node", + "name": "_safeTransfer(_token1,to,amount1Out)", + "source_mapping": { + "start": 7490, + "length": 38, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [173, 174, 175, 176, 177], - "starting_column": 9, - "ending_column": 10 + "lines": [154], + "starting_column": 29, + "ending_column": 67 }, "type_specific_fields": { "parent": { "type": "function", - "name": "removeCollateral", + "name": "swap", "source_mapping": { - "start": 6498, - "length": 1031, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 6644, + "length": 1950, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190 + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170 ], "starting_column": 5, "ending_column": 6 @@ -29766,91 +24745,35 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "removeCollateral(uint128,address)" + "signature": "swap(uint256,uint256,address,bytes)" } } }, @@ -29858,124 +24781,65 @@ }, { "type": "node", - "name": "circuitBreakerProxy.preCheck(address(templeToken),msg.sender,amount)", + "name": "(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))", "source_mapping": { - "start": 7012, - "length": 118, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 1972, + "length": 91, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [173, 174, 175, 176, 177], + "lines": [50], "starting_column": 9, - "ending_column": 10 + "ending_column": 100 }, "type_specific_fields": { "parent": { "type": "function", - "name": "removeCollateral", + "name": "_safeTransfer", "source_mapping": { - "start": 6498, - "length": 1031, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 1892, + "length": 284, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [ - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190 - ], + "lines": [49, 50, 51, 52], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "removeCollateral(uint128,address)" + "signature": "_safeTransfer(address,address,uint256)" } } }, @@ -29983,32 +24847,33 @@ }, { "type": "node", - "name": "totalCollateral -= amount", + "name": "IUniswapV2Callee(to).uniswapV2Call(msg.sender,amount0Out,amount1Out,data)", "source_mapping": { - "start": 7285, - "length": 25, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 7593, + "length": 76, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [181], - "starting_column": 9, - "ending_column": 34 + "lines": [155], + "starting_column": 30, + "ending_column": 106 }, "type_specific_fields": { "parent": { "type": "function", - "name": "removeCollateral", + "name": "swap", "source_mapping": { - "start": 6498, - "length": 1031, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 6644, + "length": 1950, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190 + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170 ], "starting_column": 5, "ending_column": 6 @@ -30016,365 +24881,205 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "removeCollateral(uint128,address)" + "signature": "swap(uint256,uint256,address,bytes)" } } }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "totalCollateral" - } - } - ], - "description": "Reentrancy in TempleLineOfCredit.removeCollateral(uint128,address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#166-190):\n\tExternal calls:\n\t- circuitBreakerProxy.preCheck(address(templeToken),msg.sender,amount) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#173-177)\n\tState variables written after the call(s):\n\t- totalCollateral -= amount (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#181)\n", - "markdown": "Reentrancy in [TempleLineOfCredit.removeCollateral(uint128,address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L166-L190):\n\tExternal calls:\n\t- [circuitBreakerProxy.preCheck(address(templeToken),msg.sender,amount)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L173-L177)\n\tState variables written after the call(s):\n\t- [totalCollateral -= amount](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L181)\n", - "first_markdown_element": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L166-L190", - "id": "7e54b77ff600dbf6c2607432f645013fef59227e4ff7c91d2c9c62ef8ddf1980", - "check": "reentrancy-benign", - "impact": "Low", - "confidence": "Medium" - }, - { - "elements": [ + "additional_fields": { "underlying_type": "external_calls" } + }, { - "type": "function", - "name": "setTlcStrategy", + "type": "node", + "name": "Swap(msg.sender,amount0In,amount1In,amount0Out,amount1Out,to)", "source_mapping": { - "start": 15688, - "length": 875, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 8516, + "length": 71, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [ - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410 - ], - "starting_column": 5, - "ending_column": 6 + "lines": [169], + "starting_column": 9, + "ending_column": 80 }, "type_specific_fields": { "parent": { - "type": "contract", - "name": "TempleLineOfCredit", + "type": "function", + "name": "swap", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 6644, + "length": 1950, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, - 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, - 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, - 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, - 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, - 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, - 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, - 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, - 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, - 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, - 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, - 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, - 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, - 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, - 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, - 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, - 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, - 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, - 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, - 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, - 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, - 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, - 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, - 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, - 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, - 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, - 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, - 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, - 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, - 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, - 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, - 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, - 874, 875, 876, 877, 878, 879, 880, 881, 882 + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170 ], - "starting_column": 1, - "ending_column": 0 + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleUniswapV2Pair", + "source_mapping": { + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "is_dependency": false, + "lines": [ + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "swap(uint256,uint256,address,bytes)" } - }, - "signature": "setTlcStrategy(address)" - } + } + }, + "additional_fields": { "underlying_type": "event" } }, { "type": "node", - "name": "daiToken.safeApprove(previousTrv,0)", + "name": "Sync(reserve0,reserve1)", "source_mapping": { - "start": 16002, - "length": 36, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 3918, + "length": 29, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [394], - "starting_column": 13, - "ending_column": 49 + "lines": [92], + "starting_column": 9, + "ending_column": 38 }, "type_specific_fields": { "parent": { "type": "function", - "name": "setTlcStrategy", + "name": "_update", "source_mapping": { - "start": 15688, - "length": 875, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 3107, + "length": 847, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [ - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410 - ], + "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "setTlcStrategy(address)" + "signature": "_update(uint256,uint256,uint112,uint112)" } } }, - "additional_fields": { "underlying_type": "external_calls" } + "additional_fields": { "underlying_type": "event" } }, { "type": "node", - "name": "daiToken.safeApprove(_trv,0)", + "name": "_update(balance0,balance1,_reserve0,_reserve1)", "source_mapping": { - "start": 16249, - "length": 29, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 8457, + "length": 49, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [402], - "starting_column": 13, - "ending_column": 42 + "lines": [168], + "starting_column": 9, + "ending_column": 58 }, "type_specific_fields": { "parent": { "type": "function", - "name": "setTlcStrategy", + "name": "swap", "source_mapping": { - "start": 15688, - "length": 875, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 6644, + "length": 1950, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410 + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170 ], "starting_column": 5, "ending_column": 6 @@ -30382,124 +25087,174 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "setTlcStrategy(address)" + "signature": "swap(uint256,uint256,address,bytes)" } } }, - "additional_fields": { "underlying_type": "external_calls" } + "additional_fields": { "underlying_type": "event" } + } + ], + "description": "Reentrancy in TempleUniswapV2Pair.swap(uint256,uint256,address,bytes) (contracts/amm/TempleUniswapV2Pair.sol#141-170):\n\tExternal calls:\n\t- _safeTransfer(_token0,to,amount0Out) (contracts/amm/TempleUniswapV2Pair.sol#153)\n\t\t- (success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value)) (contracts/amm/TempleUniswapV2Pair.sol#50)\n\t- _safeTransfer(_token1,to,amount1Out) (contracts/amm/TempleUniswapV2Pair.sol#154)\n\t\t- (success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value)) (contracts/amm/TempleUniswapV2Pair.sol#50)\n\t- IUniswapV2Callee(to).uniswapV2Call(msg.sender,amount0Out,amount1Out,data) (contracts/amm/TempleUniswapV2Pair.sol#155)\n\tEvent emitted after the call(s):\n\t- Swap(msg.sender,amount0In,amount1In,amount0Out,amount1Out,to) (contracts/amm/TempleUniswapV2Pair.sol#169)\n\t- Sync(reserve0,reserve1) (contracts/amm/TempleUniswapV2Pair.sol#92)\n\t\t- _update(balance0,balance1,_reserve0,_reserve1) (contracts/amm/TempleUniswapV2Pair.sol#168)\n", + "markdown": "Reentrancy in [TempleUniswapV2Pair.swap(uint256,uint256,address,bytes)](contracts/amm/TempleUniswapV2Pair.sol#L141-L170):\n\tExternal calls:\n\t- [_safeTransfer(_token0,to,amount0Out)](contracts/amm/TempleUniswapV2Pair.sol#L153)\n\t\t- [(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))](contracts/amm/TempleUniswapV2Pair.sol#L50)\n\t- [_safeTransfer(_token1,to,amount1Out)](contracts/amm/TempleUniswapV2Pair.sol#L154)\n\t\t- [(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))](contracts/amm/TempleUniswapV2Pair.sol#L50)\n\t- [IUniswapV2Callee(to).uniswapV2Call(msg.sender,amount0Out,amount1Out,data)](contracts/amm/TempleUniswapV2Pair.sol#L155)\n\tEvent emitted after the call(s):\n\t- [Swap(msg.sender,amount0In,amount1In,amount0Out,amount1Out,to)](contracts/amm/TempleUniswapV2Pair.sol#L169)\n\t- [Sync(reserve0,reserve1)](contracts/amm/TempleUniswapV2Pair.sol#L92)\n\t\t- [_update(balance0,balance1,_reserve0,_reserve1)](contracts/amm/TempleUniswapV2Pair.sol#L168)\n", + "first_markdown_element": "contracts/amm/TempleUniswapV2Pair.sol#L141-L170", + "id": "702607b50ee9e5b85f6e9be980d2529af09be332237e0acb690cb814df52cb87", + "check": "reentrancy-events", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "_burnDToken", + "source_mapping": { + "start": 29999, + "length": 1179, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "is_dependency": false, + "lines": [ + 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, + 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, + 703, 704, 705, 706, 707, 708, 709 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TreasuryReservesVault", + "source_mapping": { + "start": 2150, + "length": 32023, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "is_dependency": false, + "lines": [ + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, + 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, + 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, + 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, + 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, + 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, + 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, + 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, + 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, + 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, + 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, + 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, + 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, + 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, + 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, + 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, + 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, + 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, + 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, + 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, + 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, + 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, + 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, + 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, + 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, + 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, + 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, + 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, + 771, 772, 773, 774, 775, 776, 777, 778, 779 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "_burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" + } }, { "type": "node", - "name": "daiToken.safeIncreaseAllowance(_trv,type()(uint256).max)", + "name": "_burnedAmount = tokenConfig.dToken.burn(strategy,toBurnAmount)", "source_mapping": { - "start": 16292, - "length": 55, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 30398, + "length": 71, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [403], - "starting_column": 13, - "ending_column": 68 + "lines": [688], + "starting_column": 9, + "ending_column": 80 }, "type_specific_fields": { "parent": { "type": "function", - "name": "setTlcStrategy", + "name": "_burnDToken", "source_mapping": { - "start": 15688, - "length": 875, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 29999, + "length": 1179, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, "lines": [ - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410 + 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, + 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, + 703, 704, 705, 706, 707, 708, 709 ], "starting_column": 5, "ending_column": 6 @@ -30507,91 +25262,82 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "TreasuryReservesVault", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 2150, + "length": 32023, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, + 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, + 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, + 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, + 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, + 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, + 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, + 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, + 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, + 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, + 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, + 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, + 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, + 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, + 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, + 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, + 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, + 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, + 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, + 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, + 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, + 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, + 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, + 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, + 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, + 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, + 777, 778, 779 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "setTlcStrategy(address)" + "signature": "_burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" } } }, @@ -30599,32 +25345,33 @@ }, { "type": "node", - "name": "daiToken.safeApprove(previousTrv,0)", + "name": "StrategyCreditAndDebtBalance(strategy,address(token),_creditBalance,dTokenBalance)", "source_mapping": { - "start": 16002, - "length": 36, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 31081, + "length": 90, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [394], - "starting_column": 13, - "ending_column": 49 + "lines": [708], + "starting_column": 9, + "ending_column": 99 }, "type_specific_fields": { "parent": { "type": "function", - "name": "setTlcStrategy", + "name": "_burnDToken", "source_mapping": { - "start": 15688, - "length": 875, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 29999, + "length": 1179, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, "lines": [ - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410 + 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, + 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, + 703, 704, 705, 706, 707, 708, 709 ], "starting_column": 5, "ending_column": 6 @@ -30632,982 +25379,684 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "TreasuryReservesVault", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 2150, + "length": 32023, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, + 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, + 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, + 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, + 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, + 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, + 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, + 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, + 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, + 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, + 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, + 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, + 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, + 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, + 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, + 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, + 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, + 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, + 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, + 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, + 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, + 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, + 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, + 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, + 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, + 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, + 777, 778, 779 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "setTlcStrategy(address)" + "signature": "_burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } - }, + "additional_fields": { "underlying_type": "event" } + } + ], + "description": "Reentrancy in TreasuryReservesVault._burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256) (contracts/v2/TreasuryReservesVault.sol#677-709):\n\tExternal calls:\n\t- _burnedAmount = tokenConfig.dToken.burn(strategy,toBurnAmount) (contracts/v2/TreasuryReservesVault.sol#688)\n\tEvent emitted after the call(s):\n\t- StrategyCreditAndDebtBalance(strategy,address(token),_creditBalance,dTokenBalance) (contracts/v2/TreasuryReservesVault.sol#708)\n", + "markdown": "Reentrancy in [TreasuryReservesVault._burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)](contracts/v2/TreasuryReservesVault.sol#L677-L709):\n\tExternal calls:\n\t- [_burnedAmount = tokenConfig.dToken.burn(strategy,toBurnAmount)](contracts/v2/TreasuryReservesVault.sol#L688)\n\tEvent emitted after the call(s):\n\t- [StrategyCreditAndDebtBalance(strategy,address(token),_creditBalance,dTokenBalance)](contracts/v2/TreasuryReservesVault.sol#L708)\n", + "first_markdown_element": "contracts/v2/TreasuryReservesVault.sol#L677-L709", + "id": "39b30f51cb8e0f3bb137afd7388e494f2a117088a846eb999e1fe7c8a4337328", + "check": "reentrancy-events", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ { - "type": "node", - "name": "daiToken.safeApprove(_trv,0)", + "type": "function", + "name": "_doShutdown", "source_mapping": { - "start": 16249, - "length": 29, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 12280, + "length": 502, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [402], - "starting_column": 13, - "ending_column": 42 + "lines": [293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303], + "starting_column": 5, + "ending_column": 6 }, "type_specific_fields": { "parent": { - "type": "function", - "name": "setTlcStrategy", + "type": "contract", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 15688, - "length": 875, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306 ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleLineOfCredit", - "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "setTlcStrategy(address)" + "starting_column": 1, + "ending_column": 0 } - } - }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + }, + "signature": "_doShutdown(bytes)" + } }, { "type": "node", - "name": "daiToken.safeIncreaseAllowance(_trv,type()(uint256).max)", + "name": "(daiAvailable,sharesAvailable) = _checkpointDaiBalance()", "source_mapping": { - "start": 16292, - "length": 55, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 12387, + "length": 74, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [403], - "starting_column": 13, - "ending_column": 68 + "lines": [295], + "starting_column": 9, + "ending_column": 83 }, "type_specific_fields": { "parent": { "type": "function", - "name": "setTlcStrategy", + "name": "_doShutdown", "source_mapping": { - "start": 15688, - "length": 875, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 12280, + "length": 502, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [ - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410 - ], + "lines": [293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "setTlcStrategy(address)" + "signature": "_doShutdown(bytes)" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "_updateInterestRates(_debtTokenCache())", + "name": "chi = pot.drip()", "source_mapping": { - "start": 16517, - "length": 39, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 5566, + "length": 60, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [409], + "lines": [142], "starting_column": 9, - "ending_column": 48 + "ending_column": 69 }, "type_specific_fields": { "parent": { "type": "function", - "name": "setTlcStrategy", + "name": "_checkpointChi", "source_mapping": { - "start": 15688, - "length": 875, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 5445, + "length": 188, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [ - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410 - ], + "lines": [140, 141, 142, 143], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "setTlcStrategy(address)" + "signature": "_checkpointChi()" } } }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "debtTokenData" - } + "additional_fields": { "underlying_type": "external_calls_sending_eth" } }, { "type": "node", - "name": "debtTokenData.interestAccumulatorUpdatedAt = uint32(block.timestamp)", + "name": "_dsrWithdrawal(sharesAvailable,daiAvailable)", "source_mapping": { - "start": 26022, - "length": 68, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 12471, + "length": 45, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [665], - "starting_column": 13, - "ending_column": 81 + "lines": [296], + "starting_column": 9, + "ending_column": 54 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_debtTokenCache", + "name": "_doShutdown", "source_mapping": { - "start": 25878, - "length": 359, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 12280, + "length": 502, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [661, 662, 663, 664, 665, 666, 667, 668, 669], + "lines": [293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_debtTokenCache()" + "signature": "_doShutdown(bytes)" } } }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "debtTokenData" - } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "debtTokenData.totalDebt = cache.totalDebt", + "name": "pot.exit(sharesAmount)", "source_mapping": { - "start": 26104, - "length": 41, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 11597, + "length": 22, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [666], - "starting_column": 13, - "ending_column": 54 + "lines": [279], + "starting_column": 9, + "ending_column": 31 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_debtTokenCache", + "name": "_dsrWithdrawal", "source_mapping": { - "start": 25878, - "length": 359, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 11513, + "length": 199, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [661, 662, 663, 664, 665, 666, 667, 668, 669], + "lines": [278, 279, 280, 281, 282], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_debtTokenCache()" + "signature": "_dsrWithdrawal(uint256,uint256)" } } }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "debtTokenData" - } + "additional_fields": { "underlying_type": "external_calls_sending_eth" } }, { "type": "node", - "name": "debtTokenData.interestAccumulator = cache.interestAccumulator", + "name": "daiJoin.exit(address(this),daiAmount)", "source_mapping": { - "start": 26159, - "length": 61, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 11629, + "length": 38, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [667], - "starting_column": 13, - "ending_column": 74 + "lines": [280], + "starting_column": 9, + "ending_column": 47 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_debtTokenCache", + "name": "_dsrWithdrawal", "source_mapping": { - "start": 25878, - "length": 359, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 11513, + "length": 199, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [661, 662, 663, 664, 665, 666, 667, 668, 669], + "lines": [278, 279, 280, 281, 282], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "_dsrWithdrawal(uint256,uint256)" + } + } + }, + "additional_fields": { "underlying_type": "external_calls_sending_eth" } + }, + { + "type": "node", + "name": "DaiWithdrawn(daiAmount)", + "source_mapping": { + "start": 11677, + "length": 28, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "is_dependency": false, + "lines": [281], + "starting_column": 9, + "ending_column": 37 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "_dsrWithdrawal", + "source_mapping": { + "start": 11513, + "length": 199, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "is_dependency": false, + "lines": [278, 279, 280, 281, 282], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DsrBaseStrategy", + "source_mapping": { + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "is_dependency": false, + "lines": [ + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_debtTokenCache()" + "signature": "_dsrWithdrawal(uint256,uint256)" } } }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "debtTokenData" - } + "additional_fields": { "underlying_type": "event" } }, { "type": "node", - "name": "debtTokenData.interestRate = _cache.interestRate = newInterestRate", + "name": "_dsrWithdrawal(sharesAvailable,daiAvailable)", "source_mapping": { - "start": 27090, - "length": 66, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 12471, + "length": 45, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [695], - "starting_column": 13, - "ending_column": 79 + "lines": [296], + "starting_column": 9, + "ending_column": 54 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_updateInterestRates", + "name": "_doShutdown", "source_mapping": { - "start": 26678, - "length": 495, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 12280, + "length": 502, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [ - 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697 - ], + "lines": [293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_updateInterestRates(TempleLineOfCredit.DebtTokenCache)" + "signature": "_doShutdown(bytes)" } } }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "debtTokenData" - } + "additional_fields": { "underlying_type": "event" } } ], - "description": "Reentrancy in TempleLineOfCredit.setTlcStrategy(address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#386-410):\n\tExternal calls:\n\t- daiToken.safeApprove(previousTrv,0) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#394)\n\t- daiToken.safeApprove(_trv,0) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#402)\n\t- daiToken.safeIncreaseAllowance(_trv,type()(uint256).max) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#403)\n\tState variables written after the call(s):\n\t- _updateInterestRates(_debtTokenCache()) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#409)\n\t\t- debtTokenData.interestAccumulatorUpdatedAt = uint32(block.timestamp) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#665)\n\t\t- debtTokenData.totalDebt = cache.totalDebt (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#666)\n\t\t- debtTokenData.interestAccumulator = cache.interestAccumulator (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#667)\n\t\t- debtTokenData.interestRate = _cache.interestRate = newInterestRate (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#695)\n", - "markdown": "Reentrancy in [TempleLineOfCredit.setTlcStrategy(address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L386-L410):\n\tExternal calls:\n\t- [daiToken.safeApprove(previousTrv,0)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L394)\n\t- [daiToken.safeApprove(_trv,0)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L402)\n\t- [daiToken.safeIncreaseAllowance(_trv,type()(uint256).max)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L403)\n\tState variables written after the call(s):\n\t- [_updateInterestRates(_debtTokenCache())](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L409)\n\t\t- [debtTokenData.interestAccumulatorUpdatedAt = uint32(block.timestamp)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L665)\n\t\t- [debtTokenData.totalDebt = cache.totalDebt](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L666)\n\t\t- [debtTokenData.interestAccumulator = cache.interestAccumulator](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L667)\n\t\t- [debtTokenData.interestRate = _cache.interestRate = newInterestRate](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L695)\n", - "first_markdown_element": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L386-L410", - "id": "b016595bfbb96ee22807a9aeccb42614ab40898da522deed273d06aa961473ff", - "check": "reentrancy-benign", + "description": "Reentrancy in DsrBaseStrategy._doShutdown(bytes) (contracts/v2/strategies/DsrBaseStrategy.sol#293-303):\n\tExternal calls:\n\t- (daiAvailable,sharesAvailable) = _checkpointDaiBalance() (contracts/v2/strategies/DsrBaseStrategy.sol#295)\n\t\t- chi = pot.drip() (contracts/v2/strategies/DsrBaseStrategy.sol#142)\n\t- _dsrWithdrawal(sharesAvailable,daiAvailable) (contracts/v2/strategies/DsrBaseStrategy.sol#296)\n\t\t- pot.exit(sharesAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#279)\n\t\t- daiJoin.exit(address(this),daiAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#280)\n\tEvent emitted after the call(s):\n\t- DaiWithdrawn(daiAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#281)\n\t\t- _dsrWithdrawal(sharesAvailable,daiAvailable) (contracts/v2/strategies/DsrBaseStrategy.sol#296)\n", + "markdown": "Reentrancy in [DsrBaseStrategy._doShutdown(bytes)](contracts/v2/strategies/DsrBaseStrategy.sol#L293-L303):\n\tExternal calls:\n\t- [(daiAvailable,sharesAvailable) = _checkpointDaiBalance()](contracts/v2/strategies/DsrBaseStrategy.sol#L295)\n\t\t- [chi = pot.drip()](contracts/v2/strategies/DsrBaseStrategy.sol#L142)\n\t- [_dsrWithdrawal(sharesAvailable,daiAvailable)](contracts/v2/strategies/DsrBaseStrategy.sol#L296)\n\t\t- [pot.exit(sharesAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L279)\n\t\t- [daiJoin.exit(address(this),daiAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L280)\n\tEvent emitted after the call(s):\n\t- [DaiWithdrawn(daiAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L281)\n\t\t- [_dsrWithdrawal(sharesAvailable,daiAvailable)](contracts/v2/strategies/DsrBaseStrategy.sol#L296)\n", + "first_markdown_element": "contracts/v2/strategies/DsrBaseStrategy.sol#L293-L303", + "id": "2d01281faf7161866f00d8f2c914cd6f900f84c01032af46a90491363ac26414", + "check": "reentrancy-events", "impact": "Low", "confidence": "Medium" }, @@ -31615,110 +26064,129 @@ "elements": [ { "type": "function", - "name": "createExposure", + "name": "_dsrDeposit", "source_mapping": { - "start": 1322, - "length": 415, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 8061, + "length": 349, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [45, 46, 47, 48, 49, 50, 51, 52, 53, 54], + "lines": [201, 202, 203, 204, 205, 206, 207, 208, 209], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "OpsManager", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 388, - "length": 6435, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "createExposure(string,string,IERC20)" + "signature": "_dsrDeposit(uint256)" } }, { "type": "node", - "name": "exposure = OpsManagerLib.createExposure(name,symbol,revalToken,pools)", + "name": "shares = _rdiv(amount,_checkpointChi())", "source_mapping": { - "start": 1526, - "length": 81, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 8248, + "length": 48, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [51], + "lines": [204], "starting_column": 9, - "ending_column": 90 + "ending_column": 57 }, "type_specific_fields": { "parent": { "type": "function", - "name": "createExposure", + "name": "_dsrDeposit", "source_mapping": { - "start": 1322, - "length": 415, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 8061, + "length": 349, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [45, 46, 47, 48, 49, 50, 51, 52, 53, 54], + "lines": [201, 202, 203, 204, 205, 206, 207, 208, 209], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "OpsManager", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 388, - "length": 6435, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "createExposure(string,string,IERC20)" + "signature": "_dsrDeposit(uint256)" } } }, @@ -31726,64 +26194,74 @@ }, { "type": "node", - "name": "exposure = OpsManagerLib.createExposure(name,symbol,revalToken,pools)", + "name": "chi = pot.drip()", "source_mapping": { - "start": 1526, - "length": 81, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 5566, + "length": 60, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [51], + "lines": [142], "starting_column": 9, - "ending_column": 90 + "ending_column": 69 }, "type_specific_fields": { "parent": { "type": "function", - "name": "createExposure", + "name": "_checkpointChi", "source_mapping": { - "start": 1322, - "length": 415, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 5445, + "length": 188, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [45, 46, 47, 48, 49, 50, 51, 52, 53, 54], + "lines": [140, 141, 142, 143], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "OpsManager", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 388, - "length": 6435, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "createExposure(string,string,IERC20)" + "signature": "_checkpointChi()" } } }, @@ -31791,78 +26269,85 @@ }, { "type": "node", - "name": "revalTokens.push(address(revalToken))", + "name": "DaiDeposited(amount)", "source_mapping": { - "start": 1617, - "length": 37, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 8307, + "length": 25, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [52], + "lines": [206], "starting_column": 9, - "ending_column": 46 + "ending_column": 34 }, "type_specific_fields": { "parent": { "type": "function", - "name": "createExposure", + "name": "_dsrDeposit", "source_mapping": { - "start": 1322, - "length": 415, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 8061, + "length": 349, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [45, 46, 47, 48, 49, 50, 51, 52, 53, 54], + "lines": [201, 202, 203, 204, 205, 206, 207, 208, 209], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "OpsManager", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 388, - "length": 6435, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "createExposure(string,string,IERC20)" + "signature": "_dsrDeposit(uint256)" } } }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "revalTokens" - } + "additional_fields": { "underlying_type": "event" } } ], - "description": "Reentrancy in OpsManager.createExposure(string,string,IERC20) (contracts/core/OpsManager.sol#45-54):\n\tExternal calls:\n\t- exposure = OpsManagerLib.createExposure(name,symbol,revalToken,pools) (contracts/core/OpsManager.sol#51)\n\tState variables written after the call(s):\n\t- revalTokens.push(address(revalToken)) (contracts/core/OpsManager.sol#52)\n", - "markdown": "Reentrancy in [OpsManager.createExposure(string,string,IERC20)](contracts/core/OpsManager.sol#L45-L54):\n\tExternal calls:\n\t- [exposure = OpsManagerLib.createExposure(name,symbol,revalToken,pools)](contracts/core/OpsManager.sol#L51)\n\tState variables written after the call(s):\n\t- [revalTokens.push(address(revalToken))](contracts/core/OpsManager.sol#L52)\n", - "first_markdown_element": "contracts/core/OpsManager.sol#L45-L54", - "id": "51556a077db66dfc3240e846360a26235f1360662907e56d0702b662359b5526", - "check": "reentrancy-benign", + "description": "Reentrancy in DsrBaseStrategy._dsrDeposit(uint256) (contracts/v2/strategies/DsrBaseStrategy.sol#201-209):\n\tExternal calls:\n\t- shares = _rdiv(amount,_checkpointChi()) (contracts/v2/strategies/DsrBaseStrategy.sol#204)\n\t\t- chi = pot.drip() (contracts/v2/strategies/DsrBaseStrategy.sol#142)\n\tEvent emitted after the call(s):\n\t- DaiDeposited(amount) (contracts/v2/strategies/DsrBaseStrategy.sol#206)\n", + "markdown": "Reentrancy in [DsrBaseStrategy._dsrDeposit(uint256)](contracts/v2/strategies/DsrBaseStrategy.sol#L201-L209):\n\tExternal calls:\n\t- [shares = _rdiv(amount,_checkpointChi())](contracts/v2/strategies/DsrBaseStrategy.sol#L204)\n\t\t- [chi = pot.drip()](contracts/v2/strategies/DsrBaseStrategy.sol#L142)\n\tEvent emitted after the call(s):\n\t- [DaiDeposited(amount)](contracts/v2/strategies/DsrBaseStrategy.sol#L206)\n", + "first_markdown_element": "contracts/v2/strategies/DsrBaseStrategy.sol#L201-L209", + "id": "d7b6d2a10c4c72fb8ed18e875155e8f19fb9578527302b34acf8ce0824782543", + "check": "reentrancy-events", "impact": "Low", "confidence": "Medium" }, @@ -31870,97 +26355,129 @@ "elements": [ { "type": "function", - "name": "decreaseShares", + "name": "_dsrWithdrawal", "source_mapping": { - "start": 2355, - "length": 302, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 11513, + "length": 199, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [69, 70, 71, 72, 73, 74, 75, 76, 77], + "lines": [278, 279, 280, 281, 282], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryFarmingRevenue", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 547, - "length": 3059, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "decreaseShares(address,uint256)" + "signature": "_dsrWithdrawal(uint256,uint256)" } }, { "type": "node", - "name": "claimFor(account)", + "name": "pot.exit(sharesAmount)", "source_mapping": { - "start": 2441, - "length": 17, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 11597, + "length": 22, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [70], + "lines": [279], "starting_column": 9, - "ending_column": 26 + "ending_column": 31 }, "type_specific_fields": { "parent": { "type": "function", - "name": "decreaseShares", + "name": "_dsrWithdrawal", "source_mapping": { - "start": 2355, - "length": 302, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 11513, + "length": 199, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [69, 70, 71, 72, 73, 74, 75, 76, 77], + "lines": [278, 279, 280, 281, 282], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryFarmingRevenue", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 547, - "length": 3059, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "decreaseShares(address,uint256)" + "signature": "_dsrWithdrawal(uint256,uint256)" } } }, @@ -31968,245 +26485,499 @@ }, { "type": "node", - "name": "exposure.mint(account,unclaimedScaled / SCALING_FACTOR)", + "name": "daiJoin.exit(address(this),daiAmount)", "source_mapping": { - "start": 3194, - "length": 56, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 11629, + "length": 38, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [91], + "lines": [280], "starting_column": 9, - "ending_column": 65 + "ending_column": 47 }, "type_specific_fields": { "parent": { "type": "function", - "name": "claimFor", + "name": "_dsrWithdrawal", "source_mapping": { - "start": 2718, - "length": 611, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 11513, + "length": 199, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], + "lines": [278, 279, 280, 281, 282], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryFarmingRevenue", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 547, - "length": 3059, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "claimFor(address)" + "signature": "_dsrWithdrawal(uint256,uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "claimFor(account)", + "name": "DaiWithdrawn(daiAmount)", "source_mapping": { - "start": 2441, - "length": 17, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 11677, + "length": 28, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [70], + "lines": [281], "starting_column": 9, - "ending_column": 26 + "ending_column": 37 }, "type_specific_fields": { "parent": { "type": "function", - "name": "decreaseShares", + "name": "_dsrWithdrawal", "source_mapping": { - "start": 2355, - "length": 302, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 11513, + "length": 199, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [69, 70, 71, 72, 73, 74, 75, 76, 77], + "lines": [278, 279, 280, 281, 282], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryFarmingRevenue", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 547, - "length": 3059, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "decreaseShares(address,uint256)" + "signature": "_dsrWithdrawal(uint256,uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + "additional_fields": { "underlying_type": "event" } + } + ], + "description": "Reentrancy in DsrBaseStrategy._dsrWithdrawal(uint256,uint256) (contracts/v2/strategies/DsrBaseStrategy.sol#278-282):\n\tExternal calls:\n\t- pot.exit(sharesAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#279)\n\t- daiJoin.exit(address(this),daiAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#280)\n\tEvent emitted after the call(s):\n\t- DaiWithdrawn(daiAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#281)\n", + "markdown": "Reentrancy in [DsrBaseStrategy._dsrWithdrawal(uint256,uint256)](contracts/v2/strategies/DsrBaseStrategy.sol#L278-L282):\n\tExternal calls:\n\t- [pot.exit(sharesAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L279)\n\t- [daiJoin.exit(address(this),daiAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L280)\n\tEvent emitted after the call(s):\n\t- [DaiWithdrawn(daiAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L281)\n", + "first_markdown_element": "contracts/v2/strategies/DsrBaseStrategy.sol#L278-L282", + "id": "d35e410305415164f2083f99e160a70431f3fb38caf25144473d47103896e96b", + "check": "reentrancy-events", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "_mintDToken", + "source_mapping": { + "start": 28533, + "length": 1205, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "is_dependency": false, + "lines": [ + 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, + 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, + 664, 665, 666, 667, 668, 669, 670 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TreasuryReservesVault", + "source_mapping": { + "start": 2150, + "length": 32023, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "is_dependency": false, + "lines": [ + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, + 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, + 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, + 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, + 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, + 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, + 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, + 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, + 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, + 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, + 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, + 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, + 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, + 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, + 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, + 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, + 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, + 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, + 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, + 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, + 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, + 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, + 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, + 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, + 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, + 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, + 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, + 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, + 771, 772, 773, 774, 775, 776, 777, 778, 779 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "_mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" + } }, { "type": "node", - "name": "exposure.mint(account,unclaimedScaled / SCALING_FACTOR)", + "name": "tokenConfig.dToken.mint(strategy,_newDebt)", "source_mapping": { - "start": 3194, - "length": 56, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 29294, + "length": 43, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [91], - "starting_column": 9, - "ending_column": 65 + "lines": [657], + "starting_column": 13, + "ending_column": 56 }, "type_specific_fields": { "parent": { "type": "function", - "name": "claimFor", + "name": "_mintDToken", "source_mapping": { - "start": 2718, - "length": 611, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 28533, + "length": 1205, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], + "lines": [ + 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, + 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, + 664, 665, 666, 667, 668, 669, 670 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryFarmingRevenue", + "name": "TreasuryReservesVault", "source_mapping": { - "start": 547, - "length": 3059, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 2150, + "length": 32023, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100 + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, + 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, + 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, + 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, + 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, + 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, + 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, + 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, + 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, + 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, + 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, + 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, + 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, + 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, + 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, + 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, + 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, + 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, + 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, + 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, + 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, + 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, + 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, + 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, + 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, + 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, + 777, 778, 779 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "claimFor(address)" + "signature": "_mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "totalShares -= amount", + "name": "StrategyCreditAndDebtBalance(strategy,address(token),_creditBalance,dTokenBalance)", "source_mapping": { - "start": 2504, - "length": 21, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 29641, + "length": 90, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [73], + "lines": [669], "starting_column": 9, - "ending_column": 30 + "ending_column": 99 }, "type_specific_fields": { "parent": { "type": "function", - "name": "decreaseShares", + "name": "_mintDToken", "source_mapping": { - "start": 2355, - "length": 302, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 28533, + "length": 1205, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [69, 70, 71, 72, 73, 74, 75, 76, 77], + "lines": [ + 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, + 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, + 664, 665, 666, 667, 668, 669, 670 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryFarmingRevenue", + "name": "TreasuryReservesVault", "source_mapping": { - "start": 547, - "length": 3059, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 2150, + "length": 32023, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100 + "lines": [ + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, + 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, + 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, + 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, + 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, + 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, + 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, + 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, + 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, + 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, + 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, + 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, + 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, + 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, + 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, + 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, + 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, + 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, + 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, + 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, + 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, + 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, + 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, + 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, + 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, + 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, + 777, 778, 779 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "decreaseShares(address,uint256)" + "signature": "_mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" } } }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "totalShares" - } + "additional_fields": { "underlying_type": "event" } } ], - "description": "Reentrancy in TreasuryFarmingRevenue.decreaseShares(address,uint256) (contracts/core/TreasuryFarmingRevenue.sol#69-77):\n\tExternal calls:\n\t- claimFor(account) (contracts/core/TreasuryFarmingRevenue.sol#70)\n\t\t- exposure.mint(account,unclaimedScaled / SCALING_FACTOR) (contracts/core/TreasuryFarmingRevenue.sol#91)\n\tState variables written after the call(s):\n\t- totalShares -= amount (contracts/core/TreasuryFarmingRevenue.sol#73)\n", - "markdown": "Reentrancy in [TreasuryFarmingRevenue.decreaseShares(address,uint256)](contracts/core/TreasuryFarmingRevenue.sol#L69-L77):\n\tExternal calls:\n\t- [claimFor(account)](contracts/core/TreasuryFarmingRevenue.sol#L70)\n\t\t- [exposure.mint(account,unclaimedScaled / SCALING_FACTOR)](contracts/core/TreasuryFarmingRevenue.sol#L91)\n\tState variables written after the call(s):\n\t- [totalShares -= amount](contracts/core/TreasuryFarmingRevenue.sol#L73)\n", - "first_markdown_element": "contracts/core/TreasuryFarmingRevenue.sol#L69-L77", - "id": "0b0602eac2622c580688b404d63d57f1596371f95c0951d2b30d3754c6a94161", - "check": "reentrancy-benign", + "description": "Reentrancy in TreasuryReservesVault._mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256) (contracts/v2/TreasuryReservesVault.sol#638-670):\n\tExternal calls:\n\t- tokenConfig.dToken.mint(strategy,_newDebt) (contracts/v2/TreasuryReservesVault.sol#657)\n\tEvent emitted after the call(s):\n\t- StrategyCreditAndDebtBalance(strategy,address(token),_creditBalance,dTokenBalance) (contracts/v2/TreasuryReservesVault.sol#669)\n", + "markdown": "Reentrancy in [TreasuryReservesVault._mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)](contracts/v2/TreasuryReservesVault.sol#L638-L670):\n\tExternal calls:\n\t- [tokenConfig.dToken.mint(strategy,_newDebt)](contracts/v2/TreasuryReservesVault.sol#L657)\n\tEvent emitted after the call(s):\n\t- [StrategyCreditAndDebtBalance(strategy,address(token),_creditBalance,dTokenBalance)](contracts/v2/TreasuryReservesVault.sol#L669)\n", + "first_markdown_element": "contracts/v2/TreasuryReservesVault.sol#L638-L670", + "id": "d06d6a53d0451e137729438d3e1093db6d5e7f0f78494fe8b2a70bd44b393675", + "check": "reentrancy-events", "impact": "Low", "confidence": "Medium" }, @@ -32214,97 +26985,212 @@ "elements": [ { "type": "function", - "name": "increaseShares", + "name": "_withdrawFromBaseStrategy", "source_mapping": { - "start": 1987, - "length": 302, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 25804, + "length": 2552, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [56, 57, 58, 59, 60, 61, 62, 63, 64], + "lines": [ + 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, + 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, + 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, + 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryFarmingRevenue", + "name": "TreasuryReservesVault", "source_mapping": { - "start": 547, - "length": 3059, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 2150, + "length": 32023, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100 + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, + 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, + 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, + 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, + 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, + 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, + 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, + 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, + 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, + 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, + 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, + 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, + 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, + 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, + 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, + 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, + 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, + 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, + 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, + 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, + 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, + 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, + 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, + 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, + 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, + 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, + 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, + 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, + 771, 772, 773, 774, 775, 776, 777, 778, 779 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "increaseShares(address,uint256)" + "signature": "_withdrawFromBaseStrategy(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,address,uint256)" } }, { "type": "node", - "name": "claimFor(account)", + "name": "_withdrawnAmount = _baseStrategy.trvWithdraw(_withdrawFromBaseStrategyAmount)", "source_mapping": { - "start": 2073, - "length": 17, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 27290, + "length": 85, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [57], - "starting_column": 9, - "ending_column": 26 + "lines": [608], + "starting_column": 17, + "ending_column": 102 }, "type_specific_fields": { "parent": { "type": "function", - "name": "increaseShares", + "name": "_withdrawFromBaseStrategy", "source_mapping": { - "start": 1987, - "length": 302, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 25804, + "length": 2552, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [56, 57, 58, 59, 60, 61, 62, 63, 64], + "lines": [ + 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, + 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, + 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, + 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryFarmingRevenue", + "name": "TreasuryReservesVault", "source_mapping": { - "start": 547, - "length": 3059, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 2150, + "length": 32023, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100 + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, + 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, + 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, + 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, + 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, + 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, + 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, + 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, + 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, + 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, + 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, + 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, + 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, + 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, + 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, + 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, + 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, + 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, + 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, + 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, + 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, + 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, + 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, + 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, + 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, + 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, + 777, 778, 779 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "increaseShares(address,uint256)" + "signature": "_withdrawFromBaseStrategy(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,address,uint256)" } } }, @@ -32312,245 +27198,480 @@ }, { "type": "node", - "name": "exposure.mint(account,unclaimedScaled / SCALING_FACTOR)", + "name": "_burnDToken(_baseStrategyAddr,strategies[_baseStrategyAddr],token,tokenConfig,_withdrawnAmount,tokenConfig.dToken.balanceOf(_baseStrategyAddr))", "source_mapping": { - "start": 3194, - "length": 56, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 27553, + "length": 319, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [91], - "starting_column": 9, - "ending_column": 65 + "lines": [614, 615, 616, 617, 618, 619, 620, 621], + "starting_column": 21, + "ending_column": 22 }, "type_specific_fields": { "parent": { "type": "function", - "name": "claimFor", + "name": "_withdrawFromBaseStrategy", "source_mapping": { - "start": 2718, - "length": 611, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 25804, + "length": 2552, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], + "lines": [ + 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, + 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, + 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, + 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryFarmingRevenue", + "name": "TreasuryReservesVault", "source_mapping": { - "start": 547, - "length": 3059, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 2150, + "length": 32023, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100 + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, + 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, + 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, + 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, + 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, + 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, + 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, + 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, + 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, + 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, + 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, + 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, + 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, + 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, + 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, + 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, + 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, + 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, + 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, + 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, + 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, + 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, + 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, + 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, + 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, + 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, + 777, 778, 779 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "claimFor(address)" + "signature": "_withdrawFromBaseStrategy(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,address,uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "claimFor(account)", + "name": "_burnedAmount = tokenConfig.dToken.burn(strategy,toBurnAmount)", "source_mapping": { - "start": 2073, - "length": 17, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 30398, + "length": 71, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [57], + "lines": [688], "starting_column": 9, - "ending_column": 26 + "ending_column": 80 }, "type_specific_fields": { "parent": { "type": "function", - "name": "increaseShares", + "name": "_burnDToken", "source_mapping": { - "start": 1987, - "length": 302, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 29999, + "length": 1179, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [56, 57, 58, 59, 60, 61, 62, 63, 64], + "lines": [ + 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, + 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, + 703, 704, 705, 706, 707, 708, 709 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryFarmingRevenue", + "name": "TreasuryReservesVault", "source_mapping": { - "start": 547, - "length": 3059, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 2150, + "length": 32023, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100 + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, + 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, + 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, + 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, + 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, + 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, + 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, + 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, + 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, + 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, + 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, + 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, + 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, + 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, + 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, + 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, + 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, + 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, + 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, + 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, + 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, + 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, + 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, + 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, + 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, + 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, + 777, 778, 779 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "increaseShares(address,uint256)" + "signature": "_burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" } } }, "additional_fields": { "underlying_type": "external_calls_sending_eth" } }, { - "type": "node", - "name": "exposure.mint(account,unclaimedScaled / SCALING_FACTOR)", - "source_mapping": { - "start": 3194, - "length": 56, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "type": "node", + "name": "StrategyCreditAndDebtBalance(strategy,address(token),_creditBalance,dTokenBalance)", + "source_mapping": { + "start": 31081, + "length": 90, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [91], + "lines": [708], "starting_column": 9, - "ending_column": 65 + "ending_column": 99 }, "type_specific_fields": { "parent": { "type": "function", - "name": "claimFor", + "name": "_burnDToken", "source_mapping": { - "start": 2718, - "length": 611, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 29999, + "length": 1179, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], + "lines": [ + 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, + 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, + 703, 704, 705, 706, 707, 708, 709 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryFarmingRevenue", + "name": "TreasuryReservesVault", "source_mapping": { - "start": 547, - "length": 3059, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 2150, + "length": 32023, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100 + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, + 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, + 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, + 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, + 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, + 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, + 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, + 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, + 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, + 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, + 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, + 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, + 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, + 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, + 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, + 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, + 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, + 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, + 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, + 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, + 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, + 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, + 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, + 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, + 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, + 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, + 777, 778, 779 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "claimFor(address)" + "signature": "_burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + "additional_fields": { "underlying_type": "event" } }, { "type": "node", - "name": "totalShares += amount", + "name": "_burnDToken(_baseStrategyAddr,strategies[_baseStrategyAddr],token,tokenConfig,_withdrawnAmount,tokenConfig.dToken.balanceOf(_baseStrategyAddr))", "source_mapping": { - "start": 2136, - "length": 21, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 27553, + "length": 319, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [60], - "starting_column": 9, - "ending_column": 30 + "lines": [614, 615, 616, 617, 618, 619, 620, 621], + "starting_column": 21, + "ending_column": 22 }, "type_specific_fields": { "parent": { "type": "function", - "name": "increaseShares", + "name": "_withdrawFromBaseStrategy", "source_mapping": { - "start": 1987, - "length": 302, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 25804, + "length": 2552, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [56, 57, 58, 59, 60, 61, 62, 63, 64], + "lines": [ + 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, + 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, + 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, + 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryFarmingRevenue", + "name": "TreasuryReservesVault", "source_mapping": { - "start": 547, - "length": 3059, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 2150, + "length": 32023, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100 + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, + 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, + 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, + 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, + 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, + 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, + 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, + 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, + 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, + 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, + 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, + 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, + 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, + 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, + 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, + 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, + 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, + 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, + 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, + 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, + 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, + 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, + 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, + 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, + 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, + 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, + 777, 778, 779 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "increaseShares(address,uint256)" + "signature": "_withdrawFromBaseStrategy(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,address,uint256)" } } }, - "additional_fields": { - "underlying_type": "variables_written", - "variable_name": "totalShares" - } + "additional_fields": { "underlying_type": "event" } } ], - "description": "Reentrancy in TreasuryFarmingRevenue.increaseShares(address,uint256) (contracts/core/TreasuryFarmingRevenue.sol#56-64):\n\tExternal calls:\n\t- claimFor(account) (contracts/core/TreasuryFarmingRevenue.sol#57)\n\t\t- exposure.mint(account,unclaimedScaled / SCALING_FACTOR) (contracts/core/TreasuryFarmingRevenue.sol#91)\n\tState variables written after the call(s):\n\t- totalShares += amount (contracts/core/TreasuryFarmingRevenue.sol#60)\n", - "markdown": "Reentrancy in [TreasuryFarmingRevenue.increaseShares(address,uint256)](contracts/core/TreasuryFarmingRevenue.sol#L56-L64):\n\tExternal calls:\n\t- [claimFor(account)](contracts/core/TreasuryFarmingRevenue.sol#L57)\n\t\t- [exposure.mint(account,unclaimedScaled / SCALING_FACTOR)](contracts/core/TreasuryFarmingRevenue.sol#L91)\n\tState variables written after the call(s):\n\t- [totalShares += amount](contracts/core/TreasuryFarmingRevenue.sol#L60)\n", - "first_markdown_element": "contracts/core/TreasuryFarmingRevenue.sol#L56-L64", - "id": "842e91df89a71525a6459c0d1291885967545da62e3f06975364172343f78737", - "check": "reentrancy-benign", + "description": "Reentrancy in TreasuryReservesVault._withdrawFromBaseStrategy(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,address,uint256) (contracts/v2/TreasuryReservesVault.sol#582-632):\n\tExternal calls:\n\t- _withdrawnAmount = _baseStrategy.trvWithdraw(_withdrawFromBaseStrategyAmount) (contracts/v2/TreasuryReservesVault.sol#608)\n\t- _burnDToken(_baseStrategyAddr,strategies[_baseStrategyAddr],token,tokenConfig,_withdrawnAmount,tokenConfig.dToken.balanceOf(_baseStrategyAddr)) (contracts/v2/TreasuryReservesVault.sol#614-621)\n\t\t- _burnedAmount = tokenConfig.dToken.burn(strategy,toBurnAmount) (contracts/v2/TreasuryReservesVault.sol#688)\n\tEvent emitted after the call(s):\n\t- StrategyCreditAndDebtBalance(strategy,address(token),_creditBalance,dTokenBalance) (contracts/v2/TreasuryReservesVault.sol#708)\n\t\t- _burnDToken(_baseStrategyAddr,strategies[_baseStrategyAddr],token,tokenConfig,_withdrawnAmount,tokenConfig.dToken.balanceOf(_baseStrategyAddr)) (contracts/v2/TreasuryReservesVault.sol#614-621)\n", + "markdown": "Reentrancy in [TreasuryReservesVault._withdrawFromBaseStrategy(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,address,uint256)](contracts/v2/TreasuryReservesVault.sol#L582-L632):\n\tExternal calls:\n\t- [_withdrawnAmount = _baseStrategy.trvWithdraw(_withdrawFromBaseStrategyAmount)](contracts/v2/TreasuryReservesVault.sol#L608)\n\t- [_burnDToken(_baseStrategyAddr,strategies[_baseStrategyAddr],token,tokenConfig,_withdrawnAmount,tokenConfig.dToken.balanceOf(_baseStrategyAddr))](contracts/v2/TreasuryReservesVault.sol#L614-L621)\n\t\t- [_burnedAmount = tokenConfig.dToken.burn(strategy,toBurnAmount)](contracts/v2/TreasuryReservesVault.sol#L688)\n\tEvent emitted after the call(s):\n\t- [StrategyCreditAndDebtBalance(strategy,address(token),_creditBalance,dTokenBalance)](contracts/v2/TreasuryReservesVault.sol#L708)\n\t\t- [_burnDToken(_baseStrategyAddr,strategies[_baseStrategyAddr],token,tokenConfig,_withdrawnAmount,tokenConfig.dToken.balanceOf(_baseStrategyAddr))](contracts/v2/TreasuryReservesVault.sol#L614-L621)\n", + "first_markdown_element": "contracts/v2/TreasuryReservesVault.sol#L582-L632", + "id": "89618dfba3ac7d15e5970daa2e83a543e99a75c999d6a13fbdd7a2d009309297", + "check": "reentrancy-events", "impact": "Low", "confidence": "Medium" }, @@ -32558,17 +27679,19 @@ "elements": [ { "type": "function", - "name": "burn", + "name": "addLiquidity", "source_mapping": { - "start": 5241, - "length": 1294, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 20001, + "length": 2092, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138 + 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, + 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, + 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, + 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513 ], "starting_column": 5, "ending_column": 6 @@ -32576,64 +27699,98 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "Ramos", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185 + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, + 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, + 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, + 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, + 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, + 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, + 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, + 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, + 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, + 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, + 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, + 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, + 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, + 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, + 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, + 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, + 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, + 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, + 621 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "burn(address)" + "signature": "addLiquidity(IBalancerVault.JoinPoolRequest)" } }, { "type": "node", - "name": "_safeTransfer(_token0,to,amount0)", + "name": "_tokenVault.borrowProtocolToken(protocolTokenAmount,address(this))", "source_mapping": { - "start": 6213, - "length": 35, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 20777, + "length": 67, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [131], + "lines": [483], "starting_column": 9, - "ending_column": 44 + "ending_column": 76 }, "type_specific_fields": { "parent": { "type": "function", - "name": "burn", + "name": "addLiquidity", "source_mapping": { - "start": 5241, - "length": 1294, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 20001, + "length": 2092, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138 + 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, + 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, + 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, + 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513 ], "starting_column": 5, "ending_column": 6 @@ -32641,35 +27798,69 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "Ramos", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, + 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, + 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, + 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, + 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, + 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, + 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "burn(address)" + "signature": "addLiquidity(IBalancerVault.JoinPoolRequest)" } } }, @@ -32677,98 +27868,139 @@ }, { "type": "node", - "name": "(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))", + "name": "_tokenVault.borrowQuoteToken(quoteTokenAmount,address(this))", "source_mapping": { - "start": 1972, - "length": 91, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 20854, + "length": 61, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [50], + "lines": [484], "starting_column": 9, - "ending_column": 100 + "ending_column": 70 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_safeTransfer", + "name": "addLiquidity", "source_mapping": { - "start": 1892, - "length": 284, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 20001, + "length": 2092, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [49, 50, 51, 52], + "lines": [ + 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, + 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, + 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, + 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "Ramos", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, + 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, + 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, + 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, + 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, + 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, + 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_safeTransfer(address,address,uint256)" + "signature": "addLiquidity(IBalancerVault.JoinPoolRequest)" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "_safeTransfer(_token1,to,amount1)", + "name": "protocolToken.safeIncreaseAllowance(address(balancerVault),protocolTokenAmount)", "source_mapping": { - "start": 6258, - "length": 35, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 20995, + "length": 80, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [132], - "starting_column": 9, - "ending_column": 44 + "lines": [488], + "starting_column": 13, + "ending_column": 93 }, "type_specific_fields": { "parent": { "type": "function", - "name": "burn", + "name": "addLiquidity", "source_mapping": { - "start": 5241, - "length": 1294, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 20001, + "length": 2092, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138 + 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, + 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, + 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, + 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513 ], "starting_column": 5, "ending_column": 6 @@ -32776,35 +28008,69 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "Ramos", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, + 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, + 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, + 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, + 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, + 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, + 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "burn(address)" + "signature": "addLiquidity(IBalancerVault.JoinPoolRequest)" } } }, @@ -32812,98 +28078,139 @@ }, { "type": "node", - "name": "(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))", + "name": "quoteToken.safeApprove(address(balancerVault),0)", "source_mapping": { - "start": 1972, - "length": 91, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 21254, + "length": 49, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [50], - "starting_column": 9, - "ending_column": 100 + "lines": [491], + "starting_column": 17, + "ending_column": 66 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_safeTransfer", + "name": "addLiquidity", "source_mapping": { - "start": 1892, - "length": 284, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 20001, + "length": 2092, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [49, 50, 51, 52], + "lines": [ + 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, + 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, + 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, + 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "Ramos", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, + 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, + 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, + 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, + 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, + 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, + 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_safeTransfer(address,address,uint256)" + "signature": "addLiquidity(IBalancerVault.JoinPoolRequest)" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "Burn(msg.sender,amount0,amount1,to)", + "name": "quoteToken.safeIncreaseAllowance(address(balancerVault),quoteTokenAmount)", "source_mapping": { - "start": 6485, - "length": 43, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 21321, + "length": 74, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [137], - "starting_column": 9, - "ending_column": 52 + "lines": [492], + "starting_column": 17, + "ending_column": 91 }, "type_specific_fields": { "parent": { "type": "function", - "name": "burn", + "name": "addLiquidity", "source_mapping": { - "start": 5241, - "length": 1294, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 20001, + "length": 2092, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138 + 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, + 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, + 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, + 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513 ], "starting_column": 5, "ending_column": 6 @@ -32911,134 +28218,209 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "Ramos", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, + 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, + 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, + 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, + 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, + 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, + 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "burn(address)" + "signature": "addLiquidity(IBalancerVault.JoinPoolRequest)" } } }, - "additional_fields": { "underlying_type": "event" } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "Sync(reserve0,reserve1)", + "name": "balancerVault.joinPool(balancerPoolId,address(this),address(this),request)", "source_mapping": { - "start": 3918, - "length": 29, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 21538, + "length": 77, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [92], - "starting_column": 9, - "ending_column": 38 + "lines": [499], + "starting_column": 13, + "ending_column": 90 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_update", + "name": "addLiquidity", "source_mapping": { - "start": 3107, - "length": 847, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 20001, + "length": 2092, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], + "lines": [ + 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, + 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, + 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, + 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "Ramos", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, + 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, + 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, + 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, + 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, + 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, + 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_update(uint256,uint256,uint112,uint112)" + "signature": "addLiquidity(IBalancerVault.JoinPoolRequest)" } } }, - "additional_fields": { "underlying_type": "event" } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "_update(balance0,balance1,_reserve0,_reserve1)", + "name": "LiquidityAdded(quoteTokenAmount,protocolTokenAmount,bptTokensStaked)", "source_mapping": { - "start": 6426, - "length": 49, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 21814, + "length": 75, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [136], + "lines": [506], "starting_column": 9, - "ending_column": 58 + "ending_column": 84 }, "type_specific_fields": { "parent": { "type": "function", - "name": "burn", + "name": "addLiquidity", "source_mapping": { - "start": 5241, - "length": 1294, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 20001, + "length": 2092, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138 + 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, + 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, + 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, + 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513 ], "starting_column": 5, "ending_column": 6 @@ -33046,45 +28428,79 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "Ramos", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, + 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, + 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, + 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, + 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, + 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, + 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "burn(address)" + "signature": "addLiquidity(IBalancerVault.JoinPoolRequest)" } } }, "additional_fields": { "underlying_type": "event" } } ], - "description": "Reentrancy in TempleUniswapV2Pair.burn(address) (contracts/amm/TempleUniswapV2Pair.sol#118-138):\n\tExternal calls:\n\t- _safeTransfer(_token0,to,amount0) (contracts/amm/TempleUniswapV2Pair.sol#131)\n\t\t- (success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value)) (contracts/amm/TempleUniswapV2Pair.sol#50)\n\t- _safeTransfer(_token1,to,amount1) (contracts/amm/TempleUniswapV2Pair.sol#132)\n\t\t- (success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value)) (contracts/amm/TempleUniswapV2Pair.sol#50)\n\tEvent emitted after the call(s):\n\t- Burn(msg.sender,amount0,amount1,to) (contracts/amm/TempleUniswapV2Pair.sol#137)\n\t- Sync(reserve0,reserve1) (contracts/amm/TempleUniswapV2Pair.sol#92)\n\t\t- _update(balance0,balance1,_reserve0,_reserve1) (contracts/amm/TempleUniswapV2Pair.sol#136)\n", - "markdown": "Reentrancy in [TempleUniswapV2Pair.burn(address)](contracts/amm/TempleUniswapV2Pair.sol#L118-L138):\n\tExternal calls:\n\t- [_safeTransfer(_token0,to,amount0)](contracts/amm/TempleUniswapV2Pair.sol#L131)\n\t\t- [(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))](contracts/amm/TempleUniswapV2Pair.sol#L50)\n\t- [_safeTransfer(_token1,to,amount1)](contracts/amm/TempleUniswapV2Pair.sol#L132)\n\t\t- [(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))](contracts/amm/TempleUniswapV2Pair.sol#L50)\n\tEvent emitted after the call(s):\n\t- [Burn(msg.sender,amount0,amount1,to)](contracts/amm/TempleUniswapV2Pair.sol#L137)\n\t- [Sync(reserve0,reserve1)](contracts/amm/TempleUniswapV2Pair.sol#L92)\n\t\t- [_update(balance0,balance1,_reserve0,_reserve1)](contracts/amm/TempleUniswapV2Pair.sol#L136)\n", - "first_markdown_element": "contracts/amm/TempleUniswapV2Pair.sol#L118-L138", - "id": "127a57c69604f2ba16f4cd02c712486dff1968238a1c69ead2035920584207c2", + "description": "Reentrancy in Ramos.addLiquidity(IBalancerVault.JoinPoolRequest) (contracts/amo/Ramos.sol#464-513):\n\tExternal calls:\n\t- _tokenVault.borrowProtocolToken(protocolTokenAmount,address(this)) (contracts/amo/Ramos.sol#483)\n\t- _tokenVault.borrowQuoteToken(quoteTokenAmount,address(this)) (contracts/amo/Ramos.sol#484)\n\t- protocolToken.safeIncreaseAllowance(address(balancerVault),protocolTokenAmount) (contracts/amo/Ramos.sol#488)\n\t- quoteToken.safeApprove(address(balancerVault),0) (contracts/amo/Ramos.sol#491)\n\t- quoteToken.safeIncreaseAllowance(address(balancerVault),quoteTokenAmount) (contracts/amo/Ramos.sol#492)\n\t- balancerVault.joinPool(balancerPoolId,address(this),address(this),request) (contracts/amo/Ramos.sol#499)\n\tEvent emitted after the call(s):\n\t- LiquidityAdded(quoteTokenAmount,protocolTokenAmount,bptTokensStaked) (contracts/amo/Ramos.sol#506)\n", + "markdown": "Reentrancy in [Ramos.addLiquidity(IBalancerVault.JoinPoolRequest)](contracts/amo/Ramos.sol#L464-L513):\n\tExternal calls:\n\t- [_tokenVault.borrowProtocolToken(protocolTokenAmount,address(this))](contracts/amo/Ramos.sol#L483)\n\t- [_tokenVault.borrowQuoteToken(quoteTokenAmount,address(this))](contracts/amo/Ramos.sol#L484)\n\t- [protocolToken.safeIncreaseAllowance(address(balancerVault),protocolTokenAmount)](contracts/amo/Ramos.sol#L488)\n\t- [quoteToken.safeApprove(address(balancerVault),0)](contracts/amo/Ramos.sol#L491)\n\t- [quoteToken.safeIncreaseAllowance(address(balancerVault),quoteTokenAmount)](contracts/amo/Ramos.sol#L492)\n\t- [balancerVault.joinPool(balancerPoolId,address(this),address(this),request)](contracts/amo/Ramos.sol#L499)\n\tEvent emitted after the call(s):\n\t- [LiquidityAdded(quoteTokenAmount,protocolTokenAmount,bptTokensStaked)](contracts/amo/Ramos.sol#L506)\n", + "first_markdown_element": "contracts/amo/Ramos.sol#L464-L513", + "id": "15647cc5365c69815f9cf055275a3e256df8e9495b6e93d5e1a813c3a4db8bfa", "check": "reentrancy-events", "impact": "Low", "confidence": "Medium" @@ -33093,120 +28509,123 @@ "elements": [ { "type": "function", - "name": "swap", + "name": "addLiquidity", "source_mapping": { - "start": 6644, - "length": 1950, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 7071, + "length": 365, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, - "lines": [ - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170 - ], + "lines": [181, 182, 183, 184, 185, 186, 187, 188], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "RamosStrategy", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1131, + "length": 9320, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185 + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "swap(uint256,uint256,address,bytes)" + "signature": "addLiquidity(IBalancerVault.JoinPoolRequest)" } }, { "type": "node", - "name": "_safeTransfer(_token0,to,amount0Out)", + "name": "(quoteTokenAmount,protocolTokenAmount,bptTokensStaked) = ramos.addLiquidity(_requestData)", "source_mapping": { - "start": 7388, - "length": 38, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 7185, + "length": 161, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, - "lines": [153], - "starting_column": 29, - "ending_column": 67 + "lines": [182, 183, 184, 185, 186], + "starting_column": 9, + "ending_column": 45 }, "type_specific_fields": { "parent": { "type": "function", - "name": "swap", + "name": "addLiquidity", "source_mapping": { - "start": 6644, - "length": 1950, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 7071, + "length": 365, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, - "lines": [ - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170 - ], + "lines": [181, 182, 183, 184, 185, 186, 187, 188], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "RamosStrategy", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1131, + "length": 9320, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "swap(uint256,uint256,address,bytes)" + "signature": "addLiquidity(IBalancerVault.JoinPoolRequest)" } } }, @@ -33214,235 +28633,307 @@ }, { "type": "node", - "name": "(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))", + "name": "AddLiquidity(quoteTokenAmount,protocolTokenAmount,bptTokensStaked)", "source_mapping": { - "start": 1972, - "length": 91, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 7356, + "length": 73, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, - "lines": [50], + "lines": [187], "starting_column": 9, - "ending_column": 100 + "ending_column": 82 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_safeTransfer", + "name": "addLiquidity", "source_mapping": { - "start": 1892, - "length": 284, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 7071, + "length": 365, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, - "lines": [49, 50, 51, 52], + "lines": [181, 182, 183, 184, 185, 186, 187, 188], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "RamosStrategy", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1131, + "length": 9320, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_safeTransfer(address,address,uint256)" + "signature": "addLiquidity(IBalancerVault.JoinPoolRequest)" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } - }, + "additional_fields": { "underlying_type": "event" } + } + ], + "description": "Reentrancy in RamosStrategy.addLiquidity(IBalancerVault.JoinPoolRequest) (contracts/v2/strategies/RamosStrategy.sol#181-188):\n\tExternal calls:\n\t- (quoteTokenAmount,protocolTokenAmount,bptTokensStaked) = ramos.addLiquidity(_requestData) (contracts/v2/strategies/RamosStrategy.sol#182-186)\n\tEvent emitted after the call(s):\n\t- AddLiquidity(quoteTokenAmount,protocolTokenAmount,bptTokensStaked) (contracts/v2/strategies/RamosStrategy.sol#187)\n", + "markdown": "Reentrancy in [RamosStrategy.addLiquidity(IBalancerVault.JoinPoolRequest)](contracts/v2/strategies/RamosStrategy.sol#L181-L188):\n\tExternal calls:\n\t- [(quoteTokenAmount,protocolTokenAmount,bptTokensStaked) = ramos.addLiquidity(_requestData)](contracts/v2/strategies/RamosStrategy.sol#L182-L186)\n\tEvent emitted after the call(s):\n\t- [AddLiquidity(quoteTokenAmount,protocolTokenAmount,bptTokensStaked)](contracts/v2/strategies/RamosStrategy.sol#L187)\n", + "first_markdown_element": "contracts/v2/strategies/RamosStrategy.sol#L181-L188", + "id": "86c6739a14ef579509f4e0190b6310b585123eb008deed594e5fdc44ec40eefe", + "check": "reentrancy-events", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ { - "type": "node", - "name": "_safeTransfer(_token1,to,amount1Out)", + "type": "function", + "name": "batchEquipShards", "source_mapping": { - "start": 7490, - "length": 38, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 16421, + "length": 1032, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, - "lines": [154], - "starting_column": 29, - "ending_column": 67 + "lines": [ + 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422 + ], + "starting_column": 5, + "ending_column": 6 }, "type_specific_fields": { "parent": { - "type": "function", - "name": "swap", + "type": "contract", + "name": "Relic", "source_mapping": { - "start": 6644, - "length": 1950, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1674, + "length": 24655, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, "lines": [ - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170 + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, + 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, + 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, + 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, + 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, + 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, + 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, + 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, + 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, + 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, + 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, + 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, + 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, + 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, + 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, + 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, + 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, + 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, + 652, 653, 654, 655 ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleUniswapV2Pair", - "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", - "is_dependency": false, - "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "swap(uint256,uint256,address,bytes)" + "starting_column": 1, + "ending_column": 0 } - } - }, - "additional_fields": { "underlying_type": "external_calls" } + }, + "signature": "batchEquipShards(uint256,uint256[],uint256[])" + } }, { "type": "node", - "name": "(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))", + "name": "shard.safeBatchTransferFrom(msg.sender,address(this),shardIds,amounts,ZERO_BYTES)", "source_mapping": { - "start": 1972, - "length": 91, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 16818, + "length": 85, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, - "lines": [50], + "lines": [405], "starting_column": 9, - "ending_column": 100 + "ending_column": 94 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_safeTransfer", + "name": "batchEquipShards", "source_mapping": { - "start": 1892, - "length": 284, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 16421, + "length": 1032, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, - "lines": [49, 50, 51, 52], + "lines": [ + 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "Relic", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1674, + "length": 24655, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "_safeTransfer(address,address,uint256)" + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, + 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, + 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, + 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, + 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, + 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, + 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, + 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, + 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, + 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, + 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, + 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, + 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, + 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, + 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, + 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, + 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, + 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, + 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, + 654, 655 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "batchEquipShards(uint256,uint256[],uint256[])" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "IUniswapV2Callee(to).uniswapV2Call(msg.sender,amount0Out,amount1Out,data)", + "name": "ShardsEquipped(msg.sender,relicId,shardIds,amounts)", "source_mapping": { - "start": 7593, - "length": 76, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 17387, + "length": 59, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, - "lines": [155], - "starting_column": 30, - "ending_column": 106 + "lines": [421], + "starting_column": 9, + "ending_column": 68 }, "type_specific_fields": { "parent": { "type": "function", - "name": "swap", + "name": "batchEquipShards", "source_mapping": { - "start": 6644, - "length": 1950, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 16421, + "length": 1032, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, "lines": [ - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170 + 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422 ], "starting_column": 5, "ending_column": 6 @@ -33450,205 +28941,312 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "Relic", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1674, + "length": 24655, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "swap(uint256,uint256,address,bytes)" + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, + 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, + 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, + 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, + 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, + 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, + 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, + 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, + 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, + 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, + 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, + 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, + 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, + 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, + 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, + 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, + 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, + 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, + 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, + 654, 655 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "batchEquipShards(uint256,uint256[],uint256[])" } } }, - "additional_fields": { "underlying_type": "external_calls" } - }, + "additional_fields": { "underlying_type": "event" } + } + ], + "description": "Reentrancy in Relic.batchEquipShards(uint256,uint256[],uint256[]) (contracts/nexus/Relic.sol#397-422):\n\tExternal calls:\n\t- shard.safeBatchTransferFrom(msg.sender,address(this),shardIds,amounts,ZERO_BYTES) (contracts/nexus/Relic.sol#405)\n\tEvent emitted after the call(s):\n\t- ShardsEquipped(msg.sender,relicId,shardIds,amounts) (contracts/nexus/Relic.sol#421)\n", + "markdown": "Reentrancy in [Relic.batchEquipShards(uint256,uint256[],uint256[])](contracts/nexus/Relic.sol#L397-L422):\n\tExternal calls:\n\t- [shard.safeBatchTransferFrom(msg.sender,address(this),shardIds,amounts,ZERO_BYTES)](contracts/nexus/Relic.sol#L405)\n\tEvent emitted after the call(s):\n\t- [ShardsEquipped(msg.sender,relicId,shardIds,amounts)](contracts/nexus/Relic.sol#L421)\n", + "first_markdown_element": "contracts/nexus/Relic.sol#L397-L422", + "id": "07b636a128c77b7c24977edf13b264c5e6dfb0dca4ff40e6f18f5f17f0a28d7f", + "check": "reentrancy-events", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ { - "type": "node", - "name": "Swap(msg.sender,amount0In,amount1In,amount0Out,amount1Out,to)", + "type": "function", + "name": "batchUnequipShards", "source_mapping": { - "start": 8516, - "length": 71, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 17641, + "length": 1218, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, - "lines": [169], - "starting_column": 9, - "ending_column": 80 + "lines": [ + 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, + 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, + 456, 457 + ], + "starting_column": 5, + "ending_column": 6 }, "type_specific_fields": { "parent": { - "type": "function", - "name": "swap", + "type": "contract", + "name": "Relic", "source_mapping": { - "start": 6644, - "length": 1950, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1674, + "length": 24655, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, "lines": [ - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170 + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, + 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, + 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, + 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, + 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, + 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, + 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, + 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, + 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, + 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, + 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, + 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, + 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, + 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, + 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, + 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, + 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, + 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, + 652, 653, 654, 655 ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleUniswapV2Pair", - "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", - "is_dependency": false, - "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "swap(uint256,uint256,address,bytes)" + "starting_column": 1, + "ending_column": 0 } - } - }, - "additional_fields": { "underlying_type": "event" } + }, + "signature": "batchUnequipShards(uint256,uint256[],uint256[])" + } }, { "type": "node", - "name": "Sync(reserve0,reserve1)", + "name": "shard.safeBatchTransferFrom(address(this),msg.sender,shardIds,amounts,ZERO_BYTES)", "source_mapping": { - "start": 3918, - "length": 29, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 18696, + "length": 85, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, - "lines": [92], + "lines": [455], "starting_column": 9, - "ending_column": 38 + "ending_column": 94 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_update", + "name": "batchUnequipShards", "source_mapping": { - "start": 3107, - "length": 847, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 17641, + "length": 1218, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, - "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], + "lines": [ + 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, + 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, + 456, 457 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "Relic", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1674, + "length": 24655, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "_update(uint256,uint256,uint112,uint112)" + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, + 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, + 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, + 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, + 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, + 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, + 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, + 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, + 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, + 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, + 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, + 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, + 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, + 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, + 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, + 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, + 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, + 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, + 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, + 654, 655 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "batchUnequipShards(uint256,uint256[],uint256[])" } } }, - "additional_fields": { "underlying_type": "event" } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "_update(balance0,balance1,_reserve0,_reserve1)", + "name": "ShardsUnequipped(msg.sender,relicId,shardIds,amounts)", "source_mapping": { - "start": 8457, - "length": 49, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 18791, + "length": 61, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, - "lines": [168], + "lines": [456], "starting_column": 9, - "ending_column": 58 + "ending_column": 70 }, "type_specific_fields": { "parent": { "type": "function", - "name": "swap", + "name": "batchUnequipShards", "source_mapping": { - "start": 6644, - "length": 1950, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 17641, + "length": 1218, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, "lines": [ - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170 + 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, + 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, + 456, 457 ], "starting_column": 5, "ending_column": 6 @@ -33656,45 +29254,83 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "Relic", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1674, + "length": 24655, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "swap(uint256,uint256,address,bytes)" + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, + 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, + 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, + 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, + 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, + 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, + 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, + 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, + 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, + 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, + 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, + 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, + 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, + 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, + 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, + 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, + 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, + 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, + 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, + 654, 655 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "batchUnequipShards(uint256,uint256[],uint256[])" } } }, "additional_fields": { "underlying_type": "event" } } ], - "description": "Reentrancy in TempleUniswapV2Pair.swap(uint256,uint256,address,bytes) (contracts/amm/TempleUniswapV2Pair.sol#141-170):\n\tExternal calls:\n\t- _safeTransfer(_token0,to,amount0Out) (contracts/amm/TempleUniswapV2Pair.sol#153)\n\t\t- (success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value)) (contracts/amm/TempleUniswapV2Pair.sol#50)\n\t- _safeTransfer(_token1,to,amount1Out) (contracts/amm/TempleUniswapV2Pair.sol#154)\n\t\t- (success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value)) (contracts/amm/TempleUniswapV2Pair.sol#50)\n\t- IUniswapV2Callee(to).uniswapV2Call(msg.sender,amount0Out,amount1Out,data) (contracts/amm/TempleUniswapV2Pair.sol#155)\n\tEvent emitted after the call(s):\n\t- Swap(msg.sender,amount0In,amount1In,amount0Out,amount1Out,to) (contracts/amm/TempleUniswapV2Pair.sol#169)\n\t- Sync(reserve0,reserve1) (contracts/amm/TempleUniswapV2Pair.sol#92)\n\t\t- _update(balance0,balance1,_reserve0,_reserve1) (contracts/amm/TempleUniswapV2Pair.sol#168)\n", - "markdown": "Reentrancy in [TempleUniswapV2Pair.swap(uint256,uint256,address,bytes)](contracts/amm/TempleUniswapV2Pair.sol#L141-L170):\n\tExternal calls:\n\t- [_safeTransfer(_token0,to,amount0Out)](contracts/amm/TempleUniswapV2Pair.sol#L153)\n\t\t- [(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))](contracts/amm/TempleUniswapV2Pair.sol#L50)\n\t- [_safeTransfer(_token1,to,amount1Out)](contracts/amm/TempleUniswapV2Pair.sol#L154)\n\t\t- [(success,data) = token.call(abi.encodeWithSelector(SELECTOR,to,value))](contracts/amm/TempleUniswapV2Pair.sol#L50)\n\t- [IUniswapV2Callee(to).uniswapV2Call(msg.sender,amount0Out,amount1Out,data)](contracts/amm/TempleUniswapV2Pair.sol#L155)\n\tEvent emitted after the call(s):\n\t- [Swap(msg.sender,amount0In,amount1In,amount0Out,amount1Out,to)](contracts/amm/TempleUniswapV2Pair.sol#L169)\n\t- [Sync(reserve0,reserve1)](contracts/amm/TempleUniswapV2Pair.sol#L92)\n\t\t- [_update(balance0,balance1,_reserve0,_reserve1)](contracts/amm/TempleUniswapV2Pair.sol#L168)\n", - "first_markdown_element": "contracts/amm/TempleUniswapV2Pair.sol#L141-L170", - "id": "702607b50ee9e5b85f6e9be980d2529af09be332237e0acb690cb814df52cb87", + "description": "Reentrancy in Relic.batchUnequipShards(uint256,uint256[],uint256[]) (contracts/nexus/Relic.sol#430-457):\n\tExternal calls:\n\t- shard.safeBatchTransferFrom(address(this),msg.sender,shardIds,amounts,ZERO_BYTES) (contracts/nexus/Relic.sol#455)\n\tEvent emitted after the call(s):\n\t- ShardsUnequipped(msg.sender,relicId,shardIds,amounts) (contracts/nexus/Relic.sol#456)\n", + "markdown": "Reentrancy in [Relic.batchUnequipShards(uint256,uint256[],uint256[])](contracts/nexus/Relic.sol#L430-L457):\n\tExternal calls:\n\t- [shard.safeBatchTransferFrom(address(this),msg.sender,shardIds,amounts,ZERO_BYTES)](contracts/nexus/Relic.sol#L455)\n\tEvent emitted after the call(s):\n\t- [ShardsUnequipped(msg.sender,relicId,shardIds,amounts)](contracts/nexus/Relic.sol#L456)\n", + "first_markdown_element": "contracts/nexus/Relic.sol#L430-L457", + "id": "667ed421ec038b1b99874699de7c56c68905d429c6950caca378aa03d48b92e1", "check": "reentrancy-events", "impact": "Low", "confidence": "Medium" @@ -33703,209 +29339,112 @@ "elements": [ { "type": "function", - "name": "_burnDToken", + "name": "borrow", "source_mapping": { - "start": 29910, - "length": 1179, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 3212, + "length": 319, + "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/GnosisStrategy.sol", + "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", "is_dependency": false, - "lines": [ - 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, - 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, - 700, 701, 702, 703, 704, 705, 706 - ], + "lines": [88, 89, 90, 91, 92, 93, 94, 95, 96], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "GnosisStrategy", "source_mapping": { - "start": 2150, - "length": 31934, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 584, + "length": 6684, + "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/GnosisStrategy.sol", + "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, - 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, - 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, - 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, - 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, - 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, - 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, - 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, - 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, - 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, - 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, - 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, - 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, - 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, - 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, - 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, - 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, - 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, - 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, - 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, - 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, - 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, - 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, - 771, 772, 773, 774, 775, 776 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" + "signature": "borrow(IERC20,uint256)" } }, { "type": "node", - "name": "_burnedAmount = tokenConfig.dToken.burn(strategy,toBurnAmount)", + "name": "circuitBreakerProxy.preCheck(address(token),msg.sender,amount)", "source_mapping": { - "start": 30309, - "length": 71, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 3296, + "length": 112, + "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/GnosisStrategy.sol", + "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", "is_dependency": false, - "lines": [685], + "lines": [89, 90, 91, 92, 93], "starting_column": 9, - "ending_column": 80 + "ending_column": 10 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_burnDToken", + "name": "borrow", "source_mapping": { - "start": 29910, - "length": 1179, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 3212, + "length": 319, + "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/GnosisStrategy.sol", + "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", "is_dependency": false, - "lines": [ - 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, - 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, - 700, 701, 702, 703, 704, 705, 706 - ], + "lines": [88, 89, 90, 91, 92, 93, 94, 95, 96], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "GnosisStrategy", "source_mapping": { - "start": 2150, - "length": 31934, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 584, + "length": 6684, + "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/GnosisStrategy.sol", + "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" + "signature": "borrow(IERC20,uint256)" } } }, @@ -33913,125 +29452,75 @@ }, { "type": "node", - "name": "StrategyCreditAndDebtBalance(strategy,address(token),_creditBalance,dTokenBalance)", + "name": "Borrow(address(token),amount)", "source_mapping": { - "start": 30992, - "length": 90, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 3418, + "length": 35, + "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/GnosisStrategy.sol", + "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", "is_dependency": false, - "lines": [705], + "lines": [94], "starting_column": 9, - "ending_column": 99 + "ending_column": 44 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_burnDToken", + "name": "borrow", "source_mapping": { - "start": 29910, - "length": 1179, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 3212, + "length": 319, + "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/GnosisStrategy.sol", + "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", "is_dependency": false, - "lines": [ - 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, - 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, - 700, 701, 702, 703, 704, 705, 706 - ], + "lines": [88, 89, 90, 91, 92, 93, 94, 95, 96], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "GnosisStrategy", "source_mapping": { - "start": 2150, - "length": 31934, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 584, + "length": 6684, + "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/GnosisStrategy.sol", + "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" + "signature": "borrow(IERC20,uint256)" } } }, "additional_fields": { "underlying_type": "event" } } ], - "description": "Reentrancy in TreasuryReservesVault._burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256) (contracts/v2/TreasuryReservesVault.sol#674-706):\n\tExternal calls:\n\t- _burnedAmount = tokenConfig.dToken.burn(strategy,toBurnAmount) (contracts/v2/TreasuryReservesVault.sol#685)\n\tEvent emitted after the call(s):\n\t- StrategyCreditAndDebtBalance(strategy,address(token),_creditBalance,dTokenBalance) (contracts/v2/TreasuryReservesVault.sol#705)\n", - "markdown": "Reentrancy in [TreasuryReservesVault._burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)](contracts/v2/TreasuryReservesVault.sol#L674-L706):\n\tExternal calls:\n\t- [_burnedAmount = tokenConfig.dToken.burn(strategy,toBurnAmount)](contracts/v2/TreasuryReservesVault.sol#L685)\n\tEvent emitted after the call(s):\n\t- [StrategyCreditAndDebtBalance(strategy,address(token),_creditBalance,dTokenBalance)](contracts/v2/TreasuryReservesVault.sol#L705)\n", - "first_markdown_element": "contracts/v2/TreasuryReservesVault.sol#L674-L706", - "id": "78e2c75fc5c785d80a007bc1c1087bbce4563651c95d44762df3747b1f1c6ab5", + "description": "Reentrancy in GnosisStrategy.borrow(IERC20,uint256) (contracts/v2/strategies/GnosisStrategy.sol#88-96):\n\tExternal calls:\n\t- circuitBreakerProxy.preCheck(address(token),msg.sender,amount) (contracts/v2/strategies/GnosisStrategy.sol#89-93)\n\tEvent emitted after the call(s):\n\t- Borrow(address(token),amount) (contracts/v2/strategies/GnosisStrategy.sol#94)\n", + "markdown": "Reentrancy in [GnosisStrategy.borrow(IERC20,uint256)](contracts/v2/strategies/GnosisStrategy.sol#L88-L96):\n\tExternal calls:\n\t- [circuitBreakerProxy.preCheck(address(token),msg.sender,amount)](contracts/v2/strategies/GnosisStrategy.sol#L89-L93)\n\tEvent emitted after the call(s):\n\t- [Borrow(address(token),amount)](contracts/v2/strategies/GnosisStrategy.sol#L94)\n", + "first_markdown_element": "contracts/v2/strategies/GnosisStrategy.sol#L88-L96", + "id": "816d5794942352b4b9c381b210cb4b35ac9c43889f1c7eaa1b7e32f3c1f8ab33", "check": "reentrancy-events", "impact": "Low", "confidence": "Medium" @@ -34040,15 +29529,15 @@ "elements": [ { "type": "function", - "name": "_doShutdown", + "name": "borrowAndDeposit", "source_mapping": { - "start": 12265, - "length": 502, + "start": 7809, + "length": 246, "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302], + "lines": [195, 196, 197, 198, 199], "starting_column": 5, "ending_column": 6 }, @@ -34058,9 +29547,9 @@ "name": "DsrBaseStrategy", "source_mapping": { "start": 1041, - "length": 11729, + "length": 11744, "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ @@ -34084,41 +29573,41 @@ 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305 + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_doShutdown(bytes)" + "signature": "borrowAndDeposit(uint256)" } }, { "type": "node", - "name": "(daiAvailable,sharesAvailable) = _checkpointDaiBalance()", + "name": "treasuryReservesVault.borrow(daiToken,amount,address(this))", "source_mapping": { - "start": 12372, - "length": 74, + "start": 7958, + "length": 61, "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [294], + "lines": [197], "starting_column": 9, - "ending_column": 83 + "ending_column": 70 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_doShutdown", + "name": "borrowAndDeposit", "source_mapping": { - "start": 12265, - "length": 502, + "start": 7809, + "length": 246, "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302], + "lines": [195, 196, 197, 198, 199], "starting_column": 5, "ending_column": 6 }, @@ -34128,9 +29617,9 @@ "name": "DsrBaseStrategy", "source_mapping": { "start": 1041, - "length": 11729, + "length": 11744, "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ @@ -34156,13 +29645,13 @@ 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_doShutdown(bytes)" + "signature": "borrowAndDeposit(uint256)" } } }, @@ -34170,30 +29659,30 @@ }, { "type": "node", - "name": "chi = pot.drip()", + "name": "_dsrDeposit(amount)", "source_mapping": { - "start": 5566, - "length": 60, + "start": 8029, + "length": 19, "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [142], + "lines": [198], "starting_column": 9, - "ending_column": 69 + "ending_column": 28 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_checkpointChi", + "name": "borrowAndDeposit", "source_mapping": { - "start": 5445, - "length": 188, + "start": 7809, + "length": 246, "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [140, 141, 142, 143], + "lines": [195, 196, 197, 198, 199], "starting_column": 5, "ending_column": 6 }, @@ -34203,9 +29692,9 @@ "name": "DsrBaseStrategy", "source_mapping": { "start": 1041, - "length": 11729, + "length": 11744, "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ @@ -34231,44 +29720,44 @@ 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_checkpointChi()" + "signature": "borrowAndDeposit(uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "_dsrWithdrawal(sharesAvailable,daiAvailable)", + "name": "chi = pot.drip()", "source_mapping": { - "start": 12456, - "length": 45, + "start": 5566, + "length": 60, "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [295], + "lines": [142], "starting_column": 9, - "ending_column": 54 + "ending_column": 69 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_doShutdown", + "name": "_checkpointChi", "source_mapping": { - "start": 12265, - "length": 502, + "start": 5445, + "length": 188, "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302], + "lines": [140, 141, 142, 143], "starting_column": 5, "ending_column": 6 }, @@ -34278,9 +29767,9 @@ "name": "DsrBaseStrategy", "source_mapping": { "start": 1041, - "length": 11729, + "length": 11744, "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ @@ -34306,44 +29795,44 @@ 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_doShutdown(bytes)" + "signature": "_checkpointChi()" } } }, - "additional_fields": { "underlying_type": "external_calls" } + "additional_fields": { "underlying_type": "external_calls_sending_eth" } }, { "type": "node", - "name": "pot.exit(sharesAmount)", + "name": "daiJoin.join(address(this),amount)", "source_mapping": { - "start": 11582, - "length": 22, + "start": 8342, + "length": 35, "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [278], + "lines": [207], "starting_column": 9, - "ending_column": 31 + "ending_column": 44 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_dsrWithdrawal", + "name": "_dsrDeposit", "source_mapping": { - "start": 11498, - "length": 199, + "start": 8061, + "length": 349, "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [277, 278, 279, 280, 281], + "lines": [201, 202, 203, 204, 205, 206, 207, 208, 209], "starting_column": 5, "ending_column": 6 }, @@ -34353,9 +29842,9 @@ "name": "DsrBaseStrategy", "source_mapping": { "start": 1041, - "length": 11729, + "length": 11744, "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ @@ -34381,13 +29870,13 @@ 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_dsrWithdrawal(uint256,uint256)" + "signature": "_dsrDeposit(uint256)" } } }, @@ -34395,30 +29884,30 @@ }, { "type": "node", - "name": "daiJoin.exit(address(this),daiAmount)", + "name": "pot.join(shares)", "source_mapping": { - "start": 11614, - "length": 38, + "start": 8387, + "length": 16, "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [279], + "lines": [208], "starting_column": 9, - "ending_column": 47 + "ending_column": 25 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_dsrWithdrawal", + "name": "_dsrDeposit", "source_mapping": { - "start": 11498, - "length": 199, + "start": 8061, + "length": 349, "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [277, 278, 279, 280, 281], + "lines": [201, 202, 203, 204, 205, 206, 207, 208, 209], "starting_column": 5, "ending_column": 6 }, @@ -34428,9 +29917,9 @@ "name": "DsrBaseStrategy", "source_mapping": { "start": 1041, - "length": 11729, + "length": 11744, "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ @@ -34456,13 +29945,13 @@ 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_dsrWithdrawal(uint256,uint256)" + "signature": "_dsrDeposit(uint256)" } } }, @@ -34470,30 +29959,30 @@ }, { "type": "node", - "name": "DaiWithdrawn(daiAmount)", + "name": "DaiDeposited(amount)", "source_mapping": { - "start": 11662, - "length": 28, + "start": 8307, + "length": 25, "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [280], + "lines": [206], "starting_column": 9, - "ending_column": 37 + "ending_column": 34 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_dsrWithdrawal", + "name": "_dsrDeposit", "source_mapping": { - "start": 11498, - "length": 199, + "start": 8061, + "length": 349, "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [277, 278, 279, 280, 281], + "lines": [201, 202, 203, 204, 205, 206, 207, 208, 209], "starting_column": 5, "ending_column": 6 }, @@ -34503,9 +29992,9 @@ "name": "DsrBaseStrategy", "source_mapping": { "start": 1041, - "length": 11729, + "length": 11744, "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ @@ -34531,13 +30020,13 @@ 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_dsrWithdrawal(uint256,uint256)" + "signature": "_dsrDeposit(uint256)" } } }, @@ -34545,30 +30034,30 @@ }, { "type": "node", - "name": "_dsrWithdrawal(sharesAvailable,daiAvailable)", + "name": "_dsrDeposit(amount)", "source_mapping": { - "start": 12456, - "length": 45, + "start": 8029, + "length": 19, "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [295], + "lines": [198], "starting_column": 9, - "ending_column": 54 + "ending_column": 28 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_doShutdown", + "name": "borrowAndDeposit", "source_mapping": { - "start": 12265, - "length": 502, + "start": 7809, + "length": 246, "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302], + "lines": [195, 196, 197, 198, 199], "starting_column": 5, "ending_column": 6 }, @@ -34578,9 +30067,9 @@ "name": "DsrBaseStrategy", "source_mapping": { "start": 1041, - "length": 11729, + "length": 11744, "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ @@ -34606,23 +30095,23 @@ 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_doShutdown(bytes)" + "signature": "borrowAndDeposit(uint256)" } } }, "additional_fields": { "underlying_type": "event" } } ], - "description": "Reentrancy in DsrBaseStrategy._doShutdown(bytes) (contracts/v2/strategies/DsrBaseStrategy.sol#292-302):\n\tExternal calls:\n\t- (daiAvailable,sharesAvailable) = _checkpointDaiBalance() (contracts/v2/strategies/DsrBaseStrategy.sol#294)\n\t\t- chi = pot.drip() (contracts/v2/strategies/DsrBaseStrategy.sol#142)\n\t- _dsrWithdrawal(sharesAvailable,daiAvailable) (contracts/v2/strategies/DsrBaseStrategy.sol#295)\n\t\t- pot.exit(sharesAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#278)\n\t\t- daiJoin.exit(address(this),daiAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#279)\n\tEvent emitted after the call(s):\n\t- DaiWithdrawn(daiAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#280)\n\t\t- _dsrWithdrawal(sharesAvailable,daiAvailable) (contracts/v2/strategies/DsrBaseStrategy.sol#295)\n", - "markdown": "Reentrancy in [DsrBaseStrategy._doShutdown(bytes)](contracts/v2/strategies/DsrBaseStrategy.sol#L292-L302):\n\tExternal calls:\n\t- [(daiAvailable,sharesAvailable) = _checkpointDaiBalance()](contracts/v2/strategies/DsrBaseStrategy.sol#L294)\n\t\t- [chi = pot.drip()](contracts/v2/strategies/DsrBaseStrategy.sol#L142)\n\t- [_dsrWithdrawal(sharesAvailable,daiAvailable)](contracts/v2/strategies/DsrBaseStrategy.sol#L295)\n\t\t- [pot.exit(sharesAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L278)\n\t\t- [daiJoin.exit(address(this),daiAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L279)\n\tEvent emitted after the call(s):\n\t- [DaiWithdrawn(daiAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L280)\n\t\t- [_dsrWithdrawal(sharesAvailable,daiAvailable)](contracts/v2/strategies/DsrBaseStrategy.sol#L295)\n", - "first_markdown_element": "contracts/v2/strategies/DsrBaseStrategy.sol#L292-L302", - "id": "0c0fb7f0578c01e3301f1e8fb9ce2d6fe51fe24c8de06fb007ac4bcfc4f4e931", + "description": "Reentrancy in DsrBaseStrategy.borrowAndDeposit(uint256) (contracts/v2/strategies/DsrBaseStrategy.sol#195-199):\n\tExternal calls:\n\t- treasuryReservesVault.borrow(daiToken,amount,address(this)) (contracts/v2/strategies/DsrBaseStrategy.sol#197)\n\t- _dsrDeposit(amount) (contracts/v2/strategies/DsrBaseStrategy.sol#198)\n\t\t- chi = pot.drip() (contracts/v2/strategies/DsrBaseStrategy.sol#142)\n\t\t- daiJoin.join(address(this),amount) (contracts/v2/strategies/DsrBaseStrategy.sol#207)\n\t\t- pot.join(shares) (contracts/v2/strategies/DsrBaseStrategy.sol#208)\n\tEvent emitted after the call(s):\n\t- DaiDeposited(amount) (contracts/v2/strategies/DsrBaseStrategy.sol#206)\n\t\t- _dsrDeposit(amount) (contracts/v2/strategies/DsrBaseStrategy.sol#198)\n", + "markdown": "Reentrancy in [DsrBaseStrategy.borrowAndDeposit(uint256)](contracts/v2/strategies/DsrBaseStrategy.sol#L195-L199):\n\tExternal calls:\n\t- [treasuryReservesVault.borrow(daiToken,amount,address(this))](contracts/v2/strategies/DsrBaseStrategy.sol#L197)\n\t- [_dsrDeposit(amount)](contracts/v2/strategies/DsrBaseStrategy.sol#L198)\n\t\t- [chi = pot.drip()](contracts/v2/strategies/DsrBaseStrategy.sol#L142)\n\t\t- [daiJoin.join(address(this),amount)](contracts/v2/strategies/DsrBaseStrategy.sol#L207)\n\t\t- [pot.join(shares)](contracts/v2/strategies/DsrBaseStrategy.sol#L208)\n\tEvent emitted after the call(s):\n\t- [DaiDeposited(amount)](contracts/v2/strategies/DsrBaseStrategy.sol#L206)\n\t\t- [_dsrDeposit(amount)](contracts/v2/strategies/DsrBaseStrategy.sol#L198)\n", + "first_markdown_element": "contracts/v2/strategies/DsrBaseStrategy.sol#L195-L199", + "id": "fa02cb67c0fadd634b5b58c828b6c896bd82d9eafb17365664e0ed1810997c50", "check": "reentrancy-events", "impact": "Low", "confidence": "Medium" @@ -34631,129 +30120,101 @@ "elements": [ { "type": "function", - "name": "_dsrDeposit", + "name": "borrowAndDeposit", "source_mapping": { - "start": 8061, - "length": 349, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2046, + "length": 229, + "filename_relative": "contracts/v2/strategies/TempleTokenBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/TempleTokenBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/TempleTokenBaseStrategy.sol", "is_dependency": false, - "lines": [201, 202, 203, 204, 205, 206, 207, 208, 209], + "lines": [61, 62, 63, 64, 65], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TempleTokenBaseStrategy", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 689, + "length": 4427, + "filename_relative": "contracts/v2/strategies/TempleTokenBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/TempleTokenBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/TempleTokenBaseStrategy.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305 + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_dsrDeposit(uint256)" + "signature": "borrowAndDeposit(uint256)" } }, { "type": "node", - "name": "shares = _rdiv(amount,_checkpointChi())", + "name": "treasuryReservesVault.borrow(templeToken,amount,address(this))", "source_mapping": { - "start": 8248, - "length": 48, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2135, + "length": 64, + "filename_relative": "contracts/v2/strategies/TempleTokenBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/TempleTokenBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/TempleTokenBaseStrategy.sol", "is_dependency": false, - "lines": [204], + "lines": [62], "starting_column": 9, - "ending_column": 57 + "ending_column": 73 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_dsrDeposit", + "name": "borrowAndDeposit", "source_mapping": { - "start": 8061, - "length": 349, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2046, + "length": 229, + "filename_relative": "contracts/v2/strategies/TempleTokenBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/TempleTokenBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/TempleTokenBaseStrategy.sol", "is_dependency": false, - "lines": [201, 202, 203, 204, 205, 206, 207, 208, 209], + "lines": [61, 62, 63, 64, 65], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TempleTokenBaseStrategy", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 689, + "length": 4427, + "filename_relative": "contracts/v2/strategies/TempleTokenBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/TempleTokenBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/TempleTokenBaseStrategy.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_dsrDeposit(uint256)" + "signature": "borrowAndDeposit(uint256)" } } }, @@ -34761,159 +30222,259 @@ }, { "type": "node", - "name": "chi = pot.drip()", + "name": "TempleBurned(amount)", "source_mapping": { - "start": 5566, - "length": 60, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2209, + "length": 25, + "filename_relative": "contracts/v2/strategies/TempleTokenBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/TempleTokenBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/TempleTokenBaseStrategy.sol", "is_dependency": false, - "lines": [142], + "lines": [63], "starting_column": 9, - "ending_column": 69 + "ending_column": 34 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_checkpointChi", + "name": "borrowAndDeposit", "source_mapping": { - "start": 5445, - "length": 188, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2046, + "length": 229, + "filename_relative": "contracts/v2/strategies/TempleTokenBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/TempleTokenBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/TempleTokenBaseStrategy.sol", "is_dependency": false, - "lines": [140, 141, 142, 143], + "lines": [61, 62, 63, 64, 65], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TempleTokenBaseStrategy", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 689, + "length": 4427, + "filename_relative": "contracts/v2/strategies/TempleTokenBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/TempleTokenBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/TempleTokenBaseStrategy.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_checkpointChi()" + "signature": "borrowAndDeposit(uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + "additional_fields": { "underlying_type": "event" } + } + ], + "description": "Reentrancy in TempleTokenBaseStrategy.borrowAndDeposit(uint256) (contracts/v2/strategies/TempleTokenBaseStrategy.sol#61-65):\n\tExternal calls:\n\t- treasuryReservesVault.borrow(templeToken,amount,address(this)) (contracts/v2/strategies/TempleTokenBaseStrategy.sol#62)\n\tEvent emitted after the call(s):\n\t- TempleBurned(amount) (contracts/v2/strategies/TempleTokenBaseStrategy.sol#63)\n", + "markdown": "Reentrancy in [TempleTokenBaseStrategy.borrowAndDeposit(uint256)](contracts/v2/strategies/TempleTokenBaseStrategy.sol#L61-L65):\n\tExternal calls:\n\t- [treasuryReservesVault.borrow(templeToken,amount,address(this))](contracts/v2/strategies/TempleTokenBaseStrategy.sol#L62)\n\tEvent emitted after the call(s):\n\t- [TempleBurned(amount)](contracts/v2/strategies/TempleTokenBaseStrategy.sol#L63)\n", + "first_markdown_element": "contracts/v2/strategies/TempleTokenBaseStrategy.sol#L61-L65", + "id": "a4b7ebab2add03874fc7d7e0fb2176bb3cce4461f7bee4c56c5e3938077ba4b2", + "check": "reentrancy-events", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "borrowMax", + "source_mapping": { + "start": 3668, + "length": 489, + "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/GnosisStrategy.sol", + "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", + "is_dependency": false, + "lines": [102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "GnosisStrategy", + "source_mapping": { + "start": 584, + "length": 6684, + "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/GnosisStrategy.sol", + "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", + "is_dependency": false, + "lines": [ + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "borrowMax(IERC20)" + } }, { "type": "node", - "name": "DaiDeposited(amount)", + "name": "circuitBreakerProxy.preCheck(address(token),msg.sender,borrowedAmount)", "source_mapping": { - "start": 8307, - "length": 25, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 3915, + "length": 120, + "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/GnosisStrategy.sol", + "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", "is_dependency": false, - "lines": [206], + "lines": [105, 106, 107, 108, 109], "starting_column": 9, - "ending_column": 34 + "ending_column": 10 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_dsrDeposit", + "name": "borrowMax", "source_mapping": { - "start": 8061, - "length": 349, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 3668, + "length": 489, + "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/GnosisStrategy.sol", + "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", "is_dependency": false, - "lines": [201, 202, 203, 204, 205, 206, 207, 208, 209], + "lines": [102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "GnosisStrategy", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 584, + "length": 6684, + "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/GnosisStrategy.sol", + "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "borrowMax(IERC20)" + } + } + }, + "additional_fields": { "underlying_type": "external_calls" } + }, + { + "type": "node", + "name": "Borrow(address(token),borrowedAmount)", + "source_mapping": { + "start": 4045, + "length": 43, + "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/GnosisStrategy.sol", + "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", + "is_dependency": false, + "lines": [110], + "starting_column": 9, + "ending_column": 52 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "borrowMax", + "source_mapping": { + "start": 3668, + "length": 489, + "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/GnosisStrategy.sol", + "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", + "is_dependency": false, + "lines": [102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "GnosisStrategy", + "source_mapping": { + "start": 584, + "length": 6684, + "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/GnosisStrategy.sol", + "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", + "is_dependency": false, + "lines": [ + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_dsrDeposit(uint256)" + "signature": "borrowMax(IERC20)" } } }, "additional_fields": { "underlying_type": "event" } } ], - "description": "Reentrancy in DsrBaseStrategy._dsrDeposit(uint256) (contracts/v2/strategies/DsrBaseStrategy.sol#201-209):\n\tExternal calls:\n\t- shares = _rdiv(amount,_checkpointChi()) (contracts/v2/strategies/DsrBaseStrategy.sol#204)\n\t\t- chi = pot.drip() (contracts/v2/strategies/DsrBaseStrategy.sol#142)\n\tEvent emitted after the call(s):\n\t- DaiDeposited(amount) (contracts/v2/strategies/DsrBaseStrategy.sol#206)\n", - "markdown": "Reentrancy in [DsrBaseStrategy._dsrDeposit(uint256)](contracts/v2/strategies/DsrBaseStrategy.sol#L201-L209):\n\tExternal calls:\n\t- [shares = _rdiv(amount,_checkpointChi())](contracts/v2/strategies/DsrBaseStrategy.sol#L204)\n\t\t- [chi = pot.drip()](contracts/v2/strategies/DsrBaseStrategy.sol#L142)\n\tEvent emitted after the call(s):\n\t- [DaiDeposited(amount)](contracts/v2/strategies/DsrBaseStrategy.sol#L206)\n", - "first_markdown_element": "contracts/v2/strategies/DsrBaseStrategy.sol#L201-L209", - "id": "d7b6d2a10c4c72fb8ed18e875155e8f19fb9578527302b34acf8ce0824782543", + "description": "Reentrancy in GnosisStrategy.borrowMax(IERC20) (contracts/v2/strategies/GnosisStrategy.sol#102-112):\n\tExternal calls:\n\t- circuitBreakerProxy.preCheck(address(token),msg.sender,borrowedAmount) (contracts/v2/strategies/GnosisStrategy.sol#105-109)\n\tEvent emitted after the call(s):\n\t- Borrow(address(token),borrowedAmount) (contracts/v2/strategies/GnosisStrategy.sol#110)\n", + "markdown": "Reentrancy in [GnosisStrategy.borrowMax(IERC20)](contracts/v2/strategies/GnosisStrategy.sol#L102-L112):\n\tExternal calls:\n\t- [circuitBreakerProxy.preCheck(address(token),msg.sender,borrowedAmount)](contracts/v2/strategies/GnosisStrategy.sol#L105-L109)\n\tEvent emitted after the call(s):\n\t- [Borrow(address(token),borrowedAmount)](contracts/v2/strategies/GnosisStrategy.sol#L110)\n", + "first_markdown_element": "contracts/v2/strategies/GnosisStrategy.sol#L102-L112", + "id": "c3beb3c3be57476ae61c0a7cfb0301faed9288220416d314839649d2de9f7b5e", "check": "reentrancy-events", "impact": "Low", "confidence": "Medium" @@ -34922,204 +30483,123 @@ "elements": [ { "type": "function", - "name": "_dsrWithdrawal", + "name": "borrowProtocolToken", "source_mapping": { - "start": 11498, - "length": 199, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 3626, + "length": 353, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, - "lines": [277, 278, 279, 280, 281], + "lines": [91, 92, 93, 94, 95, 96, 97, 98, 99], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "RamosStrategy", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 1131, + "length": 9320, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305 + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_dsrWithdrawal(uint256,uint256)" + "signature": "borrowProtocolToken(uint256,address)" } }, { "type": "node", - "name": "pot.exit(sharesAmount)", - "source_mapping": { - "start": 11582, - "length": 22, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", - "is_dependency": false, - "lines": [278], - "starting_column": 9, - "ending_column": 31 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "_dsrWithdrawal", - "source_mapping": { - "start": 11498, - "length": 199, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", - "is_dependency": false, - "lines": [277, 278, 279, 280, 281], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "DsrBaseStrategy", - "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", - "is_dependency": false, - "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "_dsrWithdrawal(uint256,uint256)" - } - } - }, - "additional_fields": { "underlying_type": "external_calls" } - }, - { - "type": "node", - "name": "daiJoin.exit(address(this),daiAmount)", + "name": "circuitBreakerProxy.preCheck(address(templeToken),msg.sender,amount)", "source_mapping": { - "start": 11614, - "length": 38, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 3728, + "length": 118, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, - "lines": [279], + "lines": [92, 93, 94, 95, 96], "starting_column": 9, - "ending_column": 47 + "ending_column": 10 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_dsrWithdrawal", + "name": "borrowProtocolToken", "source_mapping": { - "start": 11498, - "length": 199, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 3626, + "length": 353, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, - "lines": [277, 278, 279, 280, 281], + "lines": [91, 92, 93, 94, 95, 96, 97, 98, 99], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "RamosStrategy", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 1131, + "length": 9320, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_dsrWithdrawal(uint256,uint256)" + "signature": "borrowProtocolToken(uint256,address)" } } }, @@ -35127,84 +30607,81 @@ }, { "type": "node", - "name": "DaiWithdrawn(daiAmount)", + "name": "BorrowToken(address(templeToken),amount)", "source_mapping": { - "start": 11662, - "length": 28, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 3856, + "length": 46, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, - "lines": [280], + "lines": [97], "starting_column": 9, - "ending_column": 37 + "ending_column": 55 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_dsrWithdrawal", + "name": "borrowProtocolToken", "source_mapping": { - "start": 11498, - "length": 199, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 3626, + "length": 353, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, - "lines": [277, 278, 279, 280, 281], + "lines": [91, 92, 93, 94, 95, 96, 97, 98, 99], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "RamosStrategy", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 1131, + "length": 9320, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_dsrWithdrawal(uint256,uint256)" + "signature": "borrowProtocolToken(uint256,address)" } } }, "additional_fields": { "underlying_type": "event" } } ], - "description": "Reentrancy in DsrBaseStrategy._dsrWithdrawal(uint256,uint256) (contracts/v2/strategies/DsrBaseStrategy.sol#277-281):\n\tExternal calls:\n\t- pot.exit(sharesAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#278)\n\t- daiJoin.exit(address(this),daiAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#279)\n\tEvent emitted after the call(s):\n\t- DaiWithdrawn(daiAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#280)\n", - "markdown": "Reentrancy in [DsrBaseStrategy._dsrWithdrawal(uint256,uint256)](contracts/v2/strategies/DsrBaseStrategy.sol#L277-L281):\n\tExternal calls:\n\t- [pot.exit(sharesAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L278)\n\t- [daiJoin.exit(address(this),daiAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L279)\n\tEvent emitted after the call(s):\n\t- [DaiWithdrawn(daiAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L280)\n", - "first_markdown_element": "contracts/v2/strategies/DsrBaseStrategy.sol#L277-L281", - "id": "83020029bb5c6076984a566dd01b5be6cf661433806e94b99c0674e52d40b492", + "description": "Reentrancy in RamosStrategy.borrowProtocolToken(uint256,address) (contracts/v2/strategies/RamosStrategy.sol#91-99):\n\tExternal calls:\n\t- circuitBreakerProxy.preCheck(address(templeToken),msg.sender,amount) (contracts/v2/strategies/RamosStrategy.sol#92-96)\n\tEvent emitted after the call(s):\n\t- BorrowToken(address(templeToken),amount) (contracts/v2/strategies/RamosStrategy.sol#97)\n", + "markdown": "Reentrancy in [RamosStrategy.borrowProtocolToken(uint256,address)](contracts/v2/strategies/RamosStrategy.sol#L91-L99):\n\tExternal calls:\n\t- [circuitBreakerProxy.preCheck(address(templeToken),msg.sender,amount)](contracts/v2/strategies/RamosStrategy.sol#L92-L96)\n\tEvent emitted after the call(s):\n\t- [BorrowToken(address(templeToken),amount)](contracts/v2/strategies/RamosStrategy.sol#L97)\n", + "first_markdown_element": "contracts/v2/strategies/RamosStrategy.sol#L91-L99", + "id": "e0ba9fad7b97dfcfdfbb8b5dcf413149d4e3c15549b5560fb8aacdf2167f9e31", "check": "reentrancy-events", "impact": "Low", "confidence": "Medium" @@ -35213,209 +30690,123 @@ "elements": [ { "type": "function", - "name": "_mintDToken", + "name": "borrowQuoteToken", "source_mapping": { - "start": 28444, - "length": 1205, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 4172, + "length": 347, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, - "lines": [ - 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, - 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, - 661, 662, 663, 664, 665, 666, 667 - ], + "lines": [106, 107, 108, 109, 110, 111, 112, 113, 114], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "RamosStrategy", "source_mapping": { - "start": 2150, - "length": 31934, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 1131, + "length": 9320, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, - 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, - 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, - 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, - 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, - 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, - 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, - 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, - 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, - 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, - 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, - 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, - 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, - 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, - 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, - 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, - 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, - 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, - 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, - 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, - 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, - 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, - 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, - 771, 772, 773, 774, 775, 776 + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" + "signature": "borrowQuoteToken(uint256,address)" } }, { "type": "node", - "name": "tokenConfig.dToken.mint(strategy,_newDebt)", + "name": "circuitBreakerProxy.preCheck(address(quoteToken),msg.sender,amount)", "source_mapping": { - "start": 29205, - "length": 43, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 4271, + "length": 117, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, - "lines": [654], - "starting_column": 13, - "ending_column": 56 + "lines": [107, 108, 109, 110, 111], + "starting_column": 9, + "ending_column": 10 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_mintDToken", + "name": "borrowQuoteToken", "source_mapping": { - "start": 28444, - "length": 1205, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 4172, + "length": 347, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, - "lines": [ - 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, - 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, - 661, 662, 663, 664, 665, 666, 667 - ], + "lines": [106, 107, 108, 109, 110, 111, 112, 113, 114], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "RamosStrategy", "source_mapping": { - "start": 2150, - "length": 31934, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 1131, + "length": 9320, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776 + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" + "signature": "borrowQuoteToken(uint256,address)" } } }, @@ -35423,125 +30814,81 @@ }, { "type": "node", - "name": "StrategyCreditAndDebtBalance(strategy,address(token),_creditBalance,dTokenBalance)", + "name": "BorrowToken(address(quoteToken),amount)", "source_mapping": { - "start": 29552, - "length": 90, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 4398, + "length": 45, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, - "lines": [666], + "lines": [112], "starting_column": 9, - "ending_column": 99 + "ending_column": 54 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_mintDToken", + "name": "borrowQuoteToken", "source_mapping": { - "start": 28444, - "length": 1205, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 4172, + "length": 347, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, - "lines": [ - 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, - 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, - 661, 662, 663, 664, 665, 666, 667 - ], + "lines": [106, 107, 108, 109, 110, 111, 112, 113, 114], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "RamosStrategy", "source_mapping": { - "start": 2150, - "length": 31934, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 1131, + "length": 9320, + "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776 + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" + "signature": "borrowQuoteToken(uint256,address)" } } }, "additional_fields": { "underlying_type": "event" } } ], - "description": "Reentrancy in TreasuryReservesVault._mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256) (contracts/v2/TreasuryReservesVault.sol#635-667):\n\tExternal calls:\n\t- tokenConfig.dToken.mint(strategy,_newDebt) (contracts/v2/TreasuryReservesVault.sol#654)\n\tEvent emitted after the call(s):\n\t- StrategyCreditAndDebtBalance(strategy,address(token),_creditBalance,dTokenBalance) (contracts/v2/TreasuryReservesVault.sol#666)\n", - "markdown": "Reentrancy in [TreasuryReservesVault._mintDToken(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)](contracts/v2/TreasuryReservesVault.sol#L635-L667):\n\tExternal calls:\n\t- [tokenConfig.dToken.mint(strategy,_newDebt)](contracts/v2/TreasuryReservesVault.sol#L654)\n\tEvent emitted after the call(s):\n\t- [StrategyCreditAndDebtBalance(strategy,address(token),_creditBalance,dTokenBalance)](contracts/v2/TreasuryReservesVault.sol#L666)\n", - "first_markdown_element": "contracts/v2/TreasuryReservesVault.sol#L635-L667", - "id": "e60974bde0cfdbf9c35c3502a01924fdca7dfb49e7372af2096587531e2da181", + "description": "Reentrancy in RamosStrategy.borrowQuoteToken(uint256,address) (contracts/v2/strategies/RamosStrategy.sol#106-114):\n\tExternal calls:\n\t- circuitBreakerProxy.preCheck(address(quoteToken),msg.sender,amount) (contracts/v2/strategies/RamosStrategy.sol#107-111)\n\tEvent emitted after the call(s):\n\t- BorrowToken(address(quoteToken),amount) (contracts/v2/strategies/RamosStrategy.sol#112)\n", + "markdown": "Reentrancy in [RamosStrategy.borrowQuoteToken(uint256,address)](contracts/v2/strategies/RamosStrategy.sol#L106-L114):\n\tExternal calls:\n\t- [circuitBreakerProxy.preCheck(address(quoteToken),msg.sender,amount)](contracts/v2/strategies/RamosStrategy.sol#L107-L111)\n\tEvent emitted after the call(s):\n\t- [BorrowToken(address(quoteToken),amount)](contracts/v2/strategies/RamosStrategy.sol#L112)\n", + "first_markdown_element": "contracts/v2/strategies/RamosStrategy.sol#L106-L114", + "id": "bbc7a06e8819c324c8e6cacd486325e56ef60f1d5a3b26d061c95866855e9804", "check": "reentrancy-events", "impact": "Low", "confidence": "Medium" @@ -35550,328 +30897,469 @@ "elements": [ { "type": "function", - "name": "_withdrawFromBaseStrategy", + "name": "checkpointAssetBalances", "source_mapping": { - "start": 25738, - "length": 2529, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 6888, + "length": 403, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [ - 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, - 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, - 620, 621, 622, 623, 624, 625, 626, 627, 628, 629 - ], + "lines": [173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 2150, - "length": 31934, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, - 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, - 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, - 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, - 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, - 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, - 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, - 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, - 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, - 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, - 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, - 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, - 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, - 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, - 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, - 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, - 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, - 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, - 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, - 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, - 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, - 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, - 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, - 771, 772, 773, 774, 775, 776 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_withdrawFromBaseStrategy(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,address,uint256)" + "signature": "checkpointAssetBalances()" } }, { "type": "node", - "name": "_withdrawnAmount = _baseStrategy.trvWithdraw(_withdrawFromBaseStrategyAmount)", + "name": "(daiBalance) = _checkpointDaiBalance()", "source_mapping": { - "start": 27224, - "length": 85, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 7011, + "length": 48, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [607], - "starting_column": 17, - "ending_column": 102 + "lines": [176], + "starting_column": 9, + "ending_column": 57 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_withdrawFromBaseStrategy", + "name": "checkpointAssetBalances", "source_mapping": { - "start": 25738, - "length": 2529, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 6888, + "length": 403, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [ - 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, - 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, - 620, 621, 622, 623, 624, 625, 626, 627, 628, 629 - ], + "lines": [173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 2150, - "length": 31934, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_withdrawFromBaseStrategy(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,address,uint256)" + "signature": "checkpointAssetBalances()" + } + } + }, + "additional_fields": { "underlying_type": "external_calls" } + }, + { + "type": "node", + "name": "chi = pot.drip()", + "source_mapping": { + "start": 5566, + "length": 60, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "is_dependency": false, + "lines": [142], + "starting_column": 9, + "ending_column": 69 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "_checkpointChi", + "source_mapping": { + "start": 5445, + "length": 188, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "is_dependency": false, + "lines": [140, 141, 142, 143], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DsrBaseStrategy", + "source_mapping": { + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "is_dependency": false, + "lines": [ + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "_checkpointChi()" + } + } + }, + "additional_fields": { "underlying_type": "external_calls_sending_eth" } + }, + { + "type": "node", + "name": "AssetBalancesCheckpoint(assetBalances)", + "source_mapping": { + "start": 7241, + "length": 43, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "is_dependency": false, + "lines": [182], + "starting_column": 9, + "ending_column": 52 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "checkpointAssetBalances", + "source_mapping": { + "start": 6888, + "length": 403, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "is_dependency": false, + "lines": [173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DsrBaseStrategy", + "source_mapping": { + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "is_dependency": false, + "lines": [ + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "checkpointAssetBalances()" } } }, - "additional_fields": { "underlying_type": "external_calls" } + "additional_fields": { "underlying_type": "event" } + } + ], + "description": "Reentrancy in DsrBaseStrategy.checkpointAssetBalances() (contracts/v2/strategies/DsrBaseStrategy.sol#173-183):\n\tExternal calls:\n\t- (daiBalance) = _checkpointDaiBalance() (contracts/v2/strategies/DsrBaseStrategy.sol#176)\n\t\t- chi = pot.drip() (contracts/v2/strategies/DsrBaseStrategy.sol#142)\n\tEvent emitted after the call(s):\n\t- AssetBalancesCheckpoint(assetBalances) (contracts/v2/strategies/DsrBaseStrategy.sol#182)\n", + "markdown": "Reentrancy in [DsrBaseStrategy.checkpointAssetBalances()](contracts/v2/strategies/DsrBaseStrategy.sol#L173-L183):\n\tExternal calls:\n\t- [(daiBalance) = _checkpointDaiBalance()](contracts/v2/strategies/DsrBaseStrategy.sol#L176)\n\t\t- [chi = pot.drip()](contracts/v2/strategies/DsrBaseStrategy.sol#L142)\n\tEvent emitted after the call(s):\n\t- [AssetBalancesCheckpoint(assetBalances)](contracts/v2/strategies/DsrBaseStrategy.sol#L182)\n", + "first_markdown_element": "contracts/v2/strategies/DsrBaseStrategy.sol#L173-L183", + "id": "91547e7be3e8d823bd0bb0f659906fbda2e7c22a3e071f2d8982d126ca2e8293", + "check": "reentrancy-events", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "depositAndStakeBptTokens", + "source_mapping": { + "start": 24153, + "length": 411, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", + "is_dependency": false, + "lines": [566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Ramos", + "source_mapping": { + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", + "is_dependency": false, + "lines": [ + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, + 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, + 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, + 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, + 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, + 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, + 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, + 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, + 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, + 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, + 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, + 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, + 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, + 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, + 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, + 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, + 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, + 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, + 621 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "depositAndStakeBptTokens(uint256,bool)" + } }, { "type": "node", - "name": "_burnDToken(_baseStrategyAddr,strategies[_baseStrategyAddr],token,tokenConfig,_withdrawnAmount,tokenConfig.dToken.balanceOf(_baseStrategyAddr))", + "name": "bptToken.safeTransferFrom(msg.sender,address(this),amount)", "source_mapping": { - "start": 27436, - "length": 319, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 24336, + "length": 60, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [611, 612, 613, 614, 615, 616, 617, 618], - "starting_column": 21, - "ending_column": 22 + "lines": [571], + "starting_column": 13, + "ending_column": 73 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_withdrawFromBaseStrategy", + "name": "depositAndStakeBptTokens", "source_mapping": { - "start": 25738, - "length": 2529, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 24153, + "length": 411, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [ - 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, - 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, - 620, 621, 622, 623, 624, 625, 626, 627, 628, 629 - ], + "lines": [566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "Ramos", "source_mapping": { - "start": 2150, - "length": 31934, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776 + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, + 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, + 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, + 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, + 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, + 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, + 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_withdrawFromBaseStrategy(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,address,uint256)" + "signature": "depositAndStakeBptTokens(uint256,bool)" } } }, @@ -35879,358 +31367,309 @@ }, { "type": "node", - "name": "_burnedAmount = tokenConfig.dToken.burn(strategy,toBurnAmount)", + "name": "bptToken.safeTransfer(address(amoStaking),amount)", "source_mapping": { - "start": 30309, - "length": 71, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 24416, + "length": 50, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [685], + "lines": [573], "starting_column": 9, - "ending_column": 80 + "ending_column": 59 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_burnDToken", + "name": "depositAndStakeBptTokens", "source_mapping": { - "start": 29910, - "length": 1179, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 24153, + "length": 411, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [ - 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, - 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, - 700, 701, 702, 703, 704, 705, 706 - ], + "lines": [566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "Ramos", "source_mapping": { - "start": 2150, - "length": 31934, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776 + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, + 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, + 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, + 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, + 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, + 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, + 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" + "signature": "depositAndStakeBptTokens(uint256,bool)" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "StrategyCreditAndDebtBalance(strategy,address(token),_creditBalance,dTokenBalance)", + "name": "amoStaking.depositAndStake(amount)", "source_mapping": { - "start": 30992, - "length": 90, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 24476, + "length": 34, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [705], + "lines": [574], "starting_column": 9, - "ending_column": 99 + "ending_column": 43 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_burnDToken", + "name": "depositAndStakeBptTokens", "source_mapping": { - "start": 29910, - "length": 1179, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 24153, + "length": 411, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [ - 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, - 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, - 700, 701, 702, 703, 704, 705, 706 - ], + "lines": [566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "Ramos", "source_mapping": { - "start": 2150, - "length": 31934, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776 + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, + 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, + 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, + 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, + 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, + 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, + 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_burnDToken(address,ITreasuryReservesVault.StrategyConfig,IERC20,ITreasuryReservesVault.BorrowTokenConfig,uint256,uint256)" + "signature": "depositAndStakeBptTokens(uint256,bool)" } } }, - "additional_fields": { "underlying_type": "event" } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "_burnDToken(_baseStrategyAddr,strategies[_baseStrategyAddr],token,tokenConfig,_withdrawnAmount,tokenConfig.dToken.balanceOf(_baseStrategyAddr))", + "name": "DepositAndStakeBptTokens(amount)", "source_mapping": { - "start": 27436, - "length": 319, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 24520, + "length": 37, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [611, 612, 613, 614, 615, 616, 617, 618], - "starting_column": 21, - "ending_column": 22 + "lines": [575], + "starting_column": 9, + "ending_column": 46 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_withdrawFromBaseStrategy", + "name": "depositAndStakeBptTokens", "source_mapping": { - "start": 25738, - "length": 2529, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 24153, + "length": 411, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [ - 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, - 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, - 620, 621, 622, 623, 624, 625, 626, 627, 628, 629 - ], + "lines": [566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "Ramos", "source_mapping": { - "start": 2150, - "length": 31934, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776 + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, + 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, + 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, + 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, + 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, + 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, + 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_withdrawFromBaseStrategy(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,address,uint256)" + "signature": "depositAndStakeBptTokens(uint256,bool)" } } }, "additional_fields": { "underlying_type": "event" } } ], - "description": "Reentrancy in TreasuryReservesVault._withdrawFromBaseStrategy(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,address,uint256) (contracts/v2/TreasuryReservesVault.sol#581-629):\n\tExternal calls:\n\t- _withdrawnAmount = _baseStrategy.trvWithdraw(_withdrawFromBaseStrategyAmount) (contracts/v2/TreasuryReservesVault.sol#607)\n\t- _burnDToken(_baseStrategyAddr,strategies[_baseStrategyAddr],token,tokenConfig,_withdrawnAmount,tokenConfig.dToken.balanceOf(_baseStrategyAddr)) (contracts/v2/TreasuryReservesVault.sol#611-618)\n\t\t- _burnedAmount = tokenConfig.dToken.burn(strategy,toBurnAmount) (contracts/v2/TreasuryReservesVault.sol#685)\n\tEvent emitted after the call(s):\n\t- StrategyCreditAndDebtBalance(strategy,address(token),_creditBalance,dTokenBalance) (contracts/v2/TreasuryReservesVault.sol#705)\n\t\t- _burnDToken(_baseStrategyAddr,strategies[_baseStrategyAddr],token,tokenConfig,_withdrawnAmount,tokenConfig.dToken.balanceOf(_baseStrategyAddr)) (contracts/v2/TreasuryReservesVault.sol#611-618)\n", - "markdown": "Reentrancy in [TreasuryReservesVault._withdrawFromBaseStrategy(address,IERC20,ITreasuryReservesVault.BorrowTokenConfig,address,uint256)](contracts/v2/TreasuryReservesVault.sol#L581-L629):\n\tExternal calls:\n\t- [_withdrawnAmount = _baseStrategy.trvWithdraw(_withdrawFromBaseStrategyAmount)](contracts/v2/TreasuryReservesVault.sol#L607)\n\t- [_burnDToken(_baseStrategyAddr,strategies[_baseStrategyAddr],token,tokenConfig,_withdrawnAmount,tokenConfig.dToken.balanceOf(_baseStrategyAddr))](contracts/v2/TreasuryReservesVault.sol#L611-L618)\n\t\t- [_burnedAmount = tokenConfig.dToken.burn(strategy,toBurnAmount)](contracts/v2/TreasuryReservesVault.sol#L685)\n\tEvent emitted after the call(s):\n\t- [StrategyCreditAndDebtBalance(strategy,address(token),_creditBalance,dTokenBalance)](contracts/v2/TreasuryReservesVault.sol#L705)\n\t\t- [_burnDToken(_baseStrategyAddr,strategies[_baseStrategyAddr],token,tokenConfig,_withdrawnAmount,tokenConfig.dToken.balanceOf(_baseStrategyAddr))](contracts/v2/TreasuryReservesVault.sol#L611-L618)\n", - "first_markdown_element": "contracts/v2/TreasuryReservesVault.sol#L581-L629", - "id": "8c8684d4b931d1b7fd919584856f95516d86babffb0a57f486706ca96a51623c", + "description": "Reentrancy in Ramos.depositAndStakeBptTokens(uint256,bool) (contracts/amo/Ramos.sol#566-576):\n\tExternal calls:\n\t- bptToken.safeTransferFrom(msg.sender,address(this),amount) (contracts/amo/Ramos.sol#571)\n\t- bptToken.safeTransfer(address(amoStaking),amount) (contracts/amo/Ramos.sol#573)\n\t- amoStaking.depositAndStake(amount) (contracts/amo/Ramos.sol#574)\n\tEvent emitted after the call(s):\n\t- DepositAndStakeBptTokens(amount) (contracts/amo/Ramos.sol#575)\n", + "markdown": "Reentrancy in [Ramos.depositAndStakeBptTokens(uint256,bool)](contracts/amo/Ramos.sol#L566-L576):\n\tExternal calls:\n\t- [bptToken.safeTransferFrom(msg.sender,address(this),amount)](contracts/amo/Ramos.sol#L571)\n\t- [bptToken.safeTransfer(address(amoStaking),amount)](contracts/amo/Ramos.sol#L573)\n\t- [amoStaking.depositAndStake(amount)](contracts/amo/Ramos.sol#L574)\n\tEvent emitted after the call(s):\n\t- [DepositAndStakeBptTokens(amount)](contracts/amo/Ramos.sol#L575)\n", + "first_markdown_element": "contracts/amo/Ramos.sol#L566-L576", + "id": "67e99bfded023e26233003458844419ba59173900b8f69b73dd5b1196eedee80", "check": "reentrancy-events", "impact": "Low", "confidence": "Medium" @@ -36239,19 +31678,18 @@ "elements": [ { "type": "function", - "name": "addLiquidity", + "name": "rebalanceDownExit", "source_mapping": { - "start": 20001, - "length": 2092, + "start": 13900, + "length": 1330, "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, - 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, - 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513 + 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, + 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, + 360, 361, 362, 363, 364 ], "starting_column": 5, "ending_column": 6 @@ -36264,7 +31702,7 @@ "start": 1893, "length": 24333, "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ @@ -36318,39 +31756,38 @@ "ending_column": 0 } }, - "signature": "addLiquidity(IBalancerVault.JoinPoolRequest)" + "signature": "rebalanceDownExit(uint256,uint256)" } }, { "type": "node", - "name": "_tokenVault.borrowProtocolToken(protocolTokenAmount,address(this))", + "name": "amoStaking.withdrawAndUnwrap(bptAmountIn,false,address(_poolHelper))", "source_mapping": { - "start": 20777, - "length": 67, + "start": 14331, + "length": 70, "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [483], + "lines": [343], "starting_column": 9, - "ending_column": 76 + "ending_column": 79 }, "type_specific_fields": { "parent": { "type": "function", - "name": "addLiquidity", + "name": "rebalanceDownExit", "source_mapping": { - "start": 20001, - "length": 2092, + "start": 13900, + "length": 1330, "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, - 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, - 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513 + 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, + 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, + 360, 361, 362, 363, 364 ], "starting_column": 5, "ending_column": 6 @@ -36363,7 +31800,7 @@ "start": 1893, "length": 24333, "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ @@ -36420,7 +31857,7 @@ "ending_column": 0 } }, - "signature": "addLiquidity(IBalancerVault.JoinPoolRequest)" + "signature": "rebalanceDownExit(uint256,uint256)" } } }, @@ -36428,34 +31865,33 @@ }, { "type": "node", - "name": "_tokenVault.borrowQuoteToken(quoteTokenAmount,address(this))", + "name": "quoteTokenAmountOut = _poolHelper.exitPool(bptAmountIn,minQuoteTokenAmountOut,rebalancePercentageBoundLow,rebalancePercentageBoundUp,postRebalanceDelta,1 - protocolTokenBalancerPoolIndex,treasuryPriceIndex(),quoteToken)", "source_mapping": { - "start": 20854, - "length": 61, + "start": 14451, + "length": 266, "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [484], + "lines": [346, 347, 348, 349], "starting_column": 9, - "ending_column": 70 + "ending_column": 10 }, "type_specific_fields": { "parent": { "type": "function", - "name": "addLiquidity", + "name": "rebalanceDownExit", "source_mapping": { - "start": 20001, - "length": 2092, + "start": 13900, + "length": 1330, "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, - 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, - 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513 + 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, + 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, + 360, 361, 362, 363, 364 ], "starting_column": 5, "ending_column": 6 @@ -36468,7 +31904,7 @@ "start": 1893, "length": 24333, "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ @@ -36525,7 +31961,7 @@ "ending_column": 0 } }, - "signature": "addLiquidity(IBalancerVault.JoinPoolRequest)" + "signature": "rebalanceDownExit(uint256,uint256)" } } }, @@ -36533,34 +31969,335 @@ }, { "type": "node", - "name": "protocolToken.safeIncreaseAllowance(address(balancerVault),protocolTokenAmount)", + "name": "quoteToken.safeTransfer(feeCollector,feeAmt)", "source_mapping": { - "start": 20995, - "length": 80, + "start": 14910, + "length": 45, "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [488], + "lines": [354], "starting_column": 13, - "ending_column": 93 + "ending_column": 58 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "rebalanceDownExit", + "source_mapping": { + "start": 13900, + "length": 1330, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", + "is_dependency": false, + "lines": [ + 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, + 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, + 360, 361, 362, 363, 364 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Ramos", + "source_mapping": { + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", + "is_dependency": false, + "lines": [ + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, + 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, + 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, + 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, + 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, + 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, + 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "rebalanceDownExit(uint256,uint256)" + } + } + }, + "additional_fields": { "underlying_type": "external_calls" } + }, + { + "type": "node", + "name": "RebalanceDownExit(bptAmountIn,quoteTokenAmountOut,feeAmt)", + "source_mapping": { + "start": 15049, + "length": 64, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", + "is_dependency": false, + "lines": [360], + "starting_column": 9, + "ending_column": 73 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "rebalanceDownExit", + "source_mapping": { + "start": 13900, + "length": 1330, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", + "is_dependency": false, + "lines": [ + 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, + 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, + 360, 361, 362, 363, 364 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Ramos", + "source_mapping": { + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", + "is_dependency": false, + "lines": [ + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, + 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, + 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, + 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, + 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, + 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, + 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "rebalanceDownExit(uint256,uint256)" + } + } + }, + "additional_fields": { "underlying_type": "event" } + } + ], + "description": "Reentrancy in Ramos.rebalanceDownExit(uint256,uint256) (contracts/amo/Ramos.sol#334-364):\n\tExternal calls:\n\t- amoStaking.withdrawAndUnwrap(bptAmountIn,false,address(_poolHelper)) (contracts/amo/Ramos.sol#343)\n\t- quoteTokenAmountOut = _poolHelper.exitPool(bptAmountIn,minQuoteTokenAmountOut,rebalancePercentageBoundLow,rebalancePercentageBoundUp,postRebalanceDelta,1 - protocolTokenBalancerPoolIndex,treasuryPriceIndex(),quoteToken) (contracts/amo/Ramos.sol#346-349)\n\t- quoteToken.safeTransfer(feeCollector,feeAmt) (contracts/amo/Ramos.sol#354)\n\tEvent emitted after the call(s):\n\t- RebalanceDownExit(bptAmountIn,quoteTokenAmountOut,feeAmt) (contracts/amo/Ramos.sol#360)\n", + "markdown": "Reentrancy in [Ramos.rebalanceDownExit(uint256,uint256)](contracts/amo/Ramos.sol#L334-L364):\n\tExternal calls:\n\t- [amoStaking.withdrawAndUnwrap(bptAmountIn,false,address(_poolHelper))](contracts/amo/Ramos.sol#L343)\n\t- [quoteTokenAmountOut = _poolHelper.exitPool(bptAmountIn,minQuoteTokenAmountOut,rebalancePercentageBoundLow,rebalancePercentageBoundUp,postRebalanceDelta,1 - protocolTokenBalancerPoolIndex,treasuryPriceIndex(),quoteToken)](contracts/amo/Ramos.sol#L346-L349)\n\t- [quoteToken.safeTransfer(feeCollector,feeAmt)](contracts/amo/Ramos.sol#L354)\n\tEvent emitted after the call(s):\n\t- [RebalanceDownExit(bptAmountIn,quoteTokenAmountOut,feeAmt)](contracts/amo/Ramos.sol#L360)\n", + "first_markdown_element": "contracts/amo/Ramos.sol#L334-L364", + "id": "6083aa0bd6d99d380fd5f140d51f148bea51f9d21cc99bae41a0172c0c80592f", + "check": "reentrancy-events", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "rebalanceDownJoin", + "source_mapping": { + "start": 18072, + "length": 1545, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", + "is_dependency": false, + "lines": [ + 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, + 447, 448, 449, 450, 451, 452, 453, 454, 455 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Ramos", + "source_mapping": { + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", + "is_dependency": false, + "lines": [ + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, + 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, + 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, + 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, + 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, + 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, + 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, + 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, + 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, + 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, + 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, + 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, + 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, + 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, + 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, + 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, + 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, + 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, + 621 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "rebalanceDownJoin(uint256,uint256)" + } + }, + { + "type": "node", + "name": "tokenVault.borrowProtocolToken(protocolTokenAmountIn,address(this))", + "source_mapping": { + "start": 18436, + "length": 68, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", + "is_dependency": false, + "lines": [429], + "starting_column": 9, + "ending_column": 77 }, "type_specific_fields": { "parent": { "type": "function", - "name": "addLiquidity", + "name": "rebalanceDownJoin", "source_mapping": { - "start": 20001, - "length": 2092, + "start": 18072, + "length": 1545, "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, - 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, - 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513 + 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, + 447, 448, 449, 450, 451, 452, 453, 454, 455 ], "starting_column": 5, "ending_column": 6 @@ -36573,7 +32310,7 @@ "start": 1893, "length": 24333, "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ @@ -36630,7 +32367,7 @@ "ending_column": 0 } }, - "signature": "addLiquidity(IBalancerVault.JoinPoolRequest)" + "signature": "rebalanceDownJoin(uint256,uint256)" } } }, @@ -36638,34 +32375,33 @@ }, { "type": "node", - "name": "quoteToken.safeApprove(address(balancerVault),0)", + "name": "protocolToken.safeTransfer(feeCollector,feeAmt)", "source_mapping": { - "start": 21254, - "length": 49, + "start": 18710, + "length": 48, "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [491], - "starting_column": 17, - "ending_column": 66 + "lines": [434], + "starting_column": 13, + "ending_column": 61 }, "type_specific_fields": { "parent": { "type": "function", - "name": "addLiquidity", + "name": "rebalanceDownJoin", "source_mapping": { - "start": 20001, - "length": 2092, + "start": 18072, + "length": 1545, "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, - 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, - 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513 + 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, + 447, 448, 449, 450, 451, 452, 453, 454, 455 ], "starting_column": 5, "ending_column": 6 @@ -36678,7 +32414,7 @@ "start": 1893, "length": 24333, "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ @@ -36735,7 +32471,7 @@ "ending_column": 0 } }, - "signature": "addLiquidity(IBalancerVault.JoinPoolRequest)" + "signature": "rebalanceDownJoin(uint256,uint256)" } } }, @@ -36743,34 +32479,33 @@ }, { "type": "node", - "name": "quoteToken.safeIncreaseAllowance(address(balancerVault),quoteTokenAmount)", + "name": "protocolToken.safeTransfer(address(_poolHelper),joinAmountIn)", "source_mapping": { - "start": 21321, - "length": 74, + "start": 18942, + "length": 62, "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [492], - "starting_column": 17, - "ending_column": 91 + "lines": [440], + "starting_column": 9, + "ending_column": 71 }, "type_specific_fields": { "parent": { "type": "function", - "name": "addLiquidity", + "name": "rebalanceDownJoin", "source_mapping": { - "start": 20001, - "length": 2092, + "start": 18072, + "length": 1545, "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, - 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, - 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513 + 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, + 447, 448, 449, 450, 451, 452, 453, 454, 455 ], "starting_column": 5, "ending_column": 6 @@ -36783,7 +32518,7 @@ "start": 1893, "length": 24333, "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ @@ -36840,7 +32575,7 @@ "ending_column": 0 } }, - "signature": "addLiquidity(IBalancerVault.JoinPoolRequest)" + "signature": "rebalanceDownJoin(uint256,uint256)" } } }, @@ -36848,34 +32583,33 @@ }, { "type": "node", - "name": "balancerVault.joinPool(balancerPoolId,address(this),address(this),request)", + "name": "bptTokensStaked = _poolHelper.joinPool(joinAmountIn,minBptOut,rebalancePercentageBoundUp,rebalancePercentageBoundLow,treasuryPriceIndex(),postRebalanceDelta,protocolTokenBalancerPoolIndex,protocolToken)", "source_mapping": { - "start": 21538, - "length": 77, + "start": 19057, + "length": 264, "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [499], - "starting_column": 13, - "ending_column": 90 + "lines": [443, 444, 445, 446, 447], + "starting_column": 9, + "ending_column": 10 }, "type_specific_fields": { "parent": { "type": "function", - "name": "addLiquidity", + "name": "rebalanceDownJoin", "source_mapping": { - "start": 20001, - "length": 2092, + "start": 18072, + "length": 1545, "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, - 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, - 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513 + 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, + 447, 448, 449, 450, 451, 452, 453, 454, 455 ], "starting_column": 5, "ending_column": 6 @@ -36888,7 +32622,7 @@ "start": 1893, "length": 24333, "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ @@ -36945,7 +32679,7 @@ "ending_column": 0 } }, - "signature": "addLiquidity(IBalancerVault.JoinPoolRequest)" + "signature": "rebalanceDownJoin(uint256,uint256)" } } }, @@ -36953,34 +32687,33 @@ }, { "type": "node", - "name": "LiquidityAdded(quoteTokenAmount,protocolTokenAmount,bptTokensStaked)", + "name": "RebalanceDownJoin(protocolTokenAmountIn,bptTokensStaked,feeAmt)", "source_mapping": { - "start": 21814, - "length": 75, + "start": 19331, + "length": 70, "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [506], + "lines": [448], "starting_column": 9, - "ending_column": 84 + "ending_column": 79 }, "type_specific_fields": { "parent": { "type": "function", - "name": "addLiquidity", + "name": "rebalanceDownJoin", "source_mapping": { - "start": 20001, - "length": 2092, + "start": 18072, + "length": 1545, "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, - 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, - 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513 + 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, + 447, 448, 449, 450, 451, 452, 453, 454, 455 ], "starting_column": 5, "ending_column": 6 @@ -36993,7 +32726,7 @@ "start": 1893, "length": 24333, "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ @@ -37050,17 +32783,17 @@ "ending_column": 0 } }, - "signature": "addLiquidity(IBalancerVault.JoinPoolRequest)" + "signature": "rebalanceDownJoin(uint256,uint256)" } } }, "additional_fields": { "underlying_type": "event" } } ], - "description": "Reentrancy in Ramos.addLiquidity(IBalancerVault.JoinPoolRequest) (contracts/amo/Ramos.sol#464-513):\n\tExternal calls:\n\t- _tokenVault.borrowProtocolToken(protocolTokenAmount,address(this)) (contracts/amo/Ramos.sol#483)\n\t- _tokenVault.borrowQuoteToken(quoteTokenAmount,address(this)) (contracts/amo/Ramos.sol#484)\n\t- protocolToken.safeIncreaseAllowance(address(balancerVault),protocolTokenAmount) (contracts/amo/Ramos.sol#488)\n\t- quoteToken.safeApprove(address(balancerVault),0) (contracts/amo/Ramos.sol#491)\n\t- quoteToken.safeIncreaseAllowance(address(balancerVault),quoteTokenAmount) (contracts/amo/Ramos.sol#492)\n\t- balancerVault.joinPool(balancerPoolId,address(this),address(this),request) (contracts/amo/Ramos.sol#499)\n\tEvent emitted after the call(s):\n\t- LiquidityAdded(quoteTokenAmount,protocolTokenAmount,bptTokensStaked) (contracts/amo/Ramos.sol#506)\n", - "markdown": "Reentrancy in [Ramos.addLiquidity(IBalancerVault.JoinPoolRequest)](contracts/amo/Ramos.sol#L464-L513):\n\tExternal calls:\n\t- [_tokenVault.borrowProtocolToken(protocolTokenAmount,address(this))](contracts/amo/Ramos.sol#L483)\n\t- [_tokenVault.borrowQuoteToken(quoteTokenAmount,address(this))](contracts/amo/Ramos.sol#L484)\n\t- [protocolToken.safeIncreaseAllowance(address(balancerVault),protocolTokenAmount)](contracts/amo/Ramos.sol#L488)\n\t- [quoteToken.safeApprove(address(balancerVault),0)](contracts/amo/Ramos.sol#L491)\n\t- [quoteToken.safeIncreaseAllowance(address(balancerVault),quoteTokenAmount)](contracts/amo/Ramos.sol#L492)\n\t- [balancerVault.joinPool(balancerPoolId,address(this),address(this),request)](contracts/amo/Ramos.sol#L499)\n\tEvent emitted after the call(s):\n\t- [LiquidityAdded(quoteTokenAmount,protocolTokenAmount,bptTokensStaked)](contracts/amo/Ramos.sol#L506)\n", - "first_markdown_element": "contracts/amo/Ramos.sol#L464-L513", - "id": "15647cc5365c69815f9cf055275a3e256df8e9495b6e93d5e1a813c3a4db8bfa", + "description": "Reentrancy in Ramos.rebalanceDownJoin(uint256,uint256) (contracts/amo/Ramos.sol#421-455):\n\tExternal calls:\n\t- tokenVault.borrowProtocolToken(protocolTokenAmountIn,address(this)) (contracts/amo/Ramos.sol#429)\n\t- protocolToken.safeTransfer(feeCollector,feeAmt) (contracts/amo/Ramos.sol#434)\n\t- protocolToken.safeTransfer(address(_poolHelper),joinAmountIn) (contracts/amo/Ramos.sol#440)\n\t- bptTokensStaked = _poolHelper.joinPool(joinAmountIn,minBptOut,rebalancePercentageBoundUp,rebalancePercentageBoundLow,treasuryPriceIndex(),postRebalanceDelta,protocolTokenBalancerPoolIndex,protocolToken) (contracts/amo/Ramos.sol#443-447)\n\tEvent emitted after the call(s):\n\t- RebalanceDownJoin(protocolTokenAmountIn,bptTokensStaked,feeAmt) (contracts/amo/Ramos.sol#448)\n", + "markdown": "Reentrancy in [Ramos.rebalanceDownJoin(uint256,uint256)](contracts/amo/Ramos.sol#L421-L455):\n\tExternal calls:\n\t- [tokenVault.borrowProtocolToken(protocolTokenAmountIn,address(this))](contracts/amo/Ramos.sol#L429)\n\t- [protocolToken.safeTransfer(feeCollector,feeAmt)](contracts/amo/Ramos.sol#L434)\n\t- [protocolToken.safeTransfer(address(_poolHelper),joinAmountIn)](contracts/amo/Ramos.sol#L440)\n\t- [bptTokensStaked = _poolHelper.joinPool(joinAmountIn,minBptOut,rebalancePercentageBoundUp,rebalancePercentageBoundLow,treasuryPriceIndex(),postRebalanceDelta,protocolTokenBalancerPoolIndex,protocolToken)](contracts/amo/Ramos.sol#L443-L447)\n\tEvent emitted after the call(s):\n\t- [RebalanceDownJoin(protocolTokenAmountIn,bptTokensStaked,feeAmt)](contracts/amo/Ramos.sol#L448)\n", + "first_markdown_element": "contracts/amo/Ramos.sol#L421-L455", + "id": "4ad07f927825c05b798c66409225ee0120c0e24658c057fada6ad9f73180240c", "check": "reentrancy-events", "impact": "Low", "confidence": "Medium" @@ -37069,31 +32802,34 @@ "elements": [ { "type": "function", - "name": "addLiquidity", + "name": "rebalanceUpExit", "source_mapping": { - "start": 6909, - "length": 365, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 11847, + "length": 1435, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [177, 178, 179, 180, 181, 182, 183, 184], + "lines": [ + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "RamosStrategy", + "name": "Ramos", "source_mapping": { - "start": 1131, - "length": 9158, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, @@ -37108,431 +32844,74 @@ 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "addLiquidity(IBalancerVault.JoinPoolRequest)" - } - }, - { - "type": "node", - "name": "(quoteTokenAmount,protocolTokenAmount,bptTokensStaked) = ramos.addLiquidity(_requestData)", - "source_mapping": { - "start": 7023, - "length": 161, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", - "is_dependency": false, - "lines": [178, 179, 180, 181, 182], - "starting_column": 9, - "ending_column": 45 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "addLiquidity", - "source_mapping": { - "start": 6909, - "length": 365, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", - "is_dependency": false, - "lines": [177, 178, 179, 180, 181, 182, 183, 184], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "RamosStrategy", - "source_mapping": { - "start": 1131, - "length": 9158, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", - "is_dependency": false, - "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "addLiquidity(IBalancerVault.JoinPoolRequest)" - } - } - }, - "additional_fields": { "underlying_type": "external_calls" } - }, - { - "type": "node", - "name": "AddLiquidity(quoteTokenAmount,protocolTokenAmount,bptTokensStaked)", - "source_mapping": { - "start": 7194, - "length": 73, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", - "is_dependency": false, - "lines": [183], - "starting_column": 9, - "ending_column": 82 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "addLiquidity", - "source_mapping": { - "start": 6909, - "length": 365, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", - "is_dependency": false, - "lines": [177, 178, 179, 180, 181, 182, 183, 184], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "RamosStrategy", - "source_mapping": { - "start": 1131, - "length": 9158, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", - "is_dependency": false, - "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "addLiquidity(IBalancerVault.JoinPoolRequest)" - } - } - }, - "additional_fields": { "underlying_type": "event" } - } - ], - "description": "Reentrancy in RamosStrategy.addLiquidity(IBalancerVault.JoinPoolRequest) (contracts/v2/strategies/RamosStrategy.sol#177-184):\n\tExternal calls:\n\t- (quoteTokenAmount,protocolTokenAmount,bptTokensStaked) = ramos.addLiquidity(_requestData) (contracts/v2/strategies/RamosStrategy.sol#178-182)\n\tEvent emitted after the call(s):\n\t- AddLiquidity(quoteTokenAmount,protocolTokenAmount,bptTokensStaked) (contracts/v2/strategies/RamosStrategy.sol#183)\n", - "markdown": "Reentrancy in [RamosStrategy.addLiquidity(IBalancerVault.JoinPoolRequest)](contracts/v2/strategies/RamosStrategy.sol#L177-L184):\n\tExternal calls:\n\t- [(quoteTokenAmount,protocolTokenAmount,bptTokensStaked) = ramos.addLiquidity(_requestData)](contracts/v2/strategies/RamosStrategy.sol#L178-L182)\n\tEvent emitted after the call(s):\n\t- [AddLiquidity(quoteTokenAmount,protocolTokenAmount,bptTokensStaked)](contracts/v2/strategies/RamosStrategy.sol#L183)\n", - "first_markdown_element": "contracts/v2/strategies/RamosStrategy.sol#L177-L184", - "id": "22fc0a580c6544fc37a5182c3c54343482fb7ea6aa34a1316d02db5cc188497b", - "check": "reentrancy-events", - "impact": "Low", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "batchLiquidate", - "source_mapping": { - "start": 13008, - "length": 1632, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [ - 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, - 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleLineOfCredit", - "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, - 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, - 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, - 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, - 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, - 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, - 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, - 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, - 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, - 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, - 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, - 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, - 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, - 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, - 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, - 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, - 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, - 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, - 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, - 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, - 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, - 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, - 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, - 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, - 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, - 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, - 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, - 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, - 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, - 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, - 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, - 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, - 874, 875, 876, 877, 878, 879, 880, 881, 882 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "batchLiquidate(address[])" - } - }, - { - "type": "node", - "name": "templeToken.safeIncreaseAllowance(address(treasuryReservesVault),totalCollateralClaimed)", - "source_mapping": { - "start": 14242, - "length": 89, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [350], - "starting_column": 13, - "ending_column": 102 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "batchLiquidate", - "source_mapping": { - "start": 13008, - "length": 1632, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [ - 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, - 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleLineOfCredit", - "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "batchLiquidate(address[])" + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, + 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, + 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, + 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, + 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, + 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, + 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, + 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, + 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, + 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, + 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, + 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, + 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, + 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, + 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, + 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, + 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, + 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, + 621 + ], + "starting_column": 1, + "ending_column": 0 } - } - }, - "additional_fields": { "underlying_type": "external_calls" } + }, + "signature": "rebalanceUpExit(uint256,uint256)" + } }, { "type": "node", - "name": "treasuryReservesVault.repay(templeToken,totalCollateralClaimed,address(tlcStrategy))", + "name": "amoStaking.withdrawAndUnwrap(bptAmountIn,false,address(_poolHelper))", "source_mapping": { - "start": 14345, - "length": 86, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 12270, + "length": 70, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [351], - "starting_column": 13, - "ending_column": 99 + "lines": [299], + "starting_column": 9, + "ending_column": 79 }, "type_specific_fields": { "parent": { "type": "function", - "name": "batchLiquidate", + "name": "rebalanceUpExit", "source_mapping": { - "start": 13008, - "length": 1632, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 11847, + "length": 1435, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, - 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359 + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322 ], "starting_column": 5, "ending_column": 6 @@ -37540,91 +32919,69 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "Ramos", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, + 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, + 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, + 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, + 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, + 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, + 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "batchLiquidate(address[])" + "signature": "rebalanceUpExit(uint256,uint256)" } } }, @@ -37632,31 +32989,33 @@ }, { "type": "node", - "name": "InterestRateUpdate(newInterestRate)", + "name": "protocolTokenAmountOut = _poolHelper.exitPool(bptAmountIn,minProtocolTokenOut,rebalancePercentageBoundLow,rebalancePercentageBoundUp,postRebalanceDelta,protocolTokenBalancerPoolIndex,treasuryPriceIndex(),protocolToken)", "source_mapping": { - "start": 27036, - "length": 40, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 12397, + "length": 279, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [694], - "starting_column": 13, - "ending_column": 53 + "lines": [302, 303, 304, 305, 306], + "starting_column": 9, + "ending_column": 10 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_updateInterestRates", + "name": "rebalanceUpExit", "source_mapping": { - "start": 26678, - "length": 495, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 11847, + "length": 1435, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697 + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322 ], "starting_column": 5, "ending_column": 6 @@ -37664,126 +33023,103 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "Ramos", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, + 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, + 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, + 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, + 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, + 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, + 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_updateInterestRates(TempleLineOfCredit.DebtTokenCache)" + "signature": "rebalanceUpExit(uint256,uint256)" } } }, - "additional_fields": { "underlying_type": "event" } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "_repayTotalDebt(_cache,totalDebtWiped)", + "name": "protocolToken.safeTransfer(feeCollector,feeAmt)", "source_mapping": { - "start": 14584, - "length": 39, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 12875, + "length": 48, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [357], + "lines": [311], "starting_column": 13, - "ending_column": 52 + "ending_column": 61 }, "type_specific_fields": { "parent": { "type": "function", - "name": "batchLiquidate", + "name": "rebalanceUpExit", "source_mapping": { - "start": 13008, - "length": 1632, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 11847, + "length": 1435, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, - 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359 + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322 ], "starting_column": 5, "ending_column": 6 @@ -37791,101 +33127,183 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "Ramos", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, + 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, + 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, + 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, + 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, + 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, + 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "rebalanceUpExit(uint256,uint256)" + } + } + }, + "additional_fields": { "underlying_type": "external_calls" } + }, + { + "type": "node", + "name": "RebalanceUpExit(bptAmountIn,protocolTokenAmountOut,feeAmt)", + "source_mapping": { + "start": 13091, + "length": 65, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", + "is_dependency": false, + "lines": [318], + "starting_column": 9, + "ending_column": 74 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "rebalanceUpExit", + "source_mapping": { + "start": 11847, + "length": 1435, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", + "is_dependency": false, + "lines": [ + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Ramos", + "source_mapping": { + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", + "is_dependency": false, + "lines": [ + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, + 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, + 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, + 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, + 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, + 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, + 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "batchLiquidate(address[])" + "signature": "rebalanceUpExit(uint256,uint256)" } } }, "additional_fields": { "underlying_type": "event" } } ], - "description": "Reentrancy in TempleLineOfCredit.batchLiquidate(address[]) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#318-359):\n\tExternal calls:\n\t- templeToken.safeIncreaseAllowance(address(treasuryReservesVault),totalCollateralClaimed) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#350)\n\t- treasuryReservesVault.repay(templeToken,totalCollateralClaimed,address(tlcStrategy)) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#351)\n\tEvent emitted after the call(s):\n\t- InterestRateUpdate(newInterestRate) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#694)\n\t\t- _repayTotalDebt(_cache,totalDebtWiped) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#357)\n", - "markdown": "Reentrancy in [TempleLineOfCredit.batchLiquidate(address[])](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L318-L359):\n\tExternal calls:\n\t- [templeToken.safeIncreaseAllowance(address(treasuryReservesVault),totalCollateralClaimed)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L350)\n\t- [treasuryReservesVault.repay(templeToken,totalCollateralClaimed,address(tlcStrategy))](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L351)\n\tEvent emitted after the call(s):\n\t- [InterestRateUpdate(newInterestRate)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L694)\n\t\t- [_repayTotalDebt(_cache,totalDebtWiped)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L357)\n", - "first_markdown_element": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L318-L359", - "id": "5a0680e0c99a22592cb99c77b92c7c157e4c4a584ee2a606474bd61efe053034", + "description": "Reentrancy in Ramos.rebalanceUpExit(uint256,uint256) (contracts/amo/Ramos.sol#290-322):\n\tExternal calls:\n\t- amoStaking.withdrawAndUnwrap(bptAmountIn,false,address(_poolHelper)) (contracts/amo/Ramos.sol#299)\n\t- protocolTokenAmountOut = _poolHelper.exitPool(bptAmountIn,minProtocolTokenOut,rebalancePercentageBoundLow,rebalancePercentageBoundUp,postRebalanceDelta,protocolTokenBalancerPoolIndex,treasuryPriceIndex(),protocolToken) (contracts/amo/Ramos.sol#302-306)\n\t- protocolToken.safeTransfer(feeCollector,feeAmt) (contracts/amo/Ramos.sol#311)\n\tEvent emitted after the call(s):\n\t- RebalanceUpExit(bptAmountIn,protocolTokenAmountOut,feeAmt) (contracts/amo/Ramos.sol#318)\n", + "markdown": "Reentrancy in [Ramos.rebalanceUpExit(uint256,uint256)](contracts/amo/Ramos.sol#L290-L322):\n\tExternal calls:\n\t- [amoStaking.withdrawAndUnwrap(bptAmountIn,false,address(_poolHelper))](contracts/amo/Ramos.sol#L299)\n\t- [protocolTokenAmountOut = _poolHelper.exitPool(bptAmountIn,minProtocolTokenOut,rebalancePercentageBoundLow,rebalancePercentageBoundUp,postRebalanceDelta,protocolTokenBalancerPoolIndex,treasuryPriceIndex(),protocolToken)](contracts/amo/Ramos.sol#L302-L306)\n\t- [protocolToken.safeTransfer(feeCollector,feeAmt)](contracts/amo/Ramos.sol#L311)\n\tEvent emitted after the call(s):\n\t- [RebalanceUpExit(bptAmountIn,protocolTokenAmountOut,feeAmt)](contracts/amo/Ramos.sol#L318)\n", + "first_markdown_element": "contracts/amo/Ramos.sol#L290-L322", + "id": "d1e3e7511c959f3f2562cee5d162c6238b1fb8ed8584ca23b92437d2651d74cd", "check": "reentrancy-events", "impact": "Low", "confidence": "Medium" @@ -37894,112 +33312,186 @@ "elements": [ { "type": "function", - "name": "borrow", + "name": "rebalanceUpJoin", "source_mapping": { - "start": 3212, - "length": 319, - "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/GnosisStrategy.sol", - "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", + "start": 15897, + "length": 1496, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [88, 89, 90, 91, 92, 93, 94, 95, 96], + "lines": [ + 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, + 402, 403, 404, 405, 406, 407, 408, 409 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "GnosisStrategy", + "name": "Ramos", "source_mapping": { - "start": 584, - "length": 6684, - "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/GnosisStrategy.sol", - "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191 + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, + 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, + 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, + 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, + 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, + 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, + 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, + 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, + 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, + 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, + 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, + 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, + 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, + 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, + 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, + 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, + 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, + 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, + 621 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "borrow(IERC20,uint256)" + "signature": "rebalanceUpJoin(uint256,uint256)" } }, { "type": "node", - "name": "circuitBreakerProxy.preCheck(address(token),msg.sender,amount)", + "name": "tokenVault.borrowQuoteToken(quoteTokenAmountIn,address(this))", "source_mapping": { - "start": 3296, - "length": 112, - "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/GnosisStrategy.sol", - "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", + "start": 16247, + "length": 62, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [89, 90, 91, 92, 93], + "lines": [384], "starting_column": 9, - "ending_column": 10 + "ending_column": 71 }, "type_specific_fields": { "parent": { "type": "function", - "name": "borrow", + "name": "rebalanceUpJoin", "source_mapping": { - "start": 3212, - "length": 319, - "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/GnosisStrategy.sol", - "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", + "start": 15897, + "length": 1496, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [88, 89, 90, 91, 92, 93, 94, 95, 96], + "lines": [ + 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, + 402, 403, 404, 405, 406, 407, 408, 409 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "GnosisStrategy", + "name": "Ramos", "source_mapping": { - "start": 584, - "length": 6684, - "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/GnosisStrategy.sol", - "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191 + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, + 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, + 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, + 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, + 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, + 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, + 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "borrow(IERC20,uint256)" + "signature": "rebalanceUpJoin(uint256,uint256)" } } }, @@ -38007,213 +33499,241 @@ }, { "type": "node", - "name": "Borrow(address(token),amount)", + "name": "quoteToken.safeTransfer(feeCollector,feeAmt)", "source_mapping": { - "start": 3418, - "length": 35, - "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/GnosisStrategy.sol", - "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", + "start": 16502, + "length": 45, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [94], - "starting_column": 9, - "ending_column": 44 + "lines": [389], + "starting_column": 13, + "ending_column": 58 }, "type_specific_fields": { "parent": { "type": "function", - "name": "borrow", + "name": "rebalanceUpJoin", "source_mapping": { - "start": 3212, - "length": 319, - "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/GnosisStrategy.sol", - "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", + "start": 15897, + "length": 1496, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [88, 89, 90, 91, 92, 93, 94, 95, 96], + "lines": [ + 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, + 402, 403, 404, 405, 406, 407, 408, 409 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "GnosisStrategy", + "name": "Ramos", "source_mapping": { - "start": 584, - "length": 6684, - "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/GnosisStrategy.sol", - "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191 + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, + 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, + 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, + 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, + 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, + 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, + 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "borrow(IERC20,uint256)" + "signature": "rebalanceUpJoin(uint256,uint256)" } } }, - "additional_fields": { "underlying_type": "event" } - } - ], - "description": "Reentrancy in GnosisStrategy.borrow(IERC20,uint256) (contracts/v2/strategies/GnosisStrategy.sol#88-96):\n\tExternal calls:\n\t- circuitBreakerProxy.preCheck(address(token),msg.sender,amount) (contracts/v2/strategies/GnosisStrategy.sol#89-93)\n\tEvent emitted after the call(s):\n\t- Borrow(address(token),amount) (contracts/v2/strategies/GnosisStrategy.sol#94)\n", - "markdown": "Reentrancy in [GnosisStrategy.borrow(IERC20,uint256)](contracts/v2/strategies/GnosisStrategy.sol#L88-L96):\n\tExternal calls:\n\t- [circuitBreakerProxy.preCheck(address(token),msg.sender,amount)](contracts/v2/strategies/GnosisStrategy.sol#L89-L93)\n\tEvent emitted after the call(s):\n\t- [Borrow(address(token),amount)](contracts/v2/strategies/GnosisStrategy.sol#L94)\n", - "first_markdown_element": "contracts/v2/strategies/GnosisStrategy.sol#L88-L96", - "id": "816d5794942352b4b9c381b210cb4b35ac9c43889f1c7eaa1b7e32f3c1f8ab33", - "check": "reentrancy-events", - "impact": "Low", - "confidence": "Medium" - }, - { - "elements": [ + "additional_fields": { "underlying_type": "external_calls" } + }, { - "type": "function", - "name": "borrow", + "type": "node", + "name": "quoteToken.safeTransfer(address(_poolHelper),joinAmountIn)", "source_mapping": { - "start": 8353, - "length": 1525, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 16743, + "length": 59, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [ - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242 - ], - "starting_column": 5, - "ending_column": 6 + "lines": [395], + "starting_column": 9, + "ending_column": 68 }, "type_specific_fields": { "parent": { - "type": "contract", - "name": "TempleLineOfCredit", + "type": "function", + "name": "rebalanceUpJoin", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 15897, + "length": 1496, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, - 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, - 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, - 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, - 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, - 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, - 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, - 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, - 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, - 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, - 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, - 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, - 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, - 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, - 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, - 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, - 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, - 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, - 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, - 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, - 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, - 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, - 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, - 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, - 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, - 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, - 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, - 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, - 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, - 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, - 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, - 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, - 874, 875, 876, 877, 878, 879, 880, 881, 882 + 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, + 402, 403, 404, 405, 406, 407, 408, 409 ], - "starting_column": 1, - "ending_column": 0 + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Ramos", + "source_mapping": { + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", + "is_dependency": false, + "lines": [ + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, + 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, + 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, + 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, + 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, + 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, + 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "rebalanceUpJoin(uint256,uint256)" } - }, - "signature": "borrow(uint128,address)" - } + } + }, + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "circuitBreakerProxy.preCheck(address(daiToken),msg.sender,amount)", + "name": "bptTokensStaked = _poolHelper.joinPool(joinAmountIn,minBptOut,rebalancePercentageBoundUp,rebalancePercentageBoundLow,treasuryPriceIndex(),postRebalanceDelta,1 - protocolTokenBalancerPoolIndex,quoteToken)", "source_mapping": { - "start": 8827, - "length": 115, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 16852, + "length": 250, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [213, 214, 215, 216, 217], + "lines": [398, 399, 400, 401], "starting_column": 9, "ending_column": 10 }, "type_specific_fields": { "parent": { "type": "function", - "name": "borrow", + "name": "rebalanceUpJoin", "source_mapping": { - "start": 8353, - "length": 1525, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 15897, + "length": 1496, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242 + 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, + 402, 403, 404, 405, 406, 407, 408, 409 ], "starting_column": 5, "ending_column": 6 @@ -38221,91 +33741,69 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "Ramos", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, + 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, + 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, + 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, + 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, + 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, + 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "borrow(uint128,address)" + "signature": "rebalanceUpJoin(uint256,uint256)" } } }, @@ -38313,33 +33811,33 @@ }, { "type": "node", - "name": "Borrow(msg.sender,recipient,amount)", + "name": "RebalanceUpJoin(quoteTokenAmountIn,bptTokensStaked,feeAmt)", "source_mapping": { - "start": 9641, - "length": 42, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 17112, + "length": 65, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [237], + "lines": [402], "starting_column": 9, - "ending_column": 51 + "ending_column": 74 }, "type_specific_fields": { "parent": { "type": "function", - "name": "borrow", + "name": "rebalanceUpJoin", "source_mapping": { - "start": 8353, - "length": 1525, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 15897, + "length": 1496, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242 + 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, + 402, 403, 404, 405, 406, 407, 408, 409 ], "starting_column": 5, "ending_column": 6 @@ -38347,351 +33845,269 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "Ramos", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, + 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, + 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, + 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, + 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, + 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, + 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "borrow(uint128,address)" + "signature": "rebalanceUpJoin(uint256,uint256)" } } }, "additional_fields": { "underlying_type": "event" } - }, + } + ], + "description": "Reentrancy in Ramos.rebalanceUpJoin(uint256,uint256) (contracts/amo/Ramos.sol#376-409):\n\tExternal calls:\n\t- tokenVault.borrowQuoteToken(quoteTokenAmountIn,address(this)) (contracts/amo/Ramos.sol#384)\n\t- quoteToken.safeTransfer(feeCollector,feeAmt) (contracts/amo/Ramos.sol#389)\n\t- quoteToken.safeTransfer(address(_poolHelper),joinAmountIn) (contracts/amo/Ramos.sol#395)\n\t- bptTokensStaked = _poolHelper.joinPool(joinAmountIn,minBptOut,rebalancePercentageBoundUp,rebalancePercentageBoundLow,treasuryPriceIndex(),postRebalanceDelta,1 - protocolTokenBalancerPoolIndex,quoteToken) (contracts/amo/Ramos.sol#398-401)\n\tEvent emitted after the call(s):\n\t- RebalanceUpJoin(quoteTokenAmountIn,bptTokensStaked,feeAmt) (contracts/amo/Ramos.sol#402)\n", + "markdown": "Reentrancy in [Ramos.rebalanceUpJoin(uint256,uint256)](contracts/amo/Ramos.sol#L376-L409):\n\tExternal calls:\n\t- [tokenVault.borrowQuoteToken(quoteTokenAmountIn,address(this))](contracts/amo/Ramos.sol#L384)\n\t- [quoteToken.safeTransfer(feeCollector,feeAmt)](contracts/amo/Ramos.sol#L389)\n\t- [quoteToken.safeTransfer(address(_poolHelper),joinAmountIn)](contracts/amo/Ramos.sol#L395)\n\t- [bptTokensStaked = _poolHelper.joinPool(joinAmountIn,minBptOut,rebalancePercentageBoundUp,rebalancePercentageBoundLow,treasuryPriceIndex(),postRebalanceDelta,1 - protocolTokenBalancerPoolIndex,quoteToken)](contracts/amo/Ramos.sol#L398-L401)\n\tEvent emitted after the call(s):\n\t- [RebalanceUpJoin(quoteTokenAmountIn,bptTokensStaked,feeAmt)](contracts/amo/Ramos.sol#L402)\n", + "first_markdown_element": "contracts/amo/Ramos.sol#L376-L409", + "id": "0f3416b0e7e6449ff33b7394396c4bf724c482fcbb9d305e03fcb53aaee726ac", + "check": "reentrancy-events", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ { - "type": "node", - "name": "InterestRateUpdate(newInterestRate)", + "type": "function", + "name": "recoverToGnosis", "source_mapping": { - "start": 27036, - "length": 40, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 5325, + "length": 237, + "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/GnosisStrategy.sol", + "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", "is_dependency": false, - "lines": [694], - "starting_column": 13, - "ending_column": 53 + "lines": [142, 143, 144, 145], + "starting_column": 5, + "ending_column": 6 }, "type_specific_fields": { "parent": { - "type": "function", - "name": "_updateInterestRates", + "type": "contract", + "name": "GnosisStrategy", "source_mapping": { - "start": 26678, - "length": 495, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 584, + "length": 6684, + "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/GnosisStrategy.sol", + "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", "is_dependency": false, "lines": [ - 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191 ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleLineOfCredit", - "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "recoverToGnosis(address,uint256)" + } + }, + { + "type": "node", + "name": "IERC20(token).safeTransfer(gnosisSafeWallet,amount)", + "source_mapping": { + "start": 5419, + "length": 52, + "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/GnosisStrategy.sol", + "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", + "is_dependency": false, + "lines": [143], + "starting_column": 9, + "ending_column": 61 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "recoverToGnosis", + "source_mapping": { + "start": 5325, + "length": 237, + "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/GnosisStrategy.sol", + "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", + "is_dependency": false, + "lines": [142, 143, 144, 145], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "GnosisStrategy", + "source_mapping": { + "start": 584, + "length": 6684, + "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/GnosisStrategy.sol", + "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", + "is_dependency": false, + "lines": [ + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_updateInterestRates(TempleLineOfCredit.DebtTokenCache)" + "signature": "recoverToGnosis(address,uint256)" } } }, - "additional_fields": { "underlying_type": "event" } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "_updateInterestRates(_cache)", + "name": "CommonEventsAndErrors.TokenRecovered(gnosisSafeWallet,token,amount)", "source_mapping": { - "start": 9592, - "length": 28, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 5481, + "length": 74, + "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/GnosisStrategy.sol", + "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", "is_dependency": false, - "lines": [234], - "starting_column": 13, - "ending_column": 41 + "lines": [144], + "starting_column": 9, + "ending_column": 83 }, "type_specific_fields": { "parent": { "type": "function", - "name": "borrow", + "name": "recoverToGnosis", "source_mapping": { - "start": 8353, - "length": 1525, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 5325, + "length": 237, + "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/GnosisStrategy.sol", + "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", "is_dependency": false, - "lines": [ - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242 - ], + "lines": [142, 143, 144, 145], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "GnosisStrategy", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 584, + "length": 6684, + "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/GnosisStrategy.sol", + "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "borrow(uint128,address)" + "signature": "recoverToGnosis(address,uint256)" } } }, "additional_fields": { "underlying_type": "event" } } ], - "description": "Reentrancy in TempleLineOfCredit.borrow(uint128,address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#205-242):\n\tExternal calls:\n\t- circuitBreakerProxy.preCheck(address(daiToken),msg.sender,amount) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#213-217)\n\tEvent emitted after the call(s):\n\t- Borrow(msg.sender,recipient,amount) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#237)\n\t- InterestRateUpdate(newInterestRate) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#694)\n\t\t- _updateInterestRates(_cache) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#234)\n", - "markdown": "Reentrancy in [TempleLineOfCredit.borrow(uint128,address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L205-L242):\n\tExternal calls:\n\t- [circuitBreakerProxy.preCheck(address(daiToken),msg.sender,amount)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L213-L217)\n\tEvent emitted after the call(s):\n\t- [Borrow(msg.sender,recipient,amount)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L237)\n\t- [InterestRateUpdate(newInterestRate)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L694)\n\t\t- [_updateInterestRates(_cache)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L234)\n", - "first_markdown_element": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L205-L242", - "id": "d396e64550071534c5eb2348214957ab75abad8a750f1bf354daa2d715c56de7", + "description": "Reentrancy in GnosisStrategy.recoverToGnosis(address,uint256) (contracts/v2/strategies/GnosisStrategy.sol#142-145):\n\tExternal calls:\n\t- IERC20(token).safeTransfer(gnosisSafeWallet,amount) (contracts/v2/strategies/GnosisStrategy.sol#143)\n\tEvent emitted after the call(s):\n\t- CommonEventsAndErrors.TokenRecovered(gnosisSafeWallet,token,amount) (contracts/v2/strategies/GnosisStrategy.sol#144)\n", + "markdown": "Reentrancy in [GnosisStrategy.recoverToGnosis(address,uint256)](contracts/v2/strategies/GnosisStrategy.sol#L142-L145):\n\tExternal calls:\n\t- [IERC20(token).safeTransfer(gnosisSafeWallet,amount)](contracts/v2/strategies/GnosisStrategy.sol#L143)\n\tEvent emitted after the call(s):\n\t- [CommonEventsAndErrors.TokenRecovered(gnosisSafeWallet,token,amount)](contracts/v2/strategies/GnosisStrategy.sol#L144)\n", + "first_markdown_element": "contracts/v2/strategies/GnosisStrategy.sol#L142-L145", + "id": "d9bd0a33246588c83983d63975a9ce55470568eeff09e037f055b8e7122562e2", "check": "reentrancy-events", "impact": "Low", "confidence": "Medium" @@ -38700,129 +34116,106 @@ "elements": [ { "type": "function", - "name": "borrowAndDeposit", + "name": "recoverToken", "source_mapping": { - "start": 7809, - "length": 246, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2334, + "length": 206, + "filename_relative": "contracts/amo/AuraStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/AuraStaking.sol", + "filename_short": "contracts/amo/AuraStaking.sol", "is_dependency": false, - "lines": [195, 196, 197, 198, 199], + "lines": [67, 68, 69, 70, 71], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "AuraStaking", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 604, + "length": 5204, + "filename_relative": "contracts/amo/AuraStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/AuraStaking.sol", + "filename_short": "contracts/amo/AuraStaking.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305 + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "borrowAndDeposit(uint256)" + "signature": "recoverToken(address,address,uint256)" } }, { "type": "node", - "name": "treasuryReservesVault.borrow(daiToken,amount,address(this))", + "name": "IERC20(token).safeTransfer(to,amount)", "source_mapping": { - "start": 7958, - "length": 61, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2446, + "length": 38, + "filename_relative": "contracts/amo/AuraStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/AuraStaking.sol", + "filename_short": "contracts/amo/AuraStaking.sol", "is_dependency": false, - "lines": [197], + "lines": [68], "starting_column": 9, - "ending_column": 70 + "ending_column": 47 }, "type_specific_fields": { "parent": { "type": "function", - "name": "borrowAndDeposit", + "name": "recoverToken", "source_mapping": { - "start": 7809, - "length": 246, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2334, + "length": 206, + "filename_relative": "contracts/amo/AuraStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/AuraStaking.sol", + "filename_short": "contracts/amo/AuraStaking.sol", "is_dependency": false, - "lines": [195, 196, 197, 198, 199], + "lines": [67, 68, 69, 70, 71], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "AuraStaking", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 604, + "length": 5204, + "filename_relative": "contracts/amo/AuraStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/AuraStaking.sol", + "filename_short": "contracts/amo/AuraStaking.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "borrowAndDeposit(uint256)" + "signature": "recoverToken(address,address,uint256)" } } }, @@ -38830,74 +34223,252 @@ }, { "type": "node", - "name": "_dsrDeposit(amount)", + "name": "RecoveredToken(token,to,amount)", "source_mapping": { - "start": 8029, - "length": 19, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2495, + "length": 38, + "filename_relative": "contracts/amo/AuraStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/AuraStaking.sol", + "filename_short": "contracts/amo/AuraStaking.sol", "is_dependency": false, - "lines": [198], + "lines": [70], "starting_column": 9, - "ending_column": 28 + "ending_column": 47 }, "type_specific_fields": { "parent": { "type": "function", - "name": "borrowAndDeposit", + "name": "recoverToken", "source_mapping": { - "start": 7809, - "length": 246, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2334, + "length": 206, + "filename_relative": "contracts/amo/AuraStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/AuraStaking.sol", + "filename_short": "contracts/amo/AuraStaking.sol", "is_dependency": false, - "lines": [195, 196, 197, 198, 199], + "lines": [67, 68, 69, 70, 71], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "AuraStaking", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 604, + "length": 5204, + "filename_relative": "contracts/amo/AuraStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/AuraStaking.sol", + "filename_short": "contracts/amo/AuraStaking.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "recoverToken(address,address,uint256)" + } + } + }, + "additional_fields": { "underlying_type": "event" } + } + ], + "description": "Reentrancy in AuraStaking.recoverToken(address,address,uint256) (contracts/amo/AuraStaking.sol#67-71):\n\tExternal calls:\n\t- IERC20(token).safeTransfer(to,amount) (contracts/amo/AuraStaking.sol#68)\n\tEvent emitted after the call(s):\n\t- RecoveredToken(token,to,amount) (contracts/amo/AuraStaking.sol#70)\n", + "markdown": "Reentrancy in [AuraStaking.recoverToken(address,address,uint256)](contracts/amo/AuraStaking.sol#L67-L71):\n\tExternal calls:\n\t- [IERC20(token).safeTransfer(to,amount)](contracts/amo/AuraStaking.sol#L68)\n\tEvent emitted after the call(s):\n\t- [RecoveredToken(token,to,amount)](contracts/amo/AuraStaking.sol#L70)\n", + "first_markdown_element": "contracts/amo/AuraStaking.sol#L67-L71", + "id": "721f7e4ea8f943fb92b4b72846f0042313e2b5e55c2edcd24d2ab5f7aab87665", + "check": "reentrancy-events", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "recoverToken", + "source_mapping": { + "start": 11012, + "length": 197, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", + "is_dependency": false, + "lines": [274, 275, 276, 277, 278], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Ramos", + "source_mapping": { + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", + "is_dependency": false, + "lines": [ + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, + 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, + 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, + 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, + 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, + 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, + 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, + 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, + 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, + 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, + 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, + 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, + 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, + 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, + 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, + 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, + 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, + 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, + 621 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "recoverToken(address,address,uint256)" + } + }, + { + "type": "node", + "name": "IERC20(token).safeTransfer(to,amount)", + "source_mapping": { + "start": 11115, + "length": 38, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", + "is_dependency": false, + "lines": [275], + "starting_column": 9, + "ending_column": 47 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "recoverToken", + "source_mapping": { + "start": 11012, + "length": 197, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", + "is_dependency": false, + "lines": [274, 275, 276, 277, 278], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Ramos", + "source_mapping": { + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", + "is_dependency": false, + "lines": [ + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, + 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, + 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, + 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, + 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, + 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, + 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "borrowAndDeposit(uint256)" + "signature": "recoverToken(address,address,uint256)" } } }, @@ -38905,384 +34476,775 @@ }, { "type": "node", - "name": "chi = pot.drip()", + "name": "RecoveredToken(token,to,amount)", "source_mapping": { - "start": 5566, - "length": 60, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 11164, + "length": 38, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [142], + "lines": [277], "starting_column": 9, - "ending_column": 69 + "ending_column": 47 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_checkpointChi", + "name": "recoverToken", "source_mapping": { - "start": 5445, - "length": 188, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 11012, + "length": 197, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [140, 141, 142, 143], + "lines": [274, 275, 276, 277, 278], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "Ramos", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, + 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, + 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, + 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, + 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, + 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, + 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_checkpointChi()" + "signature": "recoverToken(address,address,uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + "additional_fields": { "underlying_type": "event" } + } + ], + "description": "Reentrancy in Ramos.recoverToken(address,address,uint256) (contracts/amo/Ramos.sol#274-278):\n\tExternal calls:\n\t- IERC20(token).safeTransfer(to,amount) (contracts/amo/Ramos.sol#275)\n\tEvent emitted after the call(s):\n\t- RecoveredToken(token,to,amount) (contracts/amo/Ramos.sol#277)\n", + "markdown": "Reentrancy in [Ramos.recoverToken(address,address,uint256)](contracts/amo/Ramos.sol#L274-L278):\n\tExternal calls:\n\t- [IERC20(token).safeTransfer(to,amount)](contracts/amo/Ramos.sol#L275)\n\tEvent emitted after the call(s):\n\t- [RecoveredToken(token,to,amount)](contracts/amo/Ramos.sol#L277)\n", + "first_markdown_element": "contracts/amo/Ramos.sol#L274-L278", + "id": "a57f15edd93bacbeb09bc6f5cb3cd1b4540b96d74dac7b8b25c22b16adc633ed", + "check": "reentrancy-events", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "recoverToken", + "source_mapping": { + "start": 19466, + "length": 308, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", + "is_dependency": false, + "lines": [481, 482, 483, 484, 485], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Relic", + "source_mapping": { + "start": 1674, + "length": 24655, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", + "is_dependency": false, + "lines": [ + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, + 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, + 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, + 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, + 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, + 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, + 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, + 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, + 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, + 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, + 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, + 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, + 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, + 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, + 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, + 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, + 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, + 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, + 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, + 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, + 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, + 652, 653, 654, 655 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "recoverToken(address,address,uint256)" + } }, { "type": "node", - "name": "daiJoin.join(address(this),amount)", + "name": "IERC20(token).safeTransfer(to,amount)", "source_mapping": { - "start": 8342, - "length": 35, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 19659, + "length": 38, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, - "lines": [207], + "lines": [483], "starting_column": 9, - "ending_column": 44 + "ending_column": 47 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_dsrDeposit", + "name": "recoverToken", "source_mapping": { - "start": 8061, - "length": 349, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 19466, + "length": 308, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, - "lines": [201, 202, 203, 204, 205, 206, 207, 208, 209], + "lines": [481, 482, 483, 484, 485], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "Relic", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 1674, + "length": 24655, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, + 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, + 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, + 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, + 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, + 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, + 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, + 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, + 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, + 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, + 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, + 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, + 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, + 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, + 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, + 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, + 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, + 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, + 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, + 654, 655 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_dsrDeposit(uint256)" + "signature": "recoverToken(address,address,uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "pot.join(shares)", + "name": "CommonEventsAndErrors.TokenRecovered(to,token,amount)", "source_mapping": { - "start": 8387, - "length": 16, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 19707, + "length": 60, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, - "lines": [208], + "lines": [484], "starting_column": 9, - "ending_column": 25 + "ending_column": 69 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_dsrDeposit", + "name": "recoverToken", "source_mapping": { - "start": 8061, - "length": 349, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 19466, + "length": 308, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, - "lines": [201, 202, 203, 204, 205, 206, 207, 208, 209], + "lines": [481, 482, 483, 484, 485], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "Relic", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 1674, + "length": 24655, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, + 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, + 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, + 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, + 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, + 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, + 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, + 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, + 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, + 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, + 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, + 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, + 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, + 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, + 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, + 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, + 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, + 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, + 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, + 654, 655 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_dsrDeposit(uint256)" + "signature": "recoverToken(address,address,uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + "additional_fields": { "underlying_type": "event" } + } + ], + "description": "Reentrancy in Relic.recoverToken(address,address,uint256) (contracts/nexus/Relic.sol#481-485):\n\tExternal calls:\n\t- IERC20(token).safeTransfer(to,amount) (contracts/nexus/Relic.sol#483)\n\tEvent emitted after the call(s):\n\t- CommonEventsAndErrors.TokenRecovered(to,token,amount) (contracts/nexus/Relic.sol#484)\n", + "markdown": "Reentrancy in [Relic.recoverToken(address,address,uint256)](contracts/nexus/Relic.sol#L481-L485):\n\tExternal calls:\n\t- [IERC20(token).safeTransfer(to,amount)](contracts/nexus/Relic.sol#L483)\n\tEvent emitted after the call(s):\n\t- [CommonEventsAndErrors.TokenRecovered(to,token,amount)](contracts/nexus/Relic.sol#L484)\n", + "first_markdown_element": "contracts/nexus/Relic.sol#L481-L485", + "id": "09267eeae80caaaa6b4a7abdd0298e4bf0bf0503de1733ba720a18ed57746236", + "check": "reentrancy-events", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "removeCollateral", + "source_mapping": { + "start": 6498, + "length": 1031, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "is_dependency": false, + "lines": [ + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleLineOfCredit", + "source_mapping": { + "start": 1433, + "length": 31753, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "is_dependency": false, + "lines": [ + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, + 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, + 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, + 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, + 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, + 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, + 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, + 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, + 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, + 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, + 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, + 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, + 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, + 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, + 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, + 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, + 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, + 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, + 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, + 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, + 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, + 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, + 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, + 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, + 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, + 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, + 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, + 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, + 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, + 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, + 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, + 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, + 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, + 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, + 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, + 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, + 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, + 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "removeCollateral(uint128,address)" + } }, { "type": "node", - "name": "DaiDeposited(amount)", + "name": "circuitBreakerProxy.preCheck(address(templeToken),msg.sender,amount)", "source_mapping": { - "start": 8307, - "length": 25, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 7012, + "length": 118, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, - "lines": [206], + "lines": [173, 174, 175, 176, 177], "starting_column": 9, - "ending_column": 34 + "ending_column": 10 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_dsrDeposit", + "name": "removeCollateral", "source_mapping": { - "start": 8061, - "length": 349, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 6498, + "length": 1031, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, - "lines": [201, 202, 203, 204, 205, 206, 207, 208, 209], + "lines": [ + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TempleLineOfCredit", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 1433, + "length": 31753, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, + 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, + 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, + 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, + 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, + 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, + 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, + 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, + 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, + 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, + 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, + 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, + 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, + 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, + 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, + 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, + 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, + 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, + 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, + 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, + 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, + 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, + 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, + 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, + 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, + 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, + 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, + 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, + 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, + 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, + 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, + 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, + 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, + 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, + 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, + 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, + 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, + 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, + 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, + 883, 884, 885 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_dsrDeposit(uint256)" + "signature": "removeCollateral(uint128,address)" } } }, - "additional_fields": { "underlying_type": "event" } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "_dsrDeposit(amount)", + "name": "CollateralRemoved(msg.sender,recipient,amount)", "source_mapping": { - "start": 8029, - "length": 19, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 7320, + "length": 53, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, - "lines": [198], + "lines": [182], "starting_column": 9, - "ending_column": 28 + "ending_column": 62 }, "type_specific_fields": { "parent": { "type": "function", - "name": "borrowAndDeposit", + "name": "removeCollateral", "source_mapping": { - "start": 7809, - "length": 246, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 6498, + "length": 1031, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, - "lines": [195, 196, 197, 198, 199], + "lines": [ + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TempleLineOfCredit", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 1433, + "length": 31753, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, + 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, + 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, + 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, + 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, + 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, + 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, + 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, + 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, + 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, + 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, + 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, + 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, + 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, + 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, + 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, + 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, + 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, + 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, + 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, + 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, + 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, + 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, + 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, + 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, + 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, + 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, + 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, + 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, + 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, + 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, + 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, + 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, + 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, + 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, + 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, + 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, + 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, + 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, + 883, 884, 885 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "borrowAndDeposit(uint256)" + "signature": "removeCollateral(uint128,address)" } } }, "additional_fields": { "underlying_type": "event" } } ], - "description": "Reentrancy in DsrBaseStrategy.borrowAndDeposit(uint256) (contracts/v2/strategies/DsrBaseStrategy.sol#195-199):\n\tExternal calls:\n\t- treasuryReservesVault.borrow(daiToken,amount,address(this)) (contracts/v2/strategies/DsrBaseStrategy.sol#197)\n\t- _dsrDeposit(amount) (contracts/v2/strategies/DsrBaseStrategy.sol#198)\n\t\t- chi = pot.drip() (contracts/v2/strategies/DsrBaseStrategy.sol#142)\n\t\t- daiJoin.join(address(this),amount) (contracts/v2/strategies/DsrBaseStrategy.sol#207)\n\t\t- pot.join(shares) (contracts/v2/strategies/DsrBaseStrategy.sol#208)\n\tEvent emitted after the call(s):\n\t- DaiDeposited(amount) (contracts/v2/strategies/DsrBaseStrategy.sol#206)\n\t\t- _dsrDeposit(amount) (contracts/v2/strategies/DsrBaseStrategy.sol#198)\n", - "markdown": "Reentrancy in [DsrBaseStrategy.borrowAndDeposit(uint256)](contracts/v2/strategies/DsrBaseStrategy.sol#L195-L199):\n\tExternal calls:\n\t- [treasuryReservesVault.borrow(daiToken,amount,address(this))](contracts/v2/strategies/DsrBaseStrategy.sol#L197)\n\t- [_dsrDeposit(amount)](contracts/v2/strategies/DsrBaseStrategy.sol#L198)\n\t\t- [chi = pot.drip()](contracts/v2/strategies/DsrBaseStrategy.sol#L142)\n\t\t- [daiJoin.join(address(this),amount)](contracts/v2/strategies/DsrBaseStrategy.sol#L207)\n\t\t- [pot.join(shares)](contracts/v2/strategies/DsrBaseStrategy.sol#L208)\n\tEvent emitted after the call(s):\n\t- [DaiDeposited(amount)](contracts/v2/strategies/DsrBaseStrategy.sol#L206)\n\t\t- [_dsrDeposit(amount)](contracts/v2/strategies/DsrBaseStrategy.sol#L198)\n", - "first_markdown_element": "contracts/v2/strategies/DsrBaseStrategy.sol#L195-L199", - "id": "fa02cb67c0fadd634b5b58c828b6c896bd82d9eafb17365664e0ed1810997c50", + "description": "Reentrancy in TempleLineOfCredit.removeCollateral(uint128,address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#166-190):\n\tExternal calls:\n\t- circuitBreakerProxy.preCheck(address(templeToken),msg.sender,amount) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#173-177)\n\tEvent emitted after the call(s):\n\t- CollateralRemoved(msg.sender,recipient,amount) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#182)\n", + "markdown": "Reentrancy in [TempleLineOfCredit.removeCollateral(uint128,address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L166-L190):\n\tExternal calls:\n\t- [circuitBreakerProxy.preCheck(address(templeToken),msg.sender,amount)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L173-L177)\n\tEvent emitted after the call(s):\n\t- [CollateralRemoved(msg.sender,recipient,amount)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L182)\n", + "first_markdown_element": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L166-L190", + "id": "995ebae8f6668f6a1d468a923e261df6e2cd441ac86401c473cc53982585815d", "check": "reentrancy-events", "impact": "Low", "confidence": "Medium" @@ -39291,101 +35253,186 @@ "elements": [ { "type": "function", - "name": "borrowAndDeposit", + "name": "removeLiquidity", "source_mapping": { - "start": 2046, - "length": 229, - "filename_relative": "contracts/v2/strategies/TempleTokenBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/TempleTokenBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/TempleTokenBaseStrategy.sol", + "start": 22535, + "length": 1408, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [61, 62, 63, 64, 65], + "lines": [ + 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, + 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, + 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleTokenBaseStrategy", + "name": "Ramos", "source_mapping": { - "start": 689, - "length": 4427, - "filename_relative": "contracts/v2/strategies/TempleTokenBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/TempleTokenBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/TempleTokenBaseStrategy.sol", + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128 + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, + 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, + 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, + 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, + 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, + 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, + 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, + 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, + 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, + 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, + 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, + 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, + 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, + 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, + 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, + 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, + 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, + 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, + 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, + 621 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "borrowAndDeposit(uint256)" + "signature": "removeLiquidity(IBalancerVault.ExitPoolRequest,uint256)" } }, { "type": "node", - "name": "treasuryReservesVault.borrow(templeToken,amount,address(this))", + "name": "amoStaking.withdrawAndUnwrap(bptIn,false,address(this))", "source_mapping": { - "start": 2135, - "length": 64, - "filename_relative": "contracts/v2/strategies/TempleTokenBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/TempleTokenBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/TempleTokenBaseStrategy.sol", + "start": 23216, + "length": 57, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [62], + "lines": [541], "starting_column": 9, - "ending_column": 73 + "ending_column": 66 }, "type_specific_fields": { "parent": { "type": "function", - "name": "borrowAndDeposit", + "name": "removeLiquidity", "source_mapping": { - "start": 2046, - "length": 229, - "filename_relative": "contracts/v2/strategies/TempleTokenBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/TempleTokenBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/TempleTokenBaseStrategy.sol", + "start": 22535, + "length": 1408, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [61, 62, 63, 64, 65], + "lines": [ + 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, + 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, + 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleTokenBaseStrategy", + "name": "Ramos", "source_mapping": { - "start": 689, - "length": 4427, - "filename_relative": "contracts/v2/strategies/TempleTokenBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/TempleTokenBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/TempleTokenBaseStrategy.sol", + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128 + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, + 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, + 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, + 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, + 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, + 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, + 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "borrowAndDeposit(uint256)" + "signature": "removeLiquidity(IBalancerVault.ExitPoolRequest,uint256)" } } }, @@ -39393,183 +35440,103 @@ }, { "type": "node", - "name": "TempleBurned(amount)", - "source_mapping": { - "start": 2209, - "length": 25, - "filename_relative": "contracts/v2/strategies/TempleTokenBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/TempleTokenBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/TempleTokenBaseStrategy.sol", - "is_dependency": false, - "lines": [63], - "starting_column": 9, - "ending_column": 34 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "borrowAndDeposit", - "source_mapping": { - "start": 2046, - "length": 229, - "filename_relative": "contracts/v2/strategies/TempleTokenBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/TempleTokenBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/TempleTokenBaseStrategy.sol", - "is_dependency": false, - "lines": [61, 62, 63, 64, 65], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleTokenBaseStrategy", - "source_mapping": { - "start": 689, - "length": 4427, - "filename_relative": "contracts/v2/strategies/TempleTokenBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/TempleTokenBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/TempleTokenBaseStrategy.sol", - "is_dependency": false, - "lines": [ - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "borrowAndDeposit(uint256)" - } - } - }, - "additional_fields": { "underlying_type": "event" } - } - ], - "description": "Reentrancy in TempleTokenBaseStrategy.borrowAndDeposit(uint256) (contracts/v2/strategies/TempleTokenBaseStrategy.sol#61-65):\n\tExternal calls:\n\t- treasuryReservesVault.borrow(templeToken,amount,address(this)) (contracts/v2/strategies/TempleTokenBaseStrategy.sol#62)\n\tEvent emitted after the call(s):\n\t- TempleBurned(amount) (contracts/v2/strategies/TempleTokenBaseStrategy.sol#63)\n", - "markdown": "Reentrancy in [TempleTokenBaseStrategy.borrowAndDeposit(uint256)](contracts/v2/strategies/TempleTokenBaseStrategy.sol#L61-L65):\n\tExternal calls:\n\t- [treasuryReservesVault.borrow(templeToken,amount,address(this))](contracts/v2/strategies/TempleTokenBaseStrategy.sol#L62)\n\tEvent emitted after the call(s):\n\t- [TempleBurned(amount)](contracts/v2/strategies/TempleTokenBaseStrategy.sol#L63)\n", - "first_markdown_element": "contracts/v2/strategies/TempleTokenBaseStrategy.sol#L61-L65", - "id": "a4b7ebab2add03874fc7d7e0fb2176bb3cce4461f7bee4c56c5e3938077ba4b2", - "check": "reentrancy-events", - "impact": "Low", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "borrowMax", - "source_mapping": { - "start": 3668, - "length": 489, - "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/GnosisStrategy.sol", - "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", - "is_dependency": false, - "lines": [102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "GnosisStrategy", - "source_mapping": { - "start": 584, - "length": 6684, - "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/GnosisStrategy.sol", - "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", - "is_dependency": false, - "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "borrowMax(IERC20)" - } - }, - { - "type": "node", - "name": "circuitBreakerProxy.preCheck(address(token),msg.sender,borrowedAmount)", + "name": "balancerVault.exitPool(balancerPoolId,address(this),address(this),request)", "source_mapping": { - "start": 3915, - "length": 120, - "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/GnosisStrategy.sol", - "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", + "start": 23283, + "length": 77, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [105, 106, 107, 108, 109], + "lines": [542], "starting_column": 9, - "ending_column": 10 + "ending_column": 86 }, "type_specific_fields": { "parent": { "type": "function", - "name": "borrowMax", + "name": "removeLiquidity", "source_mapping": { - "start": 3668, - "length": 489, - "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/GnosisStrategy.sol", - "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", + "start": 22535, + "length": 1408, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112], + "lines": [ + 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, + 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, + 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "GnosisStrategy", + "name": "Ramos", "source_mapping": { - "start": 584, - "length": 6684, - "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/GnosisStrategy.sol", - "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191 + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, + 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, + 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, + 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, + 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, + 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, + 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "borrowMax(IERC20)" + "signature": "removeLiquidity(IBalancerVault.ExitPoolRequest,uint256)" } } }, @@ -39577,199 +35544,207 @@ }, { "type": "node", - "name": "Borrow(address(token),borrowedAmount)", + "name": "_tokenVault.repayProtocolToken(protocolTokenAmount)", "source_mapping": { - "start": 4045, - "length": 43, - "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/GnosisStrategy.sol", - "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", + "start": 23691, + "length": 51, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [110], - "starting_column": 9, - "ending_column": 52 + "lines": [551], + "starting_column": 13, + "ending_column": 64 }, "type_specific_fields": { "parent": { "type": "function", - "name": "borrowMax", + "name": "removeLiquidity", "source_mapping": { - "start": 3668, - "length": 489, - "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/GnosisStrategy.sol", - "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", + "start": 22535, + "length": 1408, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112], + "lines": [ + 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, + 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, + 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "GnosisStrategy", + "name": "Ramos", "source_mapping": { - "start": 584, - "length": 6684, - "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/GnosisStrategy.sol", - "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191 + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, + 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, + 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, + 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, + 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, + 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, + 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "borrowMax(IERC20)" + "signature": "removeLiquidity(IBalancerVault.ExitPoolRequest,uint256)" } } }, - "additional_fields": { "underlying_type": "event" } - } - ], - "description": "Reentrancy in GnosisStrategy.borrowMax(IERC20) (contracts/v2/strategies/GnosisStrategy.sol#102-112):\n\tExternal calls:\n\t- circuitBreakerProxy.preCheck(address(token),msg.sender,borrowedAmount) (contracts/v2/strategies/GnosisStrategy.sol#105-109)\n\tEvent emitted after the call(s):\n\t- Borrow(address(token),borrowedAmount) (contracts/v2/strategies/GnosisStrategy.sol#110)\n", - "markdown": "Reentrancy in [GnosisStrategy.borrowMax(IERC20)](contracts/v2/strategies/GnosisStrategy.sol#L102-L112):\n\tExternal calls:\n\t- [circuitBreakerProxy.preCheck(address(token),msg.sender,borrowedAmount)](contracts/v2/strategies/GnosisStrategy.sol#L105-L109)\n\tEvent emitted after the call(s):\n\t- [Borrow(address(token),borrowedAmount)](contracts/v2/strategies/GnosisStrategy.sol#L110)\n", - "first_markdown_element": "contracts/v2/strategies/GnosisStrategy.sol#L102-L112", - "id": "c3beb3c3be57476ae61c0a7cfb0301faed9288220416d314839649d2de9f7b5e", - "check": "reentrancy-events", - "impact": "Low", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "borrowProtocolToken", - "source_mapping": { - "start": 3626, - "length": 353, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", - "is_dependency": false, - "lines": [91, 92, 93, 94, 95, 96, 97, 98, 99], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "RamosStrategy", - "source_mapping": { - "start": 1131, - "length": 9158, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", - "is_dependency": false, - "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "borrowProtocolToken(uint256,address)" - } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "circuitBreakerProxy.preCheck(address(templeToken),msg.sender,amount)", + "name": "_tokenVault.repayQuoteToken(quoteTokenAmount)", "source_mapping": { - "start": 3728, - "length": 118, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 23803, + "length": 45, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [92, 93, 94, 95, 96], - "starting_column": 9, - "ending_column": 10 + "lines": [555], + "starting_column": 13, + "ending_column": 58 }, "type_specific_fields": { "parent": { "type": "function", - "name": "borrowProtocolToken", + "name": "removeLiquidity", "source_mapping": { - "start": 3626, - "length": 353, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 22535, + "length": 1408, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [91, 92, 93, 94, 95, 96, 97, 98, 99], + "lines": [ + 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, + 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, + 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "RamosStrategy", + "name": "Ramos", "source_mapping": { - "start": 1131, - "length": 9158, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261 + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, + 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, + 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, + 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, + 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, + 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, + 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "borrowProtocolToken(uint256,address)" + "signature": "removeLiquidity(IBalancerVault.ExitPoolRequest,uint256)" } } }, @@ -39777,80 +35752,113 @@ }, { "type": "node", - "name": "BorrowToken(address(templeToken),amount)", + "name": "LiquidityRemoved(quoteTokenAmount,protocolTokenAmount,bptIn)", "source_mapping": { - "start": 3856, - "length": 46, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 23869, + "length": 67, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [97], + "lines": [558], "starting_column": 9, - "ending_column": 55 + "ending_column": 76 }, "type_specific_fields": { "parent": { "type": "function", - "name": "borrowProtocolToken", + "name": "removeLiquidity", "source_mapping": { - "start": 3626, - "length": 353, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 22535, + "length": 1408, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, - "lines": [91, 92, 93, 94, 95, 96, 97, 98, 99], + "lines": [ + 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, + 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, + 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "RamosStrategy", + "name": "Ramos", "source_mapping": { - "start": 1131, - "length": 9158, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 1893, + "length": 24333, + "filename_relative": "contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", + "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261 + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, + 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, + 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, + 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, + 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, + 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, + 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, + 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, + 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, + 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, + 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "borrowProtocolToken(uint256,address)" + "signature": "removeLiquidity(IBalancerVault.ExitPoolRequest,uint256)" } } }, "additional_fields": { "underlying_type": "event" } } ], - "description": "Reentrancy in RamosStrategy.borrowProtocolToken(uint256,address) (contracts/v2/strategies/RamosStrategy.sol#91-99):\n\tExternal calls:\n\t- circuitBreakerProxy.preCheck(address(templeToken),msg.sender,amount) (contracts/v2/strategies/RamosStrategy.sol#92-96)\n\tEvent emitted after the call(s):\n\t- BorrowToken(address(templeToken),amount) (contracts/v2/strategies/RamosStrategy.sol#97)\n", - "markdown": "Reentrancy in [RamosStrategy.borrowProtocolToken(uint256,address)](contracts/v2/strategies/RamosStrategy.sol#L91-L99):\n\tExternal calls:\n\t- [circuitBreakerProxy.preCheck(address(templeToken),msg.sender,amount)](contracts/v2/strategies/RamosStrategy.sol#L92-L96)\n\tEvent emitted after the call(s):\n\t- [BorrowToken(address(templeToken),amount)](contracts/v2/strategies/RamosStrategy.sol#L97)\n", - "first_markdown_element": "contracts/v2/strategies/RamosStrategy.sol#L91-L99", - "id": "e0ba9fad7b97dfcfdfbb8b5dcf413149d4e3c15549b5560fb8aacdf2167f9e31", + "description": "Reentrancy in Ramos.removeLiquidity(IBalancerVault.ExitPoolRequest,uint256) (contracts/amo/Ramos.sol#522-559):\n\tExternal calls:\n\t- amoStaking.withdrawAndUnwrap(bptIn,false,address(this)) (contracts/amo/Ramos.sol#541)\n\t- balancerVault.exitPool(balancerPoolId,address(this),address(this),request) (contracts/amo/Ramos.sol#542)\n\t- _tokenVault.repayProtocolToken(protocolTokenAmount) (contracts/amo/Ramos.sol#551)\n\t- _tokenVault.repayQuoteToken(quoteTokenAmount) (contracts/amo/Ramos.sol#555)\n\tEvent emitted after the call(s):\n\t- LiquidityRemoved(quoteTokenAmount,protocolTokenAmount,bptIn) (contracts/amo/Ramos.sol#558)\n", + "markdown": "Reentrancy in [Ramos.removeLiquidity(IBalancerVault.ExitPoolRequest,uint256)](contracts/amo/Ramos.sol#L522-L559):\n\tExternal calls:\n\t- [amoStaking.withdrawAndUnwrap(bptIn,false,address(this))](contracts/amo/Ramos.sol#L541)\n\t- [balancerVault.exitPool(balancerPoolId,address(this),address(this),request)](contracts/amo/Ramos.sol#L542)\n\t- [_tokenVault.repayProtocolToken(protocolTokenAmount)](contracts/amo/Ramos.sol#L551)\n\t- [_tokenVault.repayQuoteToken(quoteTokenAmount)](contracts/amo/Ramos.sol#L555)\n\tEvent emitted after the call(s):\n\t- [LiquidityRemoved(quoteTokenAmount,protocolTokenAmount,bptIn)](contracts/amo/Ramos.sol#L558)\n", + "first_markdown_element": "contracts/amo/Ramos.sol#L522-L559", + "id": "bed2c1413f14f1f0f387a42599c99dbade4f123d221d53142cc235119defc33d", "check": "reentrancy-events", "impact": "Low", "confidence": "Medium" @@ -39859,15 +35867,15 @@ "elements": [ { "type": "function", - "name": "borrowQuoteToken", + "name": "removeLiquidity", "source_mapping": { - "start": 4172, - "length": 347, + "start": 8140, + "length": 365, "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, - "lines": [106, 107, 108, 109, 110, 111, 112, 113, 114], + "lines": [209, 210, 211, 212, 213, 214, 215], "starting_column": 5, "ending_column": 6 }, @@ -39877,9 +35885,9 @@ "name": "RamosStrategy", "source_mapping": { "start": 1131, - "length": 9158, + "length": 9320, "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, "lines": [ @@ -39900,41 +35908,41 @@ 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261 + 257, 258, 259, 260, 261, 262, 263, 264, 265 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "borrowQuoteToken(uint256,address)" + "signature": "removeLiquidity(IBalancerVault.ExitPoolRequest,uint256)" } }, { "type": "node", - "name": "circuitBreakerProxy.preCheck(address(quoteToken),msg.sender,amount)", + "name": "(quoteTokenAmount,protocolTokenAmount) = ramos.removeLiquidity(_requestData,_bptAmount)", "source_mapping": { - "start": 4271, - "length": 117, + "start": 8277, + "length": 140, "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, - "lines": [107, 108, 109, 110, 111], + "lines": [210, 211, 212, 213], "starting_column": 9, - "ending_column": 10 + "ending_column": 60 }, "type_specific_fields": { "parent": { "type": "function", - "name": "borrowQuoteToken", + "name": "removeLiquidity", "source_mapping": { - "start": 4172, - "length": 347, + "start": 8140, + "length": 365, "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, - "lines": [106, 107, 108, 109, 110, 111, 112, 113, 114], + "lines": [209, 210, 211, 212, 213, 214, 215], "starting_column": 5, "ending_column": 6 }, @@ -39944,9 +35952,9 @@ "name": "RamosStrategy", "source_mapping": { "start": 1131, - "length": 9158, + "length": 9320, "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, "lines": [ @@ -39968,13 +35976,14 @@ 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261 + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "borrowQuoteToken(uint256,address)" + "signature": "removeLiquidity(IBalancerVault.ExitPoolRequest,uint256)" } } }, @@ -39982,30 +35991,30 @@ }, { "type": "node", - "name": "BorrowToken(address(quoteToken),amount)", + "name": "RemoveLiquidity(quoteTokenAmount,protocolTokenAmount,_bptAmount)", "source_mapping": { - "start": 4398, - "length": 45, + "start": 8427, + "length": 71, "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, - "lines": [112], + "lines": [214], "starting_column": 9, - "ending_column": 54 + "ending_column": 80 }, "type_specific_fields": { "parent": { "type": "function", - "name": "borrowQuoteToken", + "name": "removeLiquidity", "source_mapping": { - "start": 4172, - "length": 347, + "start": 8140, + "length": 365, "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, - "lines": [106, 107, 108, 109, 110, 111, 112, 113, 114], + "lines": [209, 210, 211, 212, 213, 214, 215], "starting_column": 5, "ending_column": 6 }, @@ -40015,9 +36024,9 @@ "name": "RamosStrategy", "source_mapping": { "start": 1131, - "length": 9158, + "length": 9320, "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, "lines": [ @@ -40039,23 +36048,24 @@ 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261 + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "borrowQuoteToken(uint256,address)" + "signature": "removeLiquidity(IBalancerVault.ExitPoolRequest,uint256)" } } }, "additional_fields": { "underlying_type": "event" } } ], - "description": "Reentrancy in RamosStrategy.borrowQuoteToken(uint256,address) (contracts/v2/strategies/RamosStrategy.sol#106-114):\n\tExternal calls:\n\t- circuitBreakerProxy.preCheck(address(quoteToken),msg.sender,amount) (contracts/v2/strategies/RamosStrategy.sol#107-111)\n\tEvent emitted after the call(s):\n\t- BorrowToken(address(quoteToken),amount) (contracts/v2/strategies/RamosStrategy.sol#112)\n", - "markdown": "Reentrancy in [RamosStrategy.borrowQuoteToken(uint256,address)](contracts/v2/strategies/RamosStrategy.sol#L106-L114):\n\tExternal calls:\n\t- [circuitBreakerProxy.preCheck(address(quoteToken),msg.sender,amount)](contracts/v2/strategies/RamosStrategy.sol#L107-L111)\n\tEvent emitted after the call(s):\n\t- [BorrowToken(address(quoteToken),amount)](contracts/v2/strategies/RamosStrategy.sol#L112)\n", - "first_markdown_element": "contracts/v2/strategies/RamosStrategy.sol#L106-L114", - "id": "bbc7a06e8819c324c8e6cacd486325e56ef60f1d5a3b26d061c95866855e9804", + "description": "Reentrancy in RamosStrategy.removeLiquidity(IBalancerVault.ExitPoolRequest,uint256) (contracts/v2/strategies/RamosStrategy.sol#209-215):\n\tExternal calls:\n\t- (quoteTokenAmount,protocolTokenAmount) = ramos.removeLiquidity(_requestData,_bptAmount) (contracts/v2/strategies/RamosStrategy.sol#210-213)\n\tEvent emitted after the call(s):\n\t- RemoveLiquidity(quoteTokenAmount,protocolTokenAmount,_bptAmount) (contracts/v2/strategies/RamosStrategy.sol#214)\n", + "markdown": "Reentrancy in [RamosStrategy.removeLiquidity(IBalancerVault.ExitPoolRequest,uint256)](contracts/v2/strategies/RamosStrategy.sol#L209-L215):\n\tExternal calls:\n\t- [(quoteTokenAmount,protocolTokenAmount) = ramos.removeLiquidity(_requestData,_bptAmount)](contracts/v2/strategies/RamosStrategy.sol#L210-L213)\n\tEvent emitted after the call(s):\n\t- [RemoveLiquidity(quoteTokenAmount,protocolTokenAmount,_bptAmount)](contracts/v2/strategies/RamosStrategy.sol#L214)\n", + "first_markdown_element": "contracts/v2/strategies/RamosStrategy.sol#L209-L215", + "id": "7c31093def50156c36e632afd1bdd7b3c7f967dee0aff539f837b6a8448615ae", "check": "reentrancy-events", "impact": "Low", "confidence": "Medium" @@ -40064,129 +36074,95 @@ "elements": [ { "type": "function", - "name": "checkpointAssetBalances", + "name": "sacrifice", "source_mapping": { - "start": 6888, - "length": 403, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2117, + "length": 663, + "filename_relative": "contracts/nexus/PartnerZeroSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/PartnerZeroSacrifice.sol", + "filename_short": "contracts/nexus/PartnerZeroSacrifice.sol", "is_dependency": false, - "lines": [173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183], + "lines": [61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "PartnerZeroSacrifice", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 545, + "length": 2237, + "filename_relative": "contracts/nexus/PartnerZeroSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/PartnerZeroSacrifice.sol", + "filename_short": "contracts/nexus/PartnerZeroSacrifice.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305 + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "checkpointAssetBalances()" + "signature": "sacrifice(uint256,address)" } }, { "type": "node", - "name": "(daiBalance) = _checkpointDaiBalance()", + "name": "relic.mintRelic(to,enclaveId)", "source_mapping": { - "start": 7011, - "length": 48, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2688, + "length": 30, + "filename_relative": "contracts/nexus/PartnerZeroSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/PartnerZeroSacrifice.sol", + "filename_short": "contracts/nexus/PartnerZeroSacrifice.sol", "is_dependency": false, - "lines": [176], + "lines": [72], "starting_column": 9, - "ending_column": 57 + "ending_column": 39 }, "type_specific_fields": { "parent": { "type": "function", - "name": "checkpointAssetBalances", + "name": "sacrifice", "source_mapping": { - "start": 6888, - "length": 403, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2117, + "length": 663, + "filename_relative": "contracts/nexus/PartnerZeroSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/PartnerZeroSacrifice.sol", + "filename_short": "contracts/nexus/PartnerZeroSacrifice.sol", "is_dependency": false, - "lines": [173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183], + "lines": [61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "PartnerZeroSacrifice", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 545, + "length": 2237, + "filename_relative": "contracts/nexus/PartnerZeroSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/PartnerZeroSacrifice.sol", + "filename_short": "contracts/nexus/PartnerZeroSacrifice.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "checkpointAssetBalances()" + "signature": "sacrifice(uint256,address)" } } }, @@ -40194,257 +36170,216 @@ }, { "type": "node", - "name": "chi = pot.drip()", + "name": "PartnerSacrifice(to,relicId,enclaveId)", "source_mapping": { - "start": 5566, - "length": 60, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2728, + "length": 45, + "filename_relative": "contracts/nexus/PartnerZeroSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/PartnerZeroSacrifice.sol", + "filename_short": "contracts/nexus/PartnerZeroSacrifice.sol", "is_dependency": false, - "lines": [142], + "lines": [73], "starting_column": 9, - "ending_column": 69 + "ending_column": 54 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_checkpointChi", + "name": "sacrifice", "source_mapping": { - "start": 5445, - "length": 188, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2117, + "length": 663, + "filename_relative": "contracts/nexus/PartnerZeroSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/PartnerZeroSacrifice.sol", + "filename_short": "contracts/nexus/PartnerZeroSacrifice.sol", "is_dependency": false, - "lines": [140, 141, 142, 143], + "lines": [61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "PartnerZeroSacrifice", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 545, + "length": 2237, + "filename_relative": "contracts/nexus/PartnerZeroSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/PartnerZeroSacrifice.sol", + "filename_short": "contracts/nexus/PartnerZeroSacrifice.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_checkpointChi()" + "signature": "sacrifice(uint256,address)" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + "additional_fields": { "underlying_type": "event" } + } + ], + "description": "Reentrancy in PartnerZeroSacrifice.sacrifice(uint256,address) (contracts/nexus/PartnerZeroSacrifice.sol#61-74):\n\tExternal calls:\n\t- relic.mintRelic(to,enclaveId) (contracts/nexus/PartnerZeroSacrifice.sol#72)\n\tEvent emitted after the call(s):\n\t- PartnerSacrifice(to,relicId,enclaveId) (contracts/nexus/PartnerZeroSacrifice.sol#73)\n", + "markdown": "Reentrancy in [PartnerZeroSacrifice.sacrifice(uint256,address)](contracts/nexus/PartnerZeroSacrifice.sol#L61-L74):\n\tExternal calls:\n\t- [relic.mintRelic(to,enclaveId)](contracts/nexus/PartnerZeroSacrifice.sol#L72)\n\tEvent emitted after the call(s):\n\t- [PartnerSacrifice(to,relicId,enclaveId)](contracts/nexus/PartnerZeroSacrifice.sol#L73)\n", + "first_markdown_element": "contracts/nexus/PartnerZeroSacrifice.sol#L61-L74", + "id": "6079b2b732e92c2368039f5650f530155b1e5ebc9f8bdba8cb4b14bab5e4faf7", + "check": "reentrancy-events", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "sacrifice", + "source_mapping": { + "start": 1858, + "length": 477, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", + "is_dependency": false, + "lines": [49, 50, 51, 52, 53, 54, 55, 56], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleSacrifice", + "source_mapping": { + "start": 594, + "length": 1743, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", + "is_dependency": false, + "lines": [ + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "sacrifice(uint256,address)" + } }, { "type": "node", - "name": "AssetBalancesCheckpoint(assetBalances)", + "name": "sacrificeToken.safeTransferFrom(msg.sender,sacrificedTokenRecipient,amount)", "source_mapping": { - "start": 7241, - "length": 43, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2161, + "length": 77, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, - "lines": [182], + "lines": [53], "starting_column": 9, - "ending_column": 52 + "ending_column": 86 }, "type_specific_fields": { "parent": { "type": "function", - "name": "checkpointAssetBalances", + "name": "sacrifice", "source_mapping": { - "start": 6888, - "length": 403, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 1858, + "length": 477, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, - "lines": [173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183], + "lines": [49, 50, 51, 52, 53, 54, 55, 56], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TempleSacrifice", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 594, + "length": 1743, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "checkpointAssetBalances()" + "signature": "sacrifice(uint256,address)" } } }, - "additional_fields": { "underlying_type": "event" } - } - ], - "description": "Reentrancy in DsrBaseStrategy.checkpointAssetBalances() (contracts/v2/strategies/DsrBaseStrategy.sol#173-183):\n\tExternal calls:\n\t- (daiBalance) = _checkpointDaiBalance() (contracts/v2/strategies/DsrBaseStrategy.sol#176)\n\t\t- chi = pot.drip() (contracts/v2/strategies/DsrBaseStrategy.sol#142)\n\tEvent emitted after the call(s):\n\t- AssetBalancesCheckpoint(assetBalances) (contracts/v2/strategies/DsrBaseStrategy.sol#182)\n", - "markdown": "Reentrancy in [DsrBaseStrategy.checkpointAssetBalances()](contracts/v2/strategies/DsrBaseStrategy.sol#L173-L183):\n\tExternal calls:\n\t- [(daiBalance) = _checkpointDaiBalance()](contracts/v2/strategies/DsrBaseStrategy.sol#L176)\n\t\t- [chi = pot.drip()](contracts/v2/strategies/DsrBaseStrategy.sol#L142)\n\tEvent emitted after the call(s):\n\t- [AssetBalancesCheckpoint(assetBalances)](contracts/v2/strategies/DsrBaseStrategy.sol#L182)\n", - "first_markdown_element": "contracts/v2/strategies/DsrBaseStrategy.sol#L173-L183", - "id": "91547e7be3e8d823bd0bb0f659906fbda2e7c22a3e071f2d8982d126ca2e8293", - "check": "reentrancy-events", - "impact": "Low", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "claim", - "source_mapping": { - "start": 2481, - "length": 452, - "filename_relative": "contracts/admin/TempleTeamPaymentsV2.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsV2.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsV2.sol", - "is_dependency": false, - "lines": [74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleTeamPaymentsV2", - "source_mapping": { - "start": 346, - "length": 2589, - "filename_relative": "contracts/admin/TempleTeamPaymentsV2.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsV2.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsV2.sol", - "is_dependency": false, - "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "claim(uint256)" - } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "SafeERC20.safeTransfer(temple,msg.sender,_claimAmount)", + "name": "relic.mintRelic(to,enclaveId)", "source_mapping": { - "start": 2822, - "length": 56, - "filename_relative": "contracts/admin/TempleTeamPaymentsV2.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsV2.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsV2.sol", + "start": 2248, + "length": 30, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, - "lines": [83], + "lines": [54], "starting_column": 9, - "ending_column": 65 + "ending_column": 39 }, "type_specific_fields": { "parent": { "type": "function", - "name": "claim", + "name": "sacrifice", "source_mapping": { - "start": 2481, - "length": 452, - "filename_relative": "contracts/admin/TempleTeamPaymentsV2.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsV2.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsV2.sol", + "start": 1858, + "length": 477, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, - "lines": [74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85], + "lines": [49, 50, 51, 52, 53, 54, 55, 56], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleTeamPaymentsV2", + "name": "TempleSacrifice", "source_mapping": { - "start": 346, - "length": 2589, - "filename_relative": "contracts/admin/TempleTeamPaymentsV2.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsV2.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsV2.sol", + "start": 594, + "length": 1743, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86 + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "claim(uint256)" + "signature": "sacrifice(uint256,address)" } } }, @@ -40452,67 +36387,65 @@ }, { "type": "node", - "name": "Claimed(msg.sender,_claimAmount)", + "name": "TokenSacrificed(msg.sender,amount)", "source_mapping": { - "start": 2888, - "length": 38, - "filename_relative": "contracts/admin/TempleTeamPaymentsV2.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsV2.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsV2.sol", + "start": 2288, + "length": 40, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, - "lines": [84], + "lines": [55], "starting_column": 9, - "ending_column": 47 + "ending_column": 49 }, "type_specific_fields": { "parent": { "type": "function", - "name": "claim", + "name": "sacrifice", "source_mapping": { - "start": 2481, - "length": 452, - "filename_relative": "contracts/admin/TempleTeamPaymentsV2.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsV2.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsV2.sol", + "start": 1858, + "length": 477, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, - "lines": [74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85], + "lines": [49, 50, 51, 52, 53, 54, 55, 56], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleTeamPaymentsV2", + "name": "TempleSacrifice", "source_mapping": { - "start": 346, - "length": 2589, - "filename_relative": "contracts/admin/TempleTeamPaymentsV2.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsV2.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsV2.sol", + "start": 594, + "length": 1743, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86 + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "claim(uint256)" + "signature": "sacrifice(uint256,address)" } } }, "additional_fields": { "underlying_type": "event" } } ], - "description": "Reentrancy in TempleTeamPaymentsV2.claim(uint256) (contracts/admin/TempleTeamPaymentsV2.sol#74-85):\n\tExternal calls:\n\t- SafeERC20.safeTransfer(temple,msg.sender,_claimAmount) (contracts/admin/TempleTeamPaymentsV2.sol#83)\n\tEvent emitted after the call(s):\n\t- Claimed(msg.sender,_claimAmount) (contracts/admin/TempleTeamPaymentsV2.sol#84)\n", - "markdown": "Reentrancy in [TempleTeamPaymentsV2.claim(uint256)](contracts/admin/TempleTeamPaymentsV2.sol#L74-L85):\n\tExternal calls:\n\t- [SafeERC20.safeTransfer(temple,msg.sender,_claimAmount)](contracts/admin/TempleTeamPaymentsV2.sol#L83)\n\tEvent emitted after the call(s):\n\t- [Claimed(msg.sender,_claimAmount)](contracts/admin/TempleTeamPaymentsV2.sol#L84)\n", - "first_markdown_element": "contracts/admin/TempleTeamPaymentsV2.sol#L74-L85", - "id": "e805076f6ba37558b2d1e1e33a36ca2141157b088d4472056b82f8af89078bb2", + "description": "Reentrancy in TempleSacrifice.sacrifice(uint256,address) (contracts/nexus/TempleSacrifice.sol#49-56):\n\tExternal calls:\n\t- sacrificeToken.safeTransferFrom(msg.sender,sacrificedTokenRecipient,amount) (contracts/nexus/TempleSacrifice.sol#53)\n\t- relic.mintRelic(to,enclaveId) (contracts/nexus/TempleSacrifice.sol#54)\n\tEvent emitted after the call(s):\n\t- TokenSacrificed(msg.sender,amount) (contracts/nexus/TempleSacrifice.sol#55)\n", + "markdown": "Reentrancy in [TempleSacrifice.sacrifice(uint256,address)](contracts/nexus/TempleSacrifice.sol#L49-L56):\n\tExternal calls:\n\t- [sacrificeToken.safeTransferFrom(msg.sender,sacrificedTokenRecipient,amount)](contracts/nexus/TempleSacrifice.sol#L53)\n\t- [relic.mintRelic(to,enclaveId)](contracts/nexus/TempleSacrifice.sol#L54)\n\tEvent emitted after the call(s):\n\t- [TokenSacrificed(msg.sender,amount)](contracts/nexus/TempleSacrifice.sol#L55)\n", + "first_markdown_element": "contracts/nexus/TempleSacrifice.sol#L49-L56", + "id": "eb403842f0c1b20a1eecdbf0063598aaba33c28acfe56e0d8c0cf6804b118678", "check": "reentrancy-events", "impact": "Low", "confidence": "Medium" @@ -40521,18 +36454,17 @@ "elements": [ { "type": "function", - "name": "deployPayouts", + "name": "setTlcStrategy", "source_mapping": { - "start": 2818, - "length": 1078, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 15688, + "length": 875, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, "lines": [ - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112 + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, + 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410 ], "starting_column": 5, "ending_column": 6 @@ -40540,128 +36472,116 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleTeamPaymentsFactory", - "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", - "is_dependency": false, - "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" - } - }, - { - "type": "node", - "name": "paymentContract.initialize(_token)", - "source_mapping": { - "start": 3274, - "length": 34, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", - "is_dependency": false, - "lines": [89], - "starting_column": 9, - "ending_column": 43 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "deployPayouts", + "name": "TempleLineOfCredit", "source_mapping": { - "start": 2818, - "length": 1078, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 1433, + "length": 31753, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, "lines": [ - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleTeamPaymentsFactory", - "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", - "is_dependency": false, - "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, + 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, + 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, + 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, + 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, + 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, + 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, + 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, + 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, + 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, + 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, + 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, + 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, + 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, + 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, + 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, + 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, + 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, + 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, + 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, + 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, + 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, + 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, + 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, + 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, + 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, + 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, + 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, + 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, + 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, + 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, + 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, + 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, + 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, + 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, + 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, + 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, + 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885 + ], + "starting_column": 1, + "ending_column": 0 } - } - }, - "additional_fields": { "underlying_type": "external_calls" } + }, + "signature": "setTlcStrategy(address)" + } }, { "type": "node", - "name": "paymentContract.setAllocations(_dests,_allocations)", + "name": "daiToken.safeApprove(previousTrv,0)", "source_mapping": { - "start": 3318, - "length": 52, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 16002, + "length": 36, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, - "lines": [90], - "starting_column": 9, - "ending_column": 61 + "lines": [394], + "starting_column": 13, + "ending_column": 49 }, "type_specific_fields": { "parent": { "type": "function", - "name": "deployPayouts", + "name": "setTlcStrategy", "source_mapping": { - "start": 2818, - "length": 1078, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 15688, + "length": 875, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, "lines": [ - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112 + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, + 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410 ], "starting_column": 5, "ending_column": 6 @@ -40669,31 +36589,92 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleTeamPaymentsFactory", + "name": "TempleLineOfCredit", "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 1433, + "length": 31753, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, + 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, + 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, + 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, + 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, + 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, + 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, + 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, + 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, + 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, + 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, + 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, + 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, + 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, + 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, + 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, + 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, + 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, + 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, + 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, + 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, + 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, + 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, + 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, + 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, + 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, + 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, + 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, + 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, + 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, + 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, + 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, + 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, + 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, + 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, + 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, + 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, + 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, + 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, + 883, 884, 885 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" + "signature": "setTlcStrategy(address)" } } }, @@ -40701,33 +36682,32 @@ }, { "type": "node", - "name": "paymentContract.transferOwnership(msg.sender)", + "name": "daiToken.safeApprove(_trv,0)", "source_mapping": { - "start": 3381, - "length": 45, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 16249, + "length": 29, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, - "lines": [92], - "starting_column": 9, - "ending_column": 54 + "lines": [402], + "starting_column": 13, + "ending_column": 42 }, "type_specific_fields": { "parent": { "type": "function", - "name": "deployPayouts", + "name": "setTlcStrategy", "source_mapping": { - "start": 2818, - "length": 1078, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 15688, + "length": 875, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, "lines": [ - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112 + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, + 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410 ], "starting_column": 5, "ending_column": 6 @@ -40735,31 +36715,92 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleTeamPaymentsFactory", + "name": "TempleLineOfCredit", "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 1433, + "length": 31753, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, + 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, + 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, + 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, + 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, + 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, + 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, + 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, + 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, + 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, + 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, + 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, + 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, + 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, + 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, + 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, + 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, + 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, + 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, + 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, + 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, + 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, + 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, + 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, + 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, + 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, + 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, + 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, + 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, + 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, + 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, + 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, + 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, + 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, + 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, + 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, + 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, + 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, + 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, + 883, 884, 885 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" + "signature": "setTlcStrategy(address)" } } }, @@ -40767,33 +36808,32 @@ }, { "type": "node", - "name": "SafeERC20.safeTransferFrom(_token,msg.sender,address(paymentContract),_totalFunding)", + "name": "daiToken.safeIncreaseAllowance(_trv,type()(uint256).max)", "source_mapping": { - "start": 3473, - "length": 165, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 16292, + "length": 55, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, - "lines": [95, 96, 97, 98, 99, 100], + "lines": [403], "starting_column": 13, - "ending_column": 14 + "ending_column": 68 }, "type_specific_fields": { "parent": { "type": "function", - "name": "deployPayouts", + "name": "setTlcStrategy", "source_mapping": { - "start": 2818, - "length": 1078, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 15688, + "length": 875, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, "lines": [ - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112 + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, + 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410 ], "starting_column": 5, "ending_column": 6 @@ -40801,31 +36841,92 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleTeamPaymentsFactory", + "name": "TempleLineOfCredit", "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 1433, + "length": 31753, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, + 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, + 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, + 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, + 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, + 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, + 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, + 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, + 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, + 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, + 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, + 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, + 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, + 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, + 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, + 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, + 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, + 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, + 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, + 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, + 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, + 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, + 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, + 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, + 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, + 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, + 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, + 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, + 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, + 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, + 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, + 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, + 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, + 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, + 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, + 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, + 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, + 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, + 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, + 883, 884, 885 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" + "signature": "setTlcStrategy(address)" } } }, @@ -40833,33 +36934,32 @@ }, { "type": "node", - "name": "FundingDeployed(lastPaidEpoch,_dests,_allocations,address(paymentContract))", + "name": "TlcStrategySet(newTlcStrategy,_trv)", "source_mapping": { - "start": 3715, - "length": 141, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 16368, + "length": 41, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, - "lines": [104, 105, 106, 107, 108, 109], + "lines": [406], "starting_column": 9, - "ending_column": 10 + "ending_column": 50 }, "type_specific_fields": { "parent": { "type": "function", - "name": "deployPayouts", + "name": "setTlcStrategy", "source_mapping": { - "start": 2818, - "length": 1078, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 15688, + "length": 875, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, "lines": [ - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112 + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, + 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410 ], "starting_column": 5, "ending_column": 6 @@ -40867,41 +36967,102 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleTeamPaymentsFactory", + "name": "TempleLineOfCredit", "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 1433, + "length": 31753, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, + 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, + 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, + 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, + 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, + 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, + 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, + 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, + 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, + 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, + 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, + 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, + 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, + 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, + 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, + 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, + 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, + 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, + 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, + 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, + 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, + 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, + 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, + 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, + 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, + 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, + 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, + 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, + 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, + 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, + 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, + 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, + 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, + 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, + 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, + 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, + 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, + 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, + 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, + 883, 884, 885 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" + "signature": "setTlcStrategy(address)" } } }, "additional_fields": { "underlying_type": "event" } } ], - "description": "Reentrancy in TempleTeamPaymentsFactory.deployPayouts(IERC20,address[],uint256[],uint256) (contracts/admin/TempleTeamPaymentsFactory.sol#79-112):\n\tExternal calls:\n\t- paymentContract.initialize(_token) (contracts/admin/TempleTeamPaymentsFactory.sol#89)\n\t- paymentContract.setAllocations(_dests,_allocations) (contracts/admin/TempleTeamPaymentsFactory.sol#90)\n\t- paymentContract.transferOwnership(msg.sender) (contracts/admin/TempleTeamPaymentsFactory.sol#92)\n\t- SafeERC20.safeTransferFrom(_token,msg.sender,address(paymentContract),_totalFunding) (contracts/admin/TempleTeamPaymentsFactory.sol#95-100)\n\tEvent emitted after the call(s):\n\t- FundingDeployed(lastPaidEpoch,_dests,_allocations,address(paymentContract)) (contracts/admin/TempleTeamPaymentsFactory.sol#104-109)\n", - "markdown": "Reentrancy in [TempleTeamPaymentsFactory.deployPayouts(IERC20,address[],uint256[],uint256)](contracts/admin/TempleTeamPaymentsFactory.sol#L79-L112):\n\tExternal calls:\n\t- [paymentContract.initialize(_token)](contracts/admin/TempleTeamPaymentsFactory.sol#L89)\n\t- [paymentContract.setAllocations(_dests,_allocations)](contracts/admin/TempleTeamPaymentsFactory.sol#L90)\n\t- [paymentContract.transferOwnership(msg.sender)](contracts/admin/TempleTeamPaymentsFactory.sol#L92)\n\t- [SafeERC20.safeTransferFrom(_token,msg.sender,address(paymentContract),_totalFunding)](contracts/admin/TempleTeamPaymentsFactory.sol#L95-L100)\n\tEvent emitted after the call(s):\n\t- [FundingDeployed(lastPaidEpoch,_dests,_allocations,address(paymentContract))](contracts/admin/TempleTeamPaymentsFactory.sol#L104-L109)\n", - "first_markdown_element": "contracts/admin/TempleTeamPaymentsFactory.sol#L79-L112", - "id": "e09076945359fed962d2ff6dfd37bfd369cd1b53e0192377da32895ae9a9f829", + "description": "Reentrancy in TempleLineOfCredit.setTlcStrategy(address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#386-410):\n\tExternal calls:\n\t- daiToken.safeApprove(previousTrv,0) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#394)\n\t- daiToken.safeApprove(_trv,0) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#402)\n\t- daiToken.safeIncreaseAllowance(_trv,type()(uint256).max) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#403)\n\tEvent emitted after the call(s):\n\t- TlcStrategySet(newTlcStrategy,_trv) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#406)\n", + "markdown": "Reentrancy in [TempleLineOfCredit.setTlcStrategy(address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L386-L410):\n\tExternal calls:\n\t- [daiToken.safeApprove(previousTrv,0)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L394)\n\t- [daiToken.safeApprove(_trv,0)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L402)\n\t- [daiToken.safeIncreaseAllowance(_trv,type()(uint256).max)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L403)\n\tEvent emitted after the call(s):\n\t- [TlcStrategySet(newTlcStrategy,_trv)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L406)\n", + "first_markdown_element": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L386-L410", + "id": "324c860350f8b013fe53e7e16c80f3c65372dc79913460521e82a2cd87c23a45", "check": "reentrancy-events", "impact": "Low", "confidence": "Medium" @@ -40910,278 +37071,210 @@ "elements": [ { "type": "function", - "name": "depositAndStakeBptTokens", + "name": "shutdown", "source_mapping": { - "start": 24153, - "length": 411, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 11822, + "length": 1632, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576], + "lines": [ + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "Ramos", + "name": "TreasuryReservesVault", "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 2150, + "length": 32023, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, "lines": [ - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, - 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, - 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, - 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, - 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, - 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, - 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, - 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, - 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, - 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, - 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, - 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, - 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, - 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, - 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, - 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, - 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, - 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621 + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, + 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, + 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, + 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, + 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, + 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, + 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, + 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, + 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, + 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, + 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, + 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, + 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, + 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, + 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, + 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, + 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, + 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, + 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, + 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, + 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, + 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, + 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, + 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, + 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, + 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, + 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, + 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, + 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, + 771, 772, 773, 774, 775, 776, 777, 778, 779 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "depositAndStakeBptTokens(uint256,bool)" + "signature": "shutdown(address)" } }, { "type": "node", - "name": "bptToken.safeTransferFrom(msg.sender,address(this),amount)", + "name": "_outstandingDebt = borrowTokens[_token].dToken.burnAll(strategy)", "source_mapping": { - "start": 24336, - "length": 60, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 12499, + "length": 64, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [571], + "lines": [296], "starting_column": 13, - "ending_column": 73 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "depositAndStakeBptTokens", - "source_mapping": { - "start": 24153, - "length": 411, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", - "is_dependency": false, - "lines": [566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "Ramos", - "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", - "is_dependency": false, - "lines": [ - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, - 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, - 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, - 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, - 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, - 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, - 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, - 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "depositAndStakeBptTokens(uint256,bool)" - } - } - }, - "additional_fields": { "underlying_type": "external_calls" } - }, - { - "type": "node", - "name": "bptToken.safeTransfer(address(amoStaking),amount)", - "source_mapping": { - "start": 24416, - "length": 50, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", - "is_dependency": false, - "lines": [573], - "starting_column": 9, - "ending_column": 59 + "ending_column": 77 }, "type_specific_fields": { "parent": { "type": "function", - "name": "depositAndStakeBptTokens", + "name": "shutdown", "source_mapping": { - "start": 24153, - "length": 411, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 11822, + "length": 1632, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576], + "lines": [ + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "Ramos", + "name": "TreasuryReservesVault", "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 2150, + "length": 32023, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, "lines": [ - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, - 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, - 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, - 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, - 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, - 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, - 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, - 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621 + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, + 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, + 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, + 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, + 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, + 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, + 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, + 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, + 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, + 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, + 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, + 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, + 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, + 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, + 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, + 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, + 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, + 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, + 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, + 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, + 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, + 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, + 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, + 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, + 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, + 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, + 777, 778, 779 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "depositAndStakeBptTokens(uint256,bool)" + "signature": "shutdown(address)" } } }, @@ -41189,209 +37282,243 @@ }, { "type": "node", - "name": "amoStaking.depositAndStake(amount)", + "name": "StrategyRemoved(strategy)", "source_mapping": { - "start": 24476, - "length": 34, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 13162, + "length": 30, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [574], + "lines": [312], "starting_column": 9, - "ending_column": 43 + "ending_column": 39 }, "type_specific_fields": { "parent": { "type": "function", - "name": "depositAndStakeBptTokens", + "name": "shutdown", "source_mapping": { - "start": 24153, - "length": 411, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 11822, + "length": 1632, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576], + "lines": [ + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "Ramos", + "name": "TreasuryReservesVault", "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 2150, + "length": 32023, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, "lines": [ - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, - 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, - 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, - 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, - 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, - 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, - 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, - 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621 + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, + 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, + 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, + 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, + 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, + 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, + 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, + 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, + 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, + 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, + 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, + 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, + 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, + 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, + 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, + 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, + 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, + 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, + 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, + 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, + 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, + 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, + 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, + 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, + 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, + 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, + 777, 778, 779 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "depositAndStakeBptTokens(uint256,bool)" + "signature": "shutdown(address)" } } }, - "additional_fields": { "underlying_type": "external_calls" } + "additional_fields": { "underlying_type": "event" } }, { "type": "node", - "name": "DepositAndStakeBptTokens(amount)", + "name": "StrategyShutdownCreditAndDebt({strategy:strategy,token:address(_token),outstandingCredit:credits[_token],outstandingDebt:_outstandingDebt})", "source_mapping": { - "start": 24520, - "length": 37, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 12577, + "length": 231, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [575], - "starting_column": 9, - "ending_column": 46 + "lines": [297, 298, 299, 300, 301, 302], + "starting_column": 13, + "ending_column": 15 }, "type_specific_fields": { "parent": { "type": "function", - "name": "depositAndStakeBptTokens", + "name": "shutdown", "source_mapping": { - "start": 24153, - "length": 411, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 11822, + "length": 1632, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, - "lines": [566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576], + "lines": [ + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "Ramos", + "name": "TreasuryReservesVault", "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 2150, + "length": 32023, + "filename_relative": "contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, "lines": [ - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, - 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, - 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, - 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, - 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, - 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, - 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, - 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621 + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, + 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, + 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, + 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, + 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, + 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, + 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, + 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, + 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, + 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, + 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, + 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, + 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, + 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, + 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, + 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, + 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, + 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, + 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, + 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, + 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, + 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, + 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, + 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, + 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, + 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, + 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, + 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, + 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, + 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, + 777, 778, 779 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "depositAndStakeBptTokens(uint256,bool)" + "signature": "shutdown(address)" } } }, "additional_fields": { "underlying_type": "event" } } ], - "description": "Reentrancy in Ramos.depositAndStakeBptTokens(uint256,bool) (contracts/amo/Ramos.sol#566-576):\n\tExternal calls:\n\t- bptToken.safeTransferFrom(msg.sender,address(this),amount) (contracts/amo/Ramos.sol#571)\n\t- bptToken.safeTransfer(address(amoStaking),amount) (contracts/amo/Ramos.sol#573)\n\t- amoStaking.depositAndStake(amount) (contracts/amo/Ramos.sol#574)\n\tEvent emitted after the call(s):\n\t- DepositAndStakeBptTokens(amount) (contracts/amo/Ramos.sol#575)\n", - "markdown": "Reentrancy in [Ramos.depositAndStakeBptTokens(uint256,bool)](contracts/amo/Ramos.sol#L566-L576):\n\tExternal calls:\n\t- [bptToken.safeTransferFrom(msg.sender,address(this),amount)](contracts/amo/Ramos.sol#L571)\n\t- [bptToken.safeTransfer(address(amoStaking),amount)](contracts/amo/Ramos.sol#L573)\n\t- [amoStaking.depositAndStake(amount)](contracts/amo/Ramos.sol#L574)\n\tEvent emitted after the call(s):\n\t- [DepositAndStakeBptTokens(amount)](contracts/amo/Ramos.sol#L575)\n", - "first_markdown_element": "contracts/amo/Ramos.sol#L566-L576", - "id": "67e99bfded023e26233003458844419ba59173900b8f69b73dd5b1196eedee80", + "description": "Reentrancy in TreasuryReservesVault.shutdown(address) (contracts/v2/TreasuryReservesVault.sol#283-319):\n\tExternal calls:\n\t- _outstandingDebt = borrowTokens[_token].dToken.burnAll(strategy) (contracts/v2/TreasuryReservesVault.sol#296)\n\tEvent emitted after the call(s):\n\t- StrategyRemoved(strategy) (contracts/v2/TreasuryReservesVault.sol#312)\n\t- StrategyShutdownCreditAndDebt({strategy:strategy,token:address(_token),outstandingCredit:credits[_token],outstandingDebt:_outstandingDebt}) (contracts/v2/TreasuryReservesVault.sol#297-302)\n", + "markdown": "Reentrancy in [TreasuryReservesVault.shutdown(address)](contracts/v2/TreasuryReservesVault.sol#L283-L319):\n\tExternal calls:\n\t- [_outstandingDebt = borrowTokens[_token].dToken.burnAll(strategy)](contracts/v2/TreasuryReservesVault.sol#L296)\n\tEvent emitted after the call(s):\n\t- [StrategyRemoved(strategy)](contracts/v2/TreasuryReservesVault.sol#L312)\n\t- [StrategyShutdownCreditAndDebt({strategy:strategy,token:address(_token),outstandingCredit:credits[_token],outstandingDebt:_outstandingDebt})](contracts/v2/TreasuryReservesVault.sol#L297-L302)\n", + "first_markdown_element": "contracts/v2/TreasuryReservesVault.sol#L283-L319", + "id": "3770a3cd34d6db65975f14acb9170e3663edac9809964808500e613a8be2344e", "check": "reentrancy-events", "impact": "Low", "confidence": "Medium" @@ -41400,17 +37527,17 @@ "elements": [ { "type": "function", - "name": "directPayouts", + "name": "trvWithdraw", "source_mapping": { - "start": 4101, - "length": 829, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 10560, + "length": 947, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143 + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276 ], "starting_column": 5, "ending_column": 6 @@ -41418,61 +37545,72 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleTeamPaymentsFactory", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "directPayouts(IERC20,address[],uint256[])" + "signature": "trvWithdraw(uint256)" } }, { "type": "node", - "name": "SafeERC20.safeTransferFrom(_token,msg.sender,dest,value)", + "name": "(daiAvailable,chi,sharesAvailable) = _checkpointDaiBalance()", "source_mapping": { - "start": 4642, - "length": 59, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 11010, + "length": 86, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [133], - "starting_column": 13, - "ending_column": 72 + "lines": [264], + "starting_column": 9, + "ending_column": 95 }, "type_specific_fields": { "parent": { "type": "function", - "name": "directPayouts", + "name": "trvWithdraw", "source_mapping": { - "start": 4101, - "length": 829, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 10560, + "length": 947, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143 + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276 ], "starting_column": 5, "ending_column": 6 @@ -41480,31 +37618,44 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleTeamPaymentsFactory", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "directPayouts(IERC20,address[],uint256[])" + "signature": "trvWithdraw(uint256)" } } }, @@ -41512,504 +37663,410 @@ }, { "type": "node", - "name": "FundingPaid(lastPaidEpoch,_dests,_allocations)", + "name": "chi = pot.drip()", "source_mapping": { - "start": 4870, - "length": 53, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 5566, + "length": 60, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [142], "starting_column": 9, - "ending_column": 62 + "ending_column": 69 }, "type_specific_fields": { "parent": { "type": "function", - "name": "directPayouts", + "name": "_checkpointChi", "source_mapping": { - "start": 4101, - "length": 829, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 5445, + "length": 188, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [ - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143 - ], + "lines": [140, 141, 142, 143], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleTeamPaymentsFactory", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 279, - "length": 4653, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "directPayouts(IERC20,address[],uint256[])" + "signature": "_checkpointChi()" } } }, - "additional_fields": { "underlying_type": "event" } - } - ], - "description": "Reentrancy in TempleTeamPaymentsFactory.directPayouts(IERC20,address[],uint256[]) (contracts/admin/TempleTeamPaymentsFactory.sol#119-143):\n\tExternal calls:\n\t- SafeERC20.safeTransferFrom(_token,msg.sender,dest,value) (contracts/admin/TempleTeamPaymentsFactory.sol#133)\n\tEvent emitted after the call(s):\n\t- FundingPaid(lastPaidEpoch,_dests,_allocations) (contracts/admin/TempleTeamPaymentsFactory.sol#142)\n", - "markdown": "Reentrancy in [TempleTeamPaymentsFactory.directPayouts(IERC20,address[],uint256[])](contracts/admin/TempleTeamPaymentsFactory.sol#L119-L143):\n\tExternal calls:\n\t- [SafeERC20.safeTransferFrom(_token,msg.sender,dest,value)](contracts/admin/TempleTeamPaymentsFactory.sol#L133)\n\tEvent emitted after the call(s):\n\t- [FundingPaid(lastPaidEpoch,_dests,_allocations)](contracts/admin/TempleTeamPaymentsFactory.sol#L142)\n", - "first_markdown_element": "contracts/admin/TempleTeamPaymentsFactory.sol#L119-L143", - "id": "6c80a1f2386bfefc5e825932ef0f67802c5f2af3857235cf886592ad9e720a6d", - "check": "reentrancy-events", - "impact": "Low", - "confidence": "Medium" - }, - { - "elements": [ + "additional_fields": { "underlying_type": "external_calls_sending_eth" } + }, { - "type": "function", - "name": "rebalanceDownExit", + "type": "node", + "name": "_dsrWithdrawal(sharesAmount,requestedAmount)", "source_mapping": { - "start": 13900, - "length": 1330, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 11365, + "length": 45, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [ - 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, - 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 360, 361, 362, 363, 364 - ], - "starting_column": 5, - "ending_column": 6 + "lines": [273], + "starting_column": 9, + "ending_column": 54 }, "type_specific_fields": { "parent": { - "type": "contract", - "name": "Ramos", + "type": "function", + "name": "trvWithdraw", "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 10560, + "length": 947, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, - 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, - 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, - 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, - 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, - 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, - 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, - 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, - 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, - 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, - 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, - 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, - 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, - 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, - 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, - 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, - 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, - 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621 + 270, 271, 272, 273, 274, 275, 276 ], - "starting_column": 1, - "ending_column": 0 + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DsrBaseStrategy", + "source_mapping": { + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "is_dependency": false, + "lines": [ + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "trvWithdraw(uint256)" } - }, - "signature": "rebalanceDownExit(uint256,uint256)" - } + } + }, + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "amoStaking.withdrawAndUnwrap(bptAmountIn,false,address(_poolHelper))", + "name": "pot.exit(sharesAmount)", "source_mapping": { - "start": 14331, - "length": 70, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 11597, + "length": 22, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [343], + "lines": [279], "starting_column": 9, - "ending_column": 79 + "ending_column": 31 }, "type_specific_fields": { "parent": { "type": "function", - "name": "rebalanceDownExit", + "name": "_dsrWithdrawal", "source_mapping": { - "start": 13900, - "length": 1330, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 11513, + "length": 199, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [ - 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, - 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 360, 361, 362, 363, 364 - ], + "lines": [278, 279, 280, 281, 282], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "Ramos", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, - 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, - 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, - 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, - 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, - 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, - 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, - 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "rebalanceDownExit(uint256,uint256)" + "signature": "_dsrWithdrawal(uint256,uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls" } + "additional_fields": { "underlying_type": "external_calls_sending_eth" } }, { "type": "node", - "name": "quoteTokenAmountOut = _poolHelper.exitPool(bptAmountIn,minQuoteTokenAmountOut,rebalancePercentageBoundLow,rebalancePercentageBoundUp,postRebalanceDelta,1 - protocolTokenBalancerPoolIndex,treasuryPriceIndex(),quoteToken)", + "name": "daiJoin.exit(address(this),daiAmount)", "source_mapping": { - "start": 14451, - "length": 266, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 11629, + "length": 38, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [346, 347, 348, 349], + "lines": [280], "starting_column": 9, - "ending_column": 10 + "ending_column": 47 }, "type_specific_fields": { "parent": { "type": "function", - "name": "rebalanceDownExit", + "name": "_dsrWithdrawal", "source_mapping": { - "start": 13900, - "length": 1330, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 11513, + "length": 199, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [ - 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, - 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 360, 361, 362, 363, 364 - ], + "lines": [278, 279, 280, 281, 282], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "Ramos", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, - 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, - 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, - 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, - 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, - 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, - 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, - 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "rebalanceDownExit(uint256,uint256)" + "signature": "_dsrWithdrawal(uint256,uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls" } + "additional_fields": { "underlying_type": "external_calls_sending_eth" } }, { "type": "node", - "name": "quoteToken.safeTransfer(feeCollector,feeAmt)", + "name": "DaiWithdrawn(daiAmount)", "source_mapping": { - "start": 14910, - "length": 45, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 11677, + "length": 28, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [354], - "starting_column": 13, - "ending_column": 58 + "lines": [281], + "starting_column": 9, + "ending_column": 37 }, "type_specific_fields": { "parent": { "type": "function", - "name": "rebalanceDownExit", + "name": "_dsrWithdrawal", "source_mapping": { - "start": 13900, - "length": 1330, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 11513, + "length": 199, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [ - 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, - 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 360, 361, 362, 363, 364 - ], + "lines": [278, 279, 280, 281, 282], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "Ramos", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, - 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, - 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, - 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, - 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, - 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, - 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, - 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "rebalanceDownExit(uint256,uint256)" + "signature": "_dsrWithdrawal(uint256,uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls" } + "additional_fields": { "underlying_type": "event" } }, { "type": "node", - "name": "RebalanceDownExit(bptAmountIn,quoteTokenAmountOut,feeAmt)", + "name": "_dsrWithdrawal(sharesAmount,requestedAmount)", "source_mapping": { - "start": 15049, - "length": 64, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 11365, + "length": 45, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [360], + "lines": [273], "starting_column": 9, - "ending_column": 73 + "ending_column": 54 }, "type_specific_fields": { "parent": { "type": "function", - "name": "rebalanceDownExit", + "name": "trvWithdraw", "source_mapping": { - "start": 13900, - "length": 1330, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 10560, + "length": 947, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, - 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, - 360, 361, 362, 363, 364 + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276 ], "starting_column": 5, "ending_column": 6 @@ -42017,79 +38074,54 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "Ramos", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, - 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, - 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, - 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, - 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, - 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, - 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, - 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "rebalanceDownExit(uint256,uint256)" + "signature": "trvWithdraw(uint256)" } } }, "additional_fields": { "underlying_type": "event" } } ], - "description": "Reentrancy in Ramos.rebalanceDownExit(uint256,uint256) (contracts/amo/Ramos.sol#334-364):\n\tExternal calls:\n\t- amoStaking.withdrawAndUnwrap(bptAmountIn,false,address(_poolHelper)) (contracts/amo/Ramos.sol#343)\n\t- quoteTokenAmountOut = _poolHelper.exitPool(bptAmountIn,minQuoteTokenAmountOut,rebalancePercentageBoundLow,rebalancePercentageBoundUp,postRebalanceDelta,1 - protocolTokenBalancerPoolIndex,treasuryPriceIndex(),quoteToken) (contracts/amo/Ramos.sol#346-349)\n\t- quoteToken.safeTransfer(feeCollector,feeAmt) (contracts/amo/Ramos.sol#354)\n\tEvent emitted after the call(s):\n\t- RebalanceDownExit(bptAmountIn,quoteTokenAmountOut,feeAmt) (contracts/amo/Ramos.sol#360)\n", - "markdown": "Reentrancy in [Ramos.rebalanceDownExit(uint256,uint256)](contracts/amo/Ramos.sol#L334-L364):\n\tExternal calls:\n\t- [amoStaking.withdrawAndUnwrap(bptAmountIn,false,address(_poolHelper))](contracts/amo/Ramos.sol#L343)\n\t- [quoteTokenAmountOut = _poolHelper.exitPool(bptAmountIn,minQuoteTokenAmountOut,rebalancePercentageBoundLow,rebalancePercentageBoundUp,postRebalanceDelta,1 - protocolTokenBalancerPoolIndex,treasuryPriceIndex(),quoteToken)](contracts/amo/Ramos.sol#L346-L349)\n\t- [quoteToken.safeTransfer(feeCollector,feeAmt)](contracts/amo/Ramos.sol#L354)\n\tEvent emitted after the call(s):\n\t- [RebalanceDownExit(bptAmountIn,quoteTokenAmountOut,feeAmt)](contracts/amo/Ramos.sol#L360)\n", - "first_markdown_element": "contracts/amo/Ramos.sol#L334-L364", - "id": "6083aa0bd6d99d380fd5f140d51f148bea51f9d21cc99bae41a0172c0c80592f", + "description": "Reentrancy in DsrBaseStrategy.trvWithdraw(uint256) (contracts/v2/strategies/DsrBaseStrategy.sol#257-276):\n\tExternal calls:\n\t- (daiAvailable,chi,sharesAvailable) = _checkpointDaiBalance() (contracts/v2/strategies/DsrBaseStrategy.sol#264)\n\t\t- chi = pot.drip() (contracts/v2/strategies/DsrBaseStrategy.sol#142)\n\t- _dsrWithdrawal(sharesAmount,requestedAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#273)\n\t\t- pot.exit(sharesAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#279)\n\t\t- daiJoin.exit(address(this),daiAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#280)\n\tEvent emitted after the call(s):\n\t- DaiWithdrawn(daiAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#281)\n\t\t- _dsrWithdrawal(sharesAmount,requestedAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#273)\n", + "markdown": "Reentrancy in [DsrBaseStrategy.trvWithdraw(uint256)](contracts/v2/strategies/DsrBaseStrategy.sol#L257-L276):\n\tExternal calls:\n\t- [(daiAvailable,chi,sharesAvailable) = _checkpointDaiBalance()](contracts/v2/strategies/DsrBaseStrategy.sol#L264)\n\t\t- [chi = pot.drip()](contracts/v2/strategies/DsrBaseStrategy.sol#L142)\n\t- [_dsrWithdrawal(sharesAmount,requestedAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L273)\n\t\t- [pot.exit(sharesAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L279)\n\t\t- [daiJoin.exit(address(this),daiAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L280)\n\tEvent emitted after the call(s):\n\t- [DaiWithdrawn(daiAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L281)\n\t\t- [_dsrWithdrawal(sharesAmount,requestedAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L273)\n", + "first_markdown_element": "contracts/v2/strategies/DsrBaseStrategy.sol#L257-L276", + "id": "0a4c8e86f10e88f7cdc66960b0dd281291f86c22d1d8b92e68909c1d477f23ac", "check": "reentrancy-events", "impact": "Low", "confidence": "Medium" @@ -42098,18 +38130,16 @@ "elements": [ { "type": "function", - "name": "rebalanceDownJoin", + "name": "withdrawAndRepay", "source_mapping": { - "start": 18072, - "length": 1545, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 8509, + "length": 786, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, - 447, 448, 449, 450, 451, 452, 453, 454, 455 + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227 ], "starting_column": 5, "ending_column": 6 @@ -42117,97 +38147,72 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "Ramos", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, - 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, - 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, - 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, - 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, - 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, - 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, - 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, - 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, - 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, - 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, - 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, - 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, - 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, - 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, - 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, - 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, - 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "rebalanceDownJoin(uint256,uint256)" + "signature": "withdrawAndRepay(uint256)" } }, { "type": "node", - "name": "tokenVault.borrowProtocolToken(protocolTokenAmountIn,address(this))", + "name": "(daiAvailable,chi) = _checkpointDaiBalance()", "source_mapping": { - "start": 18436, - "length": 68, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 8690, + "length": 63, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [429], + "lines": [217], "starting_column": 9, - "ending_column": 77 + "ending_column": 72 }, "type_specific_fields": { "parent": { "type": "function", - "name": "rebalanceDownJoin", + "name": "withdrawAndRepay", "source_mapping": { - "start": 18072, - "length": 1545, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 8509, + "length": 786, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, - 447, 448, 449, 450, 451, 452, 453, 454, 455 + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227 ], "starting_column": 5, "ending_column": 6 @@ -42215,69 +38220,44 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "Ramos", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, - 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, - 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, - 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, - 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, - 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, - 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, - 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "rebalanceDownJoin(uint256,uint256)" + "signature": "withdrawAndRepay(uint256)" } } }, @@ -42285,33 +38265,107 @@ }, { "type": "node", - "name": "protocolToken.safeTransfer(feeCollector,feeAmt)", + "name": "chi = pot.drip()", "source_mapping": { - "start": 18710, - "length": 48, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 5566, + "length": 60, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [434], - "starting_column": 13, - "ending_column": 61 + "lines": [142], + "starting_column": 9, + "ending_column": 69 }, "type_specific_fields": { "parent": { "type": "function", - "name": "rebalanceDownJoin", + "name": "_checkpointChi", "source_mapping": { - "start": 18072, - "length": 1545, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 5445, + "length": 188, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "is_dependency": false, + "lines": [140, 141, 142, 143], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DsrBaseStrategy", + "source_mapping": { + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "is_dependency": false, + "lines": [ + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "_checkpointChi()" + } + } + }, + "additional_fields": { "underlying_type": "external_calls_sending_eth" } + }, + { + "type": "node", + "name": "_dsrWithdrawal(sharesAmount,withdrawalAmount)", + "source_mapping": { + "start": 9025, + "length": 46, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "is_dependency": false, + "lines": [222], + "starting_column": 9, + "ending_column": 55 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "withdrawAndRepay", + "source_mapping": { + "start": 8509, + "length": 786, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, - 447, 448, 449, 450, 451, 452, 453, 454, 455 + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227 ], "starting_column": 5, "ending_column": 6 @@ -42319,69 +38373,44 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "Ramos", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, - 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, - 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, - 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, - 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, - 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, - 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, - 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "rebalanceDownJoin(uint256,uint256)" + "signature": "withdrawAndRepay(uint256)" } } }, @@ -42389,241 +38418,257 @@ }, { "type": "node", - "name": "protocolToken.safeTransfer(address(_poolHelper),joinAmountIn)", + "name": "pot.exit(sharesAmount)", "source_mapping": { - "start": 18942, - "length": 62, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 11597, + "length": 22, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [440], + "lines": [279], "starting_column": 9, - "ending_column": 71 + "ending_column": 31 }, "type_specific_fields": { "parent": { "type": "function", - "name": "rebalanceDownJoin", + "name": "_dsrWithdrawal", "source_mapping": { - "start": 18072, - "length": 1545, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 11513, + "length": 199, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [ - 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, - 447, 448, 449, 450, 451, 452, 453, 454, 455 - ], + "lines": [278, 279, 280, 281, 282], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "Ramos", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, - 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, - 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, - 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, - 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, - 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, - 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, - 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "_dsrWithdrawal(uint256,uint256)" + } + } + }, + "additional_fields": { "underlying_type": "external_calls_sending_eth" } + }, + { + "type": "node", + "name": "daiJoin.exit(address(this),daiAmount)", + "source_mapping": { + "start": 11629, + "length": 38, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "is_dependency": false, + "lines": [280], + "starting_column": 9, + "ending_column": 47 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "_dsrWithdrawal", + "source_mapping": { + "start": 11513, + "length": 199, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "is_dependency": false, + "lines": [278, 279, 280, 281, 282], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DsrBaseStrategy", + "source_mapping": { + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "is_dependency": false, + "lines": [ + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "rebalanceDownJoin(uint256,uint256)" + "signature": "_dsrWithdrawal(uint256,uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls" } + "additional_fields": { "underlying_type": "external_calls_sending_eth" } }, { "type": "node", - "name": "bptTokensStaked = _poolHelper.joinPool(joinAmountIn,minBptOut,rebalancePercentageBoundUp,rebalancePercentageBoundLow,treasuryPriceIndex(),postRebalanceDelta,protocolTokenBalancerPoolIndex,protocolToken)", + "name": "DaiWithdrawn(daiAmount)", "source_mapping": { - "start": 19057, - "length": 264, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 11677, + "length": 28, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [443, 444, 445, 446, 447], + "lines": [281], "starting_column": 9, - "ending_column": 10 + "ending_column": 37 }, "type_specific_fields": { "parent": { "type": "function", - "name": "rebalanceDownJoin", + "name": "_dsrWithdrawal", "source_mapping": { - "start": 18072, - "length": 1545, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 11513, + "length": 199, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [ - 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, - 447, 448, 449, 450, 451, 452, 453, 454, 455 - ], + "lines": [278, 279, 280, 281, 282], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "Ramos", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, - 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, - 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, - 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, - 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, - 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, - 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, - 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "rebalanceDownJoin(uint256,uint256)" + "signature": "_dsrWithdrawal(uint256,uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls" } + "additional_fields": { "underlying_type": "event" } }, { "type": "node", - "name": "RebalanceDownJoin(protocolTokenAmountIn,bptTokensStaked,feeAmt)", + "name": "_dsrWithdrawal(sharesAmount,withdrawalAmount)", "source_mapping": { - "start": 19331, - "length": 70, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 9025, + "length": 46, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [448], + "lines": [222], "starting_column": 9, - "ending_column": 79 + "ending_column": 55 }, "type_specific_fields": { "parent": { "type": "function", - "name": "rebalanceDownJoin", + "name": "withdrawAndRepay", "source_mapping": { - "start": 18072, - "length": 1545, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 8509, + "length": 786, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, - 447, 448, 449, 450, 451, 452, 453, 454, 455 + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227 ], "starting_column": 5, "ending_column": 6 @@ -42631,79 +38676,54 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "Ramos", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, - 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, - 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, - 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, - 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, - 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, - 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, - 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "rebalanceDownJoin(uint256,uint256)" + "signature": "withdrawAndRepay(uint256)" } } }, "additional_fields": { "underlying_type": "event" } } ], - "description": "Reentrancy in Ramos.rebalanceDownJoin(uint256,uint256) (contracts/amo/Ramos.sol#421-455):\n\tExternal calls:\n\t- tokenVault.borrowProtocolToken(protocolTokenAmountIn,address(this)) (contracts/amo/Ramos.sol#429)\n\t- protocolToken.safeTransfer(feeCollector,feeAmt) (contracts/amo/Ramos.sol#434)\n\t- protocolToken.safeTransfer(address(_poolHelper),joinAmountIn) (contracts/amo/Ramos.sol#440)\n\t- bptTokensStaked = _poolHelper.joinPool(joinAmountIn,minBptOut,rebalancePercentageBoundUp,rebalancePercentageBoundLow,treasuryPriceIndex(),postRebalanceDelta,protocolTokenBalancerPoolIndex,protocolToken) (contracts/amo/Ramos.sol#443-447)\n\tEvent emitted after the call(s):\n\t- RebalanceDownJoin(protocolTokenAmountIn,bptTokensStaked,feeAmt) (contracts/amo/Ramos.sol#448)\n", - "markdown": "Reentrancy in [Ramos.rebalanceDownJoin(uint256,uint256)](contracts/amo/Ramos.sol#L421-L455):\n\tExternal calls:\n\t- [tokenVault.borrowProtocolToken(protocolTokenAmountIn,address(this))](contracts/amo/Ramos.sol#L429)\n\t- [protocolToken.safeTransfer(feeCollector,feeAmt)](contracts/amo/Ramos.sol#L434)\n\t- [protocolToken.safeTransfer(address(_poolHelper),joinAmountIn)](contracts/amo/Ramos.sol#L440)\n\t- [bptTokensStaked = _poolHelper.joinPool(joinAmountIn,minBptOut,rebalancePercentageBoundUp,rebalancePercentageBoundLow,treasuryPriceIndex(),postRebalanceDelta,protocolTokenBalancerPoolIndex,protocolToken)](contracts/amo/Ramos.sol#L443-L447)\n\tEvent emitted after the call(s):\n\t- [RebalanceDownJoin(protocolTokenAmountIn,bptTokensStaked,feeAmt)](contracts/amo/Ramos.sol#L448)\n", - "first_markdown_element": "contracts/amo/Ramos.sol#L421-L455", - "id": "4ad07f927825c05b798c66409225ee0120c0e24658c057fada6ad9f73180240c", + "description": "Reentrancy in DsrBaseStrategy.withdrawAndRepay(uint256) (contracts/v2/strategies/DsrBaseStrategy.sol#214-227):\n\tExternal calls:\n\t- (daiAvailable,chi) = _checkpointDaiBalance() (contracts/v2/strategies/DsrBaseStrategy.sol#217)\n\t\t- chi = pot.drip() (contracts/v2/strategies/DsrBaseStrategy.sol#142)\n\t- _dsrWithdrawal(sharesAmount,withdrawalAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#222)\n\t\t- pot.exit(sharesAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#279)\n\t\t- daiJoin.exit(address(this),daiAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#280)\n\tEvent emitted after the call(s):\n\t- DaiWithdrawn(daiAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#281)\n\t\t- _dsrWithdrawal(sharesAmount,withdrawalAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#222)\n", + "markdown": "Reentrancy in [DsrBaseStrategy.withdrawAndRepay(uint256)](contracts/v2/strategies/DsrBaseStrategy.sol#L214-L227):\n\tExternal calls:\n\t- [(daiAvailable,chi) = _checkpointDaiBalance()](contracts/v2/strategies/DsrBaseStrategy.sol#L217)\n\t\t- [chi = pot.drip()](contracts/v2/strategies/DsrBaseStrategy.sol#L142)\n\t- [_dsrWithdrawal(sharesAmount,withdrawalAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L222)\n\t\t- [pot.exit(sharesAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L279)\n\t\t- [daiJoin.exit(address(this),daiAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L280)\n\tEvent emitted after the call(s):\n\t- [DaiWithdrawn(daiAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L281)\n\t\t- [_dsrWithdrawal(sharesAmount,withdrawalAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L222)\n", + "first_markdown_element": "contracts/v2/strategies/DsrBaseStrategy.sol#L214-L227", + "id": "38cb9f382307934e51255ca3f7d7f51604f44bc46a20af75d7f155182cf9bb95", "check": "reentrancy-events", "impact": "Low", "confidence": "Medium" @@ -42712,186 +38732,129 @@ "elements": [ { "type": "function", - "name": "rebalanceUpExit", + "name": "withdrawAndRepayAll", "source_mapping": { - "start": 11847, - "length": 1435, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 9412, + "length": 465, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [ - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, 322 - ], + "lines": [232, 233, 234, 235, 236, 237, 238, 239, 240], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "Ramos", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, - 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, - 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, - 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, - 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, - 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, - 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, - 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, - 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, - 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, - 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, - 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, - 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, - 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, - 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, - 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, - 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, - 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "rebalanceUpExit(uint256,uint256)" + "signature": "withdrawAndRepayAll()" } }, { "type": "node", - "name": "amoStaking.withdrawAndUnwrap(bptAmountIn,false,address(_poolHelper))", + "name": "(daiAvailable,sharesAvailable) = _checkpointDaiBalance()", "source_mapping": { - "start": 12270, - "length": 70, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 9499, + "length": 74, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [299], + "lines": [233], "starting_column": 9, - "ending_column": 79 + "ending_column": 83 }, "type_specific_fields": { "parent": { "type": "function", - "name": "rebalanceUpExit", + "name": "withdrawAndRepayAll", "source_mapping": { - "start": 11847, - "length": 1435, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 9412, + "length": 465, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [ - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, 322 - ], + "lines": [232, 233, 234, 235, 236, 237, 238, 239, 240], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "Ramos", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, - 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, - 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, - 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, - 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, - 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, - 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, - 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "rebalanceUpExit(uint256,uint256)" + "signature": "withdrawAndRepayAll()" } } }, @@ -42899,207 +38862,149 @@ }, { "type": "node", - "name": "protocolTokenAmountOut = _poolHelper.exitPool(bptAmountIn,minProtocolTokenOut,rebalancePercentageBoundLow,rebalancePercentageBoundUp,postRebalanceDelta,protocolTokenBalancerPoolIndex,treasuryPriceIndex(),protocolToken)", + "name": "chi = pot.drip()", "source_mapping": { - "start": 12397, - "length": 279, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 5566, + "length": 60, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [302, 303, 304, 305, 306], + "lines": [142], "starting_column": 9, - "ending_column": 10 + "ending_column": 69 }, "type_specific_fields": { "parent": { "type": "function", - "name": "rebalanceUpExit", + "name": "_checkpointChi", "source_mapping": { - "start": 11847, - "length": 1435, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 5445, + "length": 188, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [ - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, 322 - ], + "lines": [140, 141, 142, 143], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "Ramos", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, - 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, - 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, - 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, - 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, - 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, - 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, - 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "rebalanceUpExit(uint256,uint256)" + "signature": "_checkpointChi()" } } }, - "additional_fields": { "underlying_type": "external_calls" } + "additional_fields": { "underlying_type": "external_calls_sending_eth" } }, { "type": "node", - "name": "protocolToken.safeTransfer(feeCollector,feeAmt)", + "name": "_dsrWithdrawal(sharesAvailable,daiAvailable)", "source_mapping": { - "start": 12875, - "length": 48, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 9583, + "length": 45, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [311], - "starting_column": 13, - "ending_column": 61 + "lines": [234], + "starting_column": 9, + "ending_column": 54 }, "type_specific_fields": { "parent": { "type": "function", - "name": "rebalanceUpExit", + "name": "withdrawAndRepayAll", "source_mapping": { - "start": 11847, - "length": 1435, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 9412, + "length": 465, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [ - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, 322 - ], + "lines": [232, 233, 234, 235, 236, 237, 238, 239, 240], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "Ramos", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, - 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, - 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, - 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, - 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, - 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, - 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, - 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "rebalanceUpExit(uint256,uint256)" + "signature": "withdrawAndRepayAll()" } } }, @@ -43107,613 +39012,408 @@ }, { "type": "node", - "name": "RebalanceUpExit(bptAmountIn,protocolTokenAmountOut,feeAmt)", + "name": "pot.exit(sharesAmount)", "source_mapping": { - "start": 13091, - "length": 65, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 11597, + "length": 22, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [318], + "lines": [279], "starting_column": 9, - "ending_column": 74 + "ending_column": 31 }, "type_specific_fields": { "parent": { "type": "function", - "name": "rebalanceUpExit", + "name": "_dsrWithdrawal", "source_mapping": { - "start": 11847, - "length": 1435, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 11513, + "length": 199, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [ - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, 322 - ], + "lines": [278, 279, 280, 281, 282], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "Ramos", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, - 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, - 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, - 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, - 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, - 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, - 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, - 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "rebalanceUpExit(uint256,uint256)" + "signature": "_dsrWithdrawal(uint256,uint256)" } } }, - "additional_fields": { "underlying_type": "event" } - } - ], - "description": "Reentrancy in Ramos.rebalanceUpExit(uint256,uint256) (contracts/amo/Ramos.sol#290-322):\n\tExternal calls:\n\t- amoStaking.withdrawAndUnwrap(bptAmountIn,false,address(_poolHelper)) (contracts/amo/Ramos.sol#299)\n\t- protocolTokenAmountOut = _poolHelper.exitPool(bptAmountIn,minProtocolTokenOut,rebalancePercentageBoundLow,rebalancePercentageBoundUp,postRebalanceDelta,protocolTokenBalancerPoolIndex,treasuryPriceIndex(),protocolToken) (contracts/amo/Ramos.sol#302-306)\n\t- protocolToken.safeTransfer(feeCollector,feeAmt) (contracts/amo/Ramos.sol#311)\n\tEvent emitted after the call(s):\n\t- RebalanceUpExit(bptAmountIn,protocolTokenAmountOut,feeAmt) (contracts/amo/Ramos.sol#318)\n", - "markdown": "Reentrancy in [Ramos.rebalanceUpExit(uint256,uint256)](contracts/amo/Ramos.sol#L290-L322):\n\tExternal calls:\n\t- [amoStaking.withdrawAndUnwrap(bptAmountIn,false,address(_poolHelper))](contracts/amo/Ramos.sol#L299)\n\t- [protocolTokenAmountOut = _poolHelper.exitPool(bptAmountIn,minProtocolTokenOut,rebalancePercentageBoundLow,rebalancePercentageBoundUp,postRebalanceDelta,protocolTokenBalancerPoolIndex,treasuryPriceIndex(),protocolToken)](contracts/amo/Ramos.sol#L302-L306)\n\t- [protocolToken.safeTransfer(feeCollector,feeAmt)](contracts/amo/Ramos.sol#L311)\n\tEvent emitted after the call(s):\n\t- [RebalanceUpExit(bptAmountIn,protocolTokenAmountOut,feeAmt)](contracts/amo/Ramos.sol#L318)\n", - "first_markdown_element": "contracts/amo/Ramos.sol#L290-L322", - "id": "d1e3e7511c959f3f2562cee5d162c6238b1fb8ed8584ca23b92437d2651d74cd", - "check": "reentrancy-events", - "impact": "Low", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "rebalanceUpJoin", - "source_mapping": { - "start": 15897, - "length": 1496, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", - "is_dependency": false, - "lines": [ - 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, - 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, - 402, 403, 404, 405, 406, 407, 408, 409 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "Ramos", - "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", - "is_dependency": false, - "lines": [ - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, - 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, - 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, - 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, - 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, - 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, - 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, - 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, - 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, - 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, - 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, - 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, - 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, - 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, - 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, - 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, - 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, - 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "rebalanceUpJoin(uint256,uint256)" - } + "additional_fields": { "underlying_type": "external_calls_sending_eth" } }, { "type": "node", - "name": "tokenVault.borrowQuoteToken(quoteTokenAmountIn,address(this))", + "name": "daiJoin.exit(address(this),daiAmount)", "source_mapping": { - "start": 16247, - "length": 62, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 11629, + "length": 38, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [384], + "lines": [280], "starting_column": 9, - "ending_column": 71 + "ending_column": 47 }, "type_specific_fields": { "parent": { "type": "function", - "name": "rebalanceUpJoin", + "name": "_dsrWithdrawal", "source_mapping": { - "start": 15897, - "length": 1496, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 11513, + "length": 199, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [ - 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, - 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, - 402, 403, 404, 405, 406, 407, 408, 409 - ], + "lines": [278, 279, 280, 281, 282], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "Ramos", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", - "is_dependency": false, - "lines": [ - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, - 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, - 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, - 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, - 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, - 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, - 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, - 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621 + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "is_dependency": false, + "lines": [ + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "rebalanceUpJoin(uint256,uint256)" + "signature": "_dsrWithdrawal(uint256,uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls" } + "additional_fields": { "underlying_type": "external_calls_sending_eth" } }, { "type": "node", - "name": "quoteToken.safeTransfer(feeCollector,feeAmt)", + "name": "DaiWithdrawn(daiAmount)", "source_mapping": { - "start": 16502, - "length": 45, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 11677, + "length": 28, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [389], - "starting_column": 13, - "ending_column": 58 + "lines": [281], + "starting_column": 9, + "ending_column": 37 }, "type_specific_fields": { "parent": { "type": "function", - "name": "rebalanceUpJoin", + "name": "_dsrWithdrawal", "source_mapping": { - "start": 15897, - "length": 1496, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 11513, + "length": 199, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [ - 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, - 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, - 402, 403, 404, 405, 406, 407, 408, 409 - ], + "lines": [278, 279, 280, 281, 282], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "Ramos", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, - 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, - 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, - 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, - 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, - 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, - 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, - 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "rebalanceUpJoin(uint256,uint256)" + "signature": "_dsrWithdrawal(uint256,uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls" } + "additional_fields": { "underlying_type": "event" } }, { "type": "node", - "name": "quoteToken.safeTransfer(address(_poolHelper),joinAmountIn)", + "name": "_dsrWithdrawal(sharesAvailable,daiAvailable)", "source_mapping": { - "start": 16743, - "length": 59, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 9583, + "length": 45, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [395], + "lines": [234], "starting_column": 9, - "ending_column": 68 + "ending_column": 54 }, "type_specific_fields": { "parent": { "type": "function", - "name": "rebalanceUpJoin", + "name": "withdrawAndRepayAll", "source_mapping": { - "start": 15897, - "length": 1496, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 9412, + "length": 465, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [ - 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, - 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, - 402, 403, 404, 405, 406, 407, 408, 409 - ], + "lines": [232, 233, 234, 235, 236, 237, 238, 239, 240], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "Ramos", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, - 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, - 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, - 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, - 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, - 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, - 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, - 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "rebalanceUpJoin(uint256,uint256)" + "signature": "withdrawAndRepayAll()" } } }, - "additional_fields": { "underlying_type": "external_calls" } + "additional_fields": { "underlying_type": "event" } + } + ], + "description": "Reentrancy in DsrBaseStrategy.withdrawAndRepayAll() (contracts/v2/strategies/DsrBaseStrategy.sol#232-240):\n\tExternal calls:\n\t- (daiAvailable,sharesAvailable) = _checkpointDaiBalance() (contracts/v2/strategies/DsrBaseStrategy.sol#233)\n\t\t- chi = pot.drip() (contracts/v2/strategies/DsrBaseStrategy.sol#142)\n\t- _dsrWithdrawal(sharesAvailable,daiAvailable) (contracts/v2/strategies/DsrBaseStrategy.sol#234)\n\t\t- pot.exit(sharesAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#279)\n\t\t- daiJoin.exit(address(this),daiAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#280)\n\tEvent emitted after the call(s):\n\t- DaiWithdrawn(daiAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#281)\n\t\t- _dsrWithdrawal(sharesAvailable,daiAvailable) (contracts/v2/strategies/DsrBaseStrategy.sol#234)\n", + "markdown": "Reentrancy in [DsrBaseStrategy.withdrawAndRepayAll()](contracts/v2/strategies/DsrBaseStrategy.sol#L232-L240):\n\tExternal calls:\n\t- [(daiAvailable,sharesAvailable) = _checkpointDaiBalance()](contracts/v2/strategies/DsrBaseStrategy.sol#L233)\n\t\t- [chi = pot.drip()](contracts/v2/strategies/DsrBaseStrategy.sol#L142)\n\t- [_dsrWithdrawal(sharesAvailable,daiAvailable)](contracts/v2/strategies/DsrBaseStrategy.sol#L234)\n\t\t- [pot.exit(sharesAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L279)\n\t\t- [daiJoin.exit(address(this),daiAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L280)\n\tEvent emitted after the call(s):\n\t- [DaiWithdrawn(daiAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L281)\n\t\t- [_dsrWithdrawal(sharesAvailable,daiAvailable)](contracts/v2/strategies/DsrBaseStrategy.sol#L234)\n", + "first_markdown_element": "contracts/v2/strategies/DsrBaseStrategy.sol#L232-L240", + "id": "4ba8e3c4596e10b0920e312a0648a8fa3ef9456ad23cffc62074dc7f78916f68", + "check": "reentrancy-events", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "adhocPayment", + "source_mapping": { + "start": 2841, + "length": 284, + "filename_relative": "contracts/admin/TempleTeamPayments.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPayments.sol", + "filename_short": "contracts/admin/TempleTeamPayments.sol", + "is_dependency": false, + "lines": [83, 84, 85, 86, 87, 88], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleTeamPayments", + "source_mapping": { + "start": 247, + "length": 3130, + "filename_relative": "contracts/admin/TempleTeamPayments.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPayments.sol", + "filename_short": "contracts/admin/TempleTeamPayments.sol", + "is_dependency": false, + "lines": [ + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "adhocPayment(address,uint256)" + } }, { "type": "node", - "name": "bptTokensStaked = _poolHelper.joinPool(joinAmountIn,minBptOut,rebalancePercentageBoundUp,rebalancePercentageBoundLow,treasuryPriceIndex(),postRebalanceDelta,1 - protocolTokenBalancerPoolIndex,quoteToken)", + "name": "SafeERC20.safeTransfer(TEMPLE,_to,_amount)", "source_mapping": { - "start": 16852, - "length": 250, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 3038, + "length": 44, + "filename_relative": "contracts/admin/TempleTeamPayments.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPayments.sol", + "filename_short": "contracts/admin/TempleTeamPayments.sol", "is_dependency": false, - "lines": [398, 399, 400, 401], + "lines": [86], "starting_column": 9, - "ending_column": 10 + "ending_column": 53 }, "type_specific_fields": { "parent": { "type": "function", - "name": "rebalanceUpJoin", + "name": "adhocPayment", "source_mapping": { - "start": 15897, - "length": 1496, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 2841, + "length": 284, + "filename_relative": "contracts/admin/TempleTeamPayments.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPayments.sol", + "filename_short": "contracts/admin/TempleTeamPayments.sol", "is_dependency": false, - "lines": [ - 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, - 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, - 402, 403, 404, 405, 406, 407, 408, 409 - ], + "lines": [83, 84, 85, 86, 87, 88], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "Ramos", + "name": "TempleTeamPayments", "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 247, + "length": 3130, + "filename_relative": "contracts/admin/TempleTeamPayments.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPayments.sol", + "filename_short": "contracts/admin/TempleTeamPayments.sol", "is_dependency": false, "lines": [ + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, - 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, - 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, - 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, - 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, - 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, - 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, - 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621 + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "rebalanceUpJoin(uint256,uint256)" + "signature": "adhocPayment(address,uint256)" } } }, @@ -43721,113 +39421,67 @@ }, { "type": "node", - "name": "RebalanceUpJoin(quoteTokenAmountIn,bptTokensStaked,feeAmt)", + "name": "Claimed(_to,_amount)", "source_mapping": { - "start": 17112, - "length": 65, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 3092, + "length": 26, + "filename_relative": "contracts/admin/TempleTeamPayments.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPayments.sol", + "filename_short": "contracts/admin/TempleTeamPayments.sol", "is_dependency": false, - "lines": [402], + "lines": [87], "starting_column": 9, - "ending_column": 74 + "ending_column": 35 }, "type_specific_fields": { "parent": { "type": "function", - "name": "rebalanceUpJoin", + "name": "adhocPayment", "source_mapping": { - "start": 15897, - "length": 1496, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 2841, + "length": 284, + "filename_relative": "contracts/admin/TempleTeamPayments.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPayments.sol", + "filename_short": "contracts/admin/TempleTeamPayments.sol", "is_dependency": false, - "lines": [ - 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, - 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, - 402, 403, 404, 405, 406, 407, 408, 409 - ], + "lines": [83, 84, 85, 86, 87, 88], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "Ramos", + "name": "TempleTeamPayments", "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 247, + "length": 3130, + "filename_relative": "contracts/admin/TempleTeamPayments.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPayments.sol", + "filename_short": "contracts/admin/TempleTeamPayments.sol", "is_dependency": false, "lines": [ + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, - 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, - 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, - 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, - 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, - 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, - 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, - 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621 + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "rebalanceUpJoin(uint256,uint256)" + "signature": "adhocPayment(address,uint256)" } } }, "additional_fields": { "underlying_type": "event" } } ], - "description": "Reentrancy in Ramos.rebalanceUpJoin(uint256,uint256) (contracts/amo/Ramos.sol#376-409):\n\tExternal calls:\n\t- tokenVault.borrowQuoteToken(quoteTokenAmountIn,address(this)) (contracts/amo/Ramos.sol#384)\n\t- quoteToken.safeTransfer(feeCollector,feeAmt) (contracts/amo/Ramos.sol#389)\n\t- quoteToken.safeTransfer(address(_poolHelper),joinAmountIn) (contracts/amo/Ramos.sol#395)\n\t- bptTokensStaked = _poolHelper.joinPool(joinAmountIn,minBptOut,rebalancePercentageBoundUp,rebalancePercentageBoundLow,treasuryPriceIndex(),postRebalanceDelta,1 - protocolTokenBalancerPoolIndex,quoteToken) (contracts/amo/Ramos.sol#398-401)\n\tEvent emitted after the call(s):\n\t- RebalanceUpJoin(quoteTokenAmountIn,bptTokensStaked,feeAmt) (contracts/amo/Ramos.sol#402)\n", - "markdown": "Reentrancy in [Ramos.rebalanceUpJoin(uint256,uint256)](contracts/amo/Ramos.sol#L376-L409):\n\tExternal calls:\n\t- [tokenVault.borrowQuoteToken(quoteTokenAmountIn,address(this))](contracts/amo/Ramos.sol#L384)\n\t- [quoteToken.safeTransfer(feeCollector,feeAmt)](contracts/amo/Ramos.sol#L389)\n\t- [quoteToken.safeTransfer(address(_poolHelper),joinAmountIn)](contracts/amo/Ramos.sol#L395)\n\t- [bptTokensStaked = _poolHelper.joinPool(joinAmountIn,minBptOut,rebalancePercentageBoundUp,rebalancePercentageBoundLow,treasuryPriceIndex(),postRebalanceDelta,1 - protocolTokenBalancerPoolIndex,quoteToken)](contracts/amo/Ramos.sol#L398-L401)\n\tEvent emitted after the call(s):\n\t- [RebalanceUpJoin(quoteTokenAmountIn,bptTokensStaked,feeAmt)](contracts/amo/Ramos.sol#L402)\n", - "first_markdown_element": "contracts/amo/Ramos.sol#L376-L409", - "id": "0f3416b0e7e6449ff33b7394396c4bf724c482fcbb9d305e03fcb53aaee726ac", + "description": "Reentrancy in TempleTeamPayments.adhocPayment(address,uint256) (contracts/admin/TempleTeamPayments.sol#83-88):\n\tExternal calls:\n\t- SafeERC20.safeTransfer(TEMPLE,_to,_amount) (contracts/admin/TempleTeamPayments.sol#86)\n\tEvent emitted after the call(s):\n\t- Claimed(_to,_amount) (contracts/admin/TempleTeamPayments.sol#87)\n", + "markdown": "Reentrancy in [TempleTeamPayments.adhocPayment(address,uint256)](contracts/admin/TempleTeamPayments.sol#L83-L88):\n\tExternal calls:\n\t- [SafeERC20.safeTransfer(TEMPLE,_to,_amount)](contracts/admin/TempleTeamPayments.sol#L86)\n\tEvent emitted after the call(s):\n\t- [Claimed(_to,_amount)](contracts/admin/TempleTeamPayments.sol#L87)\n", + "first_markdown_element": "contracts/admin/TempleTeamPayments.sol#L83-L88", + "id": "081d1dfdebd16cea0856cb988c13c62e2d2d6e5c3fbd25c36620643fb11a0000", "check": "reentrancy-events", "impact": "Low", "confidence": "Medium" @@ -43836,112 +39490,97 @@ "elements": [ { "type": "function", - "name": "recoverToGnosis", + "name": "claim", "source_mapping": { - "start": 5325, - "length": 237, - "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/GnosisStrategy.sol", - "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", + "start": 2480, + "length": 355, + "filename_relative": "contracts/admin/TempleTeamPayments.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPayments.sol", + "filename_short": "contracts/admin/TempleTeamPayments.sol", "is_dependency": false, - "lines": [142, 143, 144, 145], + "lines": [74, 75, 76, 77, 78, 79, 80, 81], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "GnosisStrategy", + "name": "TempleTeamPayments", "source_mapping": { - "start": 584, - "length": 6684, - "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/GnosisStrategy.sol", - "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", + "start": 247, + "length": 3130, + "filename_relative": "contracts/admin/TempleTeamPayments.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPayments.sol", + "filename_short": "contracts/admin/TempleTeamPayments.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191 + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "recoverToGnosis(address,uint256)" + "signature": "claim()" } }, { "type": "node", - "name": "IERC20(token).safeTransfer(gnosisSafeWallet,amount)", + "name": "SafeERC20.safeTransfer(TEMPLE,msg.sender,claimable)", "source_mapping": { - "start": 5419, - "length": 52, - "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/GnosisStrategy.sol", - "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", + "start": 2730, + "length": 53, + "filename_relative": "contracts/admin/TempleTeamPayments.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPayments.sol", + "filename_short": "contracts/admin/TempleTeamPayments.sol", "is_dependency": false, - "lines": [143], + "lines": [79], "starting_column": 9, - "ending_column": 61 + "ending_column": 62 }, "type_specific_fields": { "parent": { "type": "function", - "name": "recoverToGnosis", + "name": "claim", "source_mapping": { - "start": 5325, - "length": 237, - "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/GnosisStrategy.sol", - "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", + "start": 2480, + "length": 355, + "filename_relative": "contracts/admin/TempleTeamPayments.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPayments.sol", + "filename_short": "contracts/admin/TempleTeamPayments.sol", "is_dependency": false, - "lines": [142, 143, 144, 145], + "lines": [74, 75, 76, 77, 78, 79, 80, 81], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "GnosisStrategy", + "name": "TempleTeamPayments", "source_mapping": { - "start": 584, - "length": 6684, - "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/GnosisStrategy.sol", - "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", + "start": 247, + "length": 3130, + "filename_relative": "contracts/admin/TempleTeamPayments.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPayments.sol", + "filename_short": "contracts/admin/TempleTeamPayments.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191 + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "recoverToGnosis(address,uint256)" + "signature": "claim()" } } }, @@ -43949,75 +39588,67 @@ }, { "type": "node", - "name": "CommonEventsAndErrors.TokenRecovered(gnosisSafeWallet,token,amount)", + "name": "Claimed(msg.sender,claimable)", "source_mapping": { - "start": 5481, - "length": 74, - "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/GnosisStrategy.sol", - "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", + "start": 2793, + "length": 35, + "filename_relative": "contracts/admin/TempleTeamPayments.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPayments.sol", + "filename_short": "contracts/admin/TempleTeamPayments.sol", "is_dependency": false, - "lines": [144], + "lines": [80], "starting_column": 9, - "ending_column": 83 + "ending_column": 44 }, "type_specific_fields": { "parent": { "type": "function", - "name": "recoverToGnosis", + "name": "claim", "source_mapping": { - "start": 5325, - "length": 237, - "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/GnosisStrategy.sol", - "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", + "start": 2480, + "length": 355, + "filename_relative": "contracts/admin/TempleTeamPayments.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPayments.sol", + "filename_short": "contracts/admin/TempleTeamPayments.sol", "is_dependency": false, - "lines": [142, 143, 144, 145], + "lines": [74, 75, 76, 77, 78, 79, 80, 81], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "GnosisStrategy", + "name": "TempleTeamPayments", "source_mapping": { - "start": 584, - "length": 6684, - "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/GnosisStrategy.sol", - "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", + "start": 247, + "length": 3130, + "filename_relative": "contracts/admin/TempleTeamPayments.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPayments.sol", + "filename_short": "contracts/admin/TempleTeamPayments.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191 + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "recoverToGnosis(address,uint256)" + "signature": "claim()" } } }, "additional_fields": { "underlying_type": "event" } } ], - "description": "Reentrancy in GnosisStrategy.recoverToGnosis(address,uint256) (contracts/v2/strategies/GnosisStrategy.sol#142-145):\n\tExternal calls:\n\t- IERC20(token).safeTransfer(gnosisSafeWallet,amount) (contracts/v2/strategies/GnosisStrategy.sol#143)\n\tEvent emitted after the call(s):\n\t- CommonEventsAndErrors.TokenRecovered(gnosisSafeWallet,token,amount) (contracts/v2/strategies/GnosisStrategy.sol#144)\n", - "markdown": "Reentrancy in [GnosisStrategy.recoverToGnosis(address,uint256)](contracts/v2/strategies/GnosisStrategy.sol#L142-L145):\n\tExternal calls:\n\t- [IERC20(token).safeTransfer(gnosisSafeWallet,amount)](contracts/v2/strategies/GnosisStrategy.sol#L143)\n\tEvent emitted after the call(s):\n\t- [CommonEventsAndErrors.TokenRecovered(gnosisSafeWallet,token,amount)](contracts/v2/strategies/GnosisStrategy.sol#L144)\n", - "first_markdown_element": "contracts/v2/strategies/GnosisStrategy.sol#L142-L145", - "id": "d9bd0a33246588c83983d63975a9ce55470568eeff09e037f055b8e7122562e2", + "description": "Reentrancy in TempleTeamPayments.claim() (contracts/admin/TempleTeamPayments.sol#74-81):\n\tExternal calls:\n\t- SafeERC20.safeTransfer(TEMPLE,msg.sender,claimable) (contracts/admin/TempleTeamPayments.sol#79)\n\tEvent emitted after the call(s):\n\t- Claimed(msg.sender,claimable) (contracts/admin/TempleTeamPayments.sol#80)\n", + "markdown": "Reentrancy in [TempleTeamPayments.claim()](contracts/admin/TempleTeamPayments.sol#L74-L81):\n\tExternal calls:\n\t- [SafeERC20.safeTransfer(TEMPLE,msg.sender,claimable)](contracts/admin/TempleTeamPayments.sol#L79)\n\tEvent emitted after the call(s):\n\t- [Claimed(msg.sender,claimable)](contracts/admin/TempleTeamPayments.sol#L80)\n", + "first_markdown_element": "contracts/admin/TempleTeamPayments.sol#L74-L81", + "id": "5122a045d2e21480d0560d2c58820df1a98500cfc6453d3088b53c090e7d16e3", "check": "reentrancy-events", "impact": "Low", "confidence": "Medium" @@ -44026,106 +39657,96 @@ "elements": [ { "type": "function", - "name": "recoverToken", + "name": "claim", "source_mapping": { - "start": 2334, - "length": 206, - "filename_relative": "contracts/amo/AuraStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/AuraStaking.sol", - "filename_short": "contracts/amo/AuraStaking.sol", + "start": 2481, + "length": 452, + "filename_relative": "contracts/admin/TempleTeamPaymentsV2.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsV2.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsV2.sol", "is_dependency": false, - "lines": [67, 68, 69, 70, 71], + "lines": [74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "AuraStaking", + "name": "TempleTeamPaymentsV2", "source_mapping": { - "start": 604, - "length": 5204, - "filename_relative": "contracts/amo/AuraStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/AuraStaking.sol", - "filename_short": "contracts/amo/AuraStaking.sol", + "start": 346, + "length": 2589, + "filename_relative": "contracts/admin/TempleTeamPaymentsV2.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsV2.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsV2.sol", "is_dependency": false, "lines": [ - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151 + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "recoverToken(address,address,uint256)" + "signature": "claim(uint256)" } }, { "type": "node", - "name": "IERC20(token).safeTransfer(to,amount)", + "name": "SafeERC20.safeTransfer(temple,msg.sender,_claimAmount)", "source_mapping": { - "start": 2446, - "length": 38, - "filename_relative": "contracts/amo/AuraStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/AuraStaking.sol", - "filename_short": "contracts/amo/AuraStaking.sol", + "start": 2822, + "length": 56, + "filename_relative": "contracts/admin/TempleTeamPaymentsV2.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsV2.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsV2.sol", "is_dependency": false, - "lines": [68], + "lines": [83], "starting_column": 9, - "ending_column": 47 + "ending_column": 65 }, "type_specific_fields": { "parent": { "type": "function", - "name": "recoverToken", + "name": "claim", "source_mapping": { - "start": 2334, - "length": 206, - "filename_relative": "contracts/amo/AuraStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/AuraStaking.sol", - "filename_short": "contracts/amo/AuraStaking.sol", + "start": 2481, + "length": 452, + "filename_relative": "contracts/admin/TempleTeamPaymentsV2.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsV2.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsV2.sol", "is_dependency": false, - "lines": [67, 68, 69, 70, 71], + "lines": [74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "AuraStaking", + "name": "TempleTeamPaymentsV2", "source_mapping": { - "start": 604, - "length": 5204, - "filename_relative": "contracts/amo/AuraStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/AuraStaking.sol", - "filename_short": "contracts/amo/AuraStaking.sol", + "start": 346, + "length": 2589, + "filename_relative": "contracts/admin/TempleTeamPaymentsV2.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsV2.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsV2.sol", "is_dependency": false, "lines": [ - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151 + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "recoverToken(address,address,uint256)" + "signature": "claim(uint256)" } } }, @@ -44133,72 +39754,67 @@ }, { "type": "node", - "name": "RecoveredToken(token,to,amount)", + "name": "Claimed(msg.sender,_claimAmount)", "source_mapping": { - "start": 2495, + "start": 2888, "length": 38, - "filename_relative": "contracts/amo/AuraStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/AuraStaking.sol", - "filename_short": "contracts/amo/AuraStaking.sol", + "filename_relative": "contracts/admin/TempleTeamPaymentsV2.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsV2.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsV2.sol", "is_dependency": false, - "lines": [70], + "lines": [84], "starting_column": 9, "ending_column": 47 }, "type_specific_fields": { "parent": { "type": "function", - "name": "recoverToken", + "name": "claim", "source_mapping": { - "start": 2334, - "length": 206, - "filename_relative": "contracts/amo/AuraStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/AuraStaking.sol", - "filename_short": "contracts/amo/AuraStaking.sol", + "start": 2481, + "length": 452, + "filename_relative": "contracts/admin/TempleTeamPaymentsV2.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsV2.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsV2.sol", "is_dependency": false, - "lines": [67, 68, 69, 70, 71], + "lines": [74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "AuraStaking", + "name": "TempleTeamPaymentsV2", "source_mapping": { - "start": 604, - "length": 5204, - "filename_relative": "contracts/amo/AuraStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/AuraStaking.sol", - "filename_short": "contracts/amo/AuraStaking.sol", + "start": 346, + "length": 2589, + "filename_relative": "contracts/admin/TempleTeamPaymentsV2.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsV2.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsV2.sol", "is_dependency": false, "lines": [ - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151 + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "recoverToken(address,address,uint256)" + "signature": "claim(uint256)" } } }, "additional_fields": { "underlying_type": "event" } } ], - "description": "Reentrancy in AuraStaking.recoverToken(address,address,uint256) (contracts/amo/AuraStaking.sol#67-71):\n\tExternal calls:\n\t- IERC20(token).safeTransfer(to,amount) (contracts/amo/AuraStaking.sol#68)\n\tEvent emitted after the call(s):\n\t- RecoveredToken(token,to,amount) (contracts/amo/AuraStaking.sol#70)\n", - "markdown": "Reentrancy in [AuraStaking.recoverToken(address,address,uint256)](contracts/amo/AuraStaking.sol#L67-L71):\n\tExternal calls:\n\t- [IERC20(token).safeTransfer(to,amount)](contracts/amo/AuraStaking.sol#L68)\n\tEvent emitted after the call(s):\n\t- [RecoveredToken(token,to,amount)](contracts/amo/AuraStaking.sol#L70)\n", - "first_markdown_element": "contracts/amo/AuraStaking.sol#L67-L71", - "id": "721f7e4ea8f943fb92b4b72846f0042313e2b5e55c2edcd24d2ab5f7aab87665", + "description": "Reentrancy in TempleTeamPaymentsV2.claim(uint256) (contracts/admin/TempleTeamPaymentsV2.sol#74-85):\n\tExternal calls:\n\t- SafeERC20.safeTransfer(temple,msg.sender,_claimAmount) (contracts/admin/TempleTeamPaymentsV2.sol#83)\n\tEvent emitted after the call(s):\n\t- Claimed(msg.sender,_claimAmount) (contracts/admin/TempleTeamPaymentsV2.sol#84)\n", + "markdown": "Reentrancy in [TempleTeamPaymentsV2.claim(uint256)](contracts/admin/TempleTeamPaymentsV2.sol#L74-L85):\n\tExternal calls:\n\t- [SafeERC20.safeTransfer(temple,msg.sender,_claimAmount)](contracts/admin/TempleTeamPaymentsV2.sol#L83)\n\tEvent emitted after the call(s):\n\t- [Claimed(msg.sender,_claimAmount)](contracts/admin/TempleTeamPaymentsV2.sol#L84)\n", + "first_markdown_element": "contracts/admin/TempleTeamPaymentsV2.sol#L74-L85", + "id": "e805076f6ba37558b2d1e1e33a36ca2141157b088d4472056b82f8af89078bb2", "check": "reentrancy-events", "impact": "Low", "confidence": "Medium" @@ -44207,178 +39823,97 @@ "elements": [ { "type": "function", - "name": "recoverToken", + "name": "claimFor", "source_mapping": { - "start": 11012, - "length": 197, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 2718, + "length": 611, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [274, 275, 276, 277, 278], + "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "Ramos", + "name": "TreasuryFarmingRevenue", "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 547, + "length": 3059, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, "lines": [ - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, - 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, - 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, - 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, - 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, - 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, - 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, - 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, - 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, - 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, - 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, - 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, - 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, - 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, - 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, - 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, - 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, - 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "recoverToken(address,address,uint256)" + "signature": "claimFor(address)" } }, { "type": "node", - "name": "IERC20(token).safeTransfer(to,amount)", + "name": "exposure.mint(account,unclaimedScaled / SCALING_FACTOR)", "source_mapping": { - "start": 11115, - "length": 38, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 3194, + "length": 56, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [275], + "lines": [91], "starting_column": 9, - "ending_column": 47 + "ending_column": 65 }, "type_specific_fields": { "parent": { "type": "function", - "name": "recoverToken", + "name": "claimFor", "source_mapping": { - "start": 11012, - "length": 197, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 2718, + "length": 611, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [274, 275, 276, 277, 278], + "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "Ramos", + "name": "TreasuryFarmingRevenue", "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 547, + "length": 3059, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, "lines": [ - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, - 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, - 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, - 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, - 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, - 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, - 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, - 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "recoverToken(address,address,uint256)" + "signature": "claimFor(address)" } } }, @@ -44386,109 +39921,67 @@ }, { "type": "node", - "name": "RecoveredToken(token,to,amount)", + "name": "RevenueClaimed(account,unclaimedScaled / SCALING_FACTOR)", "source_mapping": { - "start": 11164, - "length": 38, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 3260, + "length": 62, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [277], + "lines": [92], "starting_column": 9, - "ending_column": 47 + "ending_column": 71 }, "type_specific_fields": { "parent": { "type": "function", - "name": "recoverToken", - "source_mapping": { - "start": 11012, - "length": 197, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "name": "claimFor", + "source_mapping": { + "start": 2718, + "length": 611, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [274, 275, 276, 277, 278], + "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "Ramos", + "name": "TreasuryFarmingRevenue", "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 547, + "length": 3059, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, "lines": [ - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, - 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, - 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, - 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, - 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, - 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, - 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, - 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "recoverToken(address,address,uint256)" + "signature": "claimFor(address)" } } }, "additional_fields": { "underlying_type": "event" } } ], - "description": "Reentrancy in Ramos.recoverToken(address,address,uint256) (contracts/amo/Ramos.sol#274-278):\n\tExternal calls:\n\t- IERC20(token).safeTransfer(to,amount) (contracts/amo/Ramos.sol#275)\n\tEvent emitted after the call(s):\n\t- RecoveredToken(token,to,amount) (contracts/amo/Ramos.sol#277)\n", - "markdown": "Reentrancy in [Ramos.recoverToken(address,address,uint256)](contracts/amo/Ramos.sol#L274-L278):\n\tExternal calls:\n\t- [IERC20(token).safeTransfer(to,amount)](contracts/amo/Ramos.sol#L275)\n\tEvent emitted after the call(s):\n\t- [RecoveredToken(token,to,amount)](contracts/amo/Ramos.sol#L277)\n", - "first_markdown_element": "contracts/amo/Ramos.sol#L274-L278", - "id": "a57f15edd93bacbeb09bc6f5cb3cd1b4540b96d74dac7b8b25c22b16adc633ed", + "description": "Reentrancy in TreasuryFarmingRevenue.claimFor(address) (contracts/core/TreasuryFarmingRevenue.sol#80-93):\n\tExternal calls:\n\t- exposure.mint(account,unclaimedScaled / SCALING_FACTOR) (contracts/core/TreasuryFarmingRevenue.sol#91)\n\tEvent emitted after the call(s):\n\t- RevenueClaimed(account,unclaimedScaled / SCALING_FACTOR) (contracts/core/TreasuryFarmingRevenue.sol#92)\n", + "markdown": "Reentrancy in [TreasuryFarmingRevenue.claimFor(address)](contracts/core/TreasuryFarmingRevenue.sol#L80-L93):\n\tExternal calls:\n\t- [exposure.mint(account,unclaimedScaled / SCALING_FACTOR)](contracts/core/TreasuryFarmingRevenue.sol#L91)\n\tEvent emitted after the call(s):\n\t- [RevenueClaimed(account,unclaimedScaled / SCALING_FACTOR)](contracts/core/TreasuryFarmingRevenue.sol#L92)\n", + "first_markdown_element": "contracts/core/TreasuryFarmingRevenue.sol#L80-L93", + "id": "d8563f03511a537e7bffa702571db6c52a8f76800b24690b23270dd982c4ccc2", "check": "reentrancy-events", "impact": "Low", "confidence": "Medium" @@ -44497,226 +39990,110 @@ "elements": [ { "type": "function", - "name": "removeCollateral", + "name": "createExposure", "source_mapping": { - "start": 6498, - "length": 1031, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 1322, + "length": 415, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, - "lines": [ - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190 - ], + "lines": [45, 46, 47, 48, 49, 50, 51, 52, 53, 54], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "OpsManager", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 388, + "length": 6435, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, - 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, - 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, - 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, - 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, - 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, - 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, - 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, - 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, - 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, - 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, - 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, - 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, - 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, - 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, - 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, - 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, - 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, - 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, - 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, - 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, - 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, - 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, - 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, - 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, - 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, - 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, - 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, - 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, - 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, - 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, - 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, - 874, 875, 876, 877, 878, 879, 880, 881, 882 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "removeCollateral(uint128,address)" + "signature": "createExposure(string,string,IERC20)" } }, { "type": "node", - "name": "circuitBreakerProxy.preCheck(address(templeToken),msg.sender,amount)", + "name": "exposure = OpsManagerLib.createExposure(name,symbol,revalToken,pools)", "source_mapping": { - "start": 7012, - "length": 118, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 1526, + "length": 81, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, - "lines": [173, 174, 175, 176, 177], + "lines": [51], "starting_column": 9, - "ending_column": 10 + "ending_column": 90 }, "type_specific_fields": { "parent": { "type": "function", - "name": "removeCollateral", + "name": "createExposure", "source_mapping": { - "start": 6498, - "length": 1031, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 1322, + "length": 415, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, - "lines": [ - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190 - ], + "lines": [45, 46, 47, 48, 49, 50, 51, 52, 53, 54], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "OpsManager", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 388, + "length": 6435, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "removeCollateral(uint128,address)" + "signature": "createExposure(string,string,IERC20)" } } }, @@ -44724,134 +40101,74 @@ }, { "type": "node", - "name": "CollateralRemoved(msg.sender,recipient,amount)", + "name": "CreateExposure(address(exposure),address(pools[revalToken]))", "source_mapping": { - "start": 7320, - "length": 53, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 1664, + "length": 66, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, - "lines": [182], + "lines": [53], "starting_column": 9, - "ending_column": 62 + "ending_column": 75 }, "type_specific_fields": { "parent": { "type": "function", - "name": "removeCollateral", + "name": "createExposure", "source_mapping": { - "start": 6498, - "length": 1031, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 1322, + "length": 415, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, - "lines": [ - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190 - ], + "lines": [45, 46, 47, 48, 49, 50, 51, 52, 53, 54], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "OpsManager", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 388, + "length": 6435, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "removeCollateral(uint128,address)" + "signature": "createExposure(string,string,IERC20)" } } }, "additional_fields": { "underlying_type": "event" } } ], - "description": "Reentrancy in TempleLineOfCredit.removeCollateral(uint128,address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#166-190):\n\tExternal calls:\n\t- circuitBreakerProxy.preCheck(address(templeToken),msg.sender,amount) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#173-177)\n\tEvent emitted after the call(s):\n\t- CollateralRemoved(msg.sender,recipient,amount) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#182)\n", - "markdown": "Reentrancy in [TempleLineOfCredit.removeCollateral(uint128,address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L166-L190):\n\tExternal calls:\n\t- [circuitBreakerProxy.preCheck(address(templeToken),msg.sender,amount)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L173-L177)\n\tEvent emitted after the call(s):\n\t- [CollateralRemoved(msg.sender,recipient,amount)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L182)\n", - "first_markdown_element": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L166-L190", - "id": "995ebae8f6668f6a1d468a923e261df6e2cd441ac86401c473cc53982585815d", + "description": "Reentrancy in OpsManager.createExposure(string,string,IERC20) (contracts/core/OpsManager.sol#45-54):\n\tExternal calls:\n\t- exposure = OpsManagerLib.createExposure(name,symbol,revalToken,pools) (contracts/core/OpsManager.sol#51)\n\tEvent emitted after the call(s):\n\t- CreateExposure(address(exposure),address(pools[revalToken])) (contracts/core/OpsManager.sol#53)\n", + "markdown": "Reentrancy in [OpsManager.createExposure(string,string,IERC20)](contracts/core/OpsManager.sol#L45-L54):\n\tExternal calls:\n\t- [exposure = OpsManagerLib.createExposure(name,symbol,revalToken,pools)](contracts/core/OpsManager.sol#L51)\n\tEvent emitted after the call(s):\n\t- [CreateExposure(address(exposure),address(pools[revalToken]))](contracts/core/OpsManager.sol#L53)\n", + "first_markdown_element": "contracts/core/OpsManager.sol#L45-L54", + "id": "4c0848edc4ba02c1e3d1ebe7d87498d178e87ad8a446b774ebd37d6847435833", "check": "reentrancy-events", "impact": "Low", "confidence": "Medium" @@ -44860,116 +40177,81 @@ "elements": [ { "type": "function", - "name": "removeLiquidity", - "source_mapping": { - "start": 22535, - "length": 1408, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", - "is_dependency": false, - "lines": [ - 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, - 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "Ramos", - "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", - "is_dependency": false, - "lines": [ - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, - 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, - 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, - 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, - 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, - 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, - 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, - 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, - 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, - 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, - 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, - 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, - 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, - 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, - 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, - 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, - 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, - 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621 + "name": "createVaultInstance", + "source_mapping": { + "start": 1960, + "length": 804, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", + "is_dependency": false, + "lines": [ + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "OpsManager", + "source_mapping": { + "start": 388, + "length": 6435, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", + "is_dependency": false, + "lines": [ + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "removeLiquidity(IBalancerVault.ExitPoolRequest,uint256)" + "signature": "createVaultInstance(string,string,uint256,uint256,Rational,uint256)" } }, { "type": "node", - "name": "amoStaking.withdrawAndUnwrap(bptIn,false,address(this))", + "name": "templeExposure.setMinterState(address(vault),true)", "source_mapping": { - "start": 23216, - "length": 57, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 2656, + "length": 51, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, - "lines": [541], + "lines": [87], "starting_column": 9, - "ending_column": 66 + "ending_column": 60 }, "type_specific_fields": { "parent": { "type": "function", - "name": "removeLiquidity", + "name": "createVaultInstance", "source_mapping": { - "start": 22535, - "length": 1408, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 1960, + "length": 804, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, "lines": [ - 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, - 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559 + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89 ], "starting_column": 5, "ending_column": 6 @@ -44977,69 +40259,34 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "Ramos", + "name": "OpsManager", "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 388, + "length": 6435, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, "lines": [ - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, - 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, - 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, - 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, - 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, - 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, - 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, - 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "removeLiquidity(IBalancerVault.ExitPoolRequest,uint256)" + "signature": "createVaultInstance(string,string,uint256,uint256,Rational,uint256)" } } }, @@ -45047,33 +40294,32 @@ }, { "type": "node", - "name": "balancerVault.exitPool(balancerPoolId,address(this),address(this),request)", + "name": "CreateVaultInstance(address(vault))", "source_mapping": { - "start": 23283, - "length": 77, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 2717, + "length": 40, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, - "lines": [542], + "lines": [88], "starting_column": 9, - "ending_column": 86 + "ending_column": 49 }, "type_specific_fields": { "parent": { "type": "function", - "name": "removeLiquidity", + "name": "createVaultInstance", "source_mapping": { - "start": 22535, - "length": 1408, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 1960, + "length": 804, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, "lines": [ - 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, - 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559 + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89 ], "starting_column": 5, "ending_column": 6 @@ -45081,173 +40327,143 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "Ramos", + "name": "OpsManager", "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 388, + "length": 6435, + "filename_relative": "contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", + "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, "lines": [ - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, - 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, - 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, - 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, - 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, - 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, - 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, - 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "removeLiquidity(IBalancerVault.ExitPoolRequest,uint256)" + "signature": "createVaultInstance(string,string,uint256,uint256,Rational,uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls" } + "additional_fields": { "underlying_type": "event" } + } + ], + "description": "Reentrancy in OpsManager.createVaultInstance(string,string,uint256,uint256,Rational,uint256) (contracts/core/OpsManager.sol#63-89):\n\tExternal calls:\n\t- templeExposure.setMinterState(address(vault),true) (contracts/core/OpsManager.sol#87)\n\tEvent emitted after the call(s):\n\t- CreateVaultInstance(address(vault)) (contracts/core/OpsManager.sol#88)\n", + "markdown": "Reentrancy in [OpsManager.createVaultInstance(string,string,uint256,uint256,Rational,uint256)](contracts/core/OpsManager.sol#L63-L89):\n\tExternal calls:\n\t- [templeExposure.setMinterState(address(vault),true)](contracts/core/OpsManager.sol#L87)\n\tEvent emitted after the call(s):\n\t- [CreateVaultInstance(address(vault))](contracts/core/OpsManager.sol#L88)\n", + "first_markdown_element": "contracts/core/OpsManager.sol#L63-L89", + "id": "df955297def3da87ad4df693d7ae4b7e7f50baa97a7182d7ae0ddc97fdb09441", + "check": "reentrancy-events", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "decreaseShares", + "source_mapping": { + "start": 2355, + "length": 302, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "is_dependency": false, + "lines": [69, 70, 71, 72, 73, 74, 75, 76, 77], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TreasuryFarmingRevenue", + "source_mapping": { + "start": 547, + "length": 3059, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "is_dependency": false, + "lines": [ + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "decreaseShares(address,uint256)" + } }, { "type": "node", - "name": "_tokenVault.repayProtocolToken(protocolTokenAmount)", + "name": "claimFor(account)", "source_mapping": { - "start": 23691, - "length": 51, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 2441, + "length": 17, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [551], - "starting_column": 13, - "ending_column": 64 + "lines": [70], + "starting_column": 9, + "ending_column": 26 }, "type_specific_fields": { "parent": { "type": "function", - "name": "removeLiquidity", + "name": "decreaseShares", "source_mapping": { - "start": 22535, - "length": 1408, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 2355, + "length": 302, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [ - 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, - 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559 - ], + "lines": [69, 70, 71, 72, 73, 74, 75, 76, 77], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "Ramos", + "name": "TreasuryFarmingRevenue", "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 547, + "length": 3059, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, "lines": [ - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, - 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, - 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, - 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, - 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, - 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, - 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, - 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "removeLiquidity(IBalancerVault.ExitPoolRequest,uint256)" + "signature": "decreaseShares(address,uint256)" } } }, @@ -45255,217 +40471,125 @@ }, { "type": "node", - "name": "_tokenVault.repayQuoteToken(quoteTokenAmount)", + "name": "exposure.mint(account,unclaimedScaled / SCALING_FACTOR)", "source_mapping": { - "start": 23803, - "length": 45, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 3194, + "length": 56, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [555], - "starting_column": 13, - "ending_column": 58 + "lines": [91], + "starting_column": 9, + "ending_column": 65 }, "type_specific_fields": { "parent": { "type": "function", - "name": "removeLiquidity", + "name": "claimFor", "source_mapping": { - "start": 22535, - "length": 1408, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 2718, + "length": 611, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [ - 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, - 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559 - ], + "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "Ramos", + "name": "TreasuryFarmingRevenue", "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 547, + "length": 3059, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, "lines": [ - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, - 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, - 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, - 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, - 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, - 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, - 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, - 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "removeLiquidity(IBalancerVault.ExitPoolRequest,uint256)" + "signature": "claimFor(address)" } } }, - "additional_fields": { "underlying_type": "external_calls" } + "additional_fields": { "underlying_type": "external_calls_sending_eth" } }, { "type": "node", - "name": "LiquidityRemoved(quoteTokenAmount,protocolTokenAmount,bptIn)", + "name": "DecreaseShares(account,amount)", "source_mapping": { - "start": 23869, - "length": 67, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 2614, + "length": 36, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [558], + "lines": [76], "starting_column": 9, - "ending_column": 76 + "ending_column": 45 }, "type_specific_fields": { "parent": { "type": "function", - "name": "removeLiquidity", + "name": "decreaseShares", "source_mapping": { - "start": 22535, - "length": 1408, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 2355, + "length": 302, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [ - 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, - 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559 - ], + "lines": [69, 70, 71, 72, 73, 74, 75, 76, 77], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "Ramos", + "name": "TreasuryFarmingRevenue", "source_mapping": { - "start": 1893, - "length": 24333, - "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", - "filename_short": "contracts/amo/Ramos.sol", + "start": 547, + "length": 3059, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, "lines": [ - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, - 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, - 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, - 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, - 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, - 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, - 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, - 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, - 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, - 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, - 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, - 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, - 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, - 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, - 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "removeLiquidity(IBalancerVault.ExitPoolRequest,uint256)" + "signature": "decreaseShares(address,uint256)" } } }, "additional_fields": { "underlying_type": "event" } } ], - "description": "Reentrancy in Ramos.removeLiquidity(IBalancerVault.ExitPoolRequest,uint256) (contracts/amo/Ramos.sol#522-559):\n\tExternal calls:\n\t- amoStaking.withdrawAndUnwrap(bptIn,false,address(this)) (contracts/amo/Ramos.sol#541)\n\t- balancerVault.exitPool(balancerPoolId,address(this),address(this),request) (contracts/amo/Ramos.sol#542)\n\t- _tokenVault.repayProtocolToken(protocolTokenAmount) (contracts/amo/Ramos.sol#551)\n\t- _tokenVault.repayQuoteToken(quoteTokenAmount) (contracts/amo/Ramos.sol#555)\n\tEvent emitted after the call(s):\n\t- LiquidityRemoved(quoteTokenAmount,protocolTokenAmount,bptIn) (contracts/amo/Ramos.sol#558)\n", - "markdown": "Reentrancy in [Ramos.removeLiquidity(IBalancerVault.ExitPoolRequest,uint256)](contracts/amo/Ramos.sol#L522-L559):\n\tExternal calls:\n\t- [amoStaking.withdrawAndUnwrap(bptIn,false,address(this))](contracts/amo/Ramos.sol#L541)\n\t- [balancerVault.exitPool(balancerPoolId,address(this),address(this),request)](contracts/amo/Ramos.sol#L542)\n\t- [_tokenVault.repayProtocolToken(protocolTokenAmount)](contracts/amo/Ramos.sol#L551)\n\t- [_tokenVault.repayQuoteToken(quoteTokenAmount)](contracts/amo/Ramos.sol#L555)\n\tEvent emitted after the call(s):\n\t- [LiquidityRemoved(quoteTokenAmount,protocolTokenAmount,bptIn)](contracts/amo/Ramos.sol#L558)\n", - "first_markdown_element": "contracts/amo/Ramos.sol#L522-L559", - "id": "bed2c1413f14f1f0f387a42599c99dbade4f123d221d53142cc235119defc33d", + "description": "Reentrancy in TreasuryFarmingRevenue.decreaseShares(address,uint256) (contracts/core/TreasuryFarmingRevenue.sol#69-77):\n\tExternal calls:\n\t- claimFor(account) (contracts/core/TreasuryFarmingRevenue.sol#70)\n\t\t- exposure.mint(account,unclaimedScaled / SCALING_FACTOR) (contracts/core/TreasuryFarmingRevenue.sol#91)\n\tEvent emitted after the call(s):\n\t- DecreaseShares(account,amount) (contracts/core/TreasuryFarmingRevenue.sol#76)\n", + "markdown": "Reentrancy in [TreasuryFarmingRevenue.decreaseShares(address,uint256)](contracts/core/TreasuryFarmingRevenue.sol#L69-L77):\n\tExternal calls:\n\t- [claimFor(account)](contracts/core/TreasuryFarmingRevenue.sol#L70)\n\t\t- [exposure.mint(account,unclaimedScaled / SCALING_FACTOR)](contracts/core/TreasuryFarmingRevenue.sol#L91)\n\tEvent emitted after the call(s):\n\t- [DecreaseShares(account,amount)](contracts/core/TreasuryFarmingRevenue.sol#L76)\n", + "first_markdown_element": "contracts/core/TreasuryFarmingRevenue.sol#L69-L77", + "id": "10f84609b6b87bcc768aa396dd6ac6045289ca78c3cb64ee97e4437cfb7c006a", "check": "reentrancy-events", "impact": "Low", "confidence": "Medium" @@ -45474,122 +40598,113 @@ "elements": [ { "type": "function", - "name": "removeLiquidity", + "name": "deployPayouts", "source_mapping": { - "start": 7978, - "length": 365, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 2818, + "length": 1078, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [205, 206, 207, 208, 209, 210, 211], + "lines": [ + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "RamosStrategy", + "name": "TempleTeamPaymentsFactory", "source_mapping": { - "start": 1131, - "length": 9158, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 279, + "length": 4653, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, 258, 259, 260, 261 + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "removeLiquidity(IBalancerVault.ExitPoolRequest,uint256)" + "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" } }, { "type": "node", - "name": "(quoteTokenAmount,protocolTokenAmount) = ramos.removeLiquidity(_requestData,_bptAmount)", + "name": "paymentContract.initialize(_token)", "source_mapping": { - "start": 8115, - "length": 140, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 3274, + "length": 34, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [206, 207, 208, 209], + "lines": [89], "starting_column": 9, - "ending_column": 60 + "ending_column": 43 }, "type_specific_fields": { "parent": { "type": "function", - "name": "removeLiquidity", + "name": "deployPayouts", "source_mapping": { - "start": 7978, - "length": 365, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 2818, + "length": 1078, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [205, 206, 207, 208, 209, 210, 211], + "lines": [ + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "RamosStrategy", + "name": "TempleTeamPaymentsFactory", "source_mapping": { - "start": 1131, - "length": 9158, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 279, + "length": 4653, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261 + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "removeLiquidity(IBalancerVault.ExitPoolRequest,uint256)" + "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" } } }, @@ -45597,216 +40712,231 @@ }, { "type": "node", - "name": "RemoveLiquidity(quoteTokenAmount,protocolTokenAmount,_bptAmount)", + "name": "paymentContract.setAllocations(_dests,_allocations)", "source_mapping": { - "start": 8265, - "length": 71, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 3318, + "length": 52, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [210], + "lines": [90], "starting_column": 9, - "ending_column": 80 + "ending_column": 61 }, "type_specific_fields": { "parent": { "type": "function", - "name": "removeLiquidity", + "name": "deployPayouts", "source_mapping": { - "start": 7978, - "length": 365, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 2818, + "length": 1078, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [205, 206, 207, 208, 209, 210, 211], + "lines": [ + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "RamosStrategy", + "name": "TempleTeamPaymentsFactory", "source_mapping": { - "start": 1131, - "length": 9158, - "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", - "filename_short": "contracts/v2/strategies/RamosStrategy.sol", + "start": 279, + "length": 4653, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, 258, 259, 260, 261 + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "removeLiquidity(IBalancerVault.ExitPoolRequest,uint256)" + "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" } } }, - "additional_fields": { "underlying_type": "event" } - } - ], - "description": "Reentrancy in RamosStrategy.removeLiquidity(IBalancerVault.ExitPoolRequest,uint256) (contracts/v2/strategies/RamosStrategy.sol#205-211):\n\tExternal calls:\n\t- (quoteTokenAmount,protocolTokenAmount) = ramos.removeLiquidity(_requestData,_bptAmount) (contracts/v2/strategies/RamosStrategy.sol#206-209)\n\tEvent emitted after the call(s):\n\t- RemoveLiquidity(quoteTokenAmount,protocolTokenAmount,_bptAmount) (contracts/v2/strategies/RamosStrategy.sol#210)\n", - "markdown": "Reentrancy in [RamosStrategy.removeLiquidity(IBalancerVault.ExitPoolRequest,uint256)](contracts/v2/strategies/RamosStrategy.sol#L205-L211):\n\tExternal calls:\n\t- [(quoteTokenAmount,protocolTokenAmount) = ramos.removeLiquidity(_requestData,_bptAmount)](contracts/v2/strategies/RamosStrategy.sol#L206-L209)\n\tEvent emitted after the call(s):\n\t- [RemoveLiquidity(quoteTokenAmount,protocolTokenAmount,_bptAmount)](contracts/v2/strategies/RamosStrategy.sol#L210)\n", - "first_markdown_element": "contracts/v2/strategies/RamosStrategy.sol#L205-L211", - "id": "fbbab7364629b05f46cf906691f4ea8afaf41cd1f6107c9ba036964f2524d523", - "check": "reentrancy-events", - "impact": "Low", - "confidence": "Medium" - }, - { - "elements": [ + "additional_fields": { "underlying_type": "external_calls" } + }, { - "type": "function", - "name": "setTlcStrategy", + "type": "node", + "name": "paymentContract.transferOwnership(msg.sender)", "source_mapping": { - "start": 15688, - "length": 875, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 3381, + "length": 45, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [ - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410 - ], - "starting_column": 5, - "ending_column": 6 + "lines": [92], + "starting_column": 9, + "ending_column": 54 }, "type_specific_fields": { "parent": { - "type": "contract", - "name": "TempleLineOfCredit", + "type": "function", + "name": "deployPayouts", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 2818, + "length": 1078, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, - 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, - 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, - 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, - 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, - 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, - 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, - 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, - 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, - 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, - 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, - 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, - 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, - 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, - 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, - 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, - 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, - 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, - 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, - 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, - 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, - 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, - 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, - 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, - 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, - 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, - 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, - 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, - 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, - 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, - 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, - 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, - 874, 875, 876, 877, 878, 879, 880, 881, 882 + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112 ], - "starting_column": 1, - "ending_column": 0 + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleTeamPaymentsFactory", + "source_mapping": { + "start": 279, + "length": 4653, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "is_dependency": false, + "lines": [ + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" } - }, - "signature": "setTlcStrategy(address)" - } + } + }, + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "daiToken.safeApprove(previousTrv,0)", + "name": "SafeERC20.safeTransferFrom(_token,msg.sender,address(paymentContract),_totalFunding)", "source_mapping": { - "start": 16002, - "length": 36, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 3473, + "length": 165, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [394], + "lines": [95, 96, 97, 98, 99, 100], "starting_column": 13, - "ending_column": 49 + "ending_column": 14 }, "type_specific_fields": { "parent": { "type": "function", - "name": "setTlcStrategy", + "name": "deployPayouts", "source_mapping": { - "start": 15688, - "length": 875, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 2818, + "length": 1078, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "is_dependency": false, + "lines": [ + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleTeamPaymentsFactory", + "source_mapping": { + "start": 279, + "length": 4653, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "is_dependency": false, + "lines": [ + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" + } + } + }, + "additional_fields": { "underlying_type": "external_calls" } + }, + { + "type": "node", + "name": "FundingDeployed(lastPaidEpoch,_dests,_allocations,address(paymentContract))", + "source_mapping": { + "start": 3715, + "length": 141, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "is_dependency": false, + "lines": [104, 105, 106, 107, 108, 109], + "starting_column": 9, + "ending_column": 10 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "deployPayouts", + "source_mapping": { + "start": 2818, + "length": 1078, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410 + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112 ], "starting_column": 5, "ending_column": 6 @@ -45814,124 +40944,127 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "TempleTeamPaymentsFactory", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 279, + "length": 4653, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "setTlcStrategy(address)" + "signature": "deployPayouts(IERC20,address[],uint256[],uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls" } + "additional_fields": { "underlying_type": "event" } + } + ], + "description": "Reentrancy in TempleTeamPaymentsFactory.deployPayouts(IERC20,address[],uint256[],uint256) (contracts/admin/TempleTeamPaymentsFactory.sol#79-112):\n\tExternal calls:\n\t- paymentContract.initialize(_token) (contracts/admin/TempleTeamPaymentsFactory.sol#89)\n\t- paymentContract.setAllocations(_dests,_allocations) (contracts/admin/TempleTeamPaymentsFactory.sol#90)\n\t- paymentContract.transferOwnership(msg.sender) (contracts/admin/TempleTeamPaymentsFactory.sol#92)\n\t- SafeERC20.safeTransferFrom(_token,msg.sender,address(paymentContract),_totalFunding) (contracts/admin/TempleTeamPaymentsFactory.sol#95-100)\n\tEvent emitted after the call(s):\n\t- FundingDeployed(lastPaidEpoch,_dests,_allocations,address(paymentContract)) (contracts/admin/TempleTeamPaymentsFactory.sol#104-109)\n", + "markdown": "Reentrancy in [TempleTeamPaymentsFactory.deployPayouts(IERC20,address[],uint256[],uint256)](contracts/admin/TempleTeamPaymentsFactory.sol#L79-L112):\n\tExternal calls:\n\t- [paymentContract.initialize(_token)](contracts/admin/TempleTeamPaymentsFactory.sol#L89)\n\t- [paymentContract.setAllocations(_dests,_allocations)](contracts/admin/TempleTeamPaymentsFactory.sol#L90)\n\t- [paymentContract.transferOwnership(msg.sender)](contracts/admin/TempleTeamPaymentsFactory.sol#L92)\n\t- [SafeERC20.safeTransferFrom(_token,msg.sender,address(paymentContract),_totalFunding)](contracts/admin/TempleTeamPaymentsFactory.sol#L95-L100)\n\tEvent emitted after the call(s):\n\t- [FundingDeployed(lastPaidEpoch,_dests,_allocations,address(paymentContract))](contracts/admin/TempleTeamPaymentsFactory.sol#L104-L109)\n", + "first_markdown_element": "contracts/admin/TempleTeamPaymentsFactory.sol#L79-L112", + "id": "e09076945359fed962d2ff6dfd37bfd369cd1b53e0192377da32895ae9a9f829", + "check": "reentrancy-events", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "depositFor", + "source_mapping": { + "start": 7408, + "length": 773, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", + "is_dependency": false, + "lines": [ + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Vault", + "source_mapping": { + "start": 1161, + "length": 7823, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", + "is_dependency": false, + "lines": [ + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "depositFor(address,uint256)" + } }, { "type": "node", - "name": "daiToken.safeApprove(_trv,0)", + "name": "SafeERC20.safeTransferFrom(templeToken,msg.sender,vaultedTempleAccount,_amount)", "source_mapping": { - "start": 16249, - "length": 29, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 7964, + "length": 82, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, - "lines": [402], + "lines": [207], "starting_column": 13, - "ending_column": 42 + "ending_column": 95 }, "type_specific_fields": { "parent": { "type": "function", - "name": "setTlcStrategy", + "name": "depositFor", "source_mapping": { - "start": 15688, - "length": 875, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 7408, + "length": 773, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, "lines": [ - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410 + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212 ], "starting_column": 5, "ending_column": 6 @@ -45939,91 +41072,37 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "Vault", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 1161, + "length": 7823, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "setTlcStrategy(address)" + "signature": "depositFor(address,uint256)" } } }, @@ -46031,32 +41110,32 @@ }, { "type": "node", - "name": "daiToken.safeIncreaseAllowance(_trv,type()(uint256).max)", + "name": "templeExposureToken.mint(address(this),_amount)", "source_mapping": { - "start": 16292, - "length": 55, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 8060, + "length": 48, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, - "lines": [403], + "lines": [208], "starting_column": 13, - "ending_column": 68 + "ending_column": 61 }, "type_specific_fields": { "parent": { "type": "function", - "name": "setTlcStrategy", + "name": "depositFor", "source_mapping": { - "start": 15688, - "length": 875, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 7408, + "length": 773, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, "lines": [ - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410 + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212 ], "starting_column": 5, "ending_column": 6 @@ -46064,91 +41143,37 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "Vault", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 1161, + "length": 7823, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "setTlcStrategy(address)" + "signature": "depositFor(address,uint256)" } } }, @@ -46156,156 +41181,161 @@ }, { "type": "node", - "name": "InterestRateUpdate(newInterestRate)", + "name": "Deposit(_account,_amount,amountStaked)", "source_mapping": { - "start": 27036, - "length": 40, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 8129, + "length": 45, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, - "lines": [694], - "starting_column": 13, - "ending_column": 53 + "lines": [211], + "starting_column": 9, + "ending_column": 54 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_updateInterestRates", + "name": "depositFor", "source_mapping": { - "start": 26678, - "length": 495, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 7408, + "length": 773, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, "lines": [ - 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697 + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212 ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { - "type": "contract", - "name": "TempleLineOfCredit", - "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 + "type": "contract", + "name": "Vault", + "source_mapping": { + "start": 1161, + "length": 7823, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", + "is_dependency": false, + "lines": [ + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "_updateInterestRates(TempleLineOfCredit.DebtTokenCache)" + "signature": "depositFor(address,uint256)" } } }, "additional_fields": { "underlying_type": "event" } + } + ], + "description": "Reentrancy in Vault.depositFor(address,uint256) (contracts/core/Vault.sol#196-212):\n\tExternal calls:\n\t- SafeERC20.safeTransferFrom(templeToken,msg.sender,vaultedTempleAccount,_amount) (contracts/core/Vault.sol#207)\n\t- templeExposureToken.mint(address(this),_amount) (contracts/core/Vault.sol#208)\n\tEvent emitted after the call(s):\n\t- Deposit(_account,_amount,amountStaked) (contracts/core/Vault.sol#211)\n", + "markdown": "Reentrancy in [Vault.depositFor(address,uint256)](contracts/core/Vault.sol#L196-L212):\n\tExternal calls:\n\t- [SafeERC20.safeTransferFrom(templeToken,msg.sender,vaultedTempleAccount,_amount)](contracts/core/Vault.sol#L207)\n\t- [templeExposureToken.mint(address(this),_amount)](contracts/core/Vault.sol#L208)\n\tEvent emitted after the call(s):\n\t- [Deposit(_account,_amount,amountStaked)](contracts/core/Vault.sol#L211)\n", + "first_markdown_element": "contracts/core/Vault.sol#L196-L212", + "id": "689116f4828c0f788fc592eb0a125792986e1b61e0aa46a6186d628790346b41", + "check": "reentrancy-events", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "directPayouts", + "source_mapping": { + "start": 4101, + "length": 829, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "is_dependency": false, + "lines": [ + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleTeamPaymentsFactory", + "source_mapping": { + "start": 279, + "length": 4653, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "is_dependency": false, + "lines": [ + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "directPayouts(IERC20,address[],uint256[])" + } }, { "type": "node", - "name": "_updateInterestRates(_debtTokenCache())", + "name": "SafeERC20.safeTransferFrom(_token,msg.sender,dest,value)", "source_mapping": { - "start": 16517, - "length": 39, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 4642, + "length": 59, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [409], - "starting_column": 9, - "ending_column": 48 + "lines": [133], + "starting_column": 13, + "ending_column": 72 }, "type_specific_fields": { "parent": { "type": "function", - "name": "setTlcStrategy", + "name": "directPayouts", "source_mapping": { - "start": 15688, - "length": 875, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 4101, + "length": 829, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410 + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143 ], "starting_column": 5, "ending_column": 6 @@ -46313,124 +41343,64 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "TempleTeamPaymentsFactory", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 279, + "length": 4653, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "setTlcStrategy(address)" + "signature": "directPayouts(IERC20,address[],uint256[])" } } }, - "additional_fields": { "underlying_type": "event" } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "TlcStrategySet(newTlcStrategy,_trv)", + "name": "FundingPaid(lastPaidEpoch,_dests,_allocations)", "source_mapping": { - "start": 16368, - "length": 41, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 4870, + "length": 53, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, - "lines": [406], + "lines": [142], "starting_column": 9, - "ending_column": 50 + "ending_column": 62 }, "type_specific_fields": { "parent": { "type": "function", - "name": "setTlcStrategy", + "name": "directPayouts", "source_mapping": { - "start": 15688, - "length": 875, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 4101, + "length": 829, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410 + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143 ], "starting_column": 5, "ending_column": 6 @@ -46438,101 +41408,41 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "TempleTeamPaymentsFactory", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 279, + "length": 4653, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "setTlcStrategy(address)" + "signature": "directPayouts(IERC20,address[],uint256[])" } } }, "additional_fields": { "underlying_type": "event" } } ], - "description": "Reentrancy in TempleLineOfCredit.setTlcStrategy(address) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#386-410):\n\tExternal calls:\n\t- daiToken.safeApprove(previousTrv,0) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#394)\n\t- daiToken.safeApprove(_trv,0) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#402)\n\t- daiToken.safeIncreaseAllowance(_trv,type()(uint256).max) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#403)\n\tEvent emitted after the call(s):\n\t- InterestRateUpdate(newInterestRate) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#694)\n\t\t- _updateInterestRates(_debtTokenCache()) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#409)\n\t- TlcStrategySet(newTlcStrategy,_trv) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#406)\n", - "markdown": "Reentrancy in [TempleLineOfCredit.setTlcStrategy(address)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L386-L410):\n\tExternal calls:\n\t- [daiToken.safeApprove(previousTrv,0)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L394)\n\t- [daiToken.safeApprove(_trv,0)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L402)\n\t- [daiToken.safeIncreaseAllowance(_trv,type()(uint256).max)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L403)\n\tEvent emitted after the call(s):\n\t- [InterestRateUpdate(newInterestRate)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L694)\n\t\t- [_updateInterestRates(_debtTokenCache())](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L409)\n\t- [TlcStrategySet(newTlcStrategy,_trv)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L406)\n", - "first_markdown_element": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L386-L410", - "id": "49a2bf0d8cbd9361bd9caf5bdef0998e29342a1822e4ba3db6a83abd980f2ea3", + "description": "Reentrancy in TempleTeamPaymentsFactory.directPayouts(IERC20,address[],uint256[]) (contracts/admin/TempleTeamPaymentsFactory.sol#119-143):\n\tExternal calls:\n\t- SafeERC20.safeTransferFrom(_token,msg.sender,dest,value) (contracts/admin/TempleTeamPaymentsFactory.sol#133)\n\tEvent emitted after the call(s):\n\t- FundingPaid(lastPaidEpoch,_dests,_allocations) (contracts/admin/TempleTeamPaymentsFactory.sol#142)\n", + "markdown": "Reentrancy in [TempleTeamPaymentsFactory.directPayouts(IERC20,address[],uint256[])](contracts/admin/TempleTeamPaymentsFactory.sol#L119-L143):\n\tExternal calls:\n\t- [SafeERC20.safeTransferFrom(_token,msg.sender,dest,value)](contracts/admin/TempleTeamPaymentsFactory.sol#L133)\n\tEvent emitted after the call(s):\n\t- [FundingPaid(lastPaidEpoch,_dests,_allocations)](contracts/admin/TempleTeamPaymentsFactory.sol#L142)\n", + "first_markdown_element": "contracts/admin/TempleTeamPaymentsFactory.sol#L119-L143", + "id": "6c80a1f2386bfefc5e825932ef0f67802c5f2af3857235cf886592ad9e720a6d", "check": "reentrancy-events", "impact": "Low", "confidence": "Medium" @@ -46541,209 +41451,97 @@ "elements": [ { "type": "function", - "name": "shutdown", + "name": "increaseShares", "source_mapping": { - "start": 11820, - "length": 1568, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 1987, + "length": 302, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [ - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318 - ], + "lines": [56, 57, 58, 59, 60, 61, 62, 63, 64], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "TreasuryFarmingRevenue", "source_mapping": { - "start": 2150, - "length": 31934, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 547, + "length": 3059, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, - 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, - 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, - 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, - 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, - 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, - 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, - 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, - 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, - 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, - 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, - 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, - 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, - 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, - 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, - 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, - 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, - 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, - 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, - 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, - 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, - 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, - 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, - 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, - 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, - 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, - 771, 772, 773, 774, 775, 776 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "shutdown(address)" + "signature": "increaseShares(address,uint256)" } }, { "type": "node", - "name": "_outstandingDebt = borrowTokens[_token].dToken.burnAll(strategy)", + "name": "claimFor(account)", "source_mapping": { - "start": 12497, - "length": 64, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 2073, + "length": 17, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [296], - "starting_column": 13, - "ending_column": 77 + "lines": [57], + "starting_column": 9, + "ending_column": 26 }, "type_specific_fields": { "parent": { "type": "function", - "name": "shutdown", + "name": "increaseShares", "source_mapping": { - "start": 11820, - "length": 1568, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 1987, + "length": 302, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [ - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318 - ], + "lines": [56, 57, 58, 59, 60, 61, 62, 63, 64], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "TreasuryFarmingRevenue", "source_mapping": { - "start": 2150, - "length": 31934, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 547, + "length": 3059, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "shutdown(address)" + "signature": "increaseShares(address,uint256)" } } }, @@ -46751,241 +41549,125 @@ }, { "type": "node", - "name": "StrategyRemoved(strategy)", + "name": "exposure.mint(account,unclaimedScaled / SCALING_FACTOR)", "source_mapping": { - "start": 13096, - "length": 30, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 3194, + "length": 56, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [311], + "lines": [91], "starting_column": 9, - "ending_column": 39 + "ending_column": 65 }, "type_specific_fields": { "parent": { "type": "function", - "name": "shutdown", + "name": "claimFor", "source_mapping": { - "start": 11820, - "length": 1568, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 2718, + "length": 611, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [ - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318 - ], + "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "TreasuryFarmingRevenue", "source_mapping": { - "start": 2150, - "length": 31934, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 547, + "length": 3059, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "shutdown(address)" + "signature": "claimFor(address)" } } }, - "additional_fields": { "underlying_type": "event" } + "additional_fields": { "underlying_type": "external_calls_sending_eth" } }, { "type": "node", - "name": "StrategyShutdownCreditAndDebt(strategy,address(_token),credits[_token],_outstandingDebt)", + "name": "IncreaseShares(account,amount)", "source_mapping": { - "start": 12575, - "length": 231, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 2246, + "length": 36, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [297, 298, 299, 300, 301, 302], - "starting_column": 13, - "ending_column": 15 + "lines": [63], + "starting_column": 9, + "ending_column": 45 }, "type_specific_fields": { "parent": { "type": "function", - "name": "shutdown", + "name": "increaseShares", "source_mapping": { - "start": 11820, - "length": 1568, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 1987, + "length": 302, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, - "lines": [ - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318 - ], + "lines": [56, 57, 58, 59, 60, 61, 62, 63, 64], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryReservesVault", + "name": "TreasuryFarmingRevenue", "source_mapping": { - "start": 2150, - "length": 31934, - "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", - "filename_short": "contracts/v2/TreasuryReservesVault.sol", + "start": 547, + "length": 3059, + "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, "lines": [ - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, - 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, - 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, - 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, - 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, - 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, - 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, - 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, - 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, - 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, - 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, - 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, - 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, - 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, - 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, - 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, - 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, - 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, - 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776 + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "shutdown(address)" + "signature": "increaseShares(address,uint256)" } } }, "additional_fields": { "underlying_type": "event" } } ], - "description": "Reentrancy in TreasuryReservesVault.shutdown(address) (contracts/v2/TreasuryReservesVault.sol#283-318):\n\tExternal calls:\n\t- _outstandingDebt = borrowTokens[_token].dToken.burnAll(strategy) (contracts/v2/TreasuryReservesVault.sol#296)\n\tEvent emitted after the call(s):\n\t- StrategyRemoved(strategy) (contracts/v2/TreasuryReservesVault.sol#311)\n\t- StrategyShutdownCreditAndDebt(strategy,address(_token),credits[_token],_outstandingDebt) (contracts/v2/TreasuryReservesVault.sol#297-302)\n", - "markdown": "Reentrancy in [TreasuryReservesVault.shutdown(address)](contracts/v2/TreasuryReservesVault.sol#L283-L318):\n\tExternal calls:\n\t- [_outstandingDebt = borrowTokens[_token].dToken.burnAll(strategy)](contracts/v2/TreasuryReservesVault.sol#L296)\n\tEvent emitted after the call(s):\n\t- [StrategyRemoved(strategy)](contracts/v2/TreasuryReservesVault.sol#L311)\n\t- [StrategyShutdownCreditAndDebt(strategy,address(_token),credits[_token],_outstandingDebt)](contracts/v2/TreasuryReservesVault.sol#L297-L302)\n", - "first_markdown_element": "contracts/v2/TreasuryReservesVault.sol#L283-L318", - "id": "5fbbdb53d26a34f157eb7ee6a3b4802c3ca5bd4c31a23bbadd57bc23eab37fc0", + "description": "Reentrancy in TreasuryFarmingRevenue.increaseShares(address,uint256) (contracts/core/TreasuryFarmingRevenue.sol#56-64):\n\tExternal calls:\n\t- claimFor(account) (contracts/core/TreasuryFarmingRevenue.sol#57)\n\t\t- exposure.mint(account,unclaimedScaled / SCALING_FACTOR) (contracts/core/TreasuryFarmingRevenue.sol#91)\n\tEvent emitted after the call(s):\n\t- IncreaseShares(account,amount) (contracts/core/TreasuryFarmingRevenue.sol#63)\n", + "markdown": "Reentrancy in [TreasuryFarmingRevenue.increaseShares(address,uint256)](contracts/core/TreasuryFarmingRevenue.sol#L56-L64):\n\tExternal calls:\n\t- [claimFor(account)](contracts/core/TreasuryFarmingRevenue.sol#L57)\n\t\t- [exposure.mint(account,unclaimedScaled / SCALING_FACTOR)](contracts/core/TreasuryFarmingRevenue.sol#L91)\n\tEvent emitted after the call(s):\n\t- [IncreaseShares(account,amount)](contracts/core/TreasuryFarmingRevenue.sol#L63)\n", + "first_markdown_element": "contracts/core/TreasuryFarmingRevenue.sol#L56-L64", + "id": "d4561252e63b6b2b82404c62a37f3524f0af810644056f99e52c4028a071621f", "check": "reentrancy-events", "impact": "Low", "confidence": "Medium" @@ -46994,135 +41676,102 @@ "elements": [ { "type": "function", - "name": "trvWithdraw", + "name": "lockFor", "source_mapping": { - "start": 10560, - "length": 932, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 943, + "length": 494, + "filename_relative": "contracts/deprecated/LockedOGTemple.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/LockedOGTemple.sol", + "filename_short": "contracts/deprecated/LockedOGTemple.sol", "is_dependency": false, "lines": [ - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275 + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53 ], - "starting_column": 5, - "ending_column": 6 + "starting_column": 3, + "ending_column": 4 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "LockedOGTemple", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 213, + "length": 2143, + "filename_relative": "contracts/deprecated/LockedOGTemple.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/LockedOGTemple.sol", + "filename_short": "contracts/deprecated/LockedOGTemple.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305 + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "trvWithdraw(uint256)" + "signature": "lockFor(address,uint256,uint256)" } }, { "type": "node", - "name": "(daiAvailable,chi,sharesAvailable) = _checkpointDaiBalance()", + "name": "SafeERC20.safeTransferFrom(OG_TEMPLE,msg.sender,address(this),_amountOGTemple)", "source_mapping": { - "start": 10973, - "length": 86, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 1247, + "length": 111, + "filename_relative": "contracts/deprecated/LockedOGTemple.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/LockedOGTemple.sol", + "filename_short": "contracts/deprecated/LockedOGTemple.sol", "is_dependency": false, - "lines": [263], - "starting_column": 9, - "ending_column": 95 + "lines": [46, 47, 48, 49, 50, 51], + "starting_column": 5, + "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "function", - "name": "trvWithdraw", + "name": "lockFor", "source_mapping": { - "start": 10560, - "length": 932, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 943, + "length": 494, + "filename_relative": "contracts/deprecated/LockedOGTemple.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/LockedOGTemple.sol", + "filename_short": "contracts/deprecated/LockedOGTemple.sol", "is_dependency": false, "lines": [ - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275 + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53 ], - "starting_column": 5, - "ending_column": 6 + "starting_column": 3, + "ending_column": 4 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "LockedOGTemple", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 213, + "length": 2143, + "filename_relative": "contracts/deprecated/LockedOGTemple.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/LockedOGTemple.sol", + "filename_short": "contracts/deprecated/LockedOGTemple.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "trvWithdraw(uint256)" + "signature": "lockFor(address,uint256,uint256)" } } }, @@ -47130,465 +41779,411 @@ }, { "type": "node", - "name": "chi = pot.drip()", + "name": "OGTempleLocked(_staker,_amountOGTemple,_lockedUntilTimestamp)", "source_mapping": { - "start": 5566, - "length": 60, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 1364, + "length": 68, + "filename_relative": "contracts/deprecated/LockedOGTemple.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/LockedOGTemple.sol", + "filename_short": "contracts/deprecated/LockedOGTemple.sol", "is_dependency": false, - "lines": [142], - "starting_column": 9, - "ending_column": 69 + "lines": [52], + "starting_column": 5, + "ending_column": 73 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_checkpointChi", + "name": "lockFor", "source_mapping": { - "start": 5445, - "length": 188, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 943, + "length": 494, + "filename_relative": "contracts/deprecated/LockedOGTemple.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/LockedOGTemple.sol", + "filename_short": "contracts/deprecated/LockedOGTemple.sol", "is_dependency": false, - "lines": [140, 141, 142, 143], - "starting_column": 5, - "ending_column": 6 + "lines": [ + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53 + ], + "starting_column": 3, + "ending_column": 4 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "LockedOGTemple", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 213, + "length": 2143, + "filename_relative": "contracts/deprecated/LockedOGTemple.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/LockedOGTemple.sol", + "filename_short": "contracts/deprecated/LockedOGTemple.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "_checkpointChi()" + "signature": "lockFor(address,uint256,uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } - }, + "additional_fields": { "underlying_type": "event" } + } + ], + "description": "Reentrancy in LockedOGTemple.lockFor(address,uint256,uint256) (contracts/deprecated/LockedOGTemple.sol#35-53):\n\tExternal calls:\n\t- SafeERC20.safeTransferFrom(OG_TEMPLE,msg.sender,address(this),_amountOGTemple) (contracts/deprecated/LockedOGTemple.sol#46-51)\n\tEvent emitted after the call(s):\n\t- OGTempleLocked(_staker,_amountOGTemple,_lockedUntilTimestamp) (contracts/deprecated/LockedOGTemple.sol#52)\n", + "markdown": "Reentrancy in [LockedOGTemple.lockFor(address,uint256,uint256)](contracts/deprecated/LockedOGTemple.sol#L35-L53):\n\tExternal calls:\n\t- [SafeERC20.safeTransferFrom(OG_TEMPLE,msg.sender,address(this),_amountOGTemple)](contracts/deprecated/LockedOGTemple.sol#L46-L51)\n\tEvent emitted after the call(s):\n\t- [OGTempleLocked(_staker,_amountOGTemple,_lockedUntilTimestamp)](contracts/deprecated/LockedOGTemple.sol#L52)\n", + "first_markdown_element": "contracts/deprecated/LockedOGTemple.sol#L35-L53", + "id": "4230808e1cd7a4f58313604bd2841ce355116b1beb66b33f45e8990f931fb60f", + "check": "reentrancy-events", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ { - "type": "node", - "name": "_dsrWithdrawal(sharesAmount,requestedAmount)", + "type": "function", + "name": "recoverToken", "source_mapping": { - "start": 11328, - "length": 45, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2526, + "length": 244, + "filename_relative": "contracts/core/VaultEarlyWithdraw.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultEarlyWithdraw.sol", + "filename_short": "contracts/core/VaultEarlyWithdraw.sol", "is_dependency": false, - "lines": [272], - "starting_column": 9, - "ending_column": 54 + "lines": [73, 74, 75, 76, 77], + "starting_column": 5, + "ending_column": 6 }, "type_specific_fields": { "parent": { - "type": "function", - "name": "trvWithdraw", + "type": "contract", + "name": "VaultEarlyWithdraw", "source_mapping": { - "start": 10560, - "length": 932, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 548, + "length": 2224, + "filename_relative": "contracts/core/VaultEarlyWithdraw.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultEarlyWithdraw.sol", + "filename_short": "contracts/core/VaultEarlyWithdraw.sol", "is_dependency": false, "lines": [ - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275 + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78 ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "DsrBaseStrategy", - "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", - "is_dependency": false, - "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "trvWithdraw(uint256)" - } - } - }, - "additional_fields": { "underlying_type": "external_calls" } + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "recoverToken(address,address,uint256)" + } }, { "type": "node", - "name": "pot.exit(sharesAmount)", + "name": "IERC20(token).safeTransfer(to,amount)", "source_mapping": { - "start": 11582, - "length": 22, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2677, + "length": 38, + "filename_relative": "contracts/core/VaultEarlyWithdraw.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultEarlyWithdraw.sol", + "filename_short": "contracts/core/VaultEarlyWithdraw.sol", "is_dependency": false, - "lines": [278], + "lines": [75], "starting_column": 9, - "ending_column": 31 + "ending_column": 47 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_dsrWithdrawal", + "name": "recoverToken", "source_mapping": { - "start": 11498, - "length": 199, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2526, + "length": 244, + "filename_relative": "contracts/core/VaultEarlyWithdraw.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultEarlyWithdraw.sol", + "filename_short": "contracts/core/VaultEarlyWithdraw.sol", "is_dependency": false, - "lines": [277, 278, 279, 280, 281], + "lines": [73, 74, 75, 76, 77], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "VaultEarlyWithdraw", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 548, + "length": 2224, + "filename_relative": "contracts/core/VaultEarlyWithdraw.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultEarlyWithdraw.sol", + "filename_short": "contracts/core/VaultEarlyWithdraw.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "_dsrWithdrawal(uint256,uint256)" + "signature": "recoverToken(address,address,uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "daiJoin.exit(address(this),daiAmount)", + "name": "TokenRecovered(token,to,amount)", "source_mapping": { - "start": 11614, + "start": 2725, "length": 38, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_relative": "contracts/core/VaultEarlyWithdraw.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultEarlyWithdraw.sol", + "filename_short": "contracts/core/VaultEarlyWithdraw.sol", "is_dependency": false, - "lines": [279], + "lines": [76], "starting_column": 9, "ending_column": 47 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_dsrWithdrawal", + "name": "recoverToken", "source_mapping": { - "start": 11498, - "length": 199, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2526, + "length": 244, + "filename_relative": "contracts/core/VaultEarlyWithdraw.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultEarlyWithdraw.sol", + "filename_short": "contracts/core/VaultEarlyWithdraw.sol", "is_dependency": false, - "lines": [277, 278, 279, 280, 281], + "lines": [73, 74, 75, 76, 77], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "VaultEarlyWithdraw", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 548, + "length": 2224, + "filename_relative": "contracts/core/VaultEarlyWithdraw.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultEarlyWithdraw.sol", + "filename_short": "contracts/core/VaultEarlyWithdraw.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "_dsrWithdrawal(uint256,uint256)" + "signature": "recoverToken(address,address,uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + "additional_fields": { "underlying_type": "event" } + } + ], + "description": "Reentrancy in VaultEarlyWithdraw.recoverToken(address,address,uint256) (contracts/core/VaultEarlyWithdraw.sol#73-77):\n\tExternal calls:\n\t- IERC20(token).safeTransfer(to,amount) (contracts/core/VaultEarlyWithdraw.sol#75)\n\tEvent emitted after the call(s):\n\t- TokenRecovered(token,to,amount) (contracts/core/VaultEarlyWithdraw.sol#76)\n", + "markdown": "Reentrancy in [VaultEarlyWithdraw.recoverToken(address,address,uint256)](contracts/core/VaultEarlyWithdraw.sol#L73-L77):\n\tExternal calls:\n\t- [IERC20(token).safeTransfer(to,amount)](contracts/core/VaultEarlyWithdraw.sol#L75)\n\tEvent emitted after the call(s):\n\t- [TokenRecovered(token,to,amount)](contracts/core/VaultEarlyWithdraw.sol#L76)\n", + "first_markdown_element": "contracts/core/VaultEarlyWithdraw.sol#L73-L77", + "id": "1c3c00beda0eb4b0661cc31987f0cf4c864705a836f5da0004529d20a3b860b8", + "check": "reentrancy-events", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "redeemAmount", + "source_mapping": { + "start": 3060, + "length": 296, + "filename_relative": "contracts/core/Exposure.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Exposure.sol", + "filename_short": "contracts/core/Exposure.sol", + "is_dependency": false, + "lines": [104, 105, 106, 107, 108, 109, 110, 111, 112, 113], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Exposure", + "source_mapping": { + "start": 362, + "length": 3820, + "filename_relative": "contracts/core/Exposure.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Exposure.sol", + "filename_short": "contracts/core/Exposure.sol", + "is_dependency": false, + "lines": [ + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "redeemAmount(uint256,address)" + } }, { "type": "node", - "name": "DaiWithdrawn(daiAmount)", + "name": "liquidator.toTemple(amount,to)", "source_mapping": { - "start": 11662, - "length": 28, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 3241, + "length": 31, + "filename_relative": "contracts/core/Exposure.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Exposure.sol", + "filename_short": "contracts/core/Exposure.sol", "is_dependency": false, - "lines": [280], - "starting_column": 9, - "ending_column": 37 + "lines": [109], + "starting_column": 13, + "ending_column": 44 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_dsrWithdrawal", + "name": "redeemAmount", "source_mapping": { - "start": 11498, - "length": 199, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 3060, + "length": 296, + "filename_relative": "contracts/core/Exposure.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Exposure.sol", + "filename_short": "contracts/core/Exposure.sol", "is_dependency": false, - "lines": [277, 278, 279, 280, 281], + "lines": [104, 105, 106, 107, 108, 109, 110, 111, 112, 113], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "Exposure", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 362, + "length": 3820, + "filename_relative": "contracts/core/Exposure.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Exposure.sol", + "filename_short": "contracts/core/Exposure.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "_dsrWithdrawal(uint256,uint256)" + "signature": "redeemAmount(uint256,address)" } } }, - "additional_fields": { "underlying_type": "event" } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "_dsrWithdrawal(sharesAmount,requestedAmount)", + "name": "Redeem(address(revalToken),msg.sender,to,amount)", "source_mapping": { - "start": 11328, - "length": 45, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 3293, + "length": 56, + "filename_relative": "contracts/core/Exposure.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Exposure.sol", + "filename_short": "contracts/core/Exposure.sol", "is_dependency": false, - "lines": [272], + "lines": [112], "starting_column": 9, - "ending_column": 54 + "ending_column": 65 }, "type_specific_fields": { "parent": { "type": "function", - "name": "trvWithdraw", + "name": "redeemAmount", "source_mapping": { - "start": 10560, - "length": 932, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 3060, + "length": 296, + "filename_relative": "contracts/core/Exposure.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Exposure.sol", + "filename_short": "contracts/core/Exposure.sol", "is_dependency": false, - "lines": [ - 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275 - ], + "lines": [104, 105, 106, 107, 108, 109, 110, 111, 112, 113], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "Exposure", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 362, + "length": 3820, + "filename_relative": "contracts/core/Exposure.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Exposure.sol", + "filename_short": "contracts/core/Exposure.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "trvWithdraw(uint256)" + "signature": "redeemAmount(uint256,address)" } } }, "additional_fields": { "underlying_type": "event" } } ], - "description": "Reentrancy in DsrBaseStrategy.trvWithdraw(uint256) (contracts/v2/strategies/DsrBaseStrategy.sol#257-275):\n\tExternal calls:\n\t- (daiAvailable,chi,sharesAvailable) = _checkpointDaiBalance() (contracts/v2/strategies/DsrBaseStrategy.sol#263)\n\t\t- chi = pot.drip() (contracts/v2/strategies/DsrBaseStrategy.sol#142)\n\t- _dsrWithdrawal(sharesAmount,requestedAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#272)\n\t\t- pot.exit(sharesAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#278)\n\t\t- daiJoin.exit(address(this),daiAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#279)\n\tEvent emitted after the call(s):\n\t- DaiWithdrawn(daiAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#280)\n\t\t- _dsrWithdrawal(sharesAmount,requestedAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#272)\n", - "markdown": "Reentrancy in [DsrBaseStrategy.trvWithdraw(uint256)](contracts/v2/strategies/DsrBaseStrategy.sol#L257-L275):\n\tExternal calls:\n\t- [(daiAvailable,chi,sharesAvailable) = _checkpointDaiBalance()](contracts/v2/strategies/DsrBaseStrategy.sol#L263)\n\t\t- [chi = pot.drip()](contracts/v2/strategies/DsrBaseStrategy.sol#L142)\n\t- [_dsrWithdrawal(sharesAmount,requestedAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L272)\n\t\t- [pot.exit(sharesAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L278)\n\t\t- [daiJoin.exit(address(this),daiAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L279)\n\tEvent emitted after the call(s):\n\t- [DaiWithdrawn(daiAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L280)\n\t\t- [_dsrWithdrawal(sharesAmount,requestedAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L272)\n", - "first_markdown_element": "contracts/v2/strategies/DsrBaseStrategy.sol#L257-L275", - "id": "cc6912f712e918c692155d8514b684ae550f245049aa0f02b0b4d5f428785178", + "description": "Reentrancy in Exposure.redeemAmount(uint256,address) (contracts/core/Exposure.sol#104-113):\n\tExternal calls:\n\t- liquidator.toTemple(amount,to) (contracts/core/Exposure.sol#109)\n\tEvent emitted after the call(s):\n\t- Redeem(address(revalToken),msg.sender,to,amount) (contracts/core/Exposure.sol#112)\n", + "markdown": "Reentrancy in [Exposure.redeemAmount(uint256,address)](contracts/core/Exposure.sol#L104-L113):\n\tExternal calls:\n\t- [liquidator.toTemple(amount,to)](contracts/core/Exposure.sol#L109)\n\tEvent emitted after the call(s):\n\t- [Redeem(address(revalToken),msg.sender,to,amount)](contracts/core/Exposure.sol#L112)\n", + "first_markdown_element": "contracts/core/Exposure.sol#L104-L113", + "id": "5c348eea3fa61ccb6c1609a61dfbf2ea3d76c031d344e46e4a98a0d17d2298c4", "check": "reentrancy-events", "impact": "Low", "confidence": "Medium" @@ -47597,16 +42192,16 @@ "elements": [ { "type": "function", - "name": "withdrawAndRepay", + "name": "stakeFor", "source_mapping": { - "start": 8509, - "length": 786, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 4887, + "length": 624, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, "lines": [ - 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227 + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136 ], "starting_column": 5, "ending_column": 6 @@ -47614,72 +42209,62 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TempleStaking", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 464, + "length": 6184, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305 + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "withdrawAndRepay(uint256)" + "signature": "stakeFor(address,uint256)" } }, { "type": "node", - "name": "(daiAvailable,chi) = _checkpointDaiBalance()", + "name": "SafeERC20.safeTransferFrom(TEMPLE,msg.sender,address(this),_amountTemple)", "source_mapping": { - "start": 8690, - "length": 63, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 5291, + "length": 76, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, - "lines": [217], + "lines": [131], "starting_column": 9, - "ending_column": 72 + "ending_column": 85 }, "type_specific_fields": { "parent": { "type": "function", - "name": "withdrawAndRepay", + "name": "stakeFor", "source_mapping": { - "start": 8509, - "length": 786, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 4887, + "length": 624, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, "lines": [ - 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227 + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136 ], "starting_column": 5, "ending_column": 6 @@ -47687,44 +42272,32 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TempleStaking", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 464, + "length": 6184, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "withdrawAndRepay(uint256)" + "signature": "stakeFor(address,uint256)" } } }, @@ -47732,107 +42305,98 @@ }, { "type": "node", - "name": "chi = pot.drip()", + "name": "OG_TEMPLE.mint(_staker,amountOgTemple)", "source_mapping": { - "start": 5566, - "length": 60, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 5377, + "length": 39, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, - "lines": [142], + "lines": [132], "starting_column": 9, - "ending_column": 69 + "ending_column": 48 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_checkpointChi", + "name": "stakeFor", "source_mapping": { - "start": 5445, - "length": 188, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 4887, + "length": 624, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, - "lines": [140, 141, 142, 143], + "lines": [ + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", - "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", - "is_dependency": false, - "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + "name": "TempleStaking", + "source_mapping": { + "start": 464, + "length": 6184, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", + "is_dependency": false, + "lines": [ + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_checkpointChi()" + "signature": "stakeFor(address,uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "_dsrWithdrawal(sharesAmount,withdrawalAmount)", + "name": "StakeCompleted(_staker,_amountTemple,0)", "source_mapping": { - "start": 9025, + "start": 5426, "length": 46, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, - "lines": [222], + "lines": [133], "starting_column": 9, "ending_column": 55 }, "type_specific_fields": { "parent": { "type": "function", - "name": "withdrawAndRepay", + "name": "stakeFor", "source_mapping": { - "start": 8509, - "length": 786, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 4887, + "length": 624, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, "lines": [ - 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227 + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136 ], "starting_column": 5, "ending_column": 6 @@ -47840,302 +42404,315 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TempleStaking", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 464, + "length": 6184, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "withdrawAndRepay(uint256)" + "signature": "stakeFor(address,uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls" } + "additional_fields": { "underlying_type": "event" } + } + ], + "description": "Reentrancy in TempleStaking.stakeFor(address,uint256) (contracts/deprecated/TempleStaking.sol#123-136):\n\tExternal calls:\n\t- SafeERC20.safeTransferFrom(TEMPLE,msg.sender,address(this),_amountTemple) (contracts/deprecated/TempleStaking.sol#131)\n\t- OG_TEMPLE.mint(_staker,amountOgTemple) (contracts/deprecated/TempleStaking.sol#132)\n\tEvent emitted after the call(s):\n\t- StakeCompleted(_staker,_amountTemple,0) (contracts/deprecated/TempleStaking.sol#133)\n", + "markdown": "Reentrancy in [TempleStaking.stakeFor(address,uint256)](contracts/deprecated/TempleStaking.sol#L123-L136):\n\tExternal calls:\n\t- [SafeERC20.safeTransferFrom(TEMPLE,msg.sender,address(this),_amountTemple)](contracts/deprecated/TempleStaking.sol#L131)\n\t- [OG_TEMPLE.mint(_staker,amountOgTemple)](contracts/deprecated/TempleStaking.sol#L132)\n\tEvent emitted after the call(s):\n\t- [StakeCompleted(_staker,_amountTemple,0)](contracts/deprecated/TempleStaking.sol#L133)\n", + "first_markdown_element": "contracts/deprecated/TempleStaking.sol#L123-L136", + "id": "b18c05c7e4e0c35ebb87b7dbe818caa384c5e387f2a89d762dad2c9429dad39c", + "check": "reentrancy-events", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "unstake", + "source_mapping": { + "start": 5711, + "length": 576, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", + "is_dependency": false, + "lines": [144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleStaking", + "source_mapping": { + "start": 464, + "length": 6184, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", + "is_dependency": false, + "lines": [ + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "unstake(uint256)" + } }, { "type": "node", - "name": "pot.exit(sharesAmount)", + "name": "OG_TEMPLE.burnFrom(msg.sender,_amountOgTemple)", "source_mapping": { - "start": 11582, - "length": 22, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 6017, + "length": 47, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, - "lines": [278], + "lines": [150], "starting_column": 9, - "ending_column": 31 + "ending_column": 56 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_dsrWithdrawal", + "name": "unstake", "source_mapping": { - "start": 11498, - "length": 199, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 5711, + "length": 576, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, - "lines": [277, 278, 279, 280, 281], + "lines": [ + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TempleStaking", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 464, + "length": 6184, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_dsrWithdrawal(uint256,uint256)" + "signature": "unstake(uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "daiJoin.exit(address(this),daiAmount)", + "name": "SafeERC20.safeIncreaseAllowance(TEMPLE,address(EXIT_QUEUE),unstakeBalanceTemple)", "source_mapping": { - "start": 11614, - "length": 38, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 6074, + "length": 82, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, - "lines": [279], + "lines": [151], "starting_column": 9, - "ending_column": 47 + "ending_column": 91 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_dsrWithdrawal", + "name": "unstake", "source_mapping": { - "start": 11498, - "length": 199, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 5711, + "length": 576, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, - "lines": [277, 278, 279, 280, 281], + "lines": [ + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TempleStaking", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 464, + "length": 6184, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_dsrWithdrawal(uint256,uint256)" + "signature": "unstake(uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "DaiWithdrawn(daiAmount)", + "name": "EXIT_QUEUE.join(msg.sender,unstakeBalanceTemple)", "source_mapping": { - "start": 11662, - "length": 28, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 6166, + "length": 49, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, - "lines": [280], + "lines": [152], "starting_column": 9, - "ending_column": 37 + "ending_column": 58 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_dsrWithdrawal", + "name": "unstake", "source_mapping": { - "start": 11498, - "length": 199, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 5711, + "length": 576, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, - "lines": [277, 278, 279, 280, 281], + "lines": [ + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TempleStaking", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 464, + "length": 6184, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_dsrWithdrawal(uint256,uint256)" + "signature": "unstake(uint256)" } } }, - "additional_fields": { "underlying_type": "event" } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "_dsrWithdrawal(sharesAmount,withdrawalAmount)", + "name": "UnstakeCompleted(msg.sender,_amountOgTemple)", "source_mapping": { - "start": 9025, - "length": 46, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 6226, + "length": 50, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, - "lines": [222], + "lines": [154], "starting_column": 9, - "ending_column": 55 + "ending_column": 59 }, "type_specific_fields": { "parent": { "type": "function", - "name": "withdrawAndRepay", + "name": "unstake", "source_mapping": { - "start": 8509, - "length": 786, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 5711, + "length": 576, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, "lines": [ - 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227 + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155 ], "starting_column": 5, "ending_column": 6 @@ -48143,54 +42720,42 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "TempleStaking", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 464, + "length": 6184, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "withdrawAndRepay(uint256)" + "signature": "unstake(uint256)" } } }, "additional_fields": { "underlying_type": "event" } } ], - "description": "Reentrancy in DsrBaseStrategy.withdrawAndRepay(uint256) (contracts/v2/strategies/DsrBaseStrategy.sol#214-227):\n\tExternal calls:\n\t- (daiAvailable,chi) = _checkpointDaiBalance() (contracts/v2/strategies/DsrBaseStrategy.sol#217)\n\t\t- chi = pot.drip() (contracts/v2/strategies/DsrBaseStrategy.sol#142)\n\t- _dsrWithdrawal(sharesAmount,withdrawalAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#222)\n\t\t- pot.exit(sharesAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#278)\n\t\t- daiJoin.exit(address(this),daiAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#279)\n\tEvent emitted after the call(s):\n\t- DaiWithdrawn(daiAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#280)\n\t\t- _dsrWithdrawal(sharesAmount,withdrawalAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#222)\n", - "markdown": "Reentrancy in [DsrBaseStrategy.withdrawAndRepay(uint256)](contracts/v2/strategies/DsrBaseStrategy.sol#L214-L227):\n\tExternal calls:\n\t- [(daiAvailable,chi) = _checkpointDaiBalance()](contracts/v2/strategies/DsrBaseStrategy.sol#L217)\n\t\t- [chi = pot.drip()](contracts/v2/strategies/DsrBaseStrategy.sol#L142)\n\t- [_dsrWithdrawal(sharesAmount,withdrawalAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L222)\n\t\t- [pot.exit(sharesAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L278)\n\t\t- [daiJoin.exit(address(this),daiAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L279)\n\tEvent emitted after the call(s):\n\t- [DaiWithdrawn(daiAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L280)\n\t\t- [_dsrWithdrawal(sharesAmount,withdrawalAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L222)\n", - "first_markdown_element": "contracts/v2/strategies/DsrBaseStrategy.sol#L214-L227", - "id": "18b95011d36c8db13b7c5b0169ea454fafaeef1cdcf728b8933f4693aabfdc22", + "description": "Reentrancy in TempleStaking.unstake(uint256) (contracts/deprecated/TempleStaking.sol#144-155):\n\tExternal calls:\n\t- OG_TEMPLE.burnFrom(msg.sender,_amountOgTemple) (contracts/deprecated/TempleStaking.sol#150)\n\t- SafeERC20.safeIncreaseAllowance(TEMPLE,address(EXIT_QUEUE),unstakeBalanceTemple) (contracts/deprecated/TempleStaking.sol#151)\n\t- EXIT_QUEUE.join(msg.sender,unstakeBalanceTemple) (contracts/deprecated/TempleStaking.sol#152)\n\tEvent emitted after the call(s):\n\t- UnstakeCompleted(msg.sender,_amountOgTemple) (contracts/deprecated/TempleStaking.sol#154)\n", + "markdown": "Reentrancy in [TempleStaking.unstake(uint256)](contracts/deprecated/TempleStaking.sol#L144-L155):\n\tExternal calls:\n\t- [OG_TEMPLE.burnFrom(msg.sender,_amountOgTemple)](contracts/deprecated/TempleStaking.sol#L150)\n\t- [SafeERC20.safeIncreaseAllowance(TEMPLE,address(EXIT_QUEUE),unstakeBalanceTemple)](contracts/deprecated/TempleStaking.sol#L151)\n\t- [EXIT_QUEUE.join(msg.sender,unstakeBalanceTemple)](contracts/deprecated/TempleStaking.sol#L152)\n\tEvent emitted after the call(s):\n\t- [UnstakeCompleted(msg.sender,_amountOgTemple)](contracts/deprecated/TempleStaking.sol#L154)\n", + "first_markdown_element": "contracts/deprecated/TempleStaking.sol#L144-L155", + "id": "325fc57e8f6e1cecb7323feddec38c5b7507dd1c8d9a046aa8b2c362a40ad09b", "check": "reentrancy-events", "impact": "Low", "confidence": "Medium" @@ -48199,129 +42764,94 @@ "elements": [ { "type": "function", - "name": "withdrawAndRepayAll", + "name": "withdraw", "source_mapping": { - "start": 9412, - "length": 465, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 1870, + "length": 562, + "filename_relative": "contracts/core/VaultEarlyWithdraw.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultEarlyWithdraw.sol", + "filename_short": "contracts/core/VaultEarlyWithdraw.sol", "is_dependency": false, - "lines": [232, 233, 234, 235, 236, 237, 238, 239, 240], + "lines": [57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "VaultEarlyWithdraw", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 548, + "length": 2224, + "filename_relative": "contracts/core/VaultEarlyWithdraw.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultEarlyWithdraw.sol", + "filename_short": "contracts/core/VaultEarlyWithdraw.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305 + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "withdrawAndRepayAll()" + "signature": "withdraw(address,uint256)" } }, { "type": "node", - "name": "(daiAvailable,sharesAvailable) = _checkpointDaiBalance()", + "name": "IERC20(_vault).safeTransferFrom(msg.sender,owner(),_templeAmount)", "source_mapping": { - "start": 9499, - "length": 74, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2162, + "length": 67, + "filename_relative": "contracts/core/VaultEarlyWithdraw.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultEarlyWithdraw.sol", + "filename_short": "contracts/core/VaultEarlyWithdraw.sol", "is_dependency": false, - "lines": [233], + "lines": [62], "starting_column": 9, - "ending_column": 83 + "ending_column": 76 }, "type_specific_fields": { "parent": { "type": "function", - "name": "withdrawAndRepayAll", + "name": "withdraw", "source_mapping": { - "start": 9412, - "length": 465, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 1870, + "length": 562, + "filename_relative": "contracts/core/VaultEarlyWithdraw.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultEarlyWithdraw.sol", + "filename_short": "contracts/core/VaultEarlyWithdraw.sol", "is_dependency": false, - "lines": [232, 233, 234, 235, 236, 237, 238, 239, 240], + "lines": [57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "VaultEarlyWithdraw", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 548, + "length": 2224, + "filename_relative": "contracts/core/VaultEarlyWithdraw.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultEarlyWithdraw.sol", + "filename_short": "contracts/core/VaultEarlyWithdraw.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "withdrawAndRepayAll()" + "signature": "withdraw(address,uint256)" } } }, @@ -48329,459 +42859,494 @@ }, { "type": "node", - "name": "chi = pot.drip()", + "name": "templeToken.safeTransfer(msg.sender,_templeAmount)", "source_mapping": { - "start": 5566, - "length": 60, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2318, + "length": 51, + "filename_relative": "contracts/core/VaultEarlyWithdraw.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultEarlyWithdraw.sol", + "filename_short": "contracts/core/VaultEarlyWithdraw.sol", "is_dependency": false, - "lines": [142], + "lines": [65], "starting_column": 9, - "ending_column": 69 + "ending_column": 60 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_checkpointChi", + "name": "withdraw", "source_mapping": { - "start": 5445, - "length": 188, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 1870, + "length": 562, + "filename_relative": "contracts/core/VaultEarlyWithdraw.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultEarlyWithdraw.sol", + "filename_short": "contracts/core/VaultEarlyWithdraw.sol", "is_dependency": false, - "lines": [140, 141, 142, 143], + "lines": [57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "VaultEarlyWithdraw", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 548, + "length": 2224, + "filename_relative": "contracts/core/VaultEarlyWithdraw.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultEarlyWithdraw.sol", + "filename_short": "contracts/core/VaultEarlyWithdraw.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "_checkpointChi()" + "signature": "withdraw(address,uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "_dsrWithdrawal(sharesAvailable,daiAvailable)", + "name": "EarlyWithdraw(msg.sender,_templeAmount)", "source_mapping": { - "start": 9583, + "start": 2380, "length": 45, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_relative": "contracts/core/VaultEarlyWithdraw.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultEarlyWithdraw.sol", + "filename_short": "contracts/core/VaultEarlyWithdraw.sol", "is_dependency": false, - "lines": [234], + "lines": [67], "starting_column": 9, "ending_column": 54 }, "type_specific_fields": { "parent": { "type": "function", - "name": "withdrawAndRepayAll", + "name": "withdraw", "source_mapping": { - "start": 9412, - "length": 465, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 1870, + "length": 562, + "filename_relative": "contracts/core/VaultEarlyWithdraw.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultEarlyWithdraw.sol", + "filename_short": "contracts/core/VaultEarlyWithdraw.sol", "is_dependency": false, - "lines": [232, 233, 234, 235, 236, 237, 238, 239, 240], + "lines": [57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "VaultEarlyWithdraw", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 548, + "length": 2224, + "filename_relative": "contracts/core/VaultEarlyWithdraw.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultEarlyWithdraw.sol", + "filename_short": "contracts/core/VaultEarlyWithdraw.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "withdrawAndRepayAll()" + "signature": "withdraw(address,uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls" } + "additional_fields": { "underlying_type": "event" } + } + ], + "description": "Reentrancy in VaultEarlyWithdraw.withdraw(address,uint256) (contracts/core/VaultEarlyWithdraw.sol#57-68):\n\tExternal calls:\n\t- IERC20(_vault).safeTransferFrom(msg.sender,owner(),_templeAmount) (contracts/core/VaultEarlyWithdraw.sol#62)\n\t- templeToken.safeTransfer(msg.sender,_templeAmount) (contracts/core/VaultEarlyWithdraw.sol#65)\n\tEvent emitted after the call(s):\n\t- EarlyWithdraw(msg.sender,_templeAmount) (contracts/core/VaultEarlyWithdraw.sol#67)\n", + "markdown": "Reentrancy in [VaultEarlyWithdraw.withdraw(address,uint256)](contracts/core/VaultEarlyWithdraw.sol#L57-L68):\n\tExternal calls:\n\t- [IERC20(_vault).safeTransferFrom(msg.sender,owner(),_templeAmount)](contracts/core/VaultEarlyWithdraw.sol#L62)\n\t- [templeToken.safeTransfer(msg.sender,_templeAmount)](contracts/core/VaultEarlyWithdraw.sol#L65)\n\tEvent emitted after the call(s):\n\t- [EarlyWithdraw(msg.sender,_templeAmount)](contracts/core/VaultEarlyWithdraw.sol#L67)\n", + "first_markdown_element": "contracts/core/VaultEarlyWithdraw.sol#L57-L68", + "id": "7a41d062356aa90302a9b5d0829abad146259b6d909dd1702764a586f2839691", + "check": "reentrancy-events", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "withdrawFor", + "source_mapping": { + "start": 8505, + "length": 349, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", + "is_dependency": false, + "lines": [220, 221, 222, 223, 224, 225, 226, 227, 228, 229], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Vault", + "source_mapping": { + "start": 1161, + "length": 7823, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", + "is_dependency": false, + "lines": [ + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdrawFor(address,address,uint256)" + } }, { "type": "node", - "name": "pot.exit(sharesAmount)", + "name": "templeExposureToken.redeemAmount(_amount,_to)", "source_mapping": { - "start": 11582, - "length": 22, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 8759, + "length": 46, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, - "lines": [278], + "lines": [227], "starting_column": 9, - "ending_column": 31 + "ending_column": 55 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_dsrWithdrawal", + "name": "withdrawFor", "source_mapping": { - "start": 11498, - "length": 199, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 8505, + "length": 349, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, - "lines": [277, 278, 279, 280, 281], + "lines": [220, 221, 222, 223, 224, 225, 226, 227, 228, 229], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "Vault", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 1161, + "length": 7823, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "_dsrWithdrawal(uint256,uint256)" + "signature": "withdrawFor(address,address,uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "daiJoin.exit(address(this),daiAmount)", + "name": "Withdraw(_account,_amount)", "source_mapping": { - "start": 11614, - "length": 38, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 8815, + "length": 32, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, - "lines": [279], + "lines": [228], "starting_column": 9, - "ending_column": 47 + "ending_column": 41 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_dsrWithdrawal", + "name": "withdrawFor", "source_mapping": { - "start": 11498, - "length": 199, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 8505, + "length": 349, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, - "lines": [277, 278, 279, 280, 281], + "lines": [220, 221, 222, 223, 224, 225, 226, 227, 228, 229], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "Vault", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 1161, + "length": 7823, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "_dsrWithdrawal(uint256,uint256)" + "signature": "withdrawFor(address,address,uint256)" } } }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + "additional_fields": { "underlying_type": "event" } + } + ], + "description": "Reentrancy in Vault.withdrawFor(address,address,uint256) (contracts/core/Vault.sol#220-229):\n\tExternal calls:\n\t- templeExposureToken.redeemAmount(_amount,_to) (contracts/core/Vault.sol#227)\n\tEvent emitted after the call(s):\n\t- Withdraw(_account,_amount) (contracts/core/Vault.sol#228)\n", + "markdown": "Reentrancy in [Vault.withdrawFor(address,address,uint256)](contracts/core/Vault.sol#L220-L229):\n\tExternal calls:\n\t- [templeExposureToken.redeemAmount(_amount,_to)](contracts/core/Vault.sol#L227)\n\tEvent emitted after the call(s):\n\t- [Withdraw(_account,_amount)](contracts/core/Vault.sol#L228)\n", + "first_markdown_element": "contracts/core/Vault.sol#L220-L229", + "id": "63e868ac379538e3598eed469ba9a28458891a3aec02e3895802a5953d73a01a", + "check": "reentrancy-events", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "withdrawFor", + "source_mapping": { + "start": 1642, + "length": 627, + "filename_relative": "contracts/deprecated/LockedOGTemple.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/LockedOGTemple.sol", + "filename_short": "contracts/deprecated/LockedOGTemple.sol", + "is_dependency": false, + "lines": [ + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "LockedOGTemple", + "source_mapping": { + "start": 213, + "length": 2143, + "filename_relative": "contracts/deprecated/LockedOGTemple.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/LockedOGTemple.sol", + "filename_short": "contracts/deprecated/LockedOGTemple.sol", + "is_dependency": false, + "lines": [ + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "withdrawFor(address,uint256)" + } }, { "type": "node", - "name": "DaiWithdrawn(daiAmount)", + "name": "SafeERC20.safeTransfer(OG_TEMPLE,_staker,entry.BalanceOGTemple)", "source_mapping": { - "start": 11662, - "length": 28, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 2140, + "length": 65, + "filename_relative": "contracts/deprecated/LockedOGTemple.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/LockedOGTemple.sol", + "filename_short": "contracts/deprecated/LockedOGTemple.sol", "is_dependency": false, - "lines": [280], - "starting_column": 9, - "ending_column": 37 + "lines": [79], + "starting_column": 5, + "ending_column": 70 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_dsrWithdrawal", + "name": "withdrawFor", "source_mapping": { - "start": 11498, - "length": 199, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 1642, + "length": 627, + "filename_relative": "contracts/deprecated/LockedOGTemple.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/LockedOGTemple.sol", + "filename_short": "contracts/deprecated/LockedOGTemple.sol", "is_dependency": false, - "lines": [277, 278, 279, 280, 281], - "starting_column": 5, - "ending_column": 6 + "lines": [ + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81 + ], + "starting_column": 3, + "ending_column": 4 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "LockedOGTemple", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 213, + "length": 2143, + "filename_relative": "contracts/deprecated/LockedOGTemple.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/LockedOGTemple.sol", + "filename_short": "contracts/deprecated/LockedOGTemple.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "_dsrWithdrawal(uint256,uint256)" + "signature": "withdrawFor(address,uint256)" } } }, - "additional_fields": { "underlying_type": "event" } + "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", - "name": "_dsrWithdrawal(sharesAvailable,daiAvailable)", - "source_mapping": { - "start": 9583, - "length": 45, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "name": "OGTempleWithdraw(_staker,entry.BalanceOGTemple)", + "source_mapping": { + "start": 2211, + "length": 53, + "filename_relative": "contracts/deprecated/LockedOGTemple.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/LockedOGTemple.sol", + "filename_short": "contracts/deprecated/LockedOGTemple.sol", "is_dependency": false, - "lines": [234], - "starting_column": 9, - "ending_column": 54 + "lines": [80], + "starting_column": 5, + "ending_column": 58 }, "type_specific_fields": { "parent": { "type": "function", - "name": "withdrawAndRepayAll", + "name": "withdrawFor", "source_mapping": { - "start": 9412, - "length": 465, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 1642, + "length": 627, + "filename_relative": "contracts/deprecated/LockedOGTemple.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/LockedOGTemple.sol", + "filename_short": "contracts/deprecated/LockedOGTemple.sol", "is_dependency": false, - "lines": [232, 233, 234, 235, 236, 237, 238, 239, 240], - "starting_column": 5, - "ending_column": 6 + "lines": [ + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81 + ], + "starting_column": 3, + "ending_column": 4 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "LockedOGTemple", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 213, + "length": 2143, + "filename_relative": "contracts/deprecated/LockedOGTemple.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/LockedOGTemple.sol", + "filename_short": "contracts/deprecated/LockedOGTemple.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "withdrawAndRepayAll()" + "signature": "withdrawFor(address,uint256)" } } }, "additional_fields": { "underlying_type": "event" } } ], - "description": "Reentrancy in DsrBaseStrategy.withdrawAndRepayAll() (contracts/v2/strategies/DsrBaseStrategy.sol#232-240):\n\tExternal calls:\n\t- (daiAvailable,sharesAvailable) = _checkpointDaiBalance() (contracts/v2/strategies/DsrBaseStrategy.sol#233)\n\t\t- chi = pot.drip() (contracts/v2/strategies/DsrBaseStrategy.sol#142)\n\t- _dsrWithdrawal(sharesAvailable,daiAvailable) (contracts/v2/strategies/DsrBaseStrategy.sol#234)\n\t\t- pot.exit(sharesAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#278)\n\t\t- daiJoin.exit(address(this),daiAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#279)\n\tEvent emitted after the call(s):\n\t- DaiWithdrawn(daiAmount) (contracts/v2/strategies/DsrBaseStrategy.sol#280)\n\t\t- _dsrWithdrawal(sharesAvailable,daiAvailable) (contracts/v2/strategies/DsrBaseStrategy.sol#234)\n", - "markdown": "Reentrancy in [DsrBaseStrategy.withdrawAndRepayAll()](contracts/v2/strategies/DsrBaseStrategy.sol#L232-L240):\n\tExternal calls:\n\t- [(daiAvailable,sharesAvailable) = _checkpointDaiBalance()](contracts/v2/strategies/DsrBaseStrategy.sol#L233)\n\t\t- [chi = pot.drip()](contracts/v2/strategies/DsrBaseStrategy.sol#L142)\n\t- [_dsrWithdrawal(sharesAvailable,daiAvailable)](contracts/v2/strategies/DsrBaseStrategy.sol#L234)\n\t\t- [pot.exit(sharesAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L278)\n\t\t- [daiJoin.exit(address(this),daiAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L279)\n\tEvent emitted after the call(s):\n\t- [DaiWithdrawn(daiAmount)](contracts/v2/strategies/DsrBaseStrategy.sol#L280)\n\t\t- [_dsrWithdrawal(sharesAvailable,daiAvailable)](contracts/v2/strategies/DsrBaseStrategy.sol#L234)\n", - "first_markdown_element": "contracts/v2/strategies/DsrBaseStrategy.sol#L232-L240", - "id": "454d865e052aca959243bb1efd05ac66e554972fa7e836d96538611e2b7a6e07", + "description": "Reentrancy in LockedOGTemple.withdrawFor(address,uint256) (contracts/deprecated/LockedOGTemple.sol#62-81):\n\tExternal calls:\n\t- SafeERC20.safeTransfer(OG_TEMPLE,_staker,entry.BalanceOGTemple) (contracts/deprecated/LockedOGTemple.sol#79)\n\tEvent emitted after the call(s):\n\t- OGTempleWithdraw(_staker,entry.BalanceOGTemple) (contracts/deprecated/LockedOGTemple.sol#80)\n", + "markdown": "Reentrancy in [LockedOGTemple.withdrawFor(address,uint256)](contracts/deprecated/LockedOGTemple.sol#L62-L81):\n\tExternal calls:\n\t- [SafeERC20.safeTransfer(OG_TEMPLE,_staker,entry.BalanceOGTemple)](contracts/deprecated/LockedOGTemple.sol#L79)\n\tEvent emitted after the call(s):\n\t- [OGTempleWithdraw(_staker,entry.BalanceOGTemple)](contracts/deprecated/LockedOGTemple.sol#L80)\n", + "first_markdown_element": "contracts/deprecated/LockedOGTemple.sol#L62-L81", + "id": "1121dbdb9cb432f782fa1dcd86b226568d78c9cf57bb807ccdc10360eed217f4", "check": "reentrancy-events", "impact": "Low", "confidence": "Medium" @@ -48795,7 +43360,7 @@ "start": 1781, "length": 248, "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [58, 59, 60, 61, 62], @@ -48810,7 +43375,7 @@ "start": 279, "length": 4653, "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ @@ -48839,7 +43404,7 @@ "start": 1916, "length": 51, "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [60], @@ -48854,7 +43419,7 @@ "start": 1781, "length": 248, "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [58, 59, 60, 61, 62], @@ -48869,7 +43434,7 @@ "start": 279, "length": 4653, "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ @@ -48901,7 +43466,7 @@ "start": 1977, "length": 45, "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [61], @@ -48916,7 +43481,7 @@ "start": 1781, "length": 248, "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [58, 59, 60, 61, 62], @@ -48931,7 +43496,7 @@ "start": 279, "length": 4653, "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", "is_dependency": false, "lines": [ @@ -48974,7 +43539,7 @@ "start": 1910, "length": 248, "filename_relative": "contracts/admin/TempleTeamPaymentsV2.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsV2.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsV2.sol", "filename_short": "contracts/admin/TempleTeamPaymentsV2.sol", "is_dependency": false, "lines": [59, 60, 61, 62, 63], @@ -48989,7 +43554,7 @@ "start": 346, "length": 2589, "filename_relative": "contracts/admin/TempleTeamPaymentsV2.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsV2.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsV2.sol", "filename_short": "contracts/admin/TempleTeamPaymentsV2.sol", "is_dependency": false, "lines": [ @@ -49013,7 +43578,7 @@ "start": 2045, "length": 51, "filename_relative": "contracts/admin/TempleTeamPaymentsV2.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsV2.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsV2.sol", "filename_short": "contracts/admin/TempleTeamPaymentsV2.sol", "is_dependency": false, "lines": [61], @@ -49028,7 +43593,7 @@ "start": 1910, "length": 248, "filename_relative": "contracts/admin/TempleTeamPaymentsV2.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsV2.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsV2.sol", "filename_short": "contracts/admin/TempleTeamPaymentsV2.sol", "is_dependency": false, "lines": [59, 60, 61, 62, 63], @@ -49043,7 +43608,7 @@ "start": 346, "length": 2589, "filename_relative": "contracts/admin/TempleTeamPaymentsV2.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsV2.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsV2.sol", "filename_short": "contracts/admin/TempleTeamPaymentsV2.sol", "is_dependency": false, "lines": [ @@ -49071,7 +43636,7 @@ "start": 2106, "length": 45, "filename_relative": "contracts/admin/TempleTeamPaymentsV2.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsV2.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsV2.sol", "filename_short": "contracts/admin/TempleTeamPaymentsV2.sol", "is_dependency": false, "lines": [62], @@ -49086,7 +43651,7 @@ "start": 1910, "length": 248, "filename_relative": "contracts/admin/TempleTeamPaymentsV2.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsV2.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsV2.sol", "filename_short": "contracts/admin/TempleTeamPaymentsV2.sol", "is_dependency": false, "lines": [59, 60, 61, 62, 63], @@ -49101,7 +43666,7 @@ "start": 346, "length": 2589, "filename_relative": "contracts/admin/TempleTeamPaymentsV2.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsV2.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsV2.sol", "filename_short": "contracts/admin/TempleTeamPaymentsV2.sol", "is_dependency": false, "lines": [ @@ -49135,347 +43700,13 @@ "elements": [ { "type": "function", - "name": "adhocPayment", - "source_mapping": { - "start": 2841, - "length": 284, - "filename_relative": "contracts/admin/TempleTeamPayments.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPayments.sol", - "filename_short": "contracts/admin/TempleTeamPayments.sol", - "is_dependency": false, - "lines": [83, 84, 85, 86, 87, 88], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleTeamPayments", - "source_mapping": { - "start": 247, - "length": 3130, - "filename_relative": "contracts/admin/TempleTeamPayments.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPayments.sol", - "filename_short": "contracts/admin/TempleTeamPayments.sol", - "is_dependency": false, - "lines": [ - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "adhocPayment(address,uint256)" - } - }, - { - "type": "node", - "name": "SafeERC20.safeTransfer(TEMPLE,_to,_amount)", - "source_mapping": { - "start": 3038, - "length": 44, - "filename_relative": "contracts/admin/TempleTeamPayments.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPayments.sol", - "filename_short": "contracts/admin/TempleTeamPayments.sol", - "is_dependency": false, - "lines": [86], - "starting_column": 9, - "ending_column": 53 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "adhocPayment", - "source_mapping": { - "start": 2841, - "length": 284, - "filename_relative": "contracts/admin/TempleTeamPayments.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPayments.sol", - "filename_short": "contracts/admin/TempleTeamPayments.sol", - "is_dependency": false, - "lines": [83, 84, 85, 86, 87, 88], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleTeamPayments", - "source_mapping": { - "start": 247, - "length": 3130, - "filename_relative": "contracts/admin/TempleTeamPayments.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPayments.sol", - "filename_short": "contracts/admin/TempleTeamPayments.sol", - "is_dependency": false, - "lines": [ - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "adhocPayment(address,uint256)" - } - } - }, - "additional_fields": { "underlying_type": "external_calls" } - }, - { - "type": "node", - "name": "Claimed(_to,_amount)", - "source_mapping": { - "start": 3092, - "length": 26, - "filename_relative": "contracts/admin/TempleTeamPayments.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPayments.sol", - "filename_short": "contracts/admin/TempleTeamPayments.sol", - "is_dependency": false, - "lines": [87], - "starting_column": 9, - "ending_column": 35 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "adhocPayment", - "source_mapping": { - "start": 2841, - "length": 284, - "filename_relative": "contracts/admin/TempleTeamPayments.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPayments.sol", - "filename_short": "contracts/admin/TempleTeamPayments.sol", - "is_dependency": false, - "lines": [83, 84, 85, 86, 87, 88], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleTeamPayments", - "source_mapping": { - "start": 247, - "length": 3130, - "filename_relative": "contracts/admin/TempleTeamPayments.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPayments.sol", - "filename_short": "contracts/admin/TempleTeamPayments.sol", - "is_dependency": false, - "lines": [ - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "adhocPayment(address,uint256)" - } - } - }, - "additional_fields": { "underlying_type": "event" } - } - ], - "description": "Reentrancy in TempleTeamPayments.adhocPayment(address,uint256) (contracts/admin/TempleTeamPayments.sol#83-88):\n\tExternal calls:\n\t- SafeERC20.safeTransfer(TEMPLE,_to,_amount) (contracts/admin/TempleTeamPayments.sol#86)\n\tEvent emitted after the call(s):\n\t- Claimed(_to,_amount) (contracts/admin/TempleTeamPayments.sol#87)\n", - "markdown": "Reentrancy in [TempleTeamPayments.adhocPayment(address,uint256)](contracts/admin/TempleTeamPayments.sol#L83-L88):\n\tExternal calls:\n\t- [SafeERC20.safeTransfer(TEMPLE,_to,_amount)](contracts/admin/TempleTeamPayments.sol#L86)\n\tEvent emitted after the call(s):\n\t- [Claimed(_to,_amount)](contracts/admin/TempleTeamPayments.sol#L87)\n", - "first_markdown_element": "contracts/admin/TempleTeamPayments.sol#L83-L88", - "id": "081d1dfdebd16cea0856cb988c13c62e2d2d6e5c3fbd25c36620643fb11a0000", - "check": "reentrancy-events", - "impact": "Low", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "claim", - "source_mapping": { - "start": 2480, - "length": 355, - "filename_relative": "contracts/admin/TempleTeamPayments.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPayments.sol", - "filename_short": "contracts/admin/TempleTeamPayments.sol", - "is_dependency": false, - "lines": [74, 75, 76, 77, 78, 79, 80, 81], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleTeamPayments", - "source_mapping": { - "start": 247, - "length": 3130, - "filename_relative": "contracts/admin/TempleTeamPayments.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPayments.sol", - "filename_short": "contracts/admin/TempleTeamPayments.sol", - "is_dependency": false, - "lines": [ - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "claim()" - } - }, - { - "type": "node", - "name": "SafeERC20.safeTransfer(TEMPLE,msg.sender,claimable)", - "source_mapping": { - "start": 2730, - "length": 53, - "filename_relative": "contracts/admin/TempleTeamPayments.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPayments.sol", - "filename_short": "contracts/admin/TempleTeamPayments.sol", - "is_dependency": false, - "lines": [79], - "starting_column": 9, - "ending_column": 62 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "claim", - "source_mapping": { - "start": 2480, - "length": 355, - "filename_relative": "contracts/admin/TempleTeamPayments.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPayments.sol", - "filename_short": "contracts/admin/TempleTeamPayments.sol", - "is_dependency": false, - "lines": [74, 75, 76, 77, 78, 79, 80, 81], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleTeamPayments", - "source_mapping": { - "start": 247, - "length": 3130, - "filename_relative": "contracts/admin/TempleTeamPayments.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPayments.sol", - "filename_short": "contracts/admin/TempleTeamPayments.sol", - "is_dependency": false, - "lines": [ - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "claim()" - } - } - }, - "additional_fields": { "underlying_type": "external_calls" } - }, - { - "type": "node", - "name": "Claimed(msg.sender,claimable)", - "source_mapping": { - "start": 2793, - "length": 35, - "filename_relative": "contracts/admin/TempleTeamPayments.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPayments.sol", - "filename_short": "contracts/admin/TempleTeamPayments.sol", - "is_dependency": false, - "lines": [80], - "starting_column": 9, - "ending_column": 44 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "claim", - "source_mapping": { - "start": 2480, - "length": 355, - "filename_relative": "contracts/admin/TempleTeamPayments.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPayments.sol", - "filename_short": "contracts/admin/TempleTeamPayments.sol", - "is_dependency": false, - "lines": [74, 75, 76, 77, 78, 79, 80, 81], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleTeamPayments", - "source_mapping": { - "start": 247, - "length": 3130, - "filename_relative": "contracts/admin/TempleTeamPayments.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPayments.sol", - "filename_short": "contracts/admin/TempleTeamPayments.sol", - "is_dependency": false, - "lines": [ - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "claim()" - } - } - }, - "additional_fields": { "underlying_type": "event" } - } - ], - "description": "Reentrancy in TempleTeamPayments.claim() (contracts/admin/TempleTeamPayments.sol#74-81):\n\tExternal calls:\n\t- SafeERC20.safeTransfer(TEMPLE,msg.sender,claimable) (contracts/admin/TempleTeamPayments.sol#79)\n\tEvent emitted after the call(s):\n\t- Claimed(msg.sender,claimable) (contracts/admin/TempleTeamPayments.sol#80)\n", - "markdown": "Reentrancy in [TempleTeamPayments.claim()](contracts/admin/TempleTeamPayments.sol#L74-L81):\n\tExternal calls:\n\t- [SafeERC20.safeTransfer(TEMPLE,msg.sender,claimable)](contracts/admin/TempleTeamPayments.sol#L79)\n\tEvent emitted after the call(s):\n\t- [Claimed(msg.sender,claimable)](contracts/admin/TempleTeamPayments.sol#L80)\n", - "first_markdown_element": "contracts/admin/TempleTeamPayments.sol#L74-L81", - "id": "5122a045d2e21480d0560d2c58820df1a98500cfc6453d3088b53c090e7d16e3", - "check": "reentrancy-events", - "impact": "Low", - "confidence": "Medium" - }, - { - "elements": [ - { - "type": "function", - "name": "claimFor", + "name": "_update", "source_mapping": { - "start": 2718, - "length": 611, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 3107, + "length": 847, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], "starting_column": 5, @@ -49484,111 +43715,60 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryFarmingRevenue", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 547, - "length": 3059, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "claimFor(address)" + "signature": "_update(uint256,uint256,uint112,uint112)" } }, { "type": "node", - "name": "exposure.mint(account,unclaimedScaled / SCALING_FACTOR)", - "source_mapping": { - "start": 3194, - "length": 56, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", - "is_dependency": false, - "lines": [91], - "starting_column": 9, - "ending_column": 65 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "claimFor", - "source_mapping": { - "start": 2718, - "length": 611, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", - "is_dependency": false, - "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TreasuryFarmingRevenue", - "source_mapping": { - "start": 547, - "length": 3059, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", - "is_dependency": false, - "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "claimFor(address)" - } - } - }, - "additional_fields": { "underlying_type": "external_calls" } - }, - { - "type": "node", - "name": "RevenueClaimed(account,unclaimedScaled / SCALING_FACTOR)", + "name": "timeElapsed > 0 && _reserve0 != 0 && _reserve1 != 0", "source_mapping": { - "start": 3260, - "length": 62, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 3460, + "length": 51, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, - "lines": [92], - "starting_column": 9, - "ending_column": 71 + "lines": [84], + "starting_column": 13, + "ending_column": 64 }, "type_specific_fields": { "parent": { "type": "function", - "name": "claimFor", - "source_mapping": { - "start": 2718, - "length": 611, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "name": "_update", + "source_mapping": { + "start": 3107, + "length": 847, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], "starting_column": 5, @@ -49597,38 +43777,45 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryFarmingRevenue", + "name": "TempleUniswapV2Pair", "source_mapping": { - "start": 547, - "length": 3059, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 440, + "length": 8733, + "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "claimFor(address)" + "signature": "_update(uint256,uint256,uint112,uint112)" } } - }, - "additional_fields": { "underlying_type": "event" } + } } ], - "description": "Reentrancy in TreasuryFarmingRevenue.claimFor(address) (contracts/core/TreasuryFarmingRevenue.sol#80-93):\n\tExternal calls:\n\t- exposure.mint(account,unclaimedScaled / SCALING_FACTOR) (contracts/core/TreasuryFarmingRevenue.sol#91)\n\tEvent emitted after the call(s):\n\t- RevenueClaimed(account,unclaimedScaled / SCALING_FACTOR) (contracts/core/TreasuryFarmingRevenue.sol#92)\n", - "markdown": "Reentrancy in [TreasuryFarmingRevenue.claimFor(address)](contracts/core/TreasuryFarmingRevenue.sol#L80-L93):\n\tExternal calls:\n\t- [exposure.mint(account,unclaimedScaled / SCALING_FACTOR)](contracts/core/TreasuryFarmingRevenue.sol#L91)\n\tEvent emitted after the call(s):\n\t- [RevenueClaimed(account,unclaimedScaled / SCALING_FACTOR)](contracts/core/TreasuryFarmingRevenue.sol#L92)\n", - "first_markdown_element": "contracts/core/TreasuryFarmingRevenue.sol#L80-L93", - "id": "d8563f03511a537e7bffa702571db6c52a8f76800b24690b23270dd982c4ccc2", - "check": "reentrancy-events", + "description": "TempleUniswapV2Pair._update(uint256,uint256,uint112,uint112) (contracts/amm/TempleUniswapV2Pair.sol#80-93) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- timeElapsed > 0 && _reserve0 != 0 && _reserve1 != 0 (contracts/amm/TempleUniswapV2Pair.sol#84)\n", + "markdown": "[TempleUniswapV2Pair._update(uint256,uint256,uint112,uint112)](contracts/amm/TempleUniswapV2Pair.sol#L80-L93) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [timeElapsed > 0 && _reserve0 != 0 && _reserve1 != 0](contracts/amm/TempleUniswapV2Pair.sol#L84)\n", + "first_markdown_element": "contracts/amm/TempleUniswapV2Pair.sol#L80-L93", + "id": "3e4c1fb2f0df938570805f2a5513be58a1af7dd63232a6822178ed2775dc9957", + "check": "timestamp", "impact": "Low", "confidence": "Medium" }, @@ -49636,186 +43823,215 @@ "elements": [ { "type": "function", - "name": "createExposure", + "name": "setOriginTime", "source_mapping": { - "start": 1322, - "length": 415, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 963, + "length": 253, + "filename_relative": "contracts/nexus/BaseSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/BaseSacrifice.sol", + "filename_short": "contracts/nexus/BaseSacrifice.sol", "is_dependency": false, - "lines": [45, 46, 47, 48, 49, 50, 51, 52, 53, 54], + "lines": [28, 29, 30, 31, 32], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "OpsManager", + "name": "BaseSacrifice", "source_mapping": { - "start": 388, - "length": 6435, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 372, + "length": 3638, + "filename_relative": "contracts/nexus/BaseSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/BaseSacrifice.sol", + "filename_short": "contracts/nexus/BaseSacrifice.sol", "is_dependency": false, "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "createExposure(string,string,IERC20)" + "signature": "setOriginTime(uint64)" } }, { "type": "node", - "name": "exposure = OpsManagerLib.createExposure(name,symbol,revalToken,pools)", + "name": "_originTime < block.timestamp", "source_mapping": { - "start": 1526, - "length": 81, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 1057, + "length": 29, + "filename_relative": "contracts/nexus/BaseSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/BaseSacrifice.sol", + "filename_short": "contracts/nexus/BaseSacrifice.sol", "is_dependency": false, - "lines": [51], - "starting_column": 9, - "ending_column": 90 + "lines": [29], + "starting_column": 13, + "ending_column": 42 }, "type_specific_fields": { "parent": { "type": "function", - "name": "createExposure", + "name": "setOriginTime", "source_mapping": { - "start": 1322, - "length": 415, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 963, + "length": 253, + "filename_relative": "contracts/nexus/BaseSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/BaseSacrifice.sol", + "filename_short": "contracts/nexus/BaseSacrifice.sol", "is_dependency": false, - "lines": [45, 46, 47, 48, 49, 50, 51, 52, 53, 54], + "lines": [28, 29, 30, 31, 32], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "OpsManager", + "name": "BaseSacrifice", "source_mapping": { - "start": 388, - "length": 6435, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 372, + "length": 3638, + "filename_relative": "contracts/nexus/BaseSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/BaseSacrifice.sol", + "filename_short": "contracts/nexus/BaseSacrifice.sol", "is_dependency": false, "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "createExposure(string,string,IERC20)" + "signature": "setOriginTime(uint64)" } } + } + } + ], + "description": "BaseSacrifice.setOriginTime(uint64) (contracts/nexus/BaseSacrifice.sol#28-32) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- _originTime < block.timestamp (contracts/nexus/BaseSacrifice.sol#29)\n", + "markdown": "[BaseSacrifice.setOriginTime(uint64)](contracts/nexus/BaseSacrifice.sol#L28-L32) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [_originTime < block.timestamp](contracts/nexus/BaseSacrifice.sol#L29)\n", + "first_markdown_element": "contracts/nexus/BaseSacrifice.sol#L28-L32", + "id": "f3427f0e09c05370d974b6b8c6dc77586c71f1b3139594985f922b66d946b6c4", + "check": "timestamp", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "getPrice", + "source_mapping": { + "start": 2602, + "length": 230, + "filename_relative": "contracts/nexus/BaseSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/BaseSacrifice.sol", + "filename_short": "contracts/nexus/BaseSacrifice.sol", + "is_dependency": false, + "lines": [65, 66, 67, 68, 69, 70], + "starting_column": 5, + "ending_column": 6 }, - "additional_fields": { "underlying_type": "external_calls" } + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "BaseSacrifice", + "source_mapping": { + "start": 372, + "length": 3638, + "filename_relative": "contracts/nexus/BaseSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/BaseSacrifice.sol", + "filename_short": "contracts/nexus/BaseSacrifice.sol", + "is_dependency": false, + "lines": [ + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "getPrice()" + } }, { "type": "node", - "name": "CreateExposure(address(exposure),address(pools[revalToken]))", + "name": "block.timestamp < originTime && customPrice == 0", "source_mapping": { - "start": 1664, - "length": 66, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 2676, + "length": 48, + "filename_relative": "contracts/nexus/BaseSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/BaseSacrifice.sol", + "filename_short": "contracts/nexus/BaseSacrifice.sol", "is_dependency": false, - "lines": [53], - "starting_column": 9, - "ending_column": 75 + "lines": [66], + "starting_column": 13, + "ending_column": 61 }, "type_specific_fields": { "parent": { "type": "function", - "name": "createExposure", + "name": "getPrice", "source_mapping": { - "start": 1322, - "length": 415, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 2602, + "length": 230, + "filename_relative": "contracts/nexus/BaseSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/BaseSacrifice.sol", + "filename_short": "contracts/nexus/BaseSacrifice.sol", "is_dependency": false, - "lines": [45, 46, 47, 48, 49, 50, 51, 52, 53, 54], + "lines": [65, 66, 67, 68, 69, 70], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "OpsManager", + "name": "BaseSacrifice", "source_mapping": { - "start": 388, - "length": 6435, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 372, + "length": 3638, + "filename_relative": "contracts/nexus/BaseSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/BaseSacrifice.sol", + "filename_short": "contracts/nexus/BaseSacrifice.sol", "is_dependency": false, "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "createExposure(string,string,IERC20)" + "signature": "getPrice()" } } - }, - "additional_fields": { "underlying_type": "event" } + } } ], - "description": "Reentrancy in OpsManager.createExposure(string,string,IERC20) (contracts/core/OpsManager.sol#45-54):\n\tExternal calls:\n\t- exposure = OpsManagerLib.createExposure(name,symbol,revalToken,pools) (contracts/core/OpsManager.sol#51)\n\tEvent emitted after the call(s):\n\t- CreateExposure(address(exposure),address(pools[revalToken])) (contracts/core/OpsManager.sol#53)\n", - "markdown": "Reentrancy in [OpsManager.createExposure(string,string,IERC20)](contracts/core/OpsManager.sol#L45-L54):\n\tExternal calls:\n\t- [exposure = OpsManagerLib.createExposure(name,symbol,revalToken,pools)](contracts/core/OpsManager.sol#L51)\n\tEvent emitted after the call(s):\n\t- [CreateExposure(address(exposure),address(pools[revalToken]))](contracts/core/OpsManager.sol#L53)\n", - "first_markdown_element": "contracts/core/OpsManager.sol#L45-L54", - "id": "4c0848edc4ba02c1e3d1ebe7d87498d178e87ad8a446b774ebd37d6847435833", - "check": "reentrancy-events", + "description": "BaseSacrifice.getPrice() (contracts/nexus/BaseSacrifice.sol#65-70) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- block.timestamp < originTime && customPrice == 0 (contracts/nexus/BaseSacrifice.sol#66)\n", + "markdown": "[BaseSacrifice.getPrice()](contracts/nexus/BaseSacrifice.sol#L65-L70) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [block.timestamp < originTime && customPrice == 0](contracts/nexus/BaseSacrifice.sol#L66)\n", + "first_markdown_element": "contracts/nexus/BaseSacrifice.sol#L65-L70", + "id": "63c51f9d42daf6de5a5e6c02b38c97cd82dd9e89b74bba859e27ec0faf26ff48", + "check": "timestamp", "impact": "Low", "confidence": "Medium" }, @@ -49823,195 +44039,213 @@ "elements": [ { "type": "function", - "name": "createVaultInstance", + "name": "_muldivRoundUp", "source_mapping": { - "start": 1960, - "length": 804, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 3701, + "length": 307, + "filename_relative": "contracts/nexus/BaseSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/BaseSacrifice.sol", + "filename_short": "contracts/nexus/BaseSacrifice.sol", "is_dependency": false, - "lines": [ - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89 - ], + "lines": [92, 93, 94, 95, 96, 97, 98], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "OpsManager", + "name": "BaseSacrifice", "source_mapping": { - "start": 388, - "length": 6435, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 372, + "length": 3638, + "filename_relative": "contracts/nexus/BaseSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/BaseSacrifice.sol", + "filename_short": "contracts/nexus/BaseSacrifice.sol", "is_dependency": false, "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "createVaultInstance(string,string,uint256,uint256,Rational,uint256)" + "signature": "_muldivRoundUp(uint256,uint256,uint256)" } }, { "type": "node", - "name": "templeExposure.setMinterState(address(vault),true)", + "name": "mulmod(uint256,uint256,uint256)(x,y,denominator) > 0", "source_mapping": { - "start": 2656, - "length": 51, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 3935, + "length": 29, + "filename_relative": "contracts/nexus/BaseSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/BaseSacrifice.sol", + "filename_short": "contracts/nexus/BaseSacrifice.sol", "is_dependency": false, - "lines": [87], - "starting_column": 9, - "ending_column": 60 + "lines": [95], + "starting_column": 13, + "ending_column": 42 }, "type_specific_fields": { "parent": { "type": "function", - "name": "createVaultInstance", + "name": "_muldivRoundUp", "source_mapping": { - "start": 1960, - "length": 804, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 3701, + "length": 307, + "filename_relative": "contracts/nexus/BaseSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/BaseSacrifice.sol", + "filename_short": "contracts/nexus/BaseSacrifice.sol", "is_dependency": false, - "lines": [ - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89 - ], + "lines": [92, 93, 94, 95, 96, 97, 98], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "OpsManager", + "name": "BaseSacrifice", "source_mapping": { - "start": 388, - "length": 6435, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 372, + "length": 3638, + "filename_relative": "contracts/nexus/BaseSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/BaseSacrifice.sol", + "filename_short": "contracts/nexus/BaseSacrifice.sol", "is_dependency": false, "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "createVaultInstance(string,string,uint256,uint256,Rational,uint256)" + "signature": "_muldivRoundUp(uint256,uint256,uint256)" } } + } + } + ], + "description": "BaseSacrifice._muldivRoundUp(uint256,uint256,uint256) (contracts/nexus/BaseSacrifice.sol#92-98) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- mulmod(uint256,uint256,uint256)(x,y,denominator) > 0 (contracts/nexus/BaseSacrifice.sol#95)\n", + "markdown": "[BaseSacrifice._muldivRoundUp(uint256,uint256,uint256)](contracts/nexus/BaseSacrifice.sol#L92-L98) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [mulmod(uint256,uint256,uint256)(x,y,denominator) > 0](contracts/nexus/BaseSacrifice.sol#L95)\n", + "first_markdown_element": "contracts/nexus/BaseSacrifice.sol#L92-L98", + "id": "2d91f19981ec17ff98381c9ddeb6c6d5e4b28c23ff05b263e49404938b4a8b31", + "check": "timestamp", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "setOriginTime", + "source_mapping": { + "start": 1393, + "length": 253, + "filename_relative": "contracts/nexus/PartnerZeroSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/PartnerZeroSacrifice.sol", + "filename_short": "contracts/nexus/PartnerZeroSacrifice.sol", + "is_dependency": false, + "lines": [40, 41, 42, 43, 44], + "starting_column": 5, + "ending_column": 6 }, - "additional_fields": { "underlying_type": "external_calls" } + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "PartnerZeroSacrifice", + "source_mapping": { + "start": 545, + "length": 2237, + "filename_relative": "contracts/nexus/PartnerZeroSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/PartnerZeroSacrifice.sol", + "filename_short": "contracts/nexus/PartnerZeroSacrifice.sol", + "is_dependency": false, + "lines": [ + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "setOriginTime(uint64)" + } }, { "type": "node", - "name": "CreateVaultInstance(address(vault))", + "name": "_originTime < block.timestamp", "source_mapping": { - "start": 2717, - "length": 40, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 1487, + "length": 29, + "filename_relative": "contracts/nexus/PartnerZeroSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/PartnerZeroSacrifice.sol", + "filename_short": "contracts/nexus/PartnerZeroSacrifice.sol", "is_dependency": false, - "lines": [88], - "starting_column": 9, - "ending_column": 49 + "lines": [41], + "starting_column": 13, + "ending_column": 42 }, "type_specific_fields": { "parent": { "type": "function", - "name": "createVaultInstance", + "name": "setOriginTime", "source_mapping": { - "start": 1960, - "length": 804, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 1393, + "length": 253, + "filename_relative": "contracts/nexus/PartnerZeroSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/PartnerZeroSacrifice.sol", + "filename_short": "contracts/nexus/PartnerZeroSacrifice.sol", "is_dependency": false, - "lines": [ - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89 - ], + "lines": [40, 41, 42, 43, 44], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "OpsManager", + "name": "PartnerZeroSacrifice", "source_mapping": { - "start": 388, - "length": 6435, - "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", - "filename_short": "contracts/core/OpsManager.sol", + "start": 545, + "length": 2237, + "filename_relative": "contracts/nexus/PartnerZeroSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/PartnerZeroSacrifice.sol", + "filename_short": "contracts/nexus/PartnerZeroSacrifice.sol", "is_dependency": false, "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184 + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "createVaultInstance(string,string,uint256,uint256,Rational,uint256)" + "signature": "setOriginTime(uint64)" } } - }, - "additional_fields": { "underlying_type": "event" } + } } ], - "description": "Reentrancy in OpsManager.createVaultInstance(string,string,uint256,uint256,Rational,uint256) (contracts/core/OpsManager.sol#63-89):\n\tExternal calls:\n\t- templeExposure.setMinterState(address(vault),true) (contracts/core/OpsManager.sol#87)\n\tEvent emitted after the call(s):\n\t- CreateVaultInstance(address(vault)) (contracts/core/OpsManager.sol#88)\n", - "markdown": "Reentrancy in [OpsManager.createVaultInstance(string,string,uint256,uint256,Rational,uint256)](contracts/core/OpsManager.sol#L63-L89):\n\tExternal calls:\n\t- [templeExposure.setMinterState(address(vault),true)](contracts/core/OpsManager.sol#L87)\n\tEvent emitted after the call(s):\n\t- [CreateVaultInstance(address(vault))](contracts/core/OpsManager.sol#L88)\n", - "first_markdown_element": "contracts/core/OpsManager.sol#L63-L89", - "id": "df955297def3da87ad4df693d7ae4b7e7f50baa97a7182d7ae0ddc97fdb09441", - "check": "reentrancy-events", + "description": "PartnerZeroSacrifice.setOriginTime(uint64) (contracts/nexus/PartnerZeroSacrifice.sol#40-44) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- _originTime < block.timestamp (contracts/nexus/PartnerZeroSacrifice.sol#41)\n", + "markdown": "[PartnerZeroSacrifice.setOriginTime(uint64)](contracts/nexus/PartnerZeroSacrifice.sol#L40-L44) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [_originTime < block.timestamp](contracts/nexus/PartnerZeroSacrifice.sol#L41)\n", + "first_markdown_element": "contracts/nexus/PartnerZeroSacrifice.sol#L40-L44", + "id": "d379e3ebeb75ae70a5ed27551abc0309925bdf642aa06e1f3ff6ccf5086e6a74", + "check": "timestamp", "impact": "Low", "confidence": "Medium" }, @@ -50019,224 +44253,208 @@ "elements": [ { "type": "function", - "name": "decreaseShares", + "name": "sacrifice", "source_mapping": { - "start": 2355, - "length": 302, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 2117, + "length": 663, + "filename_relative": "contracts/nexus/PartnerZeroSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/PartnerZeroSacrifice.sol", + "filename_short": "contracts/nexus/PartnerZeroSacrifice.sol", "is_dependency": false, - "lines": [69, 70, 71, 72, 73, 74, 75, 76, 77], + "lines": [61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryFarmingRevenue", + "name": "PartnerZeroSacrifice", "source_mapping": { - "start": 547, - "length": 3059, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 545, + "length": 2237, + "filename_relative": "contracts/nexus/PartnerZeroSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/PartnerZeroSacrifice.sol", + "filename_short": "contracts/nexus/PartnerZeroSacrifice.sol", "is_dependency": false, "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100 + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "decreaseShares(address,uint256)" + "signature": "sacrifice(uint256,address)" } }, { "type": "node", - "name": "claimFor(account)", + "name": "block.timestamp < originTime", "source_mapping": { - "start": 2441, - "length": 17, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 2270, + "length": 28, + "filename_relative": "contracts/nexus/PartnerZeroSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/PartnerZeroSacrifice.sol", + "filename_short": "contracts/nexus/PartnerZeroSacrifice.sol", "is_dependency": false, - "lines": [70], - "starting_column": 9, - "ending_column": 26 + "lines": [63], + "starting_column": 13, + "ending_column": 41 }, "type_specific_fields": { "parent": { "type": "function", - "name": "decreaseShares", + "name": "sacrifice", "source_mapping": { - "start": 2355, - "length": 302, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 2117, + "length": 663, + "filename_relative": "contracts/nexus/PartnerZeroSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/PartnerZeroSacrifice.sol", + "filename_short": "contracts/nexus/PartnerZeroSacrifice.sol", "is_dependency": false, - "lines": [69, 70, 71, 72, 73, 74, 75, 76, 77], + "lines": [61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryFarmingRevenue", + "name": "PartnerZeroSacrifice", "source_mapping": { - "start": 547, - "length": 3059, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 545, + "length": 2237, + "filename_relative": "contracts/nexus/PartnerZeroSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/PartnerZeroSacrifice.sol", + "filename_short": "contracts/nexus/PartnerZeroSacrifice.sol", "is_dependency": false, "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100 + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "decreaseShares(address,uint256)" + "signature": "sacrifice(uint256,address)" } } - }, - "additional_fields": { "underlying_type": "external_calls" } - }, + } + } + ], + "description": "PartnerZeroSacrifice.sacrifice(uint256,address) (contracts/nexus/PartnerZeroSacrifice.sol#61-74) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- block.timestamp < originTime (contracts/nexus/PartnerZeroSacrifice.sol#63)\n", + "markdown": "[PartnerZeroSacrifice.sacrifice(uint256,address)](contracts/nexus/PartnerZeroSacrifice.sol#L61-L74) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [block.timestamp < originTime](contracts/nexus/PartnerZeroSacrifice.sol#L63)\n", + "first_markdown_element": "contracts/nexus/PartnerZeroSacrifice.sol#L61-L74", + "id": "584e11e2db802607e2d56b33b10685ae1c0625bbd7dc3b92ceaff782fe60a2cc", + "check": "timestamp", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ { - "type": "node", - "name": "exposure.mint(account,unclaimedScaled / SCALING_FACTOR)", + "type": "function", + "name": "sacrifice", "source_mapping": { - "start": 3194, - "length": 56, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 1858, + "length": 477, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, - "lines": [91], - "starting_column": 9, - "ending_column": 65 + "lines": [49, 50, 51, 52, 53, 54, 55, 56], + "starting_column": 5, + "ending_column": 6 }, "type_specific_fields": { "parent": { - "type": "function", - "name": "claimFor", + "type": "contract", + "name": "TempleSacrifice", "source_mapping": { - "start": 2718, - "length": 611, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 594, + "length": 1743, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, - "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TreasuryFarmingRevenue", - "source_mapping": { - "start": 547, - "length": 3059, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", - "is_dependency": false, - "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "claimFor(address)" + "lines": [ + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58 + ], + "starting_column": 1, + "ending_column": 0 } - } - }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } + }, + "signature": "sacrifice(uint256,address)" + } }, { "type": "node", - "name": "DecreaseShares(account,amount)", + "name": "block.timestamp < originTime", "source_mapping": { - "start": 2614, - "length": 36, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 1940, + "length": 28, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, - "lines": [76], - "starting_column": 9, - "ending_column": 45 + "lines": [50], + "starting_column": 13, + "ending_column": 41 }, "type_specific_fields": { "parent": { "type": "function", - "name": "decreaseShares", + "name": "sacrifice", "source_mapping": { - "start": 2355, - "length": 302, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 1858, + "length": 477, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, - "lines": [69, 70, 71, 72, 73, 74, 75, 76, 77], + "lines": [49, 50, 51, 52, 53, 54, 55, 56], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryFarmingRevenue", + "name": "TempleSacrifice", "source_mapping": { - "start": 547, - "length": 3059, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 594, + "length": 1743, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", "is_dependency": false, "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100 + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "decreaseShares(address,uint256)" + "signature": "sacrifice(uint256,address)" } } - }, - "additional_fields": { "underlying_type": "event" } + } } ], - "description": "Reentrancy in TreasuryFarmingRevenue.decreaseShares(address,uint256) (contracts/core/TreasuryFarmingRevenue.sol#69-77):\n\tExternal calls:\n\t- claimFor(account) (contracts/core/TreasuryFarmingRevenue.sol#70)\n\t\t- exposure.mint(account,unclaimedScaled / SCALING_FACTOR) (contracts/core/TreasuryFarmingRevenue.sol#91)\n\tEvent emitted after the call(s):\n\t- DecreaseShares(account,amount) (contracts/core/TreasuryFarmingRevenue.sol#76)\n", - "markdown": "Reentrancy in [TreasuryFarmingRevenue.decreaseShares(address,uint256)](contracts/core/TreasuryFarmingRevenue.sol#L69-L77):\n\tExternal calls:\n\t- [claimFor(account)](contracts/core/TreasuryFarmingRevenue.sol#L70)\n\t\t- [exposure.mint(account,unclaimedScaled / SCALING_FACTOR)](contracts/core/TreasuryFarmingRevenue.sol#L91)\n\tEvent emitted after the call(s):\n\t- [DecreaseShares(account,amount)](contracts/core/TreasuryFarmingRevenue.sol#L76)\n", - "first_markdown_element": "contracts/core/TreasuryFarmingRevenue.sol#L69-L77", - "id": "10f84609b6b87bcc768aa396dd6ac6045289ca78c3cb64ee97e4437cfb7c006a", - "check": "reentrancy-events", + "description": "TempleSacrifice.sacrifice(uint256,address) (contracts/nexus/TempleSacrifice.sol#49-56) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- block.timestamp < originTime (contracts/nexus/TempleSacrifice.sol#50)\n", + "markdown": "[TempleSacrifice.sacrifice(uint256,address)](contracts/nexus/TempleSacrifice.sol#L49-L56) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [block.timestamp < originTime](contracts/nexus/TempleSacrifice.sol#L50)\n", + "first_markdown_element": "contracts/nexus/TempleSacrifice.sol#L49-L56", + "id": "15372902ffb3ae33e5ff69efa885d05686c6556579f604b773efafa02584e664", + "check": "timestamp", "impact": "Low", "confidence": "Medium" }, @@ -50244,17 +44462,17 @@ "elements": [ { "type": "function", - "name": "depositFor", + "name": "_initBaseCache", "source_mapping": { - "start": 7408, - "length": 773, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 26049, + "length": 748, + "filename_relative": "contracts/v2/TempleDebtToken.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TempleDebtToken.sol", + "filename_short": "contracts/v2/TempleDebtToken.sol", "is_dependency": false, "lines": [ - 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212 + 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, + 610, 611, 612, 613, 614, 615, 616, 617 ], "starting_column": 5, "ending_column": 6 @@ -50262,66 +44480,108 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "Vault", + "name": "TempleDebtToken", "source_mapping": { - "start": 1161, - "length": 7823, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 2202, + "length": 30641, + "filename_relative": "contracts/v2/TempleDebtToken.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TempleDebtToken.sol", + "filename_short": "contracts/v2/TempleDebtToken.sol", "is_dependency": false, "lines": [ - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233 + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, + 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, + 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, + 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, + 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, + 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, + 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, + 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, + 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, + 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, + 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, + 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, + 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, + 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, + 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, + 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, + 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, + 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, + 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, + 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, + 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, + 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, + 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, + 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, + 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, + 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, + 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, + 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, + 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, + 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, + 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, + 778, 779, 780, 781, 782 ], "starting_column": 1, "ending_column": 2 } }, - "signature": "depositFor(address,uint256)" + "signature": "_initBaseCache(TempleDebtToken.BaseCache)" } }, { "type": "node", - "name": "SafeERC20.safeTransferFrom(templeToken,msg.sender,vaultedTempleAccount,_amount)", + "name": "_timeElapsed > 0", "source_mapping": { - "start": 7964, - "length": 82, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 26435, + "length": 16, + "filename_relative": "contracts/v2/TempleDebtToken.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TempleDebtToken.sol", + "filename_short": "contracts/v2/TempleDebtToken.sol", "is_dependency": false, - "lines": [207], + "lines": [607], "starting_column": 13, - "ending_column": 95 + "ending_column": 29 }, "type_specific_fields": { "parent": { "type": "function", - "name": "depositFor", + "name": "_initBaseCache", "source_mapping": { - "start": 7408, - "length": 773, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 26049, + "length": 748, + "filename_relative": "contracts/v2/TempleDebtToken.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TempleDebtToken.sol", + "filename_short": "contracts/v2/TempleDebtToken.sol", "is_dependency": false, "lines": [ - 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212 + 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, + 610, 611, 612, 613, 614, 615, 616, 617 ], "starting_column": 5, "ending_column": 6 @@ -50329,141 +44589,225 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "Vault", + "name": "TempleDebtToken", "source_mapping": { - "start": 1161, - "length": 7823, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 2202, + "length": 30641, + "filename_relative": "contracts/v2/TempleDebtToken.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TempleDebtToken.sol", + "filename_short": "contracts/v2/TempleDebtToken.sol", "is_dependency": false, "lines": [ - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233 + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, + 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, + 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, + 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, + 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, + 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, + 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, + 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, + 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, + 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, + 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, + 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, + 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, + 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, + 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, + 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, + 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, + 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, + 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, + 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, + 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, + 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, + 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, + 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, + 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, + 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, + 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, + 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, + 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, + 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, + 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, + 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, + 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, + 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, + 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782 ], "starting_column": 1, "ending_column": 2 } }, - "signature": "depositFor(address,uint256)" + "signature": "_initBaseCache(TempleDebtToken.BaseCache)" } } - }, - "additional_fields": { "underlying_type": "external_calls" } - }, + } + } + ], + "description": "TempleDebtToken._initBaseCache(TempleDebtToken.BaseCache) (contracts/v2/TempleDebtToken.sol#597-617) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- _timeElapsed > 0 (contracts/v2/TempleDebtToken.sol#607)\n", + "markdown": "[TempleDebtToken._initBaseCache(TempleDebtToken.BaseCache)](contracts/v2/TempleDebtToken.sol#L597-L617) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [_timeElapsed > 0](contracts/v2/TempleDebtToken.sol#L607)\n", + "first_markdown_element": "contracts/v2/TempleDebtToken.sol#L597-L617", + "id": "31468fb88b544bfa40953f9c670145ae2d6cc30a857f141027542b78efe5314e", + "check": "timestamp", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ { - "type": "node", - "name": "templeExposureToken.mint(address(this),_amount)", + "type": "function", + "name": "_initDebtorCache", "source_mapping": { - "start": 8060, - "length": 48, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 28507, + "length": 2281, + "filename_relative": "contracts/v2/TempleDebtToken.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TempleDebtToken.sol", + "filename_short": "contracts/v2/TempleDebtToken.sol", "is_dependency": false, - "lines": [208], - "starting_column": 13, - "ending_column": 61 + "lines": [ + 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, + 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, + 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, + 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, + 724, 725, 726, 727 + ], + "starting_column": 5, + "ending_column": 6 }, "type_specific_fields": { "parent": { - "type": "function", - "name": "depositFor", + "type": "contract", + "name": "TempleDebtToken", "source_mapping": { - "start": 7408, - "length": 773, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 2202, + "length": 30641, + "filename_relative": "contracts/v2/TempleDebtToken.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TempleDebtToken.sol", + "filename_short": "contracts/v2/TempleDebtToken.sol", "is_dependency": false, "lines": [ - 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212 + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, + 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, + 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, + 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, + 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, + 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, + 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, + 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, + 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, + 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, + 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, + 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, + 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, + 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, + 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, + 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, + 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, + 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, + 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, + 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, + 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, + 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, + 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, + 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, + 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, + 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, + 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, + 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, + 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, + 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, + 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, + 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, + 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, + 778, 779, 780, 781, 782 ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "Vault", - "source_mapping": { - "start": 1161, - "length": 7823, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", - "is_dependency": false, - "lines": [ - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "depositFor(address,uint256)" + "starting_column": 1, + "ending_column": 2 } - } - }, - "additional_fields": { "underlying_type": "external_calls" } + }, + "signature": "_initDebtorCache(TempleDebtToken.BaseCache,ITempleDebtToken.Debtor,TempleDebtToken.DebtorCache,bool)" + } }, { "type": "node", - "name": "Deposit(_account,_amount,amountStaked)", + "name": "_timeElapsed > 0", "source_mapping": { - "start": 8129, - "length": 45, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 29667, + "length": 16, + "filename_relative": "contracts/v2/TempleDebtToken.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TempleDebtToken.sol", + "filename_short": "contracts/v2/TempleDebtToken.sol", "is_dependency": false, - "lines": [211], - "starting_column": 9, - "ending_column": 54 + "lines": [703], + "starting_column": 13, + "ending_column": 29 }, "type_specific_fields": { "parent": { "type": "function", - "name": "depositFor", + "name": "_initDebtorCache", "source_mapping": { - "start": 7408, - "length": 773, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 28507, + "length": 2281, + "filename_relative": "contracts/v2/TempleDebtToken.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TempleDebtToken.sol", + "filename_short": "contracts/v2/TempleDebtToken.sol", "is_dependency": false, "lines": [ - 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - 209, 210, 211, 212 + 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, + 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, + 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, + 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, + 724, 725, 726, 727 ], "starting_column": 5, "ending_column": 6 @@ -50471,48 +44815,92 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "Vault", + "name": "TempleDebtToken", "source_mapping": { - "start": 1161, - "length": 7823, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 2202, + "length": 30641, + "filename_relative": "contracts/v2/TempleDebtToken.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TempleDebtToken.sol", + "filename_short": "contracts/v2/TempleDebtToken.sol", "is_dependency": false, "lines": [ - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233 + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, + 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, + 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, + 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, + 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, + 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, + 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, + 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, + 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, + 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, + 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, + 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, + 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, + 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, + 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, + 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, + 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, + 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, + 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, + 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, + 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, + 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, + 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, + 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, + 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, + 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, + 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, + 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, + 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, + 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, + 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, + 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, + 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, + 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, + 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, + 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782 ], "starting_column": 1, "ending_column": 2 } }, - "signature": "depositFor(address,uint256)" + "signature": "_initDebtorCache(TempleDebtToken.BaseCache,ITempleDebtToken.Debtor,TempleDebtToken.DebtorCache,bool)" } } - }, - "additional_fields": { "underlying_type": "event" } + } } ], - "description": "Reentrancy in Vault.depositFor(address,uint256) (contracts/core/Vault.sol#196-212):\n\tExternal calls:\n\t- SafeERC20.safeTransferFrom(templeToken,msg.sender,vaultedTempleAccount,_amount) (contracts/core/Vault.sol#207)\n\t- templeExposureToken.mint(address(this),_amount) (contracts/core/Vault.sol#208)\n\tEvent emitted after the call(s):\n\t- Deposit(_account,_amount,amountStaked) (contracts/core/Vault.sol#211)\n", - "markdown": "Reentrancy in [Vault.depositFor(address,uint256)](contracts/core/Vault.sol#L196-L212):\n\tExternal calls:\n\t- [SafeERC20.safeTransferFrom(templeToken,msg.sender,vaultedTempleAccount,_amount)](contracts/core/Vault.sol#L207)\n\t- [templeExposureToken.mint(address(this),_amount)](contracts/core/Vault.sol#L208)\n\tEvent emitted after the call(s):\n\t- [Deposit(_account,_amount,amountStaked)](contracts/core/Vault.sol#L211)\n", - "first_markdown_element": "contracts/core/Vault.sol#L196-L212", - "id": "689116f4828c0f788fc592eb0a125792986e1b61e0aa46a6186d628790346b41", - "check": "reentrancy-events", + "description": "TempleDebtToken._initDebtorCache(TempleDebtToken.BaseCache,ITempleDebtToken.Debtor,TempleDebtToken.DebtorCache,bool) (contracts/v2/TempleDebtToken.sol#672-727) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- _timeElapsed > 0 (contracts/v2/TempleDebtToken.sol#703)\n", + "markdown": "[TempleDebtToken._initDebtorCache(TempleDebtToken.BaseCache,ITempleDebtToken.Debtor,TempleDebtToken.DebtorCache,bool)](contracts/v2/TempleDebtToken.sol#L672-L727) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [_timeElapsed > 0](contracts/v2/TempleDebtToken.sol#L703)\n", + "first_markdown_element": "contracts/v2/TempleDebtToken.sol#L672-L727", + "id": "a6d589cd4caf5ac6f228dd6218ef29c77e92ed66db618140855c2644b3b2cb10", + "check": "timestamp", "impact": "Low", "confidence": "Medium" }, @@ -50520,224 +44908,110 @@ "elements": [ { "type": "function", - "name": "increaseShares", + "name": "treasuryPriceIndex", "source_mapping": { - "start": 1987, - "length": 302, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 2676, + "length": 309, + "filename_relative": "contracts/v2/TreasuryPriceIndexOracle.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryPriceIndexOracle.sol", + "filename_short": "contracts/v2/TreasuryPriceIndexOracle.sol", "is_dependency": false, - "lines": [56, 57, 58, 59, 60, 61, 62, 63, 64], + "lines": [70, 71, 72, 73, 74], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryFarmingRevenue", + "name": "TreasuryPriceIndexOracle", "source_mapping": { - "start": 547, - "length": 3059, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 672, + "length": 3918, + "filename_relative": "contracts/v2/TreasuryPriceIndexOracle.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryPriceIndexOracle.sol", + "filename_short": "contracts/v2/TreasuryPriceIndexOracle.sol", "is_dependency": false, "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100 + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "increaseShares(address,uint256)" + "signature": "treasuryPriceIndex()" } }, { "type": "node", - "name": "claimFor(account)", - "source_mapping": { - "start": 2073, - "length": 17, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", - "is_dependency": false, - "lines": [57], - "starting_column": 9, - "ending_column": 26 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "increaseShares", - "source_mapping": { - "start": 1987, - "length": 302, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", - "is_dependency": false, - "lines": [56, 57, 58, 59, 60, 61, 62, 63, 64], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TreasuryFarmingRevenue", - "source_mapping": { - "start": 547, - "length": 3059, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", - "is_dependency": false, - "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "increaseShares(address,uint256)" - } - } - }, - "additional_fields": { "underlying_type": "external_calls" } - }, - { - "type": "node", - "name": "exposure.mint(account,unclaimedScaled / SCALING_FACTOR)", - "source_mapping": { - "start": 3194, - "length": 56, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", - "is_dependency": false, - "lines": [91], - "starting_column": 9, - "ending_column": 65 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "claimFor", - "source_mapping": { - "start": 2718, - "length": 611, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", - "is_dependency": false, - "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TreasuryFarmingRevenue", - "source_mapping": { - "start": 547, - "length": 3059, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", - "is_dependency": false, - "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "claimFor(address)" - } - } - }, - "additional_fields": { "underlying_type": "external_calls_sending_eth" } - }, - { - "type": "node", - "name": "IncreaseShares(account,amount)", + "name": "(block.timestamp < (tpiData.lastUpdatedAt + tpiData.cooldownSecs))", "source_mapping": { - "start": 2246, - "length": 36, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 2754, + "length": 204, + "filename_relative": "contracts/v2/TreasuryPriceIndexOracle.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryPriceIndexOracle.sol", + "filename_short": "contracts/v2/TreasuryPriceIndexOracle.sol", "is_dependency": false, - "lines": [63], + "lines": [71, 72, 73], "starting_column": 9, - "ending_column": 45 + "ending_column": 33 }, "type_specific_fields": { "parent": { "type": "function", - "name": "increaseShares", + "name": "treasuryPriceIndex", "source_mapping": { - "start": 1987, - "length": 302, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 2676, + "length": 309, + "filename_relative": "contracts/v2/TreasuryPriceIndexOracle.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryPriceIndexOracle.sol", + "filename_short": "contracts/v2/TreasuryPriceIndexOracle.sol", "is_dependency": false, - "lines": [56, 57, 58, 59, 60, 61, 62, 63, 64], + "lines": [70, 71, 72, 73, 74], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryFarmingRevenue", + "name": "TreasuryPriceIndexOracle", "source_mapping": { - "start": 547, - "length": 3059, - "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", - "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", + "start": 672, + "length": 3918, + "filename_relative": "contracts/v2/TreasuryPriceIndexOracle.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryPriceIndexOracle.sol", + "filename_short": "contracts/v2/TreasuryPriceIndexOracle.sol", "is_dependency": false, "lines": [ - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100 + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "increaseShares(address,uint256)" + "signature": "treasuryPriceIndex()" } } - }, - "additional_fields": { "underlying_type": "event" } + } } ], - "description": "Reentrancy in TreasuryFarmingRevenue.increaseShares(address,uint256) (contracts/core/TreasuryFarmingRevenue.sol#56-64):\n\tExternal calls:\n\t- claimFor(account) (contracts/core/TreasuryFarmingRevenue.sol#57)\n\t\t- exposure.mint(account,unclaimedScaled / SCALING_FACTOR) (contracts/core/TreasuryFarmingRevenue.sol#91)\n\tEvent emitted after the call(s):\n\t- IncreaseShares(account,amount) (contracts/core/TreasuryFarmingRevenue.sol#63)\n", - "markdown": "Reentrancy in [TreasuryFarmingRevenue.increaseShares(address,uint256)](contracts/core/TreasuryFarmingRevenue.sol#L56-L64):\n\tExternal calls:\n\t- [claimFor(account)](contracts/core/TreasuryFarmingRevenue.sol#L57)\n\t\t- [exposure.mint(account,unclaimedScaled / SCALING_FACTOR)](contracts/core/TreasuryFarmingRevenue.sol#L91)\n\tEvent emitted after the call(s):\n\t- [IncreaseShares(account,amount)](contracts/core/TreasuryFarmingRevenue.sol#L63)\n", - "first_markdown_element": "contracts/core/TreasuryFarmingRevenue.sol#L56-L64", - "id": "d4561252e63b6b2b82404c62a37f3524f0af810644056f99e52c4028a071621f", - "check": "reentrancy-events", + "description": "TreasuryPriceIndexOracle.treasuryPriceIndex() (contracts/v2/TreasuryPriceIndexOracle.sol#70-74) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- (block.timestamp < (tpiData.lastUpdatedAt + tpiData.cooldownSecs)) (contracts/v2/TreasuryPriceIndexOracle.sol#71-73)\n", + "markdown": "[TreasuryPriceIndexOracle.treasuryPriceIndex()](contracts/v2/TreasuryPriceIndexOracle.sol#L70-L74) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [(block.timestamp < (tpiData.lastUpdatedAt + tpiData.cooldownSecs))](contracts/v2/TreasuryPriceIndexOracle.sol#L71-L73)\n", + "first_markdown_element": "contracts/v2/TreasuryPriceIndexOracle.sol#L70-L74", + "id": "649566e5b9f48d4a53dd158c2137fe6a456902d4dbc71fadce5826d8bdeea4cf", + "check": "timestamp", "impact": "Low", "confidence": "Medium" }, @@ -50745,174 +45019,178 @@ "elements": [ { "type": "function", - "name": "lockFor", + "name": "setTreasuryPriceIndex", "source_mapping": { - "start": 943, - "length": 494, - "filename_relative": "contracts/deprecated/LockedOGTemple.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/LockedOGTemple.sol", - "filename_short": "contracts/deprecated/LockedOGTemple.sol", + "start": 3772, + "length": 815, + "filename_relative": "contracts/v2/TreasuryPriceIndexOracle.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryPriceIndexOracle.sol", + "filename_short": "contracts/v2/TreasuryPriceIndexOracle.sol", "is_dependency": false, "lines": [ - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53 + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116 ], - "starting_column": 3, - "ending_column": 4 + "starting_column": 5, + "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "LockedOGTemple", + "name": "TreasuryPriceIndexOracle", "source_mapping": { - "start": 213, - "length": 2143, - "filename_relative": "contracts/deprecated/LockedOGTemple.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/LockedOGTemple.sol", - "filename_short": "contracts/deprecated/LockedOGTemple.sol", + "start": 672, + "length": 3918, + "filename_relative": "contracts/v2/TreasuryPriceIndexOracle.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryPriceIndexOracle.sol", + "filename_short": "contracts/v2/TreasuryPriceIndexOracle.sol", "is_dependency": false, "lines": [ - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86 + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "lockFor(address,uint256,uint256)" + "signature": "setTreasuryPriceIndex(uint96)" } }, { "type": "node", - "name": "SafeERC20.safeTransferFrom(OG_TEMPLE,msg.sender,address(this),_amountOGTemple)", + "name": "_delta > maxTreasuryPriceIndexDelta", "source_mapping": { - "start": 1247, - "length": 111, - "filename_relative": "contracts/deprecated/LockedOGTemple.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/LockedOGTemple.sol", - "filename_short": "contracts/deprecated/LockedOGTemple.sol", + "start": 4199, + "length": 35, + "filename_relative": "contracts/v2/TreasuryPriceIndexOracle.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryPriceIndexOracle.sol", + "filename_short": "contracts/v2/TreasuryPriceIndexOracle.sol", "is_dependency": false, - "lines": [46, 47, 48, 49, 50, 51], - "starting_column": 5, - "ending_column": 6 + "lines": [105], + "starting_column": 17, + "ending_column": 52 }, "type_specific_fields": { "parent": { "type": "function", - "name": "lockFor", + "name": "setTreasuryPriceIndex", "source_mapping": { - "start": 943, - "length": 494, - "filename_relative": "contracts/deprecated/LockedOGTemple.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/LockedOGTemple.sol", - "filename_short": "contracts/deprecated/LockedOGTemple.sol", + "start": 3772, + "length": 815, + "filename_relative": "contracts/v2/TreasuryPriceIndexOracle.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryPriceIndexOracle.sol", + "filename_short": "contracts/v2/TreasuryPriceIndexOracle.sol", "is_dependency": false, "lines": [ - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53 + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116 ], - "starting_column": 3, - "ending_column": 4 + "starting_column": 5, + "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "LockedOGTemple", + "name": "TreasuryPriceIndexOracle", "source_mapping": { - "start": 213, - "length": 2143, - "filename_relative": "contracts/deprecated/LockedOGTemple.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/LockedOGTemple.sol", - "filename_short": "contracts/deprecated/LockedOGTemple.sol", + "start": 672, + "length": 3918, + "filename_relative": "contracts/v2/TreasuryPriceIndexOracle.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryPriceIndexOracle.sol", + "filename_short": "contracts/v2/TreasuryPriceIndexOracle.sol", "is_dependency": false, "lines": [ - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86 + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "lockFor(address,uint256,uint256)" + "signature": "setTreasuryPriceIndex(uint96)" } } - }, - "additional_fields": { "underlying_type": "external_calls" } + } }, { "type": "node", - "name": "OGTempleLocked(_staker,_amountOGTemple,_lockedUntilTimestamp)", + "name": "(_newTpi > _oldTpi)", "source_mapping": { - "start": 1364, - "length": 68, - "filename_relative": "contracts/deprecated/LockedOGTemple.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/LockedOGTemple.sol", - "filename_short": "contracts/deprecated/LockedOGTemple.sol", + "start": 4105, + "length": 76, + "filename_relative": "contracts/v2/TreasuryPriceIndexOracle.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryPriceIndexOracle.sol", + "filename_short": "contracts/v2/TreasuryPriceIndexOracle.sol", "is_dependency": false, - "lines": [52], - "starting_column": 5, - "ending_column": 73 + "lines": [104], + "starting_column": 13, + "ending_column": 89 }, "type_specific_fields": { "parent": { "type": "function", - "name": "lockFor", + "name": "setTreasuryPriceIndex", "source_mapping": { - "start": 943, - "length": 494, - "filename_relative": "contracts/deprecated/LockedOGTemple.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/LockedOGTemple.sol", - "filename_short": "contracts/deprecated/LockedOGTemple.sol", + "start": 3772, + "length": 815, + "filename_relative": "contracts/v2/TreasuryPriceIndexOracle.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryPriceIndexOracle.sol", + "filename_short": "contracts/v2/TreasuryPriceIndexOracle.sol", "is_dependency": false, "lines": [ - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53 + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116 ], - "starting_column": 3, - "ending_column": 4 + "starting_column": 5, + "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "LockedOGTemple", + "name": "TreasuryPriceIndexOracle", "source_mapping": { - "start": 213, - "length": 2143, - "filename_relative": "contracts/deprecated/LockedOGTemple.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/LockedOGTemple.sol", - "filename_short": "contracts/deprecated/LockedOGTemple.sol", + "start": 672, + "length": 3918, + "filename_relative": "contracts/v2/TreasuryPriceIndexOracle.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryPriceIndexOracle.sol", + "filename_short": "contracts/v2/TreasuryPriceIndexOracle.sol", "is_dependency": false, "lines": [ - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86 + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "lockFor(address,uint256,uint256)" + "signature": "setTreasuryPriceIndex(uint96)" } } - }, - "additional_fields": { "underlying_type": "event" } + } } ], - "description": "Reentrancy in LockedOGTemple.lockFor(address,uint256,uint256) (contracts/deprecated/LockedOGTemple.sol#35-53):\n\tExternal calls:\n\t- SafeERC20.safeTransferFrom(OG_TEMPLE,msg.sender,address(this),_amountOGTemple) (contracts/deprecated/LockedOGTemple.sol#46-51)\n\tEvent emitted after the call(s):\n\t- OGTempleLocked(_staker,_amountOGTemple,_lockedUntilTimestamp) (contracts/deprecated/LockedOGTemple.sol#52)\n", - "markdown": "Reentrancy in [LockedOGTemple.lockFor(address,uint256,uint256)](contracts/deprecated/LockedOGTemple.sol#L35-L53):\n\tExternal calls:\n\t- [SafeERC20.safeTransferFrom(OG_TEMPLE,msg.sender,address(this),_amountOGTemple)](contracts/deprecated/LockedOGTemple.sol#L46-L51)\n\tEvent emitted after the call(s):\n\t- [OGTempleLocked(_staker,_amountOGTemple,_lockedUntilTimestamp)](contracts/deprecated/LockedOGTemple.sol#L52)\n", - "first_markdown_element": "contracts/deprecated/LockedOGTemple.sol#L35-L53", - "id": "4230808e1cd7a4f58313604bd2841ce355116b1beb66b33f45e8990f931fb60f", - "check": "reentrancy-events", + "description": "TreasuryPriceIndexOracle.setTreasuryPriceIndex(uint96) (contracts/v2/TreasuryPriceIndexOracle.sol#97-116) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- _delta > maxTreasuryPriceIndexDelta (contracts/v2/TreasuryPriceIndexOracle.sol#105)\n\t- (_newTpi > _oldTpi) (contracts/v2/TreasuryPriceIndexOracle.sol#104)\n", + "markdown": "[TreasuryPriceIndexOracle.setTreasuryPriceIndex(uint96)](contracts/v2/TreasuryPriceIndexOracle.sol#L97-L116) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [_delta > maxTreasuryPriceIndexDelta](contracts/v2/TreasuryPriceIndexOracle.sol#L105)\n\t- [(_newTpi > _oldTpi)](contracts/v2/TreasuryPriceIndexOracle.sol#L104)\n", + "first_markdown_element": "contracts/v2/TreasuryPriceIndexOracle.sol#L97-L116", + "id": "27e472ea358357b1aa713a4753b654ee999cc773f1704e268101424130b80b61", + "check": "timestamp", "impact": "Low", "confidence": "Medium" }, @@ -50920,162 +45198,198 @@ "elements": [ { "type": "function", - "name": "recoverToken", + "name": "preCheck", "source_mapping": { - "start": 2526, - "length": 244, - "filename_relative": "contracts/core/VaultEarlyWithdraw.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultEarlyWithdraw.sol", - "filename_short": "contracts/core/VaultEarlyWithdraw.sol", + "start": 3551, + "length": 1277, + "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", "is_dependency": false, - "lines": [73, 74, 75, 76, 77], + "lines": [ + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "VaultEarlyWithdraw", + "name": "TempleCircuitBreakerAllUsersPerPeriod", "source_mapping": { - "start": 548, - "length": 2224, - "filename_relative": "contracts/core/VaultEarlyWithdraw.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultEarlyWithdraw.sol", - "filename_short": "contracts/core/VaultEarlyWithdraw.sol", + "start": 1479, + "length": 6866, + "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", "is_dependency": false, "lines": [ - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78 + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205 ], "starting_column": 1, "ending_column": 2 } }, - "signature": "recoverToken(address,address,uint256)" + "signature": "preCheck(address,uint256)" } }, { "type": "node", - "name": "IERC20(token).safeTransfer(to,amount)", + "name": "_nextBucketIndex != _currentBucketIndex", "source_mapping": { - "start": 2677, - "length": 38, - "filename_relative": "contracts/core/VaultEarlyWithdraw.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultEarlyWithdraw.sol", - "filename_short": "contracts/core/VaultEarlyWithdraw.sol", + "start": 3971, + "length": 39, + "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", "is_dependency": false, - "lines": [75], - "starting_column": 9, - "ending_column": 47 + "lines": [96], + "starting_column": 13, + "ending_column": 52 }, "type_specific_fields": { "parent": { "type": "function", - "name": "recoverToken", + "name": "preCheck", "source_mapping": { - "start": 2526, - "length": 244, - "filename_relative": "contracts/core/VaultEarlyWithdraw.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultEarlyWithdraw.sol", - "filename_short": "contracts/core/VaultEarlyWithdraw.sol", + "start": 3551, + "length": 1277, + "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", "is_dependency": false, - "lines": [73, 74, 75, 76, 77], + "lines": [ + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "VaultEarlyWithdraw", + "name": "TempleCircuitBreakerAllUsersPerPeriod", "source_mapping": { - "start": 548, - "length": 2224, - "filename_relative": "contracts/core/VaultEarlyWithdraw.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultEarlyWithdraw.sol", - "filename_short": "contracts/core/VaultEarlyWithdraw.sol", + "start": 1479, + "length": 6866, + "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", "is_dependency": false, "lines": [ - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78 + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205 ], "starting_column": 1, "ending_column": 2 } }, - "signature": "recoverToken(address,address,uint256)" + "signature": "preCheck(address,uint256)" } } - }, - "additional_fields": { "underlying_type": "external_calls" } + } }, { "type": "node", - "name": "TokenRecovered(token,to,amount)", + "name": "_minBucketResetIndex < _nextBucketIndex", "source_mapping": { - "start": 2725, - "length": 38, - "filename_relative": "contracts/core/VaultEarlyWithdraw.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultEarlyWithdraw.sol", - "filename_short": "contracts/core/VaultEarlyWithdraw.sol", + "start": 4180, + "length": 39, + "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", "is_dependency": false, - "lines": [76], - "starting_column": 9, - "ending_column": 47 + "lines": [100], + "starting_column": 24, + "ending_column": 63 }, "type_specific_fields": { "parent": { "type": "function", - "name": "recoverToken", + "name": "preCheck", "source_mapping": { - "start": 2526, - "length": 244, - "filename_relative": "contracts/core/VaultEarlyWithdraw.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultEarlyWithdraw.sol", - "filename_short": "contracts/core/VaultEarlyWithdraw.sol", + "start": 3551, + "length": 1277, + "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", "is_dependency": false, - "lines": [73, 74, 75, 76, 77], + "lines": [ + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "VaultEarlyWithdraw", + "name": "TempleCircuitBreakerAllUsersPerPeriod", "source_mapping": { - "start": 548, - "length": 2224, - "filename_relative": "contracts/core/VaultEarlyWithdraw.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultEarlyWithdraw.sol", - "filename_short": "contracts/core/VaultEarlyWithdraw.sol", + "start": 1479, + "length": 6866, + "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", "is_dependency": false, "lines": [ - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78 + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205 ], "starting_column": 1, "ending_column": 2 } }, - "signature": "recoverToken(address,address,uint256)" + "signature": "preCheck(address,uint256)" } } - }, - "additional_fields": { "underlying_type": "event" } + } } ], - "description": "Reentrancy in VaultEarlyWithdraw.recoverToken(address,address,uint256) (contracts/core/VaultEarlyWithdraw.sol#73-77):\n\tExternal calls:\n\t- IERC20(token).safeTransfer(to,amount) (contracts/core/VaultEarlyWithdraw.sol#75)\n\tEvent emitted after the call(s):\n\t- TokenRecovered(token,to,amount) (contracts/core/VaultEarlyWithdraw.sol#76)\n", - "markdown": "Reentrancy in [VaultEarlyWithdraw.recoverToken(address,address,uint256)](contracts/core/VaultEarlyWithdraw.sol#L73-L77):\n\tExternal calls:\n\t- [IERC20(token).safeTransfer(to,amount)](contracts/core/VaultEarlyWithdraw.sol#L75)\n\tEvent emitted after the call(s):\n\t- [TokenRecovered(token,to,amount)](contracts/core/VaultEarlyWithdraw.sol#L76)\n", - "first_markdown_element": "contracts/core/VaultEarlyWithdraw.sol#L73-L77", - "id": "1c3c00beda0eb4b0661cc31987f0cf4c864705a836f5da0004529d20a3b860b8", - "check": "reentrancy-events", + "description": "TempleCircuitBreakerAllUsersPerPeriod.preCheck(address,uint256) (contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#89-117) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- _nextBucketIndex != _currentBucketIndex (contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#96)\n\t- _minBucketResetIndex < _nextBucketIndex (contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#100)\n", + "markdown": "[TempleCircuitBreakerAllUsersPerPeriod.preCheck(address,uint256)](contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#L89-L117) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [_nextBucketIndex != _currentBucketIndex](contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#L96)\n\t- [_minBucketResetIndex < _nextBucketIndex](contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#L100)\n", + "first_markdown_element": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#L89-L117", + "id": "080fc01692d6234533b35c64ebb6efb9506e8defa98bc2809f7c873c4c084550", + "check": "timestamp", "impact": "Low", "confidence": "Medium" }, @@ -51083,177 +45397,122 @@ "elements": [ { "type": "function", - "name": "redeemAmount", + "name": "_getMinBucketResetIndex", "source_mapping": { - "start": 3060, - "length": 296, - "filename_relative": "contracts/core/Exposure.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Exposure.sol", - "filename_short": "contracts/core/Exposure.sol", + "start": 5647, + "length": 406, + "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", "is_dependency": false, - "lines": [104, 105, 106, 107, 108, 109, 110, 111, 112, 113], + "lines": [140, 141, 142, 143, 144, 145], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "Exposure", + "name": "TempleCircuitBreakerAllUsersPerPeriod", "source_mapping": { - "start": 362, - "length": 3820, - "filename_relative": "contracts/core/Exposure.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Exposure.sol", - "filename_short": "contracts/core/Exposure.sol", + "start": 1479, + "length": 6866, + "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", "is_dependency": false, "lines": [ - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143 + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205 ], "starting_column": 1, "ending_column": 2 } }, - "signature": "redeemAmount(uint256,address)" + "signature": "_getMinBucketResetIndex(uint32,uint32,uint32)" } }, { "type": "node", - "name": "liquidator.toTemple(amount,to)", + "name": "_currentBucketIndex < _oneperiodDurationAgoIndex", "source_mapping": { - "start": 3241, - "length": 31, - "filename_relative": "contracts/core/Exposure.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Exposure.sol", - "filename_short": "contracts/core/Exposure.sol", + "start": 5915, + "length": 121, + "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", "is_dependency": false, - "lines": [109], + "lines": [143], "starting_column": 13, - "ending_column": 44 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "redeemAmount", - "source_mapping": { - "start": 3060, - "length": 296, - "filename_relative": "contracts/core/Exposure.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Exposure.sol", - "filename_short": "contracts/core/Exposure.sol", - "is_dependency": false, - "lines": [104, 105, 106, 107, 108, 109, 110, 111, 112, 113], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "Exposure", - "source_mapping": { - "start": 362, - "length": 3820, - "filename_relative": "contracts/core/Exposure.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Exposure.sol", - "filename_short": "contracts/core/Exposure.sol", - "is_dependency": false, - "lines": [ - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "redeemAmount(uint256,address)" - } - } - }, - "additional_fields": { "underlying_type": "external_calls" } - }, - { - "type": "node", - "name": "Redeem(address(revalToken),msg.sender,to,amount)", - "source_mapping": { - "start": 3293, - "length": 56, - "filename_relative": "contracts/core/Exposure.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Exposure.sol", - "filename_short": "contracts/core/Exposure.sol", - "is_dependency": false, - "lines": [112], - "starting_column": 9, - "ending_column": 65 + "ending_column": 134 }, "type_specific_fields": { "parent": { "type": "function", - "name": "redeemAmount", + "name": "_getMinBucketResetIndex", "source_mapping": { - "start": 3060, - "length": 296, - "filename_relative": "contracts/core/Exposure.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Exposure.sol", - "filename_short": "contracts/core/Exposure.sol", + "start": 5647, + "length": 406, + "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", "is_dependency": false, - "lines": [104, 105, 106, 107, 108, 109, 110, 111, 112, 113], + "lines": [140, 141, 142, 143, 144, 145], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "Exposure", + "name": "TempleCircuitBreakerAllUsersPerPeriod", "source_mapping": { - "start": 362, - "length": 3820, - "filename_relative": "contracts/core/Exposure.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Exposure.sol", - "filename_short": "contracts/core/Exposure.sol", + "start": 1479, + "length": 6866, + "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", "is_dependency": false, "lines": [ - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143 + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205 ], "starting_column": 1, "ending_column": 2 } }, - "signature": "redeemAmount(uint256,address)" + "signature": "_getMinBucketResetIndex(uint32,uint32,uint32)" } } - }, - "additional_fields": { "underlying_type": "event" } + } } ], - "description": "Reentrancy in Exposure.redeemAmount(uint256,address) (contracts/core/Exposure.sol#104-113):\n\tExternal calls:\n\t- liquidator.toTemple(amount,to) (contracts/core/Exposure.sol#109)\n\tEvent emitted after the call(s):\n\t- Redeem(address(revalToken),msg.sender,to,amount) (contracts/core/Exposure.sol#112)\n", - "markdown": "Reentrancy in [Exposure.redeemAmount(uint256,address)](contracts/core/Exposure.sol#L104-L113):\n\tExternal calls:\n\t- [liquidator.toTemple(amount,to)](contracts/core/Exposure.sol#L109)\n\tEvent emitted after the call(s):\n\t- [Redeem(address(revalToken),msg.sender,to,amount)](contracts/core/Exposure.sol#L112)\n", - "first_markdown_element": "contracts/core/Exposure.sol#L104-L113", - "id": "5c348eea3fa61ccb6c1609a61dfbf2ea3d76c031d344e46e4a98a0d17d2298c4", - "check": "reentrancy-events", + "description": "TempleCircuitBreakerAllUsersPerPeriod._getMinBucketResetIndex(uint32,uint32,uint32) (contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#140-145) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- _currentBucketIndex < _oneperiodDurationAgoIndex (contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#143)\n", + "markdown": "[TempleCircuitBreakerAllUsersPerPeriod._getMinBucketResetIndex(uint32,uint32,uint32)](contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#L140-L145) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [_currentBucketIndex < _oneperiodDurationAgoIndex](contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#L143)\n", + "first_markdown_element": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#L140-L145", + "id": "62847204845cb0c8231dae0ccd651ab847da9f27624c490709e49b40f8c0793c", + "check": "timestamp", "impact": "Low", "confidence": "Medium" }, @@ -51261,16 +45520,17 @@ "elements": [ { "type": "function", - "name": "stakeFor", + "name": "currentUtilisation", "source_mapping": { - "start": 4887, - "length": 624, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", + "start": 6152, + "length": 910, + "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", "is_dependency": false, "lines": [ - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136 + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169 ], "starting_column": 5, "ending_column": 6 @@ -51278,62 +45538,64 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleStaking", + "name": "TempleCircuitBreakerAllUsersPerPeriod", "source_mapping": { - "start": 464, - "length": 6184, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", + "start": 1479, + "length": 6866, + "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", "is_dependency": false, "lines": [ - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163 + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "stakeFor(address,uint256)" + "signature": "currentUtilisation()" } }, { "type": "node", - "name": "SafeERC20.safeTransferFrom(TEMPLE,msg.sender,address(this),_amountTemple)", + "name": "_nextBucketIndex != _currentBucketIndex", "source_mapping": { - "start": 5291, - "length": 76, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", + "start": 6625, + "length": 39, + "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", "is_dependency": false, - "lines": [131], - "starting_column": 9, - "ending_column": 85 + "lines": [159], + "starting_column": 13, + "ending_column": 52 }, "type_specific_fields": { "parent": { "type": "function", - "name": "stakeFor", + "name": "currentUtilisation", "source_mapping": { - "start": 4887, - "length": 624, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", + "start": 6152, + "length": 910, + "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", "is_dependency": false, "lines": [ - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136 + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169 ], "starting_column": 5, "ending_column": 6 @@ -51341,65 +45603,67 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleStaking", + "name": "TempleCircuitBreakerAllUsersPerPeriod", "source_mapping": { - "start": 464, - "length": 6184, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", + "start": 1479, + "length": 6866, + "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", "is_dependency": false, "lines": [ - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163 + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "stakeFor(address,uint256)" + "signature": "currentUtilisation()" } } - }, - "additional_fields": { "underlying_type": "external_calls" } + } }, { "type": "node", - "name": "OG_TEMPLE.mint(_staker,amountOgTemple)", + "name": "_minBucketResetIndex < _nextBucketIndex", "source_mapping": { - "start": 5377, + "start": 6833, "length": 39, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", + "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", "is_dependency": false, - "lines": [132], - "starting_column": 9, - "ending_column": 48 + "lines": [162], + "starting_column": 24, + "ending_column": 63 }, "type_specific_fields": { "parent": { "type": "function", - "name": "stakeFor", + "name": "currentUtilisation", "source_mapping": { - "start": 4887, - "length": 624, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", + "start": 6152, + "length": 910, + "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", "is_dependency": false, "lines": [ - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136 + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169 ], "starting_column": 5, "ending_column": 6 @@ -51407,109 +45671,185 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleStaking", + "name": "TempleCircuitBreakerAllUsersPerPeriod", "source_mapping": { - "start": 464, - "length": 6184, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", + "start": 1479, + "length": 6866, + "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", "is_dependency": false, "lines": [ - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163 + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "stakeFor(address,uint256)" + "signature": "currentUtilisation()" + } + } + } + } + ], + "description": "TempleCircuitBreakerAllUsersPerPeriod.currentUtilisation() (contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#150-169) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- _nextBucketIndex != _currentBucketIndex (contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#159)\n\t- _minBucketResetIndex < _nextBucketIndex (contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#162)\n", + "markdown": "[TempleCircuitBreakerAllUsersPerPeriod.currentUtilisation()](contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#L150-L169) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [_nextBucketIndex != _currentBucketIndex](contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#L159)\n\t- [_minBucketResetIndex < _nextBucketIndex](contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#L162)\n", + "first_markdown_element": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#L150-L169", + "id": "824d28da623fc8596a1354a4d1ea1765d521fc6a1fdeae63acbc756dfbc451ed", + "check": "timestamp", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "latestDsrBalance", + "source_mapping": { + "start": 4929, + "length": 510, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "is_dependency": false, + "lines": [129, 130, 131, 132, 133, 134, 135, 136, 137, 138], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "DsrBaseStrategy", + "source_mapping": { + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "is_dependency": false, + "lines": [ + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306 + ], + "starting_column": 1, + "ending_column": 0 } - } - }, - "additional_fields": { "underlying_type": "external_calls" } + }, + "signature": "latestDsrBalance()" + } }, { "type": "node", - "name": "StakeCompleted(_staker,_amountTemple,0)", + "name": "(block.timestamp > rho)", "source_mapping": { - "start": 5426, - "length": 46, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", + "start": 5272, + "length": 109, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [133], + "lines": [136], "starting_column": 9, - "ending_column": 55 + "ending_column": 118 }, "type_specific_fields": { "parent": { "type": "function", - "name": "stakeFor", + "name": "latestDsrBalance", "source_mapping": { - "start": 4887, - "length": 624, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", + "start": 4929, + "length": 510, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [ - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136 - ], + "lines": [129, 130, 131, 132, 133, 134, 135, 136, 137, 138], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleStaking", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 464, - "length": 6184, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "stakeFor(address,uint256)" + "signature": "latestDsrBalance()" } } - }, - "additional_fields": { "underlying_type": "event" } + } } ], - "description": "Reentrancy in TempleStaking.stakeFor(address,uint256) (contracts/deprecated/TempleStaking.sol#123-136):\n\tExternal calls:\n\t- SafeERC20.safeTransferFrom(TEMPLE,msg.sender,address(this),_amountTemple) (contracts/deprecated/TempleStaking.sol#131)\n\t- OG_TEMPLE.mint(_staker,amountOgTemple) (contracts/deprecated/TempleStaking.sol#132)\n\tEvent emitted after the call(s):\n\t- StakeCompleted(_staker,_amountTemple,0) (contracts/deprecated/TempleStaking.sol#133)\n", - "markdown": "Reentrancy in [TempleStaking.stakeFor(address,uint256)](contracts/deprecated/TempleStaking.sol#L123-L136):\n\tExternal calls:\n\t- [SafeERC20.safeTransferFrom(TEMPLE,msg.sender,address(this),_amountTemple)](contracts/deprecated/TempleStaking.sol#L131)\n\t- [OG_TEMPLE.mint(_staker,amountOgTemple)](contracts/deprecated/TempleStaking.sol#L132)\n\tEvent emitted after the call(s):\n\t- [StakeCompleted(_staker,_amountTemple,0)](contracts/deprecated/TempleStaking.sol#L133)\n", - "first_markdown_element": "contracts/deprecated/TempleStaking.sol#L123-L136", - "id": "b18c05c7e4e0c35ebb87b7dbe818caa384c5e387f2a89d762dad2c9429dad39c", - "check": "reentrancy-events", + "description": "DsrBaseStrategy.latestDsrBalance() (contracts/v2/strategies/DsrBaseStrategy.sol#129-138) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- (block.timestamp > rho) (contracts/v2/strategies/DsrBaseStrategy.sol#136)\n", + "markdown": "[DsrBaseStrategy.latestDsrBalance()](contracts/v2/strategies/DsrBaseStrategy.sol#L129-L138) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [(block.timestamp > rho)](contracts/v2/strategies/DsrBaseStrategy.sol#L136)\n", + "first_markdown_element": "contracts/v2/strategies/DsrBaseStrategy.sol#L129-L138", + "id": "5d10ceb2f5b13a3f1d386bd3ffb62d9e64d57500eb9ce74496832fa8d54f7c5e", + "check": "timestamp", "impact": "Low", "confidence": "Medium" }, @@ -51517,206 +45857,277 @@ "elements": [ { "type": "function", - "name": "unstake", + "name": "_checkpointChi", "source_mapping": { - "start": 5711, - "length": 576, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", + "start": 5445, + "length": 188, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155], + "lines": [140, 141, 142, 143], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleStaking", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 464, - "length": 6184, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "unstake(uint256)" + "signature": "_checkpointChi()" } }, { "type": "node", - "name": "OG_TEMPLE.burnFrom(msg.sender,_amountOgTemple)", + "name": "(block.timestamp > pot.rho())", "source_mapping": { - "start": 6017, - "length": 47, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", + "start": 5566, + "length": 60, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [150], + "lines": [142], "starting_column": 9, - "ending_column": 56 + "ending_column": 69 }, "type_specific_fields": { "parent": { "type": "function", - "name": "unstake", + "name": "_checkpointChi", "source_mapping": { - "start": 5711, - "length": 576, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", + "start": 5445, + "length": 188, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, - "lines": [ - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155 - ], + "lines": [140, 141, 142, 143], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleStaking", + "name": "DsrBaseStrategy", "source_mapping": { - "start": 464, - "length": 6184, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", + "start": 1041, + "length": 11744, + "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [ - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163 + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "unstake(uint256)" + "signature": "_checkpointChi()" } } - }, - "additional_fields": { "underlying_type": "external_calls" } - }, + } + } + ], + "description": "DsrBaseStrategy._checkpointChi() (contracts/v2/strategies/DsrBaseStrategy.sol#140-143) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- (block.timestamp > pot.rho()) (contracts/v2/strategies/DsrBaseStrategy.sol#142)\n", + "markdown": "[DsrBaseStrategy._checkpointChi()](contracts/v2/strategies/DsrBaseStrategy.sol#L140-L143) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [(block.timestamp > pot.rho())](contracts/v2/strategies/DsrBaseStrategy.sol#L142)\n", + "first_markdown_element": "contracts/v2/strategies/DsrBaseStrategy.sol#L140-L143", + "id": "5cfe72c68305dea88c7c4193956094120fcd3b9c0b3634e1ae80f5a9b13cb40e", + "check": "timestamp", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ { - "type": "node", - "name": "SafeERC20.safeIncreaseAllowance(TEMPLE,address(EXIT_QUEUE),unstakeBalanceTemple)", + "type": "function", + "name": "_initDebtTokenCache", "source_mapping": { - "start": 6074, - "length": 82, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", + "start": 24259, + "length": 1450, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, - "lines": [151], - "starting_column": 9, - "ending_column": 91 + "lines": [ + 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, + 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, + 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658 + ], + "starting_column": 5, + "ending_column": 6 }, "type_specific_fields": { "parent": { - "type": "function", - "name": "unstake", + "type": "contract", + "name": "TempleLineOfCredit", "source_mapping": { - "start": 5711, - "length": 576, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", + "start": 1433, + "length": 31753, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, "lines": [ - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155 + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, + 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, + 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, + 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, + 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, + 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, + 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, + 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, + 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, + 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, + 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, + 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, + 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, + 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, + 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, + 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, + 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, + 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, + 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, + 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, + 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, + 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, + 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, + 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, + 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, + 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, + 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, + 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, + 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, + 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, + 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, + 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, + 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, + 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, + 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, + 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, + 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, + 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885 ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleStaking", - "source_mapping": { - "start": 464, - "length": 6184, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", - "is_dependency": false, - "lines": [ - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "unstake(uint256)" + "starting_column": 1, + "ending_column": 0 } - } - }, - "additional_fields": { "underlying_type": "external_calls" } + }, + "signature": "_initDebtTokenCache(TempleLineOfCredit.DebtTokenCache)" + } }, { "type": "node", - "name": "EXIT_QUEUE.join(msg.sender,unstakeBalanceTemple)", + "name": "_timeElapsed > 0", "source_mapping": { - "start": 6166, - "length": 49, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", + "start": 25121, + "length": 16, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, - "lines": [152], - "starting_column": 9, - "ending_column": 58 + "lines": [641], + "starting_column": 13, + "ending_column": 29 }, "type_specific_fields": { "parent": { "type": "function", - "name": "unstake", + "name": "_initDebtTokenCache", "source_mapping": { - "start": 5711, - "length": 576, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", + "start": 24259, + "length": 1450, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, "lines": [ - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155 + 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, + 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, + 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, + 658 ], "starting_column": 5, "ending_column": 6 @@ -51724,64 +46135,176 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleStaking", + "name": "TempleLineOfCredit", "source_mapping": { - "start": 464, - "length": 6184, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", + "start": 1433, + "length": 31753, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, "lines": [ - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163 + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, + 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, + 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, + 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, + 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, + 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, + 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, + 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, + 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, + 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, + 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, + 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, + 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, + 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, + 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, + 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, + 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, + 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, + 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, + 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, + 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, + 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, + 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, + 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, + 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, + 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, + 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, + 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, + 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, + 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, + 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, + 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, + 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, + 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, + 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, + 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, + 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, + 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, + 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, + 883, 884, 885 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "unstake(uint256)" + "signature": "_initDebtTokenCache(TempleLineOfCredit.DebtTokenCache)" } } + } + } + ], + "description": "TempleLineOfCredit._initDebtTokenCache(TempleLineOfCredit.DebtTokenCache) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#619-658) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- _timeElapsed > 0 (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#641)\n", + "markdown": "[TempleLineOfCredit._initDebtTokenCache(TempleLineOfCredit.DebtTokenCache)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L619-L658) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [_timeElapsed > 0](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L641)\n", + "first_markdown_element": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L619-L658", + "id": "1d9fb732d9369c4da234795950c435996e1f5d0b0c4fd71e2ad0007ec6f7558b", + "check": "timestamp", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "calculateClaimable", + "source_mapping": { + "start": 1893, + "length": 581, + "filename_relative": "contracts/admin/TempleTeamPayments.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPayments.sol", + "filename_short": "contracts/admin/TempleTeamPayments.sol", + "is_dependency": false, + "lines": [ + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72 + ], + "starting_column": 5, + "ending_column": 6 }, - "additional_fields": { "underlying_type": "external_calls" } + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleTeamPayments", + "source_mapping": { + "start": 247, + "length": 3130, + "filename_relative": "contracts/admin/TempleTeamPayments.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPayments.sol", + "filename_short": "contracts/admin/TempleTeamPayments.sol", + "is_dependency": false, + "lines": [ + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "calculateClaimable(address)" + } }, { "type": "node", - "name": "UnstakeCompleted(msg.sender,_amountOgTemple)", + "name": "claimableAmount + claimed[_address] > allocation[_address]", "source_mapping": { - "start": 6226, - "length": 50, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", + "start": 2293, + "length": 58, + "filename_relative": "contracts/admin/TempleTeamPayments.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPayments.sol", + "filename_short": "contracts/admin/TempleTeamPayments.sol", "is_dependency": false, - "lines": [154], - "starting_column": 9, - "ending_column": 59 + "lines": [68], + "starting_column": 13, + "ending_column": 71 }, "type_specific_fields": { "parent": { "type": "function", - "name": "unstake", + "name": "calculateClaimable", "source_mapping": { - "start": 5711, - "length": 576, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", + "start": 1893, + "length": 581, + "filename_relative": "contracts/admin/TempleTeamPayments.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPayments.sol", + "filename_short": "contracts/admin/TempleTeamPayments.sol", "is_dependency": false, "lines": [ - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155 + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72 ], "starting_column": 5, "ending_column": 6 @@ -51789,43 +46312,37 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleStaking", + "name": "TempleTeamPayments", "source_mapping": { - "start": 464, - "length": 6184, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", + "start": 247, + "length": 3130, + "filename_relative": "contracts/admin/TempleTeamPayments.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPayments.sol", + "filename_short": "contracts/admin/TempleTeamPayments.sol", "is_dependency": false, "lines": [ - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163 + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97 ], "starting_column": 1, - "ending_column": 0 + "ending_column": 2 } }, - "signature": "unstake(uint256)" + "signature": "calculateClaimable(address)" } } - }, - "additional_fields": { "underlying_type": "event" } + } } ], - "description": "Reentrancy in TempleStaking.unstake(uint256) (contracts/deprecated/TempleStaking.sol#144-155):\n\tExternal calls:\n\t- OG_TEMPLE.burnFrom(msg.sender,_amountOgTemple) (contracts/deprecated/TempleStaking.sol#150)\n\t- SafeERC20.safeIncreaseAllowance(TEMPLE,address(EXIT_QUEUE),unstakeBalanceTemple) (contracts/deprecated/TempleStaking.sol#151)\n\t- EXIT_QUEUE.join(msg.sender,unstakeBalanceTemple) (contracts/deprecated/TempleStaking.sol#152)\n\tEvent emitted after the call(s):\n\t- UnstakeCompleted(msg.sender,_amountOgTemple) (contracts/deprecated/TempleStaking.sol#154)\n", - "markdown": "Reentrancy in [TempleStaking.unstake(uint256)](contracts/deprecated/TempleStaking.sol#L144-L155):\n\tExternal calls:\n\t- [OG_TEMPLE.burnFrom(msg.sender,_amountOgTemple)](contracts/deprecated/TempleStaking.sol#L150)\n\t- [SafeERC20.safeIncreaseAllowance(TEMPLE,address(EXIT_QUEUE),unstakeBalanceTemple)](contracts/deprecated/TempleStaking.sol#L151)\n\t- [EXIT_QUEUE.join(msg.sender,unstakeBalanceTemple)](contracts/deprecated/TempleStaking.sol#L152)\n\tEvent emitted after the call(s):\n\t- [UnstakeCompleted(msg.sender,_amountOgTemple)](contracts/deprecated/TempleStaking.sol#L154)\n", - "first_markdown_element": "contracts/deprecated/TempleStaking.sol#L144-L155", - "id": "325fc57e8f6e1cecb7323feddec38c5b7507dd1c8d9a046aa8b2c362a40ad09b", - "check": "reentrancy-events", + "description": "TempleTeamPayments.calculateClaimable(address) (contracts/admin/TempleTeamPayments.sol#57-72) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- claimableAmount + claimed[_address] > allocation[_address] (contracts/admin/TempleTeamPayments.sol#68)\n", + "markdown": "[TempleTeamPayments.calculateClaimable(address)](contracts/admin/TempleTeamPayments.sol#L57-L72) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [claimableAmount + claimed[_address] > allocation[_address]](contracts/admin/TempleTeamPayments.sol#L68)\n", + "first_markdown_element": "contracts/admin/TempleTeamPayments.sol#L57-L72", + "id": "3c50b29e16f7abe9424e2eb7ddf7dd3a9178954836a5700181e781d6cab69a90", + "check": "timestamp", "impact": "Low", "confidence": "Medium" }, @@ -51833,219 +46350,234 @@ "elements": [ { "type": "function", - "name": "withdraw", + "name": "claim", "source_mapping": { - "start": 1870, - "length": 562, - "filename_relative": "contracts/core/VaultEarlyWithdraw.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultEarlyWithdraw.sol", - "filename_short": "contracts/core/VaultEarlyWithdraw.sol", + "start": 2480, + "length": 355, + "filename_relative": "contracts/admin/TempleTeamPayments.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPayments.sol", + "filename_short": "contracts/admin/TempleTeamPayments.sol", "is_dependency": false, - "lines": [57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68], + "lines": [74, 75, 76, 77, 78, 79, 80, 81], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "VaultEarlyWithdraw", + "name": "TempleTeamPayments", "source_mapping": { - "start": 548, - "length": 2224, - "filename_relative": "contracts/core/VaultEarlyWithdraw.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultEarlyWithdraw.sol", - "filename_short": "contracts/core/VaultEarlyWithdraw.sol", + "start": 247, + "length": 3130, + "filename_relative": "contracts/admin/TempleTeamPayments.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPayments.sol", + "filename_short": "contracts/admin/TempleTeamPayments.sol", "is_dependency": false, "lines": [ - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78 + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97 ], "starting_column": 1, "ending_column": 2 } }, - "signature": "withdraw(address,uint256)" + "signature": "claim()" } }, { "type": "node", - "name": "IERC20(_vault).safeTransferFrom(msg.sender,owner(),_templeAmount)", + "name": "require(bool,string)(claimable > 0,TempleTeamPayments: Member has no TEMPLE to claim)", "source_mapping": { - "start": 2162, - "length": 67, - "filename_relative": "contracts/core/VaultEarlyWithdraw.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultEarlyWithdraw.sol", - "filename_short": "contracts/core/VaultEarlyWithdraw.sol", + "start": 2602, + "length": 75, + "filename_relative": "contracts/admin/TempleTeamPayments.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPayments.sol", + "filename_short": "contracts/admin/TempleTeamPayments.sol", "is_dependency": false, - "lines": [62], + "lines": [76], "starting_column": 9, - "ending_column": 76 + "ending_column": 84 }, "type_specific_fields": { "parent": { "type": "function", - "name": "withdraw", + "name": "claim", "source_mapping": { - "start": 1870, - "length": 562, - "filename_relative": "contracts/core/VaultEarlyWithdraw.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultEarlyWithdraw.sol", - "filename_short": "contracts/core/VaultEarlyWithdraw.sol", + "start": 2480, + "length": 355, + "filename_relative": "contracts/admin/TempleTeamPayments.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPayments.sol", + "filename_short": "contracts/admin/TempleTeamPayments.sol", "is_dependency": false, - "lines": [57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68], + "lines": [74, 75, 76, 77, 78, 79, 80, 81], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "VaultEarlyWithdraw", + "name": "TempleTeamPayments", "source_mapping": { - "start": 548, - "length": 2224, - "filename_relative": "contracts/core/VaultEarlyWithdraw.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultEarlyWithdraw.sol", - "filename_short": "contracts/core/VaultEarlyWithdraw.sol", + "start": 247, + "length": 3130, + "filename_relative": "contracts/admin/TempleTeamPayments.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPayments.sol", + "filename_short": "contracts/admin/TempleTeamPayments.sol", "is_dependency": false, "lines": [ - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78 + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97 ], "starting_column": 1, "ending_column": 2 } }, - "signature": "withdraw(address,uint256)" + "signature": "claim()" } } - }, - "additional_fields": { "underlying_type": "external_calls" } - }, + } + } + ], + "description": "TempleTeamPayments.claim() (contracts/admin/TempleTeamPayments.sol#74-81) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- require(bool,string)(claimable > 0,TempleTeamPayments: Member has no TEMPLE to claim) (contracts/admin/TempleTeamPayments.sol#76)\n", + "markdown": "[TempleTeamPayments.claim()](contracts/admin/TempleTeamPayments.sol#L74-L81) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [require(bool,string)(claimable > 0,TempleTeamPayments: Member has no TEMPLE to claim)](contracts/admin/TempleTeamPayments.sol#L76)\n", + "first_markdown_element": "contracts/admin/TempleTeamPayments.sol#L74-L81", + "id": "d2cf6a934d99b6df0f4c782f92abbc6344366c44c011b9e95bdc6171398e7715", + "check": "timestamp", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ { - "type": "node", - "name": "templeToken.safeTransfer(msg.sender,_templeAmount)", + "type": "function", + "name": "withdrawFor", "source_mapping": { - "start": 2318, - "length": 51, - "filename_relative": "contracts/core/VaultEarlyWithdraw.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultEarlyWithdraw.sol", - "filename_short": "contracts/core/VaultEarlyWithdraw.sol", + "start": 3932, + "length": 543, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, - "lines": [65], - "starting_column": 9, - "ending_column": 60 + "lines": [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110], + "starting_column": 5, + "ending_column": 6 }, "type_specific_fields": { "parent": { - "type": "function", - "name": "withdraw", + "type": "contract", + "name": "Vault", "source_mapping": { - "start": 1870, - "length": 562, - "filename_relative": "contracts/core/VaultEarlyWithdraw.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultEarlyWithdraw.sol", - "filename_short": "contracts/core/VaultEarlyWithdraw.sol", + "start": 1161, + "length": 7823, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, - "lines": [57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "VaultEarlyWithdraw", - "source_mapping": { - "start": 548, - "length": 2224, - "filename_relative": "contracts/core/VaultEarlyWithdraw.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultEarlyWithdraw.sol", - "filename_short": "contracts/core/VaultEarlyWithdraw.sol", - "is_dependency": false, - "lines": [ - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "withdraw(address,uint256)" + "lines": [ + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233 + ], + "starting_column": 1, + "ending_column": 2 } - } - }, - "additional_fields": { "underlying_type": "external_calls" } + }, + "signature": "withdrawFor(address,uint256,uint256,uint8,bytes32,bytes32)" + } }, { "type": "node", - "name": "EarlyWithdraw(msg.sender,_templeAmount)", + "name": "require(bool,string)(block.timestamp <= deadline,Vault: expired deadline)", "source_mapping": { - "start": 2380, - "length": 45, - "filename_relative": "contracts/core/VaultEarlyWithdraw.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultEarlyWithdraw.sol", - "filename_short": "contracts/core/VaultEarlyWithdraw.sol", + "start": 4050, + "length": 63, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, - "lines": [67], + "lines": [101], "starting_column": 9, - "ending_column": 54 + "ending_column": 72 }, "type_specific_fields": { "parent": { "type": "function", - "name": "withdraw", + "name": "withdrawFor", "source_mapping": { - "start": 1870, - "length": 562, - "filename_relative": "contracts/core/VaultEarlyWithdraw.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultEarlyWithdraw.sol", - "filename_short": "contracts/core/VaultEarlyWithdraw.sol", + "start": 3932, + "length": 543, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, - "lines": [57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68], + "lines": [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "VaultEarlyWithdraw", + "name": "Vault", "source_mapping": { - "start": 548, - "length": 2224, - "filename_relative": "contracts/core/VaultEarlyWithdraw.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultEarlyWithdraw.sol", - "filename_short": "contracts/core/VaultEarlyWithdraw.sol", + "start": 1161, + "length": 7823, + "filename_relative": "contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", + "filename_short": "contracts/core/Vault.sol", "is_dependency": false, "lines": [ - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78 + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233 ], "starting_column": 1, "ending_column": 2 } }, - "signature": "withdraw(address,uint256)" + "signature": "withdrawFor(address,uint256,uint256,uint8,bytes32,bytes32)" } } - }, - "additional_fields": { "underlying_type": "event" } + } } ], - "description": "Reentrancy in VaultEarlyWithdraw.withdraw(address,uint256) (contracts/core/VaultEarlyWithdraw.sol#57-68):\n\tExternal calls:\n\t- IERC20(_vault).safeTransferFrom(msg.sender,owner(),_templeAmount) (contracts/core/VaultEarlyWithdraw.sol#62)\n\t- templeToken.safeTransfer(msg.sender,_templeAmount) (contracts/core/VaultEarlyWithdraw.sol#65)\n\tEvent emitted after the call(s):\n\t- EarlyWithdraw(msg.sender,_templeAmount) (contracts/core/VaultEarlyWithdraw.sol#67)\n", - "markdown": "Reentrancy in [VaultEarlyWithdraw.withdraw(address,uint256)](contracts/core/VaultEarlyWithdraw.sol#L57-L68):\n\tExternal calls:\n\t- [IERC20(_vault).safeTransferFrom(msg.sender,owner(),_templeAmount)](contracts/core/VaultEarlyWithdraw.sol#L62)\n\t- [templeToken.safeTransfer(msg.sender,_templeAmount)](contracts/core/VaultEarlyWithdraw.sol#L65)\n\tEvent emitted after the call(s):\n\t- [EarlyWithdraw(msg.sender,_templeAmount)](contracts/core/VaultEarlyWithdraw.sol#L67)\n", - "first_markdown_element": "contracts/core/VaultEarlyWithdraw.sol#L57-L68", - "id": "7a41d062356aa90302a9b5d0829abad146259b6d909dd1702764a586f2839691", - "check": "reentrancy-events", + "description": "Vault.withdrawFor(address,uint256,uint256,uint8,bytes32,bytes32) (contracts/core/Vault.sol#100-110) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- require(bool,string)(block.timestamp <= deadline,Vault: expired deadline) (contracts/core/Vault.sol#101)\n", + "markdown": "[Vault.withdrawFor(address,uint256,uint256,uint8,bytes32,bytes32)](contracts/core/Vault.sol#L100-L110) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [require(bool,string)(block.timestamp <= deadline,Vault: expired deadline)](contracts/core/Vault.sol#L101)\n", + "first_markdown_element": "contracts/core/Vault.sol#L100-L110", + "id": "23a917169154350b1f8e103875cf17fe3784896b355e9f9441c8bdfede6fc4a3", + "check": "timestamp", "impact": "Low", "confidence": "Medium" }, @@ -52053,15 +46585,15 @@ "elements": [ { "type": "function", - "name": "withdrawFor", + "name": "inEnterExitWindow", "source_mapping": { - "start": 8505, - "length": 349, + "start": 5359, + "length": 569, "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", "filename_short": "contracts/core/Vault.sol", "is_dependency": false, - "lines": [220, 221, 222, 223, 224, 225, 226, 227, 228, 229], + "lines": [140, 141, 142, 143, 144, 145, 146, 147, 148], "starting_column": 5, "ending_column": 6 }, @@ -52073,7 +46605,7 @@ "start": 1161, "length": 7823, "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", "filename_short": "contracts/core/Vault.sol", "is_dependency": false, "lines": [ @@ -52097,35 +46629,35 @@ "ending_column": 2 } }, - "signature": "withdrawFor(address,address,uint256)" + "signature": "inEnterExitWindow()" } }, { "type": "node", - "name": "templeExposureToken.redeemAmount(_amount,_to)", + "name": "block.timestamp < firstPeriodStartTimestamp", "source_mapping": { - "start": 8759, - "length": 46, + "start": 5459, + "length": 43, "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", "filename_short": "contracts/core/Vault.sol", "is_dependency": false, - "lines": [227], - "starting_column": 9, - "ending_column": 55 + "lines": [141], + "starting_column": 13, + "ending_column": 56 }, "type_specific_fields": { "parent": { "type": "function", - "name": "withdrawFor", + "name": "inEnterExitWindow", "source_mapping": { - "start": 8505, - "length": 349, + "start": 5359, + "length": 569, "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", "filename_short": "contracts/core/Vault.sol", "is_dependency": false, - "lines": [220, 221, 222, 223, 224, 225, 226, 227, 228, 229], + "lines": [140, 141, 142, 143, 144, 145, 146, 147, 148], "starting_column": 5, "ending_column": 6 }, @@ -52137,7 +46669,7 @@ "start": 1161, "length": 7823, "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", "filename_short": "contracts/core/Vault.sol", "is_dependency": false, "lines": [ @@ -52162,38 +46694,37 @@ "ending_column": 2 } }, - "signature": "withdrawFor(address,address,uint256)" + "signature": "inEnterExitWindow()" } } - }, - "additional_fields": { "underlying_type": "external_calls" } + } }, { "type": "node", - "name": "Withdraw(_account,_amount)", + "name": "inWindow = cycleNumber * periodDuration + firstPeriodStartTimestamp + enterExitWindowDuration + ENTER_EXIT_WINDOW_BUFFER > block.timestamp", "source_mapping": { - "start": 8815, - "length": 32, + "start": 5783, + "length": 138, "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", "filename_short": "contracts/core/Vault.sol", "is_dependency": false, - "lines": [228], + "lines": [147], "starting_column": 9, - "ending_column": 41 + "ending_column": 147 }, "type_specific_fields": { "parent": { "type": "function", - "name": "withdrawFor", + "name": "inEnterExitWindow", "source_mapping": { - "start": 8505, - "length": 349, + "start": 5359, + "length": 569, "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", "filename_short": "contracts/core/Vault.sol", "is_dependency": false, - "lines": [220, 221, 222, 223, 224, 225, 226, 227, 228, 229], + "lines": [140, 141, 142, 143, 144, 145, 146, 147, 148], "starting_column": 5, "ending_column": 6 }, @@ -52205,7 +46736,7 @@ "start": 1161, "length": 7823, "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", "filename_short": "contracts/core/Vault.sol", "is_dependency": false, "lines": [ @@ -52230,18 +46761,17 @@ "ending_column": 2 } }, - "signature": "withdrawFor(address,address,uint256)" + "signature": "inEnterExitWindow()" } } - }, - "additional_fields": { "underlying_type": "event" } + } } ], - "description": "Reentrancy in Vault.withdrawFor(address,address,uint256) (contracts/core/Vault.sol#220-229):\n\tExternal calls:\n\t- templeExposureToken.redeemAmount(_amount,_to) (contracts/core/Vault.sol#227)\n\tEvent emitted after the call(s):\n\t- Withdraw(_account,_amount) (contracts/core/Vault.sol#228)\n", - "markdown": "Reentrancy in [Vault.withdrawFor(address,address,uint256)](contracts/core/Vault.sol#L220-L229):\n\tExternal calls:\n\t- [templeExposureToken.redeemAmount(_amount,_to)](contracts/core/Vault.sol#L227)\n\tEvent emitted after the call(s):\n\t- [Withdraw(_account,_amount)](contracts/core/Vault.sol#L228)\n", - "first_markdown_element": "contracts/core/Vault.sol#L220-L229", - "id": "63e868ac379538e3598eed469ba9a28458891a3aec02e3895802a5953d73a01a", - "check": "reentrancy-events", + "description": "Vault.inEnterExitWindow() (contracts/core/Vault.sol#140-148) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- block.timestamp < firstPeriodStartTimestamp (contracts/core/Vault.sol#141)\n\t- inWindow = cycleNumber * periodDuration + firstPeriodStartTimestamp + enterExitWindowDuration + ENTER_EXIT_WINDOW_BUFFER > block.timestamp (contracts/core/Vault.sol#147)\n", + "markdown": "[Vault.inEnterExitWindow()](contracts/core/Vault.sol#L140-L148) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [block.timestamp < firstPeriodStartTimestamp](contracts/core/Vault.sol#L141)\n\t- [inWindow = cycleNumber * periodDuration + firstPeriodStartTimestamp + enterExitWindowDuration + ENTER_EXIT_WINDOW_BUFFER > block.timestamp](contracts/core/Vault.sol#L147)\n", + "first_markdown_element": "contracts/core/Vault.sol#L140-L148", + "id": "1ec8a1ed491ee4363e9d98709e6ea81c368e5197aa117baaec3fb5dca7a37050", + "check": "timestamp", "impact": "Low", "confidence": "Medium" }, @@ -52254,7 +46784,7 @@ "start": 1642, "length": 627, "filename_relative": "contracts/deprecated/LockedOGTemple.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/LockedOGTemple.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/LockedOGTemple.sol", "filename_short": "contracts/deprecated/LockedOGTemple.sol", "is_dependency": false, "lines": [ @@ -52272,97 +46802,36 @@ "start": 213, "length": 2143, "filename_relative": "contracts/deprecated/LockedOGTemple.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/LockedOGTemple.sol", - "filename_short": "contracts/deprecated/LockedOGTemple.sol", - "is_dependency": false, - "lines": [ - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "withdrawFor(address,uint256)" - } - }, - { - "type": "node", - "name": "SafeERC20.safeTransfer(OG_TEMPLE,_staker,entry.BalanceOGTemple)", - "source_mapping": { - "start": 2140, - "length": 65, - "filename_relative": "contracts/deprecated/LockedOGTemple.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/LockedOGTemple.sol", - "filename_short": "contracts/deprecated/LockedOGTemple.sol", - "is_dependency": false, - "lines": [79], - "starting_column": 5, - "ending_column": 70 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "withdrawFor", - "source_mapping": { - "start": 1642, - "length": 627, - "filename_relative": "contracts/deprecated/LockedOGTemple.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/LockedOGTemple.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/LockedOGTemple.sol", "filename_short": "contracts/deprecated/LockedOGTemple.sol", - "is_dependency": false, - "lines": [ - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81 - ], - "starting_column": 3, - "ending_column": 4 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "LockedOGTemple", - "source_mapping": { - "start": 213, - "length": 2143, - "filename_relative": "contracts/deprecated/LockedOGTemple.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/LockedOGTemple.sol", - "filename_short": "contracts/deprecated/LockedOGTemple.sol", - "is_dependency": false, - "lines": [ - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "withdrawFor(address,uint256)" + "is_dependency": false, + "lines": [ + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86 + ], + "starting_column": 1, + "ending_column": 2 } - } - }, - "additional_fields": { "underlying_type": "external_calls" } + }, + "signature": "withdrawFor(address,uint256)" + } }, { "type": "node", - "name": "OGTempleWithdraw(_staker,entry.BalanceOGTemple)", + "name": "require(bool,string)(lockedEntries[_idx].LockedUntilTimestamp < block.timestamp,Specified entry is still locked)", "source_mapping": { - "start": 2211, - "length": 53, + "start": 1867, + "length": 120, "filename_relative": "contracts/deprecated/LockedOGTemple.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/LockedOGTemple.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/LockedOGTemple.sol", "filename_short": "contracts/deprecated/LockedOGTemple.sol", "is_dependency": false, - "lines": [80], + "lines": [69, 70, 71, 72], "starting_column": 5, - "ending_column": 58 + "ending_column": 6 }, "type_specific_fields": { "parent": { @@ -52372,7 +46841,7 @@ "start": 1642, "length": 627, "filename_relative": "contracts/deprecated/LockedOGTemple.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/LockedOGTemple.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/LockedOGTemple.sol", "filename_short": "contracts/deprecated/LockedOGTemple.sol", "is_dependency": false, "lines": [ @@ -52390,7 +46859,7 @@ "start": 213, "length": 2143, "filename_relative": "contracts/deprecated/LockedOGTemple.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/LockedOGTemple.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/LockedOGTemple.sol", "filename_short": "contracts/deprecated/LockedOGTemple.sol", "is_dependency": false, "lines": [ @@ -52408,15 +46877,14 @@ "signature": "withdrawFor(address,uint256)" } } - }, - "additional_fields": { "underlying_type": "event" } + } } ], - "description": "Reentrancy in LockedOGTemple.withdrawFor(address,uint256) (contracts/deprecated/LockedOGTemple.sol#62-81):\n\tExternal calls:\n\t- SafeERC20.safeTransfer(OG_TEMPLE,_staker,entry.BalanceOGTemple) (contracts/deprecated/LockedOGTemple.sol#79)\n\tEvent emitted after the call(s):\n\t- OGTempleWithdraw(_staker,entry.BalanceOGTemple) (contracts/deprecated/LockedOGTemple.sol#80)\n", - "markdown": "Reentrancy in [LockedOGTemple.withdrawFor(address,uint256)](contracts/deprecated/LockedOGTemple.sol#L62-L81):\n\tExternal calls:\n\t- [SafeERC20.safeTransfer(OG_TEMPLE,_staker,entry.BalanceOGTemple)](contracts/deprecated/LockedOGTemple.sol#L79)\n\tEvent emitted after the call(s):\n\t- [OGTempleWithdraw(_staker,entry.BalanceOGTemple)](contracts/deprecated/LockedOGTemple.sol#L80)\n", + "description": "LockedOGTemple.withdrawFor(address,uint256) (contracts/deprecated/LockedOGTemple.sol#62-81) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- require(bool,string)(lockedEntries[_idx].LockedUntilTimestamp < block.timestamp,Specified entry is still locked) (contracts/deprecated/LockedOGTemple.sol#69-72)\n", + "markdown": "[LockedOGTemple.withdrawFor(address,uint256)](contracts/deprecated/LockedOGTemple.sol#L62-L81) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [require(bool,string)(lockedEntries[_idx].LockedUntilTimestamp < block.timestamp,Specified entry is still locked)](contracts/deprecated/LockedOGTemple.sol#L69-L72)\n", "first_markdown_element": "contracts/deprecated/LockedOGTemple.sol#L62-L81", - "id": "1121dbdb9cb432f782fa1dcd86b226568d78c9cf57bb807ccdc10360eed217f4", - "check": "reentrancy-events", + "id": "87a3b425d06a0ad7aa92a349ed04204eb047ebb07373cbfbcf3ed5aaaf25be67", + "check": "timestamp", "impact": "Low", "confidence": "Medium" }, @@ -52424,121 +46892,187 @@ "elements": [ { "type": "function", - "name": "_update", + "name": "constructor", "source_mapping": { - "start": 3107, - "length": 847, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1568, + "length": 783, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, - "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], + "lines": [ + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "TempleStaking", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 464, + "length": 6184, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185 + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_update(uint256,uint256,uint112,uint112)" + "signature": "constructor(IERC20,IExitQueue,uint256,uint256)" } }, { "type": "node", - "name": "timeElapsed > 0 && _reserve0 != 0 && _reserve1 != 0", + "name": "require(bool,string)(_startTimestamp < block.timestamp,Start timestamp must be in the past)", "source_mapping": { - "start": 3460, - "length": 51, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1716, + "length": 81, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, - "lines": [84], - "starting_column": 13, - "ending_column": 64 + "lines": [51], + "starting_column": 9, + "ending_column": 90 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_update", + "name": "constructor", "source_mapping": { - "start": 3107, - "length": 847, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 1568, + "length": 783, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, - "lines": [80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93], + "lines": [ + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleUniswapV2Pair", + "name": "TempleStaking", "source_mapping": { - "start": 440, - "length": 8733, - "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", - "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", + "start": 464, + "length": 6184, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185 + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_update(uint256,uint256,uint112,uint112)" + "signature": "constructor(IERC20,IExitQueue,uint256,uint256)" + } + } + } + }, + { + "type": "node", + "name": "require(bool,string)(_startTimestamp > (block.timestamp - (24 * 2 * 60 * 60)),Start timestamp can't be more than 2 days in the past)", + "source_mapping": { + "start": 1807, + "length": 122, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", + "is_dependency": false, + "lines": [52], + "starting_column": 9, + "ending_column": 131 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "constructor", + "source_mapping": { + "start": 1568, + "length": 783, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", + "is_dependency": false, + "lines": [ + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleStaking", + "source_mapping": { + "start": 464, + "length": 6184, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", + "is_dependency": false, + "lines": [ + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "constructor(IERC20,IExitQueue,uint256,uint256)" } } } } ], - "description": "TempleUniswapV2Pair._update(uint256,uint256,uint112,uint112) (contracts/amm/TempleUniswapV2Pair.sol#80-93) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- timeElapsed > 0 && _reserve0 != 0 && _reserve1 != 0 (contracts/amm/TempleUniswapV2Pair.sol#84)\n", - "markdown": "[TempleUniswapV2Pair._update(uint256,uint256,uint112,uint112)](contracts/amm/TempleUniswapV2Pair.sol#L80-L93) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [timeElapsed > 0 && _reserve0 != 0 && _reserve1 != 0](contracts/amm/TempleUniswapV2Pair.sol#L84)\n", - "first_markdown_element": "contracts/amm/TempleUniswapV2Pair.sol#L80-L93", - "id": "3e4c1fb2f0df938570805f2a5513be58a1af7dd63232a6822178ed2775dc9957", + "description": "TempleStaking.constructor(IERC20,IExitQueue,uint256,uint256) (contracts/deprecated/TempleStaking.sol#45-64) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- require(bool,string)(_startTimestamp < block.timestamp,Start timestamp must be in the past) (contracts/deprecated/TempleStaking.sol#51)\n\t- require(bool,string)(_startTimestamp > (block.timestamp - (24 * 2 * 60 * 60)),Start timestamp can't be more than 2 days in the past) (contracts/deprecated/TempleStaking.sol#52)\n", + "markdown": "[TempleStaking.constructor(IERC20,IExitQueue,uint256,uint256)](contracts/deprecated/TempleStaking.sol#L45-L64) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [require(bool,string)(_startTimestamp < block.timestamp,Start timestamp must be in the past)](contracts/deprecated/TempleStaking.sol#L51)\n\t- [require(bool,string)(_startTimestamp > (block.timestamp - (24 * 2 * 60 * 60)),Start timestamp can't be more than 2 days in the past)](contracts/deprecated/TempleStaking.sol#L52)\n", + "first_markdown_element": "contracts/deprecated/TempleStaking.sol#L45-L64", + "id": "554e23718b67bc5f2aee502eb1257244b26e204743aa400a021bde5dfdae3375", "check": "timestamp", "impact": "Low", "confidence": "Medium" @@ -52547,17 +47081,17 @@ "elements": [ { "type": "function", - "name": "_initBaseCache", + "name": "_updateAccumulationFactor", "source_mapping": { - "start": 26067, - "length": 748, - "filename_relative": "contracts/v2/TempleDebtToken.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TempleDebtToken.sol", - "filename_short": "contracts/v2/TempleDebtToken.sol", + "start": 4050, + "length": 745, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, "lines": [ - 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, - 613, 614, 615, 616, 617, 618, 619, 620 + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120 ], "starting_column": 5, "ending_column": 6 @@ -52565,108 +47099,62 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleDebtToken", + "name": "TempleStaking", "source_mapping": { - "start": 2202, - "length": 30794, - "filename_relative": "contracts/v2/TempleDebtToken.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TempleDebtToken.sol", - "filename_short": "contracts/v2/TempleDebtToken.sol", + "start": 464, + "length": 6184, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, "lines": [ - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, - 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, - 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, - 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, - 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, - 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, - 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, - 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, - 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, - 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, - 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, - 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, - 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, - 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, - 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, - 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, - 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, - 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, - 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, - 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, - 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, - 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, - 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, - 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, - 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, - 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, - 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, - 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, - 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, - 778, 779, 780, 781, 782, 783, 784, 785, 786, 787 + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "_initBaseCache(TempleDebtToken.BaseCache)" + "signature": "_updateAccumulationFactor()" } }, { "type": "node", - "name": "_timeElapsed > 0", + "name": "_currentEpoch <= lastUpdatedEpoch", "source_mapping": { - "start": 26453, - "length": 16, - "filename_relative": "contracts/v2/TempleDebtToken.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TempleDebtToken.sol", - "filename_short": "contracts/v2/TempleDebtToken.sol", + "start": 4429, + "length": 33, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, - "lines": [610], + "lines": [112], "starting_column": 13, - "ending_column": 29 + "ending_column": 46 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_initBaseCache", + "name": "_updateAccumulationFactor", "source_mapping": { - "start": 26067, - "length": 748, - "filename_relative": "contracts/v2/TempleDebtToken.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TempleDebtToken.sol", - "filename_short": "contracts/v2/TempleDebtToken.sol", + "start": 4050, + "length": 745, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, "lines": [ - 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, - 613, 614, 615, 616, 617, 618, 619, 620 + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120 ], "starting_column": 5, "ending_column": 6 @@ -52674,92 +47162,41 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleDebtToken", + "name": "TempleStaking", "source_mapping": { - "start": 2202, - "length": 30794, - "filename_relative": "contracts/v2/TempleDebtToken.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TempleDebtToken.sol", - "filename_short": "contracts/v2/TempleDebtToken.sol", + "start": 464, + "length": 6184, + "filename_relative": "contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", + "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, "lines": [ - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, - 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, - 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, - 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, - 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, - 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, - 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, - 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, - 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, - 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, - 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, - 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, - 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, - 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, - 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, - 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, - 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, - 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, - 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, - 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, - 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, - 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, - 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, - 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, - 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, - 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, - 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, - 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, - 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, - 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, - 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, - 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, - 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, - 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, - 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, - 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, - 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, - 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, - 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, - 783, 784, 785, 786, 787 + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "_initBaseCache(TempleDebtToken.BaseCache)" + "signature": "_updateAccumulationFactor()" } } } } ], - "description": "TempleDebtToken._initBaseCache(TempleDebtToken.BaseCache) (contracts/v2/TempleDebtToken.sol#600-620) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- _timeElapsed > 0 (contracts/v2/TempleDebtToken.sol#610)\n", - "markdown": "[TempleDebtToken._initBaseCache(TempleDebtToken.BaseCache)](contracts/v2/TempleDebtToken.sol#L600-L620) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [_timeElapsed > 0](contracts/v2/TempleDebtToken.sol#L610)\n", - "first_markdown_element": "contracts/v2/TempleDebtToken.sol#L600-L620", - "id": "6e8b2fe865c5b94af26bfe6da60132a041274861c67401abfd680652de9fb083", + "description": "TempleStaking._updateAccumulationFactor() (contracts/deprecated/TempleStaking.sol#105-120) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- _currentEpoch <= lastUpdatedEpoch (contracts/deprecated/TempleStaking.sol#112)\n", + "markdown": "[TempleStaking._updateAccumulationFactor()](contracts/deprecated/TempleStaking.sol#L105-L120) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [_currentEpoch <= lastUpdatedEpoch](contracts/deprecated/TempleStaking.sol#L112)\n", + "first_markdown_element": "contracts/deprecated/TempleStaking.sol#L105-L120", + "id": "2c34b26cb8045acf51e728be298d8b7511ea225b13e5adb53e7379207bee9ebf", "check": "timestamp", "impact": "Low", "confidence": "Medium" @@ -52768,132 +47205,81 @@ "elements": [ { "type": "function", - "name": "_initDebtorCache", + "name": "relayedSetEndorsementsFor", "source_mapping": { - "start": 28394, - "length": 2547, - "filename_relative": "contracts/v2/TempleDebtToken.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TempleDebtToken.sol", - "filename_short": "contracts/v2/TempleDebtToken.sol", + "start": 3694, + "length": 758, + "filename_relative": "contracts/governance/ElderElection.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/governance/ElderElection.sol", + "filename_short": "contracts/governance/ElderElection.sol", "is_dependency": false, - "lines": [ - 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, - 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, - 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, - 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, - 724, 725, 726, 727, 728, 729, 730, 731, 732 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleDebtToken", - "source_mapping": { - "start": 2202, - "length": 30794, - "filename_relative": "contracts/v2/TempleDebtToken.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TempleDebtToken.sol", - "filename_short": "contracts/v2/TempleDebtToken.sol", - "is_dependency": false, - "lines": [ - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, - 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, - 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, - 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, - 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, - 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, - 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, - 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, - 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, - 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, - 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, - 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, - 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, - 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, - 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, - 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, - 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, - 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, - 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, - 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, - 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, - 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, - 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, - 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, - 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, - 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, - 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, - 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, - 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, - 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, - 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, - 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, - 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, - 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, - 778, 779, 780, 781, 782, 783, 784, 785, 786, 787 + "lines": [ + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ElderElection", + "source_mapping": { + "start": 908, + "length": 5057, + "filename_relative": "contracts/governance/ElderElection.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/governance/ElderElection.sol", + "filename_short": "contracts/governance/ElderElection.sol", + "is_dependency": false, + "lines": [ + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184 ], "starting_column": 1, "ending_column": 2 } }, - "signature": "_initDebtorCache(TempleDebtToken.BaseCache,ITempleDebtToken.Debtor,TempleDebtToken.DebtorCache,bool)" + "signature": "relayedSetEndorsementsFor(ElderElection.EndorsementReq,bytes)" } }, { "type": "node", - "name": "_timeElapsed > 0", + "name": "block.timestamp > req.deadline", "source_mapping": { - "start": 29925, - "length": 16, - "filename_relative": "contracts/v2/TempleDebtToken.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TempleDebtToken.sol", - "filename_short": "contracts/v2/TempleDebtToken.sol", + "start": 4147, + "length": 30, + "filename_relative": "contracts/governance/ElderElection.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/governance/ElderElection.sol", + "filename_short": "contracts/governance/ElderElection.sol", "is_dependency": false, - "lines": [710], + "lines": [128], "starting_column": 13, - "ending_column": 29 + "ending_column": 43 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_initDebtorCache", + "name": "relayedSetEndorsementsFor", "source_mapping": { - "start": 28394, - "length": 2547, - "filename_relative": "contracts/v2/TempleDebtToken.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TempleDebtToken.sol", - "filename_short": "contracts/v2/TempleDebtToken.sol", + "start": 3694, + "length": 758, + "filename_relative": "contracts/governance/ElderElection.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/governance/ElderElection.sol", + "filename_short": "contracts/governance/ElderElection.sol", "is_dependency": false, "lines": [ - 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, - 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, - 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, - 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, - 724, 725, 726, 727, 728, 729, 730, 731, 732 + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133 ], "starting_column": 5, "ending_column": 6 @@ -52901,15 +47287,16 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleDebtToken", + "name": "ElderElection", "source_mapping": { - "start": 2202, - "length": 30794, - "filename_relative": "contracts/v2/TempleDebtToken.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TempleDebtToken.sol", - "filename_short": "contracts/v2/TempleDebtToken.sol", + "start": 908, + "length": 5057, + "filename_relative": "contracts/governance/ElderElection.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/governance/ElderElection.sol", + "filename_short": "contracts/governance/ElderElection.sol", "is_dependency": false, "lines": [ + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, @@ -52921,72 +47308,22 @@ 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, - 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, - 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, - 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, - 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, - 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, - 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, - 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, - 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, - 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, - 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, - 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, - 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, - 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, - 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, - 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, - 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, - 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, - 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, - 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, - 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, - 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, - 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, - 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, - 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, - 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, - 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, - 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, - 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, - 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, - 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, - 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, - 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, - 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, - 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, - 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, - 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, - 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, - 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, - 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, - 783, 784, 785, 786, 787 + 183, 184 ], "starting_column": 1, "ending_column": 2 } }, - "signature": "_initDebtorCache(TempleDebtToken.BaseCache,ITempleDebtToken.Debtor,TempleDebtToken.DebtorCache,bool)" + "signature": "relayedSetEndorsementsFor(ElderElection.EndorsementReq,bytes)" } } } } ], - "description": "TempleDebtToken._initDebtorCache(TempleDebtToken.BaseCache,ITempleDebtToken.Debtor,TempleDebtToken.DebtorCache,bool) (contracts/v2/TempleDebtToken.sol#672-732) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- _timeElapsed > 0 (contracts/v2/TempleDebtToken.sol#710)\n", - "markdown": "[TempleDebtToken._initDebtorCache(TempleDebtToken.BaseCache,ITempleDebtToken.Debtor,TempleDebtToken.DebtorCache,bool)](contracts/v2/TempleDebtToken.sol#L672-L732) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [_timeElapsed > 0](contracts/v2/TempleDebtToken.sol#L710)\n", - "first_markdown_element": "contracts/v2/TempleDebtToken.sol#L672-L732", - "id": "3db535aad30989ad97556838a81a972efa9ee5b5400596dc61690254418f0002", + "description": "ElderElection.relayedSetEndorsementsFor(ElderElection.EndorsementReq,bytes) (contracts/governance/ElderElection.sol#116-133) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- block.timestamp > req.deadline (contracts/governance/ElderElection.sol#128)\n", + "markdown": "[ElderElection.relayedSetEndorsementsFor(ElderElection.EndorsementReq,bytes)](contracts/governance/ElderElection.sol#L116-L133) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [block.timestamp > req.deadline](contracts/governance/ElderElection.sol#L128)\n", + "first_markdown_element": "contracts/governance/ElderElection.sol#L116-L133", + "id": "239671d596cd02628eaf3011f43031162b8fe5ef0e67e790828aa11ea864ca0c", "check": "timestamp", "impact": "Low", "confidence": "Medium" @@ -52995,128 +47332,856 @@ "elements": [ { "type": "function", - "name": "treasuryPriceIndex", + "name": "_setAux", "source_mapping": { - "start": 2676, - "length": 309, - "filename_relative": "contracts/v2/TreasuryPriceIndexOracle.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryPriceIndexOracle.sol", - "filename_short": "contracts/v2/TreasuryPriceIndexOracle.sol", + "start": 8668, + "length": 395, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, - "lines": [70, 71, 72, 73, 74], + "lines": [238, 239, 240, 241, 242, 243, 244, 245, 246, 247], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryPriceIndexOracle", + "name": "ERC721ACustom", "source_mapping": { - "start": 672, - "length": 3918, - "filename_relative": "contracts/v2/TreasuryPriceIndexOracle.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryPriceIndexOracle.sol", - "filename_short": "contracts/v2/TreasuryPriceIndexOracle.sol", + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119 + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, + 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, + 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, + 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, + 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, + 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, + 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, + 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, + 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, + 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, + 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, + 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, + 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, + 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, + 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, + 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, + 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, + 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, + 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, + 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, + 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, + 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, + 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, + 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, + 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, + 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, + 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, + 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, + 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, + 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, + 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, + 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, + 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, + 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, + 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, + 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, + 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, + 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, + 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, + 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, + 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, + 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, + 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, + 1150, 1151, 1152, 1153, 1154, 1155 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "treasuryPriceIndex()" + "signature": "_setAux(address,uint64)" } }, { "type": "node", - "name": "(block.timestamp < (tpiData.lastUpdatedAt + tpiData.cooldownSecs))", + "name": "", "source_mapping": { - "start": 2754, - "length": 204, - "filename_relative": "contracts/v2/TreasuryPriceIndexOracle.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryPriceIndexOracle.sol", - "filename_short": "contracts/v2/TreasuryPriceIndexOracle.sol", + "start": 8882, + "length": 49, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, - "lines": [71, 72, 73], + "lines": [242, 243, 244], "starting_column": 9, - "ending_column": 33 + "ending_column": 10 }, "type_specific_fields": { "parent": { "type": "function", - "name": "treasuryPriceIndex", + "name": "_setAux", "source_mapping": { - "start": 2676, - "length": 309, - "filename_relative": "contracts/v2/TreasuryPriceIndexOracle.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryPriceIndexOracle.sol", - "filename_short": "contracts/v2/TreasuryPriceIndexOracle.sol", + "start": 8668, + "length": 395, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, - "lines": [70, 71, 72, 73, 74], + "lines": [238, 239, 240, 241, 242, 243, 244, 245, 246, 247], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryPriceIndexOracle", + "name": "ERC721ACustom", "source_mapping": { - "start": 672, - "length": 3918, - "filename_relative": "contracts/v2/TreasuryPriceIndexOracle.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryPriceIndexOracle.sol", - "filename_short": "contracts/v2/TreasuryPriceIndexOracle.sol", + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "treasuryPriceIndex()" + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, + 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, + 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, + 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, + 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, + 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, + 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, + 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, + 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, + 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, + 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, + 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, + 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, + 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, + 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, + 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, + 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, + 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, + 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, + 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, + 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, + 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, + 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, + 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, + 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, + 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, + 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, + 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, + 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, + 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, + 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, + 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, + 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, + 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, + 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, + 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, + 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, + 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, + 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, + 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, + 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, + 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, + 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, + 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, + 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, + 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, + 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, + 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, + 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, + 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, + 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, + 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, + 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, + 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, + 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, + 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, + 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, + 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, + 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, + 1151, 1152, 1153, 1154, 1155 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "_setAux(address,uint64)" + } + } + } + } + ], + "description": "ERC721ACustom._setAux(address,uint64) (contracts/nexus/ERC721ACustom.sol#238-247) uses assembly\n\t- INLINE ASM (contracts/nexus/ERC721ACustom.sol#242-244)\n", + "markdown": "[ERC721ACustom._setAux(address,uint64)](contracts/nexus/ERC721ACustom.sol#L238-L247) uses assembly\n\t- [INLINE ASM](contracts/nexus/ERC721ACustom.sol#L242-L244)\n", + "first_markdown_element": "contracts/nexus/ERC721ACustom.sol#L238-L247", + "id": "06e480d7c1139fd7ecd8efc1f85a43be745b486e9c1acd3769a1872ebf957d16", + "check": "assembly", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "_packOwnershipData", + "source_mapping": { + "start": 15849, + "length": 443, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", + "is_dependency": false, + "lines": [408, 409, 410, 411, 412, 413, 414, 415], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ERC721ACustom", + "source_mapping": { + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", + "is_dependency": false, + "lines": [ + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, + 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, + 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, + 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, + 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, + 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, + 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, + 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, + 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, + 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, + 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, + 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, + 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, + 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, + 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, + 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, + 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, + 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, + 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, + 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, + 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, + 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, + 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, + 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, + 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, + 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, + 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, + 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, + 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, + 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, + 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, + 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, + 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, + 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, + 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, + 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, + 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, + 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, + 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, + 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, + 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, + 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, + 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, + 1150, 1151, 1152, 1153, 1154, 1155 + ], + "starting_column": 1, + "ending_column": 0 } - } + }, + "signature": "_packOwnershipData(address,uint256)" } - } - ], - "description": "TreasuryPriceIndexOracle.treasuryPriceIndex() (contracts/v2/TreasuryPriceIndexOracle.sol#70-74) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- (block.timestamp < (tpiData.lastUpdatedAt + tpiData.cooldownSecs)) (contracts/v2/TreasuryPriceIndexOracle.sol#71-73)\n", - "markdown": "[TreasuryPriceIndexOracle.treasuryPriceIndex()](contracts/v2/TreasuryPriceIndexOracle.sol#L70-L74) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [(block.timestamp < (tpiData.lastUpdatedAt + tpiData.cooldownSecs))](contracts/v2/TreasuryPriceIndexOracle.sol#L71-L73)\n", - "first_markdown_element": "contracts/v2/TreasuryPriceIndexOracle.sol#L70-L74", - "id": "649566e5b9f48d4a53dd158c2137fe6a456902d4dbc71fadce5826d8bdeea4cf", - "check": "timestamp", - "impact": "Low", - "confidence": "Medium" + }, + { + "type": "node", + "name": "", + "source_mapping": { + "start": 15955, + "length": 331, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", + "is_dependency": false, + "lines": [409, 410, 411, 412, 413, 414], + "starting_column": 9, + "ending_column": 10 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "_packOwnershipData", + "source_mapping": { + "start": 15849, + "length": 443, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", + "is_dependency": false, + "lines": [408, 409, 410, 411, 412, 413, 414, 415], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ERC721ACustom", + "source_mapping": { + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", + "is_dependency": false, + "lines": [ + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, + 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, + 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, + 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, + 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, + 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, + 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, + 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, + 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, + 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, + 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, + 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, + 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, + 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, + 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, + 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, + 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, + 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, + 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, + 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, + 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, + 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, + 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, + 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, + 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, + 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, + 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, + 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, + 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, + 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, + 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, + 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, + 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, + 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, + 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, + 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, + 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, + 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, + 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, + 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, + 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, + 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, + 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, + 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, + 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, + 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, + 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, + 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, + 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, + 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, + 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, + 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, + 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, + 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, + 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, + 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, + 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, + 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, + 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, + 1151, 1152, 1153, 1154, 1155 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "_packOwnershipData(address,uint256)" + } + } + } + } + ], + "description": "ERC721ACustom._packOwnershipData(address,uint256) (contracts/nexus/ERC721ACustom.sol#408-415) uses assembly\n\t- INLINE ASM (contracts/nexus/ERC721ACustom.sol#409-414)\n", + "markdown": "[ERC721ACustom._packOwnershipData(address,uint256)](contracts/nexus/ERC721ACustom.sol#L408-L415) uses assembly\n\t- [INLINE ASM](contracts/nexus/ERC721ACustom.sol#L409-L414)\n", + "first_markdown_element": "contracts/nexus/ERC721ACustom.sol#L408-L415", + "id": "fc165c07b15d1aa68f79b4ef53a103deb9da2120f72d52dd210a997739806131", + "check": "assembly", + "impact": "Informational", + "confidence": "High" }, { "elements": [ { "type": "function", - "name": "setTreasuryPriceIndex", + "name": "_nextInitializedFlag", "source_mapping": { - "start": 3772, - "length": 815, - "filename_relative": "contracts/v2/TreasuryPriceIndexOracle.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryPriceIndexOracle.sol", - "filename_short": "contracts/v2/TreasuryPriceIndexOracle.sol", + "start": 16389, + "length": 318, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", + "is_dependency": false, + "lines": [420, 421, 422, 423, 424, 425, 426], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ERC721ACustom", + "source_mapping": { + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", + "is_dependency": false, + "lines": [ + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, + 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, + 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, + 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, + 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, + 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, + 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, + 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, + 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, + 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, + 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, + 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, + 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, + 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, + 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, + 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, + 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, + 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, + 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, + 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, + 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, + 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, + 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, + 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, + 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, + 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, + 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, + 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, + 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, + 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, + 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, + 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, + 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, + 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, + 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, + 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, + 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, + 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, + 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, + 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, + 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, + 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, + 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, + 1150, 1151, 1152, 1153, 1154, 1155 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "_nextInitializedFlag(uint256)" + } + }, + { + "type": "node", + "name": "", + "source_mapping": { + "start": 16550, + "length": 151, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", + "is_dependency": false, + "lines": [422, 423, 424, 425], + "starting_column": 9, + "ending_column": 10 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "_nextInitializedFlag", + "source_mapping": { + "start": 16389, + "length": 318, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", + "is_dependency": false, + "lines": [420, 421, 422, 423, 424, 425, 426], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ERC721ACustom", + "source_mapping": { + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", + "is_dependency": false, + "lines": [ + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, + 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, + 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, + 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, + 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, + 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, + 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, + 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, + 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, + 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, + 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, + 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, + 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, + 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, + 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, + 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, + 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, + 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, + 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, + 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, + 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, + 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, + 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, + 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, + 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, + 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, + 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, + 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, + 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, + 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, + 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, + 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, + 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, + 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, + 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, + 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, + 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, + 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, + 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, + 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, + 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, + 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, + 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, + 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, + 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, + 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, + 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, + 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, + 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, + 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, + 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, + 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, + 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, + 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, + 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, + 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, + 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, + 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, + 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, + 1151, 1152, 1153, 1154, 1155 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "_nextInitializedFlag(uint256)" + } + } + } + } + ], + "description": "ERC721ACustom._nextInitializedFlag(uint256) (contracts/nexus/ERC721ACustom.sol#420-426) uses assembly\n\t- INLINE ASM (contracts/nexus/ERC721ACustom.sol#422-425)\n", + "markdown": "[ERC721ACustom._nextInitializedFlag(uint256)](contracts/nexus/ERC721ACustom.sol#L420-L426) uses assembly\n\t- [INLINE ASM](contracts/nexus/ERC721ACustom.sol#L422-L425)\n", + "first_markdown_element": "contracts/nexus/ERC721ACustom.sol#L420-L426", + "id": "41a3e65a4ae25a85ebaed6307ac7a7c0b20df5583aade927826a4e73be1cf0f7", + "check": "assembly", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "_isSenderApprovedOrOwner", + "source_mapping": { + "start": 19205, + "length": 646, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116 + 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514 ], "starting_column": 5, "ending_column": 6 @@ -53124,58 +48189,140 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryPriceIndexOracle", + "name": "ERC721ACustom", "source_mapping": { - "start": 672, - "length": 3918, - "filename_relative": "contracts/v2/TreasuryPriceIndexOracle.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryPriceIndexOracle.sol", - "filename_short": "contracts/v2/TreasuryPriceIndexOracle.sol", + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119 + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, + 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, + 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, + 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, + 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, + 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, + 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, + 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, + 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, + 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, + 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, + 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, + 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, + 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, + 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, + 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, + 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, + 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, + 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, + 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, + 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, + 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, + 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, + 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, + 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, + 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, + 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, + 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, + 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, + 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, + 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, + 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, + 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, + 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, + 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, + 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, + 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, + 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, + 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, + 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, + 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, + 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, + 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, + 1150, 1151, 1152, 1153, 1154, 1155 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "setTreasuryPriceIndex(uint96)" + "signature": "_isSenderApprovedOrOwner(address,address,address)" } }, { "type": "node", - "name": "_delta > maxTreasuryPriceIndexDelta", + "name": "", "source_mapping": { - "start": 4199, - "length": 35, - "filename_relative": "contracts/v2/TreasuryPriceIndexOracle.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryPriceIndexOracle.sol", - "filename_short": "contracts/v2/TreasuryPriceIndexOracle.sol", + "start": 19373, + "length": 472, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, - "lines": [105], - "starting_column": 17, - "ending_column": 52 + "lines": [506, 507, 508, 509, 510, 511, 512, 513], + "starting_column": 9, + "ending_column": 10 }, "type_specific_fields": { "parent": { "type": "function", - "name": "setTreasuryPriceIndex", + "name": "_isSenderApprovedOrOwner", "source_mapping": { - "start": 3772, - "length": 815, - "filename_relative": "contracts/v2/TreasuryPriceIndexOracle.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryPriceIndexOracle.sol", - "filename_short": "contracts/v2/TreasuryPriceIndexOracle.sol", + "start": 19205, + "length": 646, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116 + 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, + 514 ], "starting_column": 5, "ending_column": 6 @@ -53183,61 +48330,281 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryPriceIndexOracle", + "name": "ERC721ACustom", "source_mapping": { - "start": 672, - "length": 3918, - "filename_relative": "contracts/v2/TreasuryPriceIndexOracle.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryPriceIndexOracle.sol", - "filename_short": "contracts/v2/TreasuryPriceIndexOracle.sol", + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "setTreasuryPriceIndex(uint96)" + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, + 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, + 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, + 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, + 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, + 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, + 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, + 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, + 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, + 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, + 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, + 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, + 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, + 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, + 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, + 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, + 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, + 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, + 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, + 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, + 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, + 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, + 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, + 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, + 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, + 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, + 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, + 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, + 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, + 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, + 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, + 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, + 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, + 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, + 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, + 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, + 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, + 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, + 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, + 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, + 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, + 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, + 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, + 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, + 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, + 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, + 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, + 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, + 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, + 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, + 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, + 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, + 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, + 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, + 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, + 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, + 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, + 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, + 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, + 1151, 1152, 1153, 1154, 1155 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "_isSenderApprovedOrOwner(address,address,address)" + } + } + } + } + ], + "description": "ERC721ACustom._isSenderApprovedOrOwner(address,address,address) (contracts/nexus/ERC721ACustom.sol#501-514) uses assembly\n\t- INLINE ASM (contracts/nexus/ERC721ACustom.sol#506-513)\n", + "markdown": "[ERC721ACustom._isSenderApprovedOrOwner(address,address,address)](contracts/nexus/ERC721ACustom.sol#L501-L514) uses assembly\n\t- [INLINE ASM](contracts/nexus/ERC721ACustom.sol#L506-L513)\n", + "first_markdown_element": "contracts/nexus/ERC721ACustom.sol#L501-L514", + "id": "b09bfa9ad24df6cbf60ff8c021a431bd10ae14b078f58eae541e4e693da5b28e", + "check": "assembly", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "_getApprovedSlotAndAddress", + "source_mapping": { + "start": 19959, + "length": 474, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", + "is_dependency": false, + "lines": [519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ERC721ACustom", + "source_mapping": { + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", + "is_dependency": false, + "lines": [ + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, + 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, + 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, + 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, + 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, + 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, + 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, + 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, + 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, + 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, + 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, + 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, + 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, + 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, + 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, + 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, + 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, + 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, + 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, + 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, + 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, + 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, + 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, + 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, + 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, + 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, + 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, + 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, + 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, + 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, + 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, + 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, + 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, + 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, + 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, + 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, + 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, + 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, + 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, + 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, + 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, + 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, + 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, + 1150, 1151, 1152, 1153, 1154, 1155 + ], + "starting_column": 1, + "ending_column": 0 } - } + }, + "signature": "_getApprovedSlotAndAddress(uint256)" } }, { "type": "node", - "name": "(_newTpi > _oldTpi)", - "source_mapping": { - "start": 4105, - "length": 76, - "filename_relative": "contracts/v2/TreasuryPriceIndexOracle.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryPriceIndexOracle.sol", - "filename_short": "contracts/v2/TreasuryPriceIndexOracle.sol", - "is_dependency": false, - "lines": [104], - "starting_column": 13, - "ending_column": 89 + "name": "", + "source_mapping": { + "start": 20295, + "length": 132, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", + "is_dependency": false, + "lines": [526, 527, 528, 529], + "starting_column": 9, + "ending_column": 10 }, "type_specific_fields": { "parent": { "type": "function", - "name": "setTreasuryPriceIndex", + "name": "_getApprovedSlotAndAddress", "source_mapping": { - "start": 3772, - "length": 815, - "filename_relative": "contracts/v2/TreasuryPriceIndexOracle.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryPriceIndexOracle.sol", - "filename_short": "contracts/v2/TreasuryPriceIndexOracle.sol", + "start": 19959, + "length": 474, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116 + 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530 ], "starting_column": 5, "ending_column": 6 @@ -53245,57 +48612,148 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TreasuryPriceIndexOracle", + "name": "ERC721ACustom", "source_mapping": { - "start": 672, - "length": 3918, - "filename_relative": "contracts/v2/TreasuryPriceIndexOracle.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryPriceIndexOracle.sol", - "filename_short": "contracts/v2/TreasuryPriceIndexOracle.sol", + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "setTreasuryPriceIndex(uint96)" - } - } - } - } - ], - "description": "TreasuryPriceIndexOracle.setTreasuryPriceIndex(uint96) (contracts/v2/TreasuryPriceIndexOracle.sol#97-116) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- _delta > maxTreasuryPriceIndexDelta (contracts/v2/TreasuryPriceIndexOracle.sol#105)\n\t- (_newTpi > _oldTpi) (contracts/v2/TreasuryPriceIndexOracle.sol#104)\n", - "markdown": "[TreasuryPriceIndexOracle.setTreasuryPriceIndex(uint96)](contracts/v2/TreasuryPriceIndexOracle.sol#L97-L116) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [_delta > maxTreasuryPriceIndexDelta](contracts/v2/TreasuryPriceIndexOracle.sol#L105)\n\t- [(_newTpi > _oldTpi)](contracts/v2/TreasuryPriceIndexOracle.sol#L104)\n", - "first_markdown_element": "contracts/v2/TreasuryPriceIndexOracle.sol#L97-L116", - "id": "27e472ea358357b1aa713a4753b654ee999cc773f1704e268101424130b80b61", - "check": "timestamp", - "impact": "Low", - "confidence": "Medium" + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, + 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, + 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, + 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, + 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, + 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, + 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, + 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, + 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, + 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, + 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, + 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, + 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, + 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, + 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, + 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, + 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, + 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, + 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, + 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, + 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, + 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, + 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, + 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, + 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, + 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, + 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, + 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, + 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, + 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, + 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, + 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, + 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, + 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, + 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, + 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, + 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, + 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, + 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, + 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, + 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, + 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, + 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, + 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, + 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, + 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, + 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, + 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, + 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, + 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, + 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, + 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, + 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, + 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, + 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, + 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, + 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, + 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, + 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, + 1151, 1152, 1153, 1154, 1155 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "_getApprovedSlotAndAddress(uint256)" + } + } + } + } + ], + "description": "ERC721ACustom._getApprovedSlotAndAddress(uint256) (contracts/nexus/ERC721ACustom.sol#519-530) uses assembly\n\t- INLINE ASM (contracts/nexus/ERC721ACustom.sol#526-529)\n", + "markdown": "[ERC721ACustom._getApprovedSlotAndAddress(uint256)](contracts/nexus/ERC721ACustom.sol#L519-L530) uses assembly\n\t- [INLINE ASM](contracts/nexus/ERC721ACustom.sol#L526-L529)\n", + "first_markdown_element": "contracts/nexus/ERC721ACustom.sol#L519-L530", + "id": "9a5b8f3df9103de1c7fe9d69daa9de339e35889f22956c16f3792283cf73e33e", + "check": "assembly", + "impact": "Informational", + "confidence": "High" }, { "elements": [ { "type": "function", - "name": "preCheck", + "name": "transferFrom", "source_mapping": { - "start": 3551, - "length": 1277, - "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "start": 21034, + "length": 3447, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117 + 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, + 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, + 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, + 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, + 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625 ], "starting_column": 5, "ending_column": 6 @@ -53303,65 +48761,144 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleCircuitBreakerAllUsersPerPeriod", + "name": "ERC721ACustom", "source_mapping": { - "start": 1479, - "length": 6866, - "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205 + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, + 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, + 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, + 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, + 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, + 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, + 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, + 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, + 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, + 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, + 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, + 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, + 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, + 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, + 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, + 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, + 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, + 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, + 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, + 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, + 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, + 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, + 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, + 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, + 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, + 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, + 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, + 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, + 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, + 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, + 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, + 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, + 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, + 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, + 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, + 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, + 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, + 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, + 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, + 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, + 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, + 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, + 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, + 1150, 1151, 1152, 1153, 1154, 1155 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "preCheck(address,uint256)" + "signature": "transferFrom(address,address,uint256)" } }, { "type": "node", - "name": "_nextBucketIndex != _currentBucketIndex", + "name": "", "source_mapping": { - "start": 3971, - "length": 39, - "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "start": 22002, + "length": 190, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, - "lines": [96], - "starting_column": 13, - "ending_column": 52 + "lines": [570, 571, 572, 573, 574, 575], + "starting_column": 9, + "ending_column": 10 }, "type_specific_fields": { "parent": { "type": "function", - "name": "preCheck", + "name": "transferFrom", "source_mapping": { - "start": 3551, - "length": 1277, - "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "start": 21034, + "length": 3447, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117 + 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, + 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, + 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, + 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, + 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625 ], "starting_column": 5, "ending_column": 6 @@ -53369,68 +48906,152 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleCircuitBreakerAllUsersPerPeriod", + "name": "ERC721ACustom", "source_mapping": { - "start": 1479, - "length": 6866, - "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "preCheck(address,uint256)" + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, + 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, + 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, + 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, + 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, + 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, + 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, + 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, + 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, + 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, + 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, + 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, + 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, + 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, + 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, + 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, + 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, + 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, + 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, + 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, + 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, + 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, + 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, + 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, + 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, + 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, + 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, + 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, + 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, + 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, + 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, + 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, + 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, + 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, + 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, + 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, + 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, + 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, + 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, + 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, + 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, + 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, + 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, + 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, + 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, + 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, + 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, + 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, + 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, + 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, + 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, + 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, + 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, + 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, + 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, + 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, + 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, + 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, + 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, + 1151, 1152, 1153, 1154, 1155 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "transferFrom(address,address,uint256)" } } } }, { "type": "node", - "name": "_minBucketResetIndex < _nextBucketIndex", + "name": "", "source_mapping": { - "start": 4180, - "length": 39, - "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "start": 23987, + "length": 367, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, - "lines": [100], - "starting_column": 24, - "ending_column": 63 + "lines": [611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621], + "starting_column": 9, + "ending_column": 10 }, "type_specific_fields": { "parent": { "type": "function", - "name": "preCheck", + "name": "transferFrom", "source_mapping": { - "start": 3551, - "length": 1277, - "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "start": 21034, + "length": 3447, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117 + 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, + 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, + 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, + 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, + 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625 ], "starting_column": 5, "ending_column": 6 @@ -53438,186 +49059,433 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleCircuitBreakerAllUsersPerPeriod", + "name": "ERC721ACustom", "source_mapping": { - "start": 1479, - "length": 6866, - "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "preCheck(address,uint256)" - } - } - } - } - ], - "description": "TempleCircuitBreakerAllUsersPerPeriod.preCheck(address,uint256) (contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#89-117) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- _nextBucketIndex != _currentBucketIndex (contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#96)\n\t- _minBucketResetIndex < _nextBucketIndex (contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#100)\n", - "markdown": "[TempleCircuitBreakerAllUsersPerPeriod.preCheck(address,uint256)](contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#L89-L117) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [_nextBucketIndex != _currentBucketIndex](contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#L96)\n\t- [_minBucketResetIndex < _nextBucketIndex](contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#L100)\n", - "first_markdown_element": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#L89-L117", - "id": "080fc01692d6234533b35c64ebb6efb9506e8defa98bc2809f7c873c4c084550", - "check": "timestamp", - "impact": "Low", - "confidence": "Medium" + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, + 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, + 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, + 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, + 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, + 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, + 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, + 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, + 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, + 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, + 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, + 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, + 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, + 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, + 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, + 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, + 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, + 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, + 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, + 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, + 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, + 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, + 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, + 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, + 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, + 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, + 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, + 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, + 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, + 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, + 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, + 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, + 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, + 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, + 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, + 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, + 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, + 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, + 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, + 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, + 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, + 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, + 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, + 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, + 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, + 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, + 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, + 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, + 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, + 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, + 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, + 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, + 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, + 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, + 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, + 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, + 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, + 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, + 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, + 1151, 1152, 1153, 1154, 1155 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "transferFrom(address,address,uint256)" + } + } + } + } + ], + "description": "ERC721ACustom.transferFrom(address,address,uint256) (contracts/nexus/ERC721ACustom.sol#549-625) uses assembly\n\t- INLINE ASM (contracts/nexus/ERC721ACustom.sol#570-575)\n\t- INLINE ASM (contracts/nexus/ERC721ACustom.sol#611-621)\n", + "markdown": "[ERC721ACustom.transferFrom(address,address,uint256)](contracts/nexus/ERC721ACustom.sol#L549-L625) uses assembly\n\t- [INLINE ASM](contracts/nexus/ERC721ACustom.sol#L570-L575)\n\t- [INLINE ASM](contracts/nexus/ERC721ACustom.sol#L611-L621)\n", + "first_markdown_element": "contracts/nexus/ERC721ACustom.sol#L549-L625", + "id": "50b38892aedaa004e1165a67b0d655ac6882fc59da6b70e42ff93f348056c691", + "check": "assembly", + "impact": "Informational", + "confidence": "High" }, { "elements": [ { "type": "function", - "name": "_getMinBucketResetIndex", + "name": "_checkContractOnERC721Received", "source_mapping": { - "start": 5647, - "length": 406, - "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "start": 27771, + "length": 673, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, - "lines": [140, 141, 142, 143, 144, 145], + "lines": [ + 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, + 735, 736, 737, 738, 739, 740 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleCircuitBreakerAllUsersPerPeriod", + "name": "ERC721ACustom", "source_mapping": { - "start": 1479, - "length": 6866, - "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205 + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, + 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, + 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, + 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, + 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, + 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, + 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, + 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, + 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, + 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, + 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, + 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, + 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, + 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, + 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, + 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, + 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, + 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, + 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, + 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, + 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, + 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, + 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, + 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, + 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, + 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, + 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, + 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, + 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, + 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, + 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, + 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, + 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, + 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, + 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, + 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, + 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, + 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, + 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, + 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, + 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, + 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, + 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, + 1150, 1151, 1152, 1153, 1154, 1155 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "_getMinBucketResetIndex(uint32,uint32,uint32)" + "signature": "_checkContractOnERC721Received(address,address,uint256,bytes)" } }, { "type": "node", - "name": "_currentBucketIndex < _oneperiodDurationAgoIndex", + "name": "", "source_mapping": { - "start": 5915, - "length": 121, - "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "start": 28349, + "length": 79, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, - "lines": [143], + "lines": [736, 737, 738], "starting_column": 13, - "ending_column": 134 + "ending_column": 14 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_getMinBucketResetIndex", + "name": "_checkContractOnERC721Received", "source_mapping": { - "start": 5647, - "length": 406, - "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "start": 27771, + "length": 673, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, - "lines": [140, 141, 142, 143, 144, 145], + "lines": [ + 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, + 735, 736, 737, 738, 739, 740 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleCircuitBreakerAllUsersPerPeriod", + "name": "ERC721ACustom", "source_mapping": { - "start": 1479, - "length": 6866, - "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "_getMinBucketResetIndex(uint32,uint32,uint32)" - } - } - } - } - ], - "description": "TempleCircuitBreakerAllUsersPerPeriod._getMinBucketResetIndex(uint32,uint32,uint32) (contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#140-145) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- _currentBucketIndex < _oneperiodDurationAgoIndex (contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#143)\n", - "markdown": "[TempleCircuitBreakerAllUsersPerPeriod._getMinBucketResetIndex(uint32,uint32,uint32)](contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#L140-L145) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [_currentBucketIndex < _oneperiodDurationAgoIndex](contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#L143)\n", - "first_markdown_element": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#L140-L145", - "id": "62847204845cb0c8231dae0ccd651ab847da9f27624c490709e49b40f8c0793c", - "check": "timestamp", - "impact": "Low", - "confidence": "Medium" + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, + 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, + 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, + 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, + 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, + 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, + 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, + 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, + 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, + 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, + 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, + 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, + 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, + 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, + 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, + 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, + 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, + 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, + 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, + 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, + 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, + 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, + 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, + 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, + 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, + 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, + 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, + 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, + 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, + 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, + 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, + 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, + 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, + 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, + 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, + 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, + 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, + 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, + 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, + 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, + 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, + 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, + 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, + 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, + 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, + 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, + 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, + 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, + 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, + 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, + 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, + 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, + 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, + 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, + 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, + 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, + 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, + 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, + 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, + 1151, 1152, 1153, 1154, 1155 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "_checkContractOnERC721Received(address,address,uint256,bytes)" + } + } + } + } + ], + "description": "ERC721ACustom._checkContractOnERC721Received(address,address,uint256,bytes) (contracts/nexus/ERC721ACustom.sol#722-740) uses assembly\n\t- INLINE ASM (contracts/nexus/ERC721ACustom.sol#736-738)\n", + "markdown": "[ERC721ACustom._checkContractOnERC721Received(address,address,uint256,bytes)](contracts/nexus/ERC721ACustom.sol#L722-L740) uses assembly\n\t- [INLINE ASM](contracts/nexus/ERC721ACustom.sol#L736-L738)\n", + "first_markdown_element": "contracts/nexus/ERC721ACustom.sol#L722-L740", + "id": "e47f1b9bb93c46ab8b50bb8474d01e1875db79ef2cb0d56f4cb82e5d9f889e4b", + "check": "assembly", + "impact": "Informational", + "confidence": "High" }, { "elements": [ { "type": "function", - "name": "currentUtilisation", + "name": "_mint", "source_mapping": { - "start": 6152, - "length": 910, - "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "start": 28890, + "length": 2251, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169 + 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, + 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, + 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, + 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, + 808, 809, 810 ], "starting_column": 5, "ending_column": 6 @@ -53625,132 +49493,143 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleCircuitBreakerAllUsersPerPeriod", + "name": "ERC721ACustom", "source_mapping": { - "start": 1479, - "length": 6866, - "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205 + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, + 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, + 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, + 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, + 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, + 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, + 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, + 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, + 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, + 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, + 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, + 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, + 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, + 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, + 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, + 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, + 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, + 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, + 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, + 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, + 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, + 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, + 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, + 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, + 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, + 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, + 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, + 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, + 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, + 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, + 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, + 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, + 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, + 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, + 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, + 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, + 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, + 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, + 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, + 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, + 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, + 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, + 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, + 1150, 1151, 1152, 1153, 1154, 1155 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "currentUtilisation()" - } - }, - { - "type": "node", - "name": "_nextBucketIndex != _currentBucketIndex", - "source_mapping": { - "start": 6625, - "length": 39, - "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "is_dependency": false, - "lines": [159], - "starting_column": 13, - "ending_column": 52 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "currentUtilisation", - "source_mapping": { - "start": 6152, - "length": 910, - "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "is_dependency": false, - "lines": [ - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169 - ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleCircuitBreakerAllUsersPerPeriod", - "source_mapping": { - "start": 1479, - "length": 6866, - "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "is_dependency": false, - "lines": [ - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "currentUtilisation()" - } - } + "signature": "_mint(address,uint256)" } }, { "type": "node", - "name": "_minBucketResetIndex < _nextBucketIndex", + "name": "", "source_mapping": { - "start": 6833, - "length": 39, - "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "start": 30380, + "length": 450, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, - "lines": [162], - "starting_column": 24, - "ending_column": 63 + "lines": [792, 793, 794, 795, 796, 797, 798, 799, 800, 801, 802], + "starting_column": 17, + "ending_column": 18 }, "type_specific_fields": { "parent": { "type": "function", - "name": "currentUtilisation", + "name": "_mint", "source_mapping": { - "start": 6152, - "length": 910, - "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "start": 28890, + "length": 2251, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169 + 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, + 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, + 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, + 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, + 808, 809, 810 ], "starting_column": 5, "ending_column": 6 @@ -53758,344 +49637,724 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleCircuitBreakerAllUsersPerPeriod", - "source_mapping": { - "start": 1479, - "length": 6866, - "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "name": "ERC721ACustom", + "source_mapping": { + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "currentUtilisation()" - } - } - } - } - ], - "description": "TempleCircuitBreakerAllUsersPerPeriod.currentUtilisation() (contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#150-169) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- _nextBucketIndex != _currentBucketIndex (contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#159)\n\t- _minBucketResetIndex < _nextBucketIndex (contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#162)\n", - "markdown": "[TempleCircuitBreakerAllUsersPerPeriod.currentUtilisation()](contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#L150-L169) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [_nextBucketIndex != _currentBucketIndex](contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#L159)\n\t- [_minBucketResetIndex < _nextBucketIndex](contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#L162)\n", - "first_markdown_element": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol#L150-L169", - "id": "824d28da623fc8596a1354a4d1ea1765d521fc6a1fdeae63acbc756dfbc451ed", - "check": "timestamp", - "impact": "Low", - "confidence": "Medium" + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, + 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, + 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, + 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, + 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, + 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, + 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, + 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, + 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, + 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, + 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, + 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, + 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, + 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, + 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, + 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, + 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, + 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, + 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, + 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, + 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, + 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, + 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, + 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, + 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, + 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, + 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, + 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, + 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, + 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, + 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, + 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, + 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, + 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, + 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, + 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, + 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, + 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, + 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, + 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, + 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, + 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, + 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, + 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, + 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, + 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, + 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, + 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, + 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, + 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, + 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, + 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, + 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, + 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, + 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, + 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, + 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, + 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, + 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, + 1151, 1152, 1153, 1154, 1155 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "_mint(address,uint256)" + } + } + } + } + ], + "description": "ERC721ACustom._mint(address,uint256) (contracts/nexus/ERC721ACustom.sol#756-810) uses assembly\n\t- INLINE ASM (contracts/nexus/ERC721ACustom.sol#792-802)\n", + "markdown": "[ERC721ACustom._mint(address,uint256)](contracts/nexus/ERC721ACustom.sol#L756-L810) uses assembly\n\t- [INLINE ASM](contracts/nexus/ERC721ACustom.sol#L792-L802)\n", + "first_markdown_element": "contracts/nexus/ERC721ACustom.sol#L756-L810", + "id": "68fafc65c3aa810e1a341f96b7c48127218d7e394b0f33b70a8313fb214683c5", + "check": "assembly", + "impact": "Informational", + "confidence": "High" }, { "elements": [ { "type": "function", - "name": "latestDsrBalance", + "name": "_burn", "source_mapping": { - "start": 4929, - "length": 510, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 36529, + "length": 3024, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, - "lines": [129, 130, 131, 132, 133, 134, 135, 136, 137, 138], + "lines": [ + 970, 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, + 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, + 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, + 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, + 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, + 1030, 1031, 1032, 1033, 1034, 1035, 1036 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "ERC721ACustom", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305 + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, + 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, + 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, + 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, + 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, + 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, + 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, + 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, + 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, + 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, + 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, + 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, + 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, + 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, + 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, + 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, + 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, + 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, + 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, + 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, + 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, + 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, + 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, + 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, + 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, + 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, + 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, + 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, + 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, + 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, + 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, + 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, + 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, + 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, + 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, + 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, + 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, + 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, + 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, + 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, + 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, + 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, + 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, + 1150, 1151, 1152, 1153, 1154, 1155 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "latestDsrBalance()" + "signature": "_burn(uint256,bool)" } }, { "type": "node", - "name": "(block.timestamp > rho)", + "name": "", "source_mapping": { - "start": 5272, - "length": 109, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 37287, + "length": 190, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, - "lines": [136], + "lines": [986, 987, 988, 989, 990, 991], "starting_column": 9, - "ending_column": 118 + "ending_column": 10 }, "type_specific_fields": { "parent": { "type": "function", - "name": "latestDsrBalance", + "name": "_burn", "source_mapping": { - "start": 4929, - "length": 510, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 36529, + "length": 3024, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, - "lines": [129, 130, 131, 132, 133, 134, 135, 136, 137, 138], + "lines": [ + 970, 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, + 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, + 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 1006, + 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, + 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, + 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "ERC721ACustom", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "latestDsrBalance()" - } - } - } - } - ], - "description": "DsrBaseStrategy.latestDsrBalance() (contracts/v2/strategies/DsrBaseStrategy.sol#129-138) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- (block.timestamp > rho) (contracts/v2/strategies/DsrBaseStrategy.sol#136)\n", - "markdown": "[DsrBaseStrategy.latestDsrBalance()](contracts/v2/strategies/DsrBaseStrategy.sol#L129-L138) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [(block.timestamp > rho)](contracts/v2/strategies/DsrBaseStrategy.sol#L136)\n", - "first_markdown_element": "contracts/v2/strategies/DsrBaseStrategy.sol#L129-L138", - "id": "5d10ceb2f5b13a3f1d386bd3ffb62d9e64d57500eb9ce74496832fa8d54f7c5e", - "check": "timestamp", - "impact": "Low", - "confidence": "Medium" + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, + 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, + 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, + 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, + 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, + 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, + 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, + 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, + 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, + 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, + 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, + 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, + 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, + 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, + 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, + 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, + 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, + 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, + 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, + 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, + 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, + 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, + 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, + 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, + 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, + 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, + 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, + 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, + 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, + 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, + 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, + 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, + 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, + 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, + 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, + 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, + 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, + 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, + 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, + 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, + 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, + 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, + 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, + 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, + 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, + 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, + 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, + 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, + 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, + 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, + 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, + 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, + 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, + 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, + 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, + 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, + 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, + 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, + 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, + 1151, 1152, 1153, 1154, 1155 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "_burn(uint256,bool)" + } + } + } + } + ], + "description": "ERC721ACustom._burn(uint256,bool) (contracts/nexus/ERC721ACustom.sol#970-1036) uses assembly\n\t- INLINE ASM (contracts/nexus/ERC721ACustom.sol#986-991)\n", + "markdown": "[ERC721ACustom._burn(uint256,bool)](contracts/nexus/ERC721ACustom.sol#L970-L1036) uses assembly\n\t- [INLINE ASM](contracts/nexus/ERC721ACustom.sol#L986-L991)\n", + "first_markdown_element": "contracts/nexus/ERC721ACustom.sol#L970-L1036", + "id": "c54a8b48cc8c436c71ba902db58bb0df133b628b0e0969be25eddd7c1798c13e", + "check": "assembly", + "impact": "Informational", + "confidence": "High" }, { "elements": [ { "type": "function", - "name": "_checkpointChi", + "name": "_setExtraDataAt", "source_mapping": { - "start": 5445, - "length": 188, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 39836, + "length": 531, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, - "lines": [140, 141, 142, 143], + "lines": [ + 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "ERC721ACustom", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, - 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305 + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, + 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, + 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, + 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, + 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, + 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, + 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, + 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, + 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, + 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, + 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, + 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, + 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, + 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, + 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, + 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, + 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, + 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, + 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, + 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, + 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, + 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, + 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, + 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, + 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, + 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, + 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, + 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, + 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, + 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, + 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, + 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, + 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, + 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, + 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, + 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, + 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, + 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, + 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, + 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, + 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, + 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, + 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, + 1150, 1151, 1152, 1153, 1154, 1155 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_checkpointChi()" + "signature": "_setExtraDataAt(uint256,uint24)" } }, { "type": "node", - "name": "(block.timestamp > pot.rho())", + "name": "", "source_mapping": { - "start": 5566, - "length": 60, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 40155, + "length": 61, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, - "lines": [142], + "lines": [1050, 1051, 1052], "starting_column": 9, - "ending_column": 69 + "ending_column": 10 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_checkpointChi", + "name": "_setExtraDataAt", "source_mapping": { - "start": 5445, - "length": 188, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 39836, + "length": 531, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, - "lines": [140, 141, 142, 143], + "lines": [ + 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "DsrBaseStrategy", + "name": "ERC721ACustom", "source_mapping": { - "start": 1041, - "length": 11729, - "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "_checkpointChi()" - } - } - } - } - ], - "description": "DsrBaseStrategy._checkpointChi() (contracts/v2/strategies/DsrBaseStrategy.sol#140-143) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- (block.timestamp > pot.rho()) (contracts/v2/strategies/DsrBaseStrategy.sol#142)\n", - "markdown": "[DsrBaseStrategy._checkpointChi()](contracts/v2/strategies/DsrBaseStrategy.sol#L140-L143) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [(block.timestamp > pot.rho())](contracts/v2/strategies/DsrBaseStrategy.sol#L142)\n", - "first_markdown_element": "contracts/v2/strategies/DsrBaseStrategy.sol#L140-L143", - "id": "5cfe72c68305dea88c7c4193956094120fcd3b9c0b3634e1ae80f5a9b13cb40e", - "check": "timestamp", - "impact": "Low", - "confidence": "Medium" + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, + 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, + 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, + 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, + 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, + 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, + 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, + 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, + 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, + 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, + 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, + 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, + 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, + 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, + 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, + 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, + 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, + 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, + 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, + 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, + 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, + 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, + 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, + 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, + 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, + 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, + 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, + 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, + 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, + 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, + 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, + 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, + 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, + 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, + 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, + 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, + 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, + 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, + 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, + 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, + 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, + 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, + 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, + 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, + 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, + 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, + 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, + 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, + 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, + 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, + 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, + 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, + 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, + 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, + 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, + 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, + 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, + 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, + 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, + 1151, 1152, 1153, 1154, 1155 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "_setExtraDataAt(uint256,uint24)" + } + } + } + } + ], + "description": "ERC721ACustom._setExtraDataAt(uint256,uint24) (contracts/nexus/ERC721ACustom.sol#1045-1055) uses assembly\n\t- INLINE ASM (contracts/nexus/ERC721ACustom.sol#1050-1052)\n", + "markdown": "[ERC721ACustom._setExtraDataAt(uint256,uint24)](contracts/nexus/ERC721ACustom.sol#L1045-L1055) uses assembly\n\t- [INLINE ASM](contracts/nexus/ERC721ACustom.sol#L1050-L1052)\n", + "first_markdown_element": "contracts/nexus/ERC721ACustom.sol#L1045-L1055", + "id": "4b0e15bff4b2cb379753f06f7250f382f759e9c5d1a9aea704765787079cfd4e", + "check": "assembly", + "impact": "Informational", + "confidence": "High" }, { "elements": [ { "type": "function", - "name": "_initDebtTokenCache", + "name": "_toString", "source_mapping": { - "start": 24259, - "length": 1482, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 42089, + "length": 1708, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, - 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655 + 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, + 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, + 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, + 1139, 1140, 1141, 1142, 1143 ], "starting_column": 5, "ending_column": 6 @@ -54103,117 +50362,147 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "ERC721ACustom", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, - 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, - 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, - 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, - 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, - 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, - 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, - 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, - 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, - 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, - 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, - 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, - 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, - 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, - 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, - 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, - 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, - 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, - 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, - 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, - 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, - 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, - 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, - 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, - 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, - 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, - 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, - 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, - 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, - 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, - 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, - 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, - 874, 875, 876, 877, 878, 879, 880, 881, 882 + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, + 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, + 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, + 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, + 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, + 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, + 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, + 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, + 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, + 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, + 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, + 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, + 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, + 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, + 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, + 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, + 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, + 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, + 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, + 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, + 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, + 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, + 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, + 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, + 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, + 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, + 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, + 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, + 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, + 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, + 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, + 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, + 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, + 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, + 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, + 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, + 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, + 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, + 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, + 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, + 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, + 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, + 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, + 1150, 1151, 1152, 1153, 1154, 1155 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_initDebtTokenCache(TempleLineOfCredit.DebtTokenCache)" + "signature": "_toString(uint256)" } }, { "type": "node", - "name": "blockTs != interestAccumulatorUpdatedAt", + "name": "", "source_mapping": { - "start": 25104, - "length": 39, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 42183, + "length": 1608, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, - "lines": [638], - "starting_column": 13, - "ending_column": 52 + "lines": [ + 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, + 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, + 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, + 1140, 1141, 1142 + ], + "starting_column": 9, + "ending_column": 10 }, "type_specific_fields": { "parent": { "type": "function", - "name": "_initDebtTokenCache", + "name": "_toString", "source_mapping": { - "start": 24259, - "length": 1482, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 42089, + "length": 1708, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, - 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, - 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655 + 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, + 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, + 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, + 1136, 1137, 1138, 1139, 1140, 1141, 1142, 1143 ], "starting_column": 5, "ending_column": 6 @@ -54221,1213 +50510,2093 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "ERC721ACustom", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "_initDebtTokenCache(TempleLineOfCredit.DebtTokenCache)" - } - } - } - } - ], - "description": "TempleLineOfCredit._initDebtTokenCache(TempleLineOfCredit.DebtTokenCache) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#619-655) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- blockTs != interestAccumulatorUpdatedAt (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#638)\n", - "markdown": "[TempleLineOfCredit._initDebtTokenCache(TempleLineOfCredit.DebtTokenCache)](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L619-L655) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [blockTs != interestAccumulatorUpdatedAt](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L638)\n", - "first_markdown_element": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L619-L655", - "id": "bbf3ae9dacc69c14f4f01cb48810bed5e1e302865c57341bf29c6cd90678f491", - "check": "timestamp", - "impact": "Low", - "confidence": "Medium" + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, + 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, + 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, + 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, + 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, + 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, + 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, + 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, + 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, + 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, + 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, + 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, + 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, + 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, + 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, + 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, + 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, + 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, + 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, + 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, + 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, + 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, + 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, + 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, + 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, + 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, + 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, + 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, + 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, + 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, + 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, + 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, + 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, + 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, + 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, + 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, + 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, + 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, + 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, + 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, + 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, + 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, + 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, + 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, + 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, + 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, + 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, + 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, + 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, + 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, + 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, + 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, + 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, + 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, + 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, + 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, + 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, + 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, + 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, + 1151, 1152, 1153, 1154, 1155 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "_toString(uint256)" + } + } + } + } + ], + "description": "ERC721ACustom._toString(uint256) (contracts/nexus/ERC721ACustom.sol#1106-1143) uses assembly\n\t- INLINE ASM (contracts/nexus/ERC721ACustom.sol#1107-1142)\n", + "markdown": "[ERC721ACustom._toString(uint256)](contracts/nexus/ERC721ACustom.sol#L1106-L1143) uses assembly\n\t- [INLINE ASM](contracts/nexus/ERC721ACustom.sol#L1107-L1142)\n", + "first_markdown_element": "contracts/nexus/ERC721ACustom.sol#L1106-L1143", + "id": "83d37e60cbbb85b78ff628c5310bd9dc883e9c6121fd732cc3a6c2cef3a23330", + "check": "assembly", + "impact": "Informational", + "confidence": "High" }, { "elements": [ { "type": "function", - "name": "calculateClaimable", + "name": "_revert", "source_mapping": { - "start": 1893, - "length": 581, - "filename_relative": "contracts/admin/TempleTeamPayments.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPayments.sol", - "filename_short": "contracts/admin/TempleTeamPayments.sol", + "start": 43859, + "length": 160, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, - "lines": [ - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72 - ], + "lines": [1148, 1149, 1150, 1151, 1152, 1153], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleTeamPayments", + "name": "ERC721ACustom", "source_mapping": { - "start": 247, - "length": 3130, - "filename_relative": "contracts/admin/TempleTeamPayments.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPayments.sol", - "filename_short": "contracts/admin/TempleTeamPayments.sol", + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97 + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, + 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, + 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, + 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, + 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, + 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, + 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, + 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, + 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, + 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, + 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, + 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, + 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, + 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, + 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, + 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, + 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, + 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, + 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, + 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, + 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, + 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, + 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, + 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, + 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, + 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, + 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, + 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, + 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, + 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, + 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, + 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, + 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, + 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, + 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, + 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, + 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, + 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, + 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, + 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, + 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, + 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, + 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, + 1150, 1151, 1152, 1153, 1154, 1155 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "calculateClaimable(address)" + "signature": "_revert(bytes4)" } }, { "type": "node", - "name": "claimableAmount + claimed[_address] > allocation[_address]", + "name": "", "source_mapping": { - "start": 2293, - "length": 58, - "filename_relative": "contracts/admin/TempleTeamPayments.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPayments.sol", - "filename_short": "contracts/admin/TempleTeamPayments.sol", + "start": 43922, + "length": 91, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, - "lines": [68], - "starting_column": 13, - "ending_column": 71 + "lines": [1149, 1150, 1151, 1152], + "starting_column": 9, + "ending_column": 10 }, "type_specific_fields": { "parent": { "type": "function", - "name": "calculateClaimable", + "name": "_revert", "source_mapping": { - "start": 1893, - "length": 581, - "filename_relative": "contracts/admin/TempleTeamPayments.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPayments.sol", - "filename_short": "contracts/admin/TempleTeamPayments.sol", + "start": 43859, + "length": 160, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, - "lines": [ - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72 - ], + "lines": [1148, 1149, 1150, 1151, 1152, 1153], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleTeamPayments", + "name": "ERC721ACustom", "source_mapping": { - "start": 247, - "length": 3130, - "filename_relative": "contracts/admin/TempleTeamPayments.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPayments.sol", - "filename_short": "contracts/admin/TempleTeamPayments.sol", + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "calculateClaimable(address)" - } - } - } - } - ], - "description": "TempleTeamPayments.calculateClaimable(address) (contracts/admin/TempleTeamPayments.sol#57-72) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- claimableAmount + claimed[_address] > allocation[_address] (contracts/admin/TempleTeamPayments.sol#68)\n", - "markdown": "[TempleTeamPayments.calculateClaimable(address)](contracts/admin/TempleTeamPayments.sol#L57-L72) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [claimableAmount + claimed[_address] > allocation[_address]](contracts/admin/TempleTeamPayments.sol#L68)\n", - "first_markdown_element": "contracts/admin/TempleTeamPayments.sol#L57-L72", - "id": "3c50b29e16f7abe9424e2eb7ddf7dd3a9178954836a5700181e781d6cab69a90", - "check": "timestamp", - "impact": "Low", - "confidence": "Medium" + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, + 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, + 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, + 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, + 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, + 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, + 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, + 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, + 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, + 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, + 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, + 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, + 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, + 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, + 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, + 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, + 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, + 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, + 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, + 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, + 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, + 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, + 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, + 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, + 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, + 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, + 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, + 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, + 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, + 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, + 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, + 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, + 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, + 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, + 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, + 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, + 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, + 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, + 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, + 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, + 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, + 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, + 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, + 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, + 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, + 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, + 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, + 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, + 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1000, + 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, + 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, + 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, + 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, + 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, + 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, + 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, + 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, + 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, + 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, + 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, + 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, + 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, + 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, + 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, + 1151, 1152, 1153, 1154, 1155 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "_revert(bytes4)" + } + } + } + } + ], + "description": "ERC721ACustom._revert(bytes4) (contracts/nexus/ERC721ACustom.sol#1148-1153) uses assembly\n\t- INLINE ASM (contracts/nexus/ERC721ACustom.sol#1149-1152)\n", + "markdown": "[ERC721ACustom._revert(bytes4)](contracts/nexus/ERC721ACustom.sol#L1148-L1153) uses assembly\n\t- [INLINE ASM](contracts/nexus/ERC721ACustom.sol#L1149-L1152)\n", + "first_markdown_element": "contracts/nexus/ERC721ACustom.sol#L1148-L1153", + "id": "35b4e0bf6148d047d302522b1fc5ff0c5ca85f7995d8f8b04a17e400f8ce01f3", + "check": "assembly", + "impact": "Informational", + "confidence": "High" }, { "elements": [ { "type": "function", - "name": "claim", + "name": "signatureSplit", "source_mapping": { - "start": 2480, - "length": 355, - "filename_relative": "contracts/admin/TempleTeamPayments.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPayments.sol", - "filename_short": "contracts/admin/TempleTeamPayments.sol", + "start": 1240, + "length": 959, + "filename_relative": "contracts/v2/safeGuards/SafeForked.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/safeGuards/SafeForked.sol", + "filename_short": "contracts/v2/safeGuards/SafeForked.sol", "is_dependency": false, - "lines": [74, 75, 76, 77, 78, 79, 80, 81], + "lines": [ + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleTeamPayments", + "name": "SafeForked", "source_mapping": { - "start": 247, - "length": 3130, - "filename_relative": "contracts/admin/TempleTeamPayments.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPayments.sol", - "filename_short": "contracts/admin/TempleTeamPayments.sol", + "start": 462, + "length": 6708, + "filename_relative": "contracts/v2/safeGuards/SafeForked.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/safeGuards/SafeForked.sol", + "filename_short": "contracts/v2/safeGuards/SafeForked.sol", "is_dependency": false, "lines": [ - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "claim()" + "signature": "signatureSplit(bytes,uint256)" } }, { "type": "node", - "name": "require(bool,string)(claimable > 0,TempleTeamPayments: Member has no TEMPLE to claim)", + "name": "", "source_mapping": { - "start": 2602, - "length": 75, - "filename_relative": "contracts/admin/TempleTeamPayments.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPayments.sol", - "filename_short": "contracts/admin/TempleTeamPayments.sol", + "start": 1654, + "length": 539, + "filename_relative": "contracts/v2/safeGuards/SafeForked.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/safeGuards/SafeForked.sol", + "filename_short": "contracts/v2/safeGuards/SafeForked.sol", "is_dependency": false, - "lines": [76], + "lines": [35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], "starting_column": 9, - "ending_column": 84 + "ending_column": 10 }, "type_specific_fields": { "parent": { "type": "function", - "name": "claim", + "name": "signatureSplit", "source_mapping": { - "start": 2480, - "length": 355, - "filename_relative": "contracts/admin/TempleTeamPayments.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPayments.sol", - "filename_short": "contracts/admin/TempleTeamPayments.sol", + "start": 1240, + "length": 959, + "filename_relative": "contracts/v2/safeGuards/SafeForked.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/safeGuards/SafeForked.sol", + "filename_short": "contracts/v2/safeGuards/SafeForked.sol", "is_dependency": false, - "lines": [74, 75, 76, 77, 78, 79, 80, 81], + "lines": [ + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleTeamPayments", + "name": "SafeForked", "source_mapping": { - "start": 247, - "length": 3130, - "filename_relative": "contracts/admin/TempleTeamPayments.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPayments.sol", - "filename_short": "contracts/admin/TempleTeamPayments.sol", + "start": 462, + "length": 6708, + "filename_relative": "contracts/v2/safeGuards/SafeForked.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/safeGuards/SafeForked.sol", + "filename_short": "contracts/v2/safeGuards/SafeForked.sol", "is_dependency": false, "lines": [ - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97 + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "claim()" + "signature": "signatureSplit(bytes,uint256)" } } } } ], - "description": "TempleTeamPayments.claim() (contracts/admin/TempleTeamPayments.sol#74-81) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- require(bool,string)(claimable > 0,TempleTeamPayments: Member has no TEMPLE to claim) (contracts/admin/TempleTeamPayments.sol#76)\n", - "markdown": "[TempleTeamPayments.claim()](contracts/admin/TempleTeamPayments.sol#L74-L81) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [require(bool,string)(claimable > 0,TempleTeamPayments: Member has no TEMPLE to claim)](contracts/admin/TempleTeamPayments.sol#L76)\n", - "first_markdown_element": "contracts/admin/TempleTeamPayments.sol#L74-L81", - "id": "d2cf6a934d99b6df0f4c782f92abbc6344366c44c011b9e95bdc6171398e7715", - "check": "timestamp", - "impact": "Low", - "confidence": "Medium" + "description": "SafeForked.signatureSplit(bytes,uint256) (contracts/v2/safeGuards/SafeForked.sol#22-46) uses assembly\n\t- INLINE ASM (contracts/v2/safeGuards/SafeForked.sol#35-45)\n", + "markdown": "[SafeForked.signatureSplit(bytes,uint256)](contracts/v2/safeGuards/SafeForked.sol#L22-L46) uses assembly\n\t- [INLINE ASM](contracts/v2/safeGuards/SafeForked.sol#L35-L45)\n", + "first_markdown_element": "contracts/v2/safeGuards/SafeForked.sol#L22-L46", + "id": "3ae97a7384e3769435f8b201c1864a124173df742b9300bf25e8a1a702a86371", + "check": "assembly", + "impact": "Informational", + "confidence": "High" }, { "elements": [ { "type": "function", - "name": "withdrawFor", + "name": "gain", "source_mapping": { - "start": 3932, - "length": 543, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 925, + "length": 300, + "filename_relative": "contracts/deprecated/Faith.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/Faith.sol", + "filename_short": "contracts/deprecated/Faith.sol", "is_dependency": false, - "lines": [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110], + "lines": [31, 32, 33, 34, 35, 36, 37], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "Vault", + "name": "Faith", "source_mapping": { - "start": 1161, - "length": 7823, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 125, + "length": 1740, + "filename_relative": "contracts/deprecated/Faith.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/Faith.sol", + "filename_short": "contracts/deprecated/Faith.sol", "is_dependency": false, "lines": [ - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233 + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "withdrawFor(address,uint256,uint256,uint8,bytes32,bytes32)" + "signature": "gain(address,uint112)" } }, { "type": "node", - "name": "require(bool,string)(block.timestamp <= deadline,Vault: expired deadline)", + "name": "require(bool,string)(canManageFaith[msg.sender] == true,Faith: caller cannot manage faith)", "source_mapping": { - "start": 4050, - "length": 63, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 986, + "length": 80, + "filename_relative": "contracts/deprecated/Faith.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/Faith.sol", + "filename_short": "contracts/deprecated/Faith.sol", "is_dependency": false, - "lines": [101], + "lines": [32], "starting_column": 9, - "ending_column": 72 + "ending_column": 89 }, "type_specific_fields": { "parent": { "type": "function", - "name": "withdrawFor", + "name": "gain", "source_mapping": { - "start": 3932, - "length": 543, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 925, + "length": 300, + "filename_relative": "contracts/deprecated/Faith.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/Faith.sol", + "filename_short": "contracts/deprecated/Faith.sol", "is_dependency": false, - "lines": [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110], + "lines": [31, 32, 33, 34, 35, 36, 37], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "Vault", + "name": "Faith", "source_mapping": { - "start": 1161, - "length": 7823, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 125, + "length": 1740, + "filename_relative": "contracts/deprecated/Faith.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/Faith.sol", + "filename_short": "contracts/deprecated/Faith.sol", "is_dependency": false, "lines": [ - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233 + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "withdrawFor(address,uint256,uint256,uint8,bytes32,bytes32)" + "signature": "gain(address,uint112)" } } } } ], - "description": "Vault.withdrawFor(address,uint256,uint256,uint8,bytes32,bytes32) (contracts/core/Vault.sol#100-110) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- require(bool,string)(block.timestamp <= deadline,Vault: expired deadline) (contracts/core/Vault.sol#101)\n", - "markdown": "[Vault.withdrawFor(address,uint256,uint256,uint8,bytes32,bytes32)](contracts/core/Vault.sol#L100-L110) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [require(bool,string)(block.timestamp <= deadline,Vault: expired deadline)](contracts/core/Vault.sol#L101)\n", - "first_markdown_element": "contracts/core/Vault.sol#L100-L110", - "id": "23a917169154350b1f8e103875cf17fe3784896b355e9f9441c8bdfede6fc4a3", - "check": "timestamp", - "impact": "Low", - "confidence": "Medium" + "description": "Faith.gain(address,uint112) (contracts/deprecated/Faith.sol#31-37) compares to a boolean constant:\n\t-require(bool,string)(canManageFaith[msg.sender] == true,Faith: caller cannot manage faith) (contracts/deprecated/Faith.sol#32)\n", + "markdown": "[Faith.gain(address,uint112)](contracts/deprecated/Faith.sol#L31-L37) compares to a boolean constant:\n\t-[require(bool,string)(canManageFaith[msg.sender] == true,Faith: caller cannot manage faith)](contracts/deprecated/Faith.sol#L32)\n", + "first_markdown_element": "contracts/deprecated/Faith.sol#L31-L37", + "id": "56cf0d358c021f966d8663efb62e81b7ea09bb2bf0bc7a5ba363ebe693c3bf56", + "check": "boolean-equal", + "impact": "Informational", + "confidence": "High" }, { "elements": [ { "type": "function", - "name": "inEnterExitWindow", + "name": "redeem", "source_mapping": { - "start": 5359, - "length": 569, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 1231, + "length": 412, + "filename_relative": "contracts/deprecated/Faith.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/Faith.sol", + "filename_short": "contracts/deprecated/Faith.sol", "is_dependency": false, - "lines": [140, 141, 142, 143, 144, 145, 146, 147, 148], + "lines": [39, 40, 41, 42, 43, 44, 45, 46, 47, 48], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "Vault", + "name": "Faith", "source_mapping": { - "start": 1161, - "length": 7823, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 125, + "length": 1740, + "filename_relative": "contracts/deprecated/Faith.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/Faith.sol", + "filename_short": "contracts/deprecated/Faith.sol", "is_dependency": false, "lines": [ - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233 + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "inEnterExitWindow()" + "signature": "redeem(address,uint112)" } }, { "type": "node", - "name": "block.timestamp < firstPeriodStartTimestamp", + "name": "require(bool,string)(canManageFaith[msg.sender] == true,Faith: caller cannot manage faith)", "source_mapping": { - "start": 5459, - "length": 43, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 1294, + "length": 80, + "filename_relative": "contracts/deprecated/Faith.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/Faith.sol", + "filename_short": "contracts/deprecated/Faith.sol", "is_dependency": false, - "lines": [141], - "starting_column": 13, - "ending_column": 56 + "lines": [40], + "starting_column": 9, + "ending_column": 89 }, "type_specific_fields": { "parent": { "type": "function", - "name": "inEnterExitWindow", + "name": "redeem", "source_mapping": { - "start": 5359, - "length": 569, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 1231, + "length": 412, + "filename_relative": "contracts/deprecated/Faith.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/Faith.sol", + "filename_short": "contracts/deprecated/Faith.sol", "is_dependency": false, - "lines": [140, 141, 142, 143, 144, 145, 146, 147, 148], + "lines": [39, 40, 41, 42, 43, 44, 45, 46, 47, 48], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "Vault", + "name": "Faith", "source_mapping": { - "start": 1161, - "length": 7823, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 125, + "length": 1740, + "filename_relative": "contracts/deprecated/Faith.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/Faith.sol", + "filename_short": "contracts/deprecated/Faith.sol", "is_dependency": false, "lines": [ - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233 + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "inEnterExitWindow()" + "signature": "redeem(address,uint112)" + } + } + } + } + ], + "description": "Faith.redeem(address,uint112) (contracts/deprecated/Faith.sol#39-48) compares to a boolean constant:\n\t-require(bool,string)(canManageFaith[msg.sender] == true,Faith: caller cannot manage faith) (contracts/deprecated/Faith.sol#40)\n", + "markdown": "[Faith.redeem(address,uint112)](contracts/deprecated/Faith.sol#L39-L48) compares to a boolean constant:\n\t-[require(bool,string)(canManageFaith[msg.sender] == true,Faith: caller cannot manage faith)](contracts/deprecated/Faith.sol#L40)\n", + "first_markdown_element": "contracts/deprecated/Faith.sol#L39-L48", + "id": "f752127c3f283f8e0863072b8bdc266223eb3fecc4b64e758a86403628b01ba6", + "check": "boolean-equal", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "setNewMinterShards", + "source_mapping": { + "start": 3478, + "length": 596, + "filename_relative": "contracts/nexus/Shard.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Shard.sol", + "filename_short": "contracts/nexus/Shard.sol", + "is_dependency": false, + "lines": [ + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "Shard", + "source_mapping": { + "start": 1243, + "length": 12607, + "filename_relative": "contracts/nexus/Shard.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Shard.sol", + "filename_short": "contracts/nexus/Shard.sol", + "is_dependency": false, + "lines": [ + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, + 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, + 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359 + ], + "starting_column": 1, + "ending_column": 0 } - } + }, + "signature": "setNewMinterShards(address[])" } }, { "type": "node", - "name": "inWindow = cycleNumber * periodDuration + firstPeriodStartTimestamp + enterExitWindowDuration + ENTER_EXIT_WINDOW_BUFFER > block.timestamp", + "name": "_currentIndex = shardId + 1", "source_mapping": { - "start": 5783, - "length": 138, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 3873, + "length": 27, + "filename_relative": "contracts/nexus/Shard.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Shard.sol", + "filename_short": "contracts/nexus/Shard.sol", "is_dependency": false, - "lines": [147], - "starting_column": 9, - "ending_column": 147 + "lines": [83], + "starting_column": 13, + "ending_column": 40 }, "type_specific_fields": { "parent": { "type": "function", - "name": "inEnterExitWindow", + "name": "setNewMinterShards", "source_mapping": { - "start": 5359, - "length": 569, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 3478, + "length": 596, + "filename_relative": "contracts/nexus/Shard.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Shard.sol", + "filename_short": "contracts/nexus/Shard.sol", "is_dependency": false, - "lines": [140, 141, 142, 143, 144, 145, 146, 147, 148], + "lines": [ + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "Vault", + "name": "Shard", "source_mapping": { - "start": 1161, - "length": 7823, - "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", - "filename_short": "contracts/core/Vault.sol", + "start": 1243, + "length": 12607, + "filename_relative": "contracts/nexus/Shard.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Shard.sol", + "filename_short": "contracts/nexus/Shard.sol", "is_dependency": false, "lines": [ - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233 + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, + 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, + 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "inEnterExitWindow()" + "signature": "setNewMinterShards(address[])" } } } } ], - "description": "Vault.inEnterExitWindow() (contracts/core/Vault.sol#140-148) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- block.timestamp < firstPeriodStartTimestamp (contracts/core/Vault.sol#141)\n\t- inWindow = cycleNumber * periodDuration + firstPeriodStartTimestamp + enterExitWindowDuration + ENTER_EXIT_WINDOW_BUFFER > block.timestamp (contracts/core/Vault.sol#147)\n", - "markdown": "[Vault.inEnterExitWindow()](contracts/core/Vault.sol#L140-L148) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [block.timestamp < firstPeriodStartTimestamp](contracts/core/Vault.sol#L141)\n\t- [inWindow = cycleNumber * periodDuration + firstPeriodStartTimestamp + enterExitWindowDuration + ENTER_EXIT_WINDOW_BUFFER > block.timestamp](contracts/core/Vault.sol#L147)\n", - "first_markdown_element": "contracts/core/Vault.sol#L140-L148", - "id": "1ec8a1ed491ee4363e9d98709e6ea81c368e5197aa117baaec3fb5dca7a37050", - "check": "timestamp", - "impact": "Low", + "description": "Shard.setNewMinterShards(address[]) (contracts/nexus/Shard.sol#74-90) has costly operations inside a loop:\n\t- _currentIndex = shardId + 1 (contracts/nexus/Shard.sol#83)\n", + "markdown": "[Shard.setNewMinterShards(address[])](contracts/nexus/Shard.sol#L74-L90) has costly operations inside a loop:\n\t- [_currentIndex = shardId + 1](contracts/nexus/Shard.sol#L83)\n", + "first_markdown_element": "contracts/nexus/Shard.sol#L74-L90", + "id": "d70f343cb7daba478c86048aa6ce20f387928d1890b6c18a0f91f1c1aa2c67d4", + "check": "costly-loop", + "impact": "Informational", "confidence": "Medium" }, { "elements": [ { "type": "function", - "name": "withdrawFor", + "name": "batchLiquidate", "source_mapping": { - "start": 1642, - "length": 627, - "filename_relative": "contracts/deprecated/LockedOGTemple.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/LockedOGTemple.sol", - "filename_short": "contracts/deprecated/LockedOGTemple.sol", + "start": 13008, + "length": 1632, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, "lines": [ - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81 + 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, + 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359 ], - "starting_column": 3, - "ending_column": 4 + "starting_column": 5, + "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "LockedOGTemple", + "name": "TempleLineOfCredit", "source_mapping": { - "start": 213, - "length": 2143, - "filename_relative": "contracts/deprecated/LockedOGTemple.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/LockedOGTemple.sol", - "filename_short": "contracts/deprecated/LockedOGTemple.sol", + "start": 1433, + "length": 31753, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, "lines": [ - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86 + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, + 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, + 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, + 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, + 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, + 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, + 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, + 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, + 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, + 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, + 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, + 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, + 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, + 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, + 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, + 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, + 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, + 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, + 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, + 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, + 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, + 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, + 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, + 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, + 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, + 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, + 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, + 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, + 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, + 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, + 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, + 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, + 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, + 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, + 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, + 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, + 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, + 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, + 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, + 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, + 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, + 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, + 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "withdrawFor(address,uint256)" + "signature": "batchLiquidate(address[])" } }, { "type": "node", - "name": "require(bool,string)(lockedEntries[_idx].LockedUntilTimestamp < block.timestamp,Specified entry is still locked)", + "name": "delete allAccountsData[_account]", "source_mapping": { - "start": 1867, - "length": 120, - "filename_relative": "contracts/deprecated/LockedOGTemple.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/LockedOGTemple.sol", - "filename_short": "contracts/deprecated/LockedOGTemple.sol", + "start": 14023, + "length": 32, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, - "lines": [69, 70, 71, 72], - "starting_column": 5, - "ending_column": 6 + "lines": [344], + "starting_column": 17, + "ending_column": 49 }, "type_specific_fields": { "parent": { "type": "function", - "name": "withdrawFor", + "name": "batchLiquidate", "source_mapping": { - "start": 1642, - "length": 627, - "filename_relative": "contracts/deprecated/LockedOGTemple.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/LockedOGTemple.sol", - "filename_short": "contracts/deprecated/LockedOGTemple.sol", + "start": 13008, + "length": 1632, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, "lines": [ - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81 + 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, + 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359 ], - "starting_column": 3, - "ending_column": 4 + "starting_column": 5, + "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "LockedOGTemple", + "name": "TempleLineOfCredit", "source_mapping": { - "start": 213, - "length": 2143, - "filename_relative": "contracts/deprecated/LockedOGTemple.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/LockedOGTemple.sol", - "filename_short": "contracts/deprecated/LockedOGTemple.sol", + "start": 1433, + "length": 31753, + "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, "lines": [ - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86 + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, + 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, + 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, + 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, + 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, + 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, + 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, + 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, + 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, + 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, + 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, + 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, + 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, + 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, + 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, + 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, + 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, + 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, + 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, + 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, + 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, + 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, + 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, + 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, + 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, + 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, + 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, + 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, + 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, + 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, + 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, + 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, + 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, + 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, + 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, + 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, + 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, + 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, + 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, + 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, + 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, + 883, 884, 885 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "withdrawFor(address,uint256)" + "signature": "batchLiquidate(address[])" } } } } ], - "description": "LockedOGTemple.withdrawFor(address,uint256) (contracts/deprecated/LockedOGTemple.sol#62-81) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- require(bool,string)(lockedEntries[_idx].LockedUntilTimestamp < block.timestamp,Specified entry is still locked) (contracts/deprecated/LockedOGTemple.sol#69-72)\n", - "markdown": "[LockedOGTemple.withdrawFor(address,uint256)](contracts/deprecated/LockedOGTemple.sol#L62-L81) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [require(bool,string)(lockedEntries[_idx].LockedUntilTimestamp < block.timestamp,Specified entry is still locked)](contracts/deprecated/LockedOGTemple.sol#L69-L72)\n", - "first_markdown_element": "contracts/deprecated/LockedOGTemple.sol#L62-L81", - "id": "87a3b425d06a0ad7aa92a349ed04204eb047ebb07373cbfbcf3ed5aaaf25be67", - "check": "timestamp", - "impact": "Low", + "description": "TempleLineOfCredit.batchLiquidate(address[]) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#318-359) has costly operations inside a loop:\n\t- delete allAccountsData[_account] (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#344)\n", + "markdown": "[TempleLineOfCredit.batchLiquidate(address[])](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L318-L359) has costly operations inside a loop:\n\t- [delete allAccountsData[_account]](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L344)\n", + "first_markdown_element": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L318-L359", + "id": "a95c0c9dfeb348e0fd86f2f14090e1fbee931ec14c7a4d06443de73a63f4c257", + "check": "costly-loop", + "impact": "Informational", "confidence": "Medium" }, { "elements": [ { "type": "function", - "name": "constructor", + "name": "_approve", "source_mapping": { - "start": 1568, - "length": 783, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", + "start": 34995, + "length": 109, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, - "lines": [ - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64 - ], + "lines": [916, 917, 918], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleStaking", + "name": "ERC721ACustom", "source_mapping": { - "start": 464, - "length": 6184, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163 + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, + 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, + 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, + 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, + 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, + 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, + 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, + 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, + 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, + 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, + 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, + 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, + 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, + 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, + 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, + 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, + 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, + 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, + 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, + 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, + 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, + 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, + 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, + 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, + 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, + 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, + 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, + 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, + 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, + 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, + 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, + 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, + 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, + 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, + 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, + 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, + 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, + 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, + 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, + 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, + 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, + 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, + 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, + 1150, 1151, 1152, 1153, 1154, 1155 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "constructor(IERC20,IExitQueue,uint256,uint256)" + "signature": "_approve(address,uint256)" } - }, + } + ], + "description": "ERC721ACustom._approve(address,uint256) (contracts/nexus/ERC721ACustom.sol#916-918) is never used and should be removed\n", + "markdown": "[ERC721ACustom._approve(address,uint256)](contracts/nexus/ERC721ACustom.sol#L916-L918) is never used and should be removed\n", + "first_markdown_element": "contracts/nexus/ERC721ACustom.sol#L916-L918", + "id": "107e1702b0c16ca67e94609619e4b454d4148c40e81df2658e76f4c10dc1c96b", + "check": "dead-code", + "impact": "Informational", + "confidence": "Medium" + }, + { + "elements": [ { - "type": "node", - "name": "require(bool,string)(_startTimestamp < block.timestamp,Start timestamp must be in the past)", + "type": "function", + "name": "_baseURI", "source_mapping": { - "start": 1716, - "length": 81, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", + "start": 11456, + "length": 111, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, - "lines": [51], - "starting_column": 9, - "ending_column": 90 + "lines": [305, 306, 307], + "starting_column": 5, + "ending_column": 6 }, "type_specific_fields": { "parent": { - "type": "function", - "name": "constructor", + "type": "contract", + "name": "ERC721ACustom", "source_mapping": { - "start": 1568, - "length": 783, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64 + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, + 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, + 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, + 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, + 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, + 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, + 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, + 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, + 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, + 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, + 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, + 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, + 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, + 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, + 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, + 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, + 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, + 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, + 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, + 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, + 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, + 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, + 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, + 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, + 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, + 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, + 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, + 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, + 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, + 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, + 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, + 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, + 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, + 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, + 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, + 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, + 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, + 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, + 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, + 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, + 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, + 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, + 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, + 1150, 1151, 1152, 1153, 1154, 1155 ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleStaking", - "source_mapping": { - "start": 464, - "length": 6184, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", - "is_dependency": false, - "lines": [ - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "constructor(IERC20,IExitQueue,uint256,uint256)" + "starting_column": 1, + "ending_column": 0 } - } + }, + "signature": "_baseURI(uint256)" } - }, + } + ], + "description": "ERC721ACustom._baseURI(uint256) (contracts/nexus/ERC721ACustom.sol#305-307) is never used and should be removed\n", + "markdown": "[ERC721ACustom._baseURI(uint256)](contracts/nexus/ERC721ACustom.sol#L305-L307) is never used and should be removed\n", + "first_markdown_element": "contracts/nexus/ERC721ACustom.sol#L305-L307", + "id": "3924e2431236ed02a140712e77dab31cee7c279aa94b682edd1daa8768865092", + "check": "dead-code", + "impact": "Informational", + "confidence": "Medium" + }, + { + "elements": [ { - "type": "node", - "name": "require(bool,string)(_startTimestamp > (block.timestamp - (24 * 2 * 60 * 60)),Start timestamp can't be more than 2 days in the past)", + "type": "function", + "name": "_beforeTokenTransfers", "source_mapping": { - "start": 1807, - "length": 122, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", + "start": 26389, + "length": 154, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, - "lines": [52], - "starting_column": 9, - "ending_column": 131 + "lines": [682, 683, 684, 685, 686, 687], + "starting_column": 5, + "ending_column": 26 }, "type_specific_fields": { "parent": { - "type": "function", - "name": "constructor", + "type": "contract", + "name": "ERC721ACustom", "source_mapping": { - "start": 1568, - "length": 783, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64 + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, + 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, + 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, + 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, + 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, + 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, + 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, + 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, + 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, + 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, + 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, + 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, + 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, + 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, + 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, + 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, + 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, + 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, + 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, + 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, + 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, + 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, + 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, + 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, + 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, + 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, + 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, + 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, + 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, + 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, + 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, + 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, + 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, + 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, + 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, + 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, + 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, + 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, + 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, + 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, + 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, + 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, + 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, + 1150, 1151, 1152, 1153, 1154, 1155 ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleStaking", - "source_mapping": { - "start": 464, - "length": 6184, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", - "is_dependency": false, - "lines": [ - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "constructor(IERC20,IExitQueue,uint256,uint256)" + "starting_column": 1, + "ending_column": 0 } - } + }, + "signature": "_beforeTokenTransfers(address,address,uint256,uint256)" } } ], - "description": "TempleStaking.constructor(IERC20,IExitQueue,uint256,uint256) (contracts/deprecated/TempleStaking.sol#45-64) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- require(bool,string)(_startTimestamp < block.timestamp,Start timestamp must be in the past) (contracts/deprecated/TempleStaking.sol#51)\n\t- require(bool,string)(_startTimestamp > (block.timestamp - (24 * 2 * 60 * 60)),Start timestamp can't be more than 2 days in the past) (contracts/deprecated/TempleStaking.sol#52)\n", - "markdown": "[TempleStaking.constructor(IERC20,IExitQueue,uint256,uint256)](contracts/deprecated/TempleStaking.sol#L45-L64) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [require(bool,string)(_startTimestamp < block.timestamp,Start timestamp must be in the past)](contracts/deprecated/TempleStaking.sol#L51)\n\t- [require(bool,string)(_startTimestamp > (block.timestamp - (24 * 2 * 60 * 60)),Start timestamp can't be more than 2 days in the past)](contracts/deprecated/TempleStaking.sol#L52)\n", - "first_markdown_element": "contracts/deprecated/TempleStaking.sol#L45-L64", - "id": "554e23718b67bc5f2aee502eb1257244b26e204743aa400a021bde5dfdae3375", - "check": "timestamp", - "impact": "Low", + "description": "ERC721ACustom._beforeTokenTransfers(address,address,uint256,uint256) (contracts/nexus/ERC721ACustom.sol#682-687) is never used and should be removed\n", + "markdown": "[ERC721ACustom._beforeTokenTransfers(address,address,uint256,uint256)](contracts/nexus/ERC721ACustom.sol#L682-L687) is never used and should be removed\n", + "first_markdown_element": "contracts/nexus/ERC721ACustom.sol#L682-L687", + "id": "e8d7a2c3a581ee357da94ce43be85ace6d7bc9c7684fee0b2750c26eada5210c", + "check": "dead-code", + "impact": "Informational", "confidence": "Medium" }, { "elements": [ { "type": "function", - "name": "_updateAccumulationFactor", + "name": "_burn", "source_mapping": { - "start": 4050, - "length": 745, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", + "start": 36225, + "length": 87, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, - "lines": [ - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120 - ], + "lines": [956, 957, 958], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleStaking", + "name": "ERC721ACustom", "source_mapping": { - "start": 464, - "length": 6184, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163 + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, + 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, + 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, + 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, + 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, + 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, + 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, + 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, + 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, + 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, + 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, + 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, + 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, + 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, + 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, + 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, + 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, + 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, + 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, + 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, + 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, + 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, + 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, + 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, + 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, + 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, + 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, + 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, + 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, + 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, + 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, + 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, + 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, + 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, + 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, + 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, + 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, + 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, + 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, + 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, + 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, + 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, + 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, + 1150, 1151, 1152, 1153, 1154, 1155 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "_updateAccumulationFactor()" + "signature": "_burn(uint256)" } - }, + } + ], + "description": "ERC721ACustom._burn(uint256) (contracts/nexus/ERC721ACustom.sol#956-958) is never used and should be removed\n", + "markdown": "[ERC721ACustom._burn(uint256)](contracts/nexus/ERC721ACustom.sol#L956-L958) is never used and should be removed\n", + "first_markdown_element": "contracts/nexus/ERC721ACustom.sol#L956-L958", + "id": "3251288602d1a4c37634325127d4a862bd8030d14eb8b9ec4a3d24198fe9e720", + "check": "dead-code", + "impact": "Informational", + "confidence": "Medium" + }, + { + "elements": [ { - "type": "node", - "name": "_currentEpoch <= lastUpdatedEpoch", + "type": "function", + "name": "_burn", "source_mapping": { - "start": 4429, - "length": 33, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", + "start": 36529, + "length": 3024, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, - "lines": [112], - "starting_column": 13, - "ending_column": 46 + "lines": [ + 970, 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, + 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, + 996, 997, 998, 999, 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, + 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, + 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, + 1030, 1031, 1032, 1033, 1034, 1035, 1036 + ], + "starting_column": 5, + "ending_column": 6 }, "type_specific_fields": { "parent": { - "type": "function", - "name": "_updateAccumulationFactor", + "type": "contract", + "name": "ERC721ACustom", "source_mapping": { - "start": 4050, - "length": 745, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120 + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, + 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, + 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, + 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, + 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, + 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, + 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, + 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, + 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, + 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, + 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, + 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, + 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, + 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, + 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, + 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, + 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, + 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, + 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, + 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, + 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, + 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, + 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, + 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, + 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, + 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, + 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, + 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, + 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, + 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, + 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, + 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, + 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, + 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, + 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, + 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, + 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, + 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, + 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, + 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, + 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, + 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, + 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, + 1150, 1151, 1152, 1153, 1154, 1155 ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleStaking", - "source_mapping": { - "start": 464, - "length": 6184, - "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", - "filename_short": "contracts/deprecated/TempleStaking.sol", - "is_dependency": false, - "lines": [ - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "_updateAccumulationFactor()" + "starting_column": 1, + "ending_column": 0 } - } + }, + "signature": "_burn(uint256,bool)" } } ], - "description": "TempleStaking._updateAccumulationFactor() (contracts/deprecated/TempleStaking.sol#105-120) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- _currentEpoch <= lastUpdatedEpoch (contracts/deprecated/TempleStaking.sol#112)\n", - "markdown": "[TempleStaking._updateAccumulationFactor()](contracts/deprecated/TempleStaking.sol#L105-L120) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [_currentEpoch <= lastUpdatedEpoch](contracts/deprecated/TempleStaking.sol#L112)\n", - "first_markdown_element": "contracts/deprecated/TempleStaking.sol#L105-L120", - "id": "2c34b26cb8045acf51e728be298d8b7511ea225b13e5adb53e7379207bee9ebf", - "check": "timestamp", - "impact": "Low", + "description": "ERC721ACustom._burn(uint256,bool) (contracts/nexus/ERC721ACustom.sol#970-1036) is never used and should be removed\n", + "markdown": "[ERC721ACustom._burn(uint256,bool)](contracts/nexus/ERC721ACustom.sol#L970-L1036) is never used and should be removed\n", + "first_markdown_element": "contracts/nexus/ERC721ACustom.sol#L970-L1036", + "id": "899f994904e6ffcf00a58d6512f437ad250ca2c923f18cf9bdc93c596385e098", + "check": "dead-code", + "impact": "Informational", "confidence": "Medium" }, { "elements": [ { "type": "function", - "name": "relayedSetEndorsementsFor", + "name": "_getAux", "source_mapping": { - "start": 3694, - "length": 758, - "filename_relative": "contracts/governance/ElderElection.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/governance/ElderElection.sol", - "filename_short": "contracts/governance/ElderElection.sol", + "start": 8351, + "length": 135, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, - "lines": [ - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133 - ], + "lines": [230, 231, 232], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "ElderElection", + "name": "ERC721ACustom", "source_mapping": { - "start": 908, - "length": 5057, - "filename_relative": "contracts/governance/ElderElection.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/governance/ElderElection.sol", - "filename_short": "contracts/governance/ElderElection.sol", + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184 + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, + 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, + 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, + 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, + 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, + 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, + 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, + 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, + 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, + 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, + 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, + 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, + 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, + 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, + 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, + 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, + 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, + 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, + 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, + 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, + 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, + 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, + 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, + 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, + 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, + 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, + 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, + 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, + 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, + 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, + 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, + 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, + 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, + 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, + 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, + 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, + 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, + 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, + 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, + 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, + 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, + 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, + 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, + 1150, 1151, 1152, 1153, 1154, 1155 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "relayedSetEndorsementsFor(ElderElection.EndorsementReq,bytes)" + "signature": "_getAux(address)" } - }, + } + ], + "description": "ERC721ACustom._getAux(address) (contracts/nexus/ERC721ACustom.sol#230-232) is never used and should be removed\n", + "markdown": "[ERC721ACustom._getAux(address)](contracts/nexus/ERC721ACustom.sol#L230-L232) is never used and should be removed\n", + "first_markdown_element": "contracts/nexus/ERC721ACustom.sol#L230-L232", + "id": "d7ab554dc5dfbe6126f619eae97eb2e0e8bf423ad613024d9a7bbcd33294a473", + "check": "dead-code", + "impact": "Informational", + "confidence": "Medium" + }, + { + "elements": [ { - "type": "node", - "name": "block.timestamp > req.deadline", + "type": "function", + "name": "_initializeOwnershipAt", "source_mapping": { - "start": 4147, - "length": 30, - "filename_relative": "contracts/governance/ElderElection.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/governance/ElderElection.sol", - "filename_short": "contracts/governance/ElderElection.sol", + "start": 13069, + "length": 192, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, - "lines": [128], - "starting_column": 13, - "ending_column": 43 + "lines": [350, 351, 352, 353, 354], + "starting_column": 5, + "ending_column": 6 }, "type_specific_fields": { "parent": { - "type": "function", - "name": "relayedSetEndorsementsFor", + "type": "contract", + "name": "ERC721ACustom", "source_mapping": { - "start": 3694, - "length": 758, - "filename_relative": "contracts/governance/ElderElection.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/governance/ElderElection.sol", - "filename_short": "contracts/governance/ElderElection.sol", + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133 + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, + 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, + 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, + 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, + 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, + 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, + 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, + 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, + 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, + 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, + 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, + 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, + 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, + 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, + 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, + 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, + 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, + 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, + 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, + 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, + 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, + 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, + 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, + 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, + 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, + 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, + 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, + 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, + 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, + 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, + 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, + 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, + 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, + 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, + 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, + 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, + 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, + 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, + 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, + 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, + 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, + 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, + 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, + 1150, 1151, 1152, 1153, 1154, 1155 ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "ElderElection", - "source_mapping": { - "start": 908, - "length": 5057, - "filename_relative": "contracts/governance/ElderElection.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/governance/ElderElection.sol", - "filename_short": "contracts/governance/ElderElection.sol", - "is_dependency": false, - "lines": [ - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184 - ], - "starting_column": 1, - "ending_column": 2 - } - }, - "signature": "relayedSetEndorsementsFor(ElderElection.EndorsementReq,bytes)" + "starting_column": 1, + "ending_column": 0 } - } + }, + "signature": "_initializeOwnershipAt(uint256)" } } ], - "description": "ElderElection.relayedSetEndorsementsFor(ElderElection.EndorsementReq,bytes) (contracts/governance/ElderElection.sol#116-133) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- block.timestamp > req.deadline (contracts/governance/ElderElection.sol#128)\n", - "markdown": "[ElderElection.relayedSetEndorsementsFor(ElderElection.EndorsementReq,bytes)](contracts/governance/ElderElection.sol#L116-L133) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [block.timestamp > req.deadline](contracts/governance/ElderElection.sol#L128)\n", - "first_markdown_element": "contracts/governance/ElderElection.sol#L116-L133", - "id": "239671d596cd02628eaf3011f43031162b8fe5ef0e67e790828aa11ea864ca0c", - "check": "timestamp", - "impact": "Low", + "description": "ERC721ACustom._initializeOwnershipAt(uint256) (contracts/nexus/ERC721ACustom.sol#350-354) is never used and should be removed\n", + "markdown": "[ERC721ACustom._initializeOwnershipAt(uint256)](contracts/nexus/ERC721ACustom.sol#L350-L354) is never used and should be removed\n", + "first_markdown_element": "contracts/nexus/ERC721ACustom.sol#L350-L354", + "id": "9f0b131292abda888c82c9c2aee04b607bb19f9e200925bb6027c41e93743e48", + "check": "dead-code", + "impact": "Informational", "confidence": "Medium" }, { "elements": [ { "type": "function", - "name": "signatureSplit", + "name": "_mintERC2309", "source_mapping": { - "start": 1240, - "length": 959, - "filename_relative": "contracts/v2/safeGuards/SafeForked.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/safeGuards/SafeForked.sol", - "filename_short": "contracts/v2/safeGuards/SafeForked.sol", + "start": 31981, + "length": 1470, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46 + 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, + 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, + 859, 860, 861, 862, 863, 864, 865 ], "starting_column": 5, "ending_column": 6 @@ -55435,550 +52604,922 @@ "type_specific_fields": { "parent": { "type": "contract", - "name": "SafeForked", + "name": "ERC721ACustom", "source_mapping": { - "start": 462, - "length": 6708, - "filename_relative": "contracts/v2/safeGuards/SafeForked.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/safeGuards/SafeForked.sol", - "filename_short": "contracts/v2/safeGuards/SafeForked.sol", + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131 + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, + 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, + 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, + 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, + 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, + 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, + 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, + 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, + 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, + 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, + 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, + 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, + 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, + 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, + 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, + 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, + 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, + 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, + 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, + 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, + 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, + 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, + 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, + 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, + 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, + 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, + 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, + 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, + 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, + 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, + 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, + 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, + 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, + 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, + 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, + 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, + 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, + 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, + 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, + 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, + 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, + 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, + 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, + 1150, 1151, 1152, 1153, 1154, 1155 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "signatureSplit(bytes,uint256)" + "signature": "_mintERC2309(address,uint256)" } - }, + } + ], + "description": "ERC721ACustom._mintERC2309(address,uint256) (contracts/nexus/ERC721ACustom.sol#833-865) is never used and should be removed\n", + "markdown": "[ERC721ACustom._mintERC2309(address,uint256)](contracts/nexus/ERC721ACustom.sol#L833-L865) is never used and should be removed\n", + "first_markdown_element": "contracts/nexus/ERC721ACustom.sol#L833-L865", + "id": "71a7d522ab2e2a70542031d80b89a02a7002a2be8801b13b7db81cf266ce5de6", + "check": "dead-code", + "impact": "Informational", + "confidence": "Medium" + }, + { + "elements": [ { - "type": "node", - "name": "", + "type": "function", + "name": "_numberBurned", "source_mapping": { - "start": 1654, - "length": 539, - "filename_relative": "contracts/v2/safeGuards/SafeForked.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/safeGuards/SafeForked.sol", - "filename_short": "contracts/v2/safeGuards/SafeForked.sol", + "start": 8062, + "length": 176, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, - "lines": [35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45], - "starting_column": 9, - "ending_column": 10 + "lines": [223, 224, 225], + "starting_column": 5, + "ending_column": 6 }, "type_specific_fields": { "parent": { - "type": "function", - "name": "signatureSplit", + "type": "contract", + "name": "ERC721ACustom", "source_mapping": { - "start": 1240, - "length": 959, - "filename_relative": "contracts/v2/safeGuards/SafeForked.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/safeGuards/SafeForked.sol", - "filename_short": "contracts/v2/safeGuards/SafeForked.sol", + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46 + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, + 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, + 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, + 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, + 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, + 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, + 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, + 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, + 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, + 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, + 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, + 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, + 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, + 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, + 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, + 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, + 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, + 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, + 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, + 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, + 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, + 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, + 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, + 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, + 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, + 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, + 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, + 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, + 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, + 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, + 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, + 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, + 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, + 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, + 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, + 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, + 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, + 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, + 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, + 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, + 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, + 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, + 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, + 1150, 1151, 1152, 1153, 1154, 1155 ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "SafeForked", - "source_mapping": { - "start": 462, - "length": 6708, - "filename_relative": "contracts/v2/safeGuards/SafeForked.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/safeGuards/SafeForked.sol", - "filename_short": "contracts/v2/safeGuards/SafeForked.sol", - "is_dependency": false, - "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "signatureSplit(bytes,uint256)" + "starting_column": 1, + "ending_column": 0 } - } + }, + "signature": "_numberBurned(address)" } } ], - "description": "SafeForked.signatureSplit(bytes,uint256) (contracts/v2/safeGuards/SafeForked.sol#22-46) uses assembly\n\t- INLINE ASM (contracts/v2/safeGuards/SafeForked.sol#35-45)\n", - "markdown": "[SafeForked.signatureSplit(bytes,uint256)](contracts/v2/safeGuards/SafeForked.sol#L22-L46) uses assembly\n\t- [INLINE ASM](contracts/v2/safeGuards/SafeForked.sol#L35-L45)\n", - "first_markdown_element": "contracts/v2/safeGuards/SafeForked.sol#L22-L46", - "id": "3ae97a7384e3769435f8b201c1864a124173df742b9300bf25e8a1a702a86371", - "check": "assembly", + "description": "ERC721ACustom._numberBurned(address) (contracts/nexus/ERC721ACustom.sol#223-225) is never used and should be removed\n", + "markdown": "[ERC721ACustom._numberBurned(address)](contracts/nexus/ERC721ACustom.sol#L223-L225) is never used and should be removed\n", + "first_markdown_element": "contracts/nexus/ERC721ACustom.sol#L223-L225", + "id": "55ef26360df603f4fced283950ce9273460026c3f64792df4dcb7d24f83289b8", + "check": "dead-code", "impact": "Informational", - "confidence": "High" + "confidence": "Medium" }, { "elements": [ { "type": "function", - "name": "gain", + "name": "_numberMinted", "source_mapping": { - "start": 925, - "length": 300, - "filename_relative": "contracts/deprecated/Faith.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/Faith.sol", - "filename_short": "contracts/deprecated/Faith.sol", + "start": 7793, + "length": 176, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, - "lines": [31, 32, 33, 34, 35, 36, 37], + "lines": [216, 217, 218], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "Faith", + "name": "ERC721ACustom", "source_mapping": { - "start": 125, - "length": 1740, - "filename_relative": "contracts/deprecated/Faith.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/Faith.sol", - "filename_short": "contracts/deprecated/Faith.sol", + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58 + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, + 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, + 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, + 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, + 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, + 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, + 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, + 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, + 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, + 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, + 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, + 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, + 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, + 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, + 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, + 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, + 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, + 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, + 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, + 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, + 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, + 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, + 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, + 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, + 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, + 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, + 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, + 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, + 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, + 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, + 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, + 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, + 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, + 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, + 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, + 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, + 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, + 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, + 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, + 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, + 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, + 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, + 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, + 1150, 1151, 1152, 1153, 1154, 1155 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "gain(address,uint112)" - } - }, - { - "type": "node", - "name": "require(bool,string)(canManageFaith[msg.sender] == true,Faith: caller cannot manage faith)", - "source_mapping": { - "start": 986, - "length": 80, - "filename_relative": "contracts/deprecated/Faith.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/Faith.sol", - "filename_short": "contracts/deprecated/Faith.sol", - "is_dependency": false, - "lines": [32], - "starting_column": 9, - "ending_column": 89 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "gain", - "source_mapping": { - "start": 925, - "length": 300, - "filename_relative": "contracts/deprecated/Faith.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/Faith.sol", - "filename_short": "contracts/deprecated/Faith.sol", - "is_dependency": false, - "lines": [31, 32, 33, 34, 35, 36, 37], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "Faith", - "source_mapping": { - "start": 125, - "length": 1740, - "filename_relative": "contracts/deprecated/Faith.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/Faith.sol", - "filename_short": "contracts/deprecated/Faith.sol", - "is_dependency": false, - "lines": [ - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "gain(address,uint112)" - } - } + "signature": "_numberMinted(address)" } } ], - "description": "Faith.gain(address,uint112) (contracts/deprecated/Faith.sol#31-37) compares to a boolean constant:\n\t-require(bool,string)(canManageFaith[msg.sender] == true,Faith: caller cannot manage faith) (contracts/deprecated/Faith.sol#32)\n", - "markdown": "[Faith.gain(address,uint112)](contracts/deprecated/Faith.sol#L31-L37) compares to a boolean constant:\n\t-[require(bool,string)(canManageFaith[msg.sender] == true,Faith: caller cannot manage faith)](contracts/deprecated/Faith.sol#L32)\n", - "first_markdown_element": "contracts/deprecated/Faith.sol#L31-L37", - "id": "56cf0d358c021f966d8663efb62e81b7ea09bb2bf0bc7a5ba363ebe693c3bf56", - "check": "boolean-equal", + "description": "ERC721ACustom._numberMinted(address) (contracts/nexus/ERC721ACustom.sol#216-218) is never used and should be removed\n", + "markdown": "[ERC721ACustom._numberMinted(address)](contracts/nexus/ERC721ACustom.sol#L216-L218) is never used and should be removed\n", + "first_markdown_element": "contracts/nexus/ERC721ACustom.sol#L216-L218", + "id": "5ea1215bbd0dad930eb81f1f5a94f3cf1a86c0cf5731606e69cbdc7fe528bc1c", + "check": "dead-code", "impact": "Informational", - "confidence": "High" + "confidence": "Medium" }, { "elements": [ { "type": "function", - "name": "redeem", + "name": "_ownershipAt", "source_mapping": { - "start": 1231, - "length": 412, - "filename_relative": "contracts/deprecated/Faith.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/Faith.sol", - "filename_short": "contracts/deprecated/Faith.sol", + "start": 12485, + "length": 159, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, - "lines": [39, 40, 41, 42, 43, 44, 45, 46, 47, 48], + "lines": [335, 336, 337], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "Faith", + "name": "ERC721ACustom", "source_mapping": { - "start": 125, - "length": 1740, - "filename_relative": "contracts/deprecated/Faith.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/Faith.sol", - "filename_short": "contracts/deprecated/Faith.sol", + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58 + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, + 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, + 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, + 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, + 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, + 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, + 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, + 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, + 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, + 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, + 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, + 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, + 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, + 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, + 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, + 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, + 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, + 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, + 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, + 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, + 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, + 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, + 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, + 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, + 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, + 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, + 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, + 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, + 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, + 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, + 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, + 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, + 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, + 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, + 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, + 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, + 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, + 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, + 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, + 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, + 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, + 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, + 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, + 1150, 1151, 1152, 1153, 1154, 1155 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "redeem(address,uint112)" + "signature": "_ownershipAt(uint256)" } - }, - { - "type": "node", - "name": "require(bool,string)(canManageFaith[msg.sender] == true,Faith: caller cannot manage faith)", - "source_mapping": { - "start": 1294, - "length": 80, - "filename_relative": "contracts/deprecated/Faith.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/Faith.sol", - "filename_short": "contracts/deprecated/Faith.sol", - "is_dependency": false, - "lines": [40], - "starting_column": 9, - "ending_column": 89 - }, - "type_specific_fields": { - "parent": { - "type": "function", - "name": "redeem", - "source_mapping": { - "start": 1231, - "length": 412, - "filename_relative": "contracts/deprecated/Faith.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/Faith.sol", - "filename_short": "contracts/deprecated/Faith.sol", - "is_dependency": false, - "lines": [39, 40, 41, 42, 43, 44, 45, 46, 47, 48], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "Faith", - "source_mapping": { - "start": 125, - "length": 1740, - "filename_relative": "contracts/deprecated/Faith.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/Faith.sol", - "filename_short": "contracts/deprecated/Faith.sol", - "is_dependency": false, - "lines": [ - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "redeem(address,uint112)" + } + ], + "description": "ERC721ACustom._ownershipAt(uint256) (contracts/nexus/ERC721ACustom.sol#335-337) is never used and should be removed\n", + "markdown": "[ERC721ACustom._ownershipAt(uint256)](contracts/nexus/ERC721ACustom.sol#L335-L337) is never used and should be removed\n", + "first_markdown_element": "contracts/nexus/ERC721ACustom.sol#L335-L337", + "id": "b5dc052b841d4be1eae0bc2a6e120d48ae792342d460db816007056a4dc76304", + "check": "dead-code", + "impact": "Informational", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "_ownershipIsInitialized", + "source_mapping": { + "start": 12823, + "length": 138, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", + "is_dependency": false, + "lines": [343, 344, 345], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "ERC721ACustom", + "source_mapping": { + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", + "is_dependency": false, + "lines": [ + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, + 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, + 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, + 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, + 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, + 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, + 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, + 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, + 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, + 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, + 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, + 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, + 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, + 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, + 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, + 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, + 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, + 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, + 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, + 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, + 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, + 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, + 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, + 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, + 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, + 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, + 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, + 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, + 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, + 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, + 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, + 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, + 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, + 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, + 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, + 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, + 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, + 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, + 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, + 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, + 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, + 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, + 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, + 1150, 1151, 1152, 1153, 1154, 1155 + ], + "starting_column": 1, + "ending_column": 0 } - } + }, + "signature": "_ownershipIsInitialized(uint256)" } } ], - "description": "Faith.redeem(address,uint112) (contracts/deprecated/Faith.sol#39-48) compares to a boolean constant:\n\t-require(bool,string)(canManageFaith[msg.sender] == true,Faith: caller cannot manage faith) (contracts/deprecated/Faith.sol#40)\n", - "markdown": "[Faith.redeem(address,uint112)](contracts/deprecated/Faith.sol#L39-L48) compares to a boolean constant:\n\t-[require(bool,string)(canManageFaith[msg.sender] == true,Faith: caller cannot manage faith)](contracts/deprecated/Faith.sol#L40)\n", - "first_markdown_element": "contracts/deprecated/Faith.sol#L39-L48", - "id": "f752127c3f283f8e0863072b8bdc266223eb3fecc4b64e758a86403628b01ba6", - "check": "boolean-equal", + "description": "ERC721ACustom._ownershipIsInitialized(uint256) (contracts/nexus/ERC721ACustom.sol#343-345) is never used and should be removed\n", + "markdown": "[ERC721ACustom._ownershipIsInitialized(uint256)](contracts/nexus/ERC721ACustom.sol#L343-L345) is never used and should be removed\n", + "first_markdown_element": "contracts/nexus/ERC721ACustom.sol#L343-L345", + "id": "aaad82f0f4982688cdec0c0a1390611da56648067c838f2183a8e4b39c740831", + "check": "dead-code", "impact": "Informational", - "confidence": "High" + "confidence": "Medium" }, { "elements": [ { "type": "function", - "name": "batchLiquidate", + "name": "_ownershipOf", "source_mapping": { - "start": 13008, - "length": 1632, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 12230, + "length": 164, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, - "lines": [ - 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, - 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359 - ], + "lines": [328, 329, 330], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "TempleLineOfCredit", + "name": "ERC721ACustom", "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, - 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, - 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, - 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, - 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, - 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, - 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, - 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, - 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, - 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, - 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, - 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, - 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, - 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, - 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, - 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, - 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, - 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, - 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, - 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, - 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, - 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, - 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, - 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, - 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, - 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, - 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, - 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, - 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, - 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, - 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, - 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, - 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, - 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, - 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, - 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, - 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, - 874, 875, 876, 877, 878, 879, 880, 881, 882 + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, + 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, + 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, + 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, + 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, + 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, + 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, + 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, + 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, + 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, + 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, + 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, + 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, + 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, + 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, + 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, + 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, + 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, + 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, + 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, + 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, + 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, + 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, + 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, + 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, + 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, + 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, + 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, + 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, + 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, + 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, + 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, + 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, + 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, + 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, + 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, + 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, + 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, + 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, + 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, + 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, + 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, + 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, + 1150, 1151, 1152, 1153, 1154, 1155 ], "starting_column": 1, "ending_column": 0 } }, - "signature": "batchLiquidate(address[])" + "signature": "_ownershipOf(uint256)" } - }, + } + ], + "description": "ERC721ACustom._ownershipOf(uint256) (contracts/nexus/ERC721ACustom.sol#328-330) is never used and should be removed\n", + "markdown": "[ERC721ACustom._ownershipOf(uint256)](contracts/nexus/ERC721ACustom.sol#L328-L330) is never used and should be removed\n", + "first_markdown_element": "contracts/nexus/ERC721ACustom.sol#L328-L330", + "id": "35f012d1eace6dc6f4bdb229f8dcb45222783ce5455f72f84e575fdbcb88b71b", + "check": "dead-code", + "impact": "Informational", + "confidence": "Medium" + }, + { + "elements": [ { - "type": "node", - "name": "delete allAccountsData[_account]", + "type": "function", + "name": "_safeMint", "source_mapping": { - "start": 14023, - "length": 32, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 34617, + "length": 110, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, - "lines": [344], - "starting_column": 17, - "ending_column": 49 + "lines": [905, 906, 907], + "starting_column": 5, + "ending_column": 6 }, "type_specific_fields": { "parent": { - "type": "function", - "name": "batchLiquidate", + "type": "contract", + "name": "ERC721ACustom", "source_mapping": { - "start": 13008, - "length": 1632, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, - 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359 + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, + 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, + 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, + 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, + 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, + 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, + 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, + 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, + 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, + 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, + 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, + 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, + 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, + 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, + 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, + 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, + 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, + 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, + 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, + 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, + 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, + 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, + 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, + 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, + 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, + 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, + 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, + 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, + 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, + 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, + 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, + 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, + 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, + 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, + 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, + 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, + 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, + 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, + 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, + 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, + 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, + 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, + 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, + 1150, 1151, 1152, 1153, 1154, 1155 ], - "starting_column": 5, - "ending_column": 6 - }, - "type_specific_fields": { - "parent": { - "type": "contract", - "name": "TempleLineOfCredit", - "source_mapping": { - "start": 1433, - "length": 31765, - "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "is_dependency": false, - "lines": [ - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, - 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, - 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, - 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, - 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, - 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, - 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, - 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, - 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, - 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, - 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, - 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, - 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, - 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, - 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, - 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, - 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, - 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, - 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, - 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, - 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, - 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, - 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, - 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, - 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, - 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, - 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, - 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, - 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, - 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - "signature": "batchLiquidate(address[])" + "starting_column": 1, + "ending_column": 0 } - } + }, + "signature": "_safeMint(address,uint256)" } } ], - "description": "TempleLineOfCredit.batchLiquidate(address[]) (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#318-359) has costly operations inside a loop:\n\t- delete allAccountsData[_account] (contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#344)\n", - "markdown": "[TempleLineOfCredit.batchLiquidate(address[])](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L318-L359) has costly operations inside a loop:\n\t- [delete allAccountsData[_account]](contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L344)\n", - "first_markdown_element": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol#L318-L359", - "id": "a95c0c9dfeb348e0fd86f2f14090e1fbee931ec14c7a4d06443de73a63f4c257", - "check": "costly-loop", + "description": "ERC721ACustom._safeMint(address,uint256) (contracts/nexus/ERC721ACustom.sol#905-907) is never used and should be removed\n", + "markdown": "[ERC721ACustom._safeMint(address,uint256)](contracts/nexus/ERC721ACustom.sol#L905-L907) is never used and should be removed\n", + "first_markdown_element": "contracts/nexus/ERC721ACustom.sol#L905-L907", + "id": "dc153eda950f1e8478f28694e7e8f2450d5ce8a84c66d05262a80bad5d08b533", + "check": "dead-code", "impact": "Informational", "confidence": "Medium" }, @@ -55986,45 +53527,132 @@ "elements": [ { "type": "function", - "name": "encodeUInt32", + "name": "_setAux", "source_mapping": { - "start": 163, - "length": 183, - "filename_relative": "contracts/common/SafeCast.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/common/SafeCast.sol", - "filename_short": "contracts/common/SafeCast.sol", + "start": 8668, + "length": 395, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, - "lines": [8, 9, 10, 11], + "lines": [238, 239, 240, 241, 242, 243, 244, 245, 246, 247], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "SafeCast", + "name": "ERC721ACustom", "source_mapping": { - "start": 103, - "length": 1008, - "filename_relative": "contracts/common/SafeCast.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/common/SafeCast.sol", - "filename_short": "contracts/common/SafeCast.sol", + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32 + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, + 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, + 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, + 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, + 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, + 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, + 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, + 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, + 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, + 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, + 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, + 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, + 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, + 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, + 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, + 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, + 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, + 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, + 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, + 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, + 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, + 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, + 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, + 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, + 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, + 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, + 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, + 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, + 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, + 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, + 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, + 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, + 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, + 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, + 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, + 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, + 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, + 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, + 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, + 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, + 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, + 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, + 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, + 1150, 1151, 1152, 1153, 1154, 1155 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "encodeUInt32(uint256)" + "signature": "_setAux(address,uint64)" } } ], - "description": "SafeCast.encodeUInt32(uint256) (contracts/common/SafeCast.sol#8-11) is never used and should be removed\n", - "markdown": "[SafeCast.encodeUInt32(uint256)](contracts/common/SafeCast.sol#L8-L11) is never used and should be removed\n", - "first_markdown_element": "contracts/common/SafeCast.sol#L8-L11", - "id": "f0aab31e85bfb6ebec4ea852aa07ca2f61753391310df55b8ebaa67a37f08742", + "description": "ERC721ACustom._setAux(address,uint64) (contracts/nexus/ERC721ACustom.sol#238-247) is never used and should be removed\n", + "markdown": "[ERC721ACustom._setAux(address,uint64)](contracts/nexus/ERC721ACustom.sol#L238-L247) is never used and should be removed\n", + "first_markdown_element": "contracts/nexus/ERC721ACustom.sol#L238-L247", + "id": "077d5fe745b66dd5f74f2bc2833e56adf89a05d6e97c9f0706853a8197874f4e", "check": "dead-code", "impact": "Informational", "confidence": "Medium" @@ -56033,45 +53661,134 @@ "elements": [ { "type": "function", - "name": "encodeUInt64", + "name": "_setExtraDataAt", "source_mapping": { - "start": 352, - "length": 183, - "filename_relative": "contracts/common/SafeCast.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/common/SafeCast.sol", - "filename_short": "contracts/common/SafeCast.sol", + "start": 39836, + "length": 531, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, - "lines": [13, 14, 15, 16], + "lines": [ + 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055 + ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "SafeCast", + "name": "ERC721ACustom", "source_mapping": { - "start": 103, - "length": 1008, - "filename_relative": "contracts/common/SafeCast.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/common/SafeCast.sol", - "filename_short": "contracts/common/SafeCast.sol", + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32 + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, + 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, + 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, + 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, + 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, + 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, + 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, + 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, + 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, + 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, + 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, + 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, + 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, + 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, + 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, + 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, + 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, + 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, + 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, + 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, + 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, + 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, + 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, + 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, + 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, + 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, + 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, + 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, + 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, + 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, + 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, + 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, + 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, + 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, + 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, + 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, + 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, + 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, + 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, + 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, + 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, + 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, + 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, + 1150, 1151, 1152, 1153, 1154, 1155 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "encodeUInt64(uint256)" + "signature": "_setExtraDataAt(uint256,uint24)" } } ], - "description": "SafeCast.encodeUInt64(uint256) (contracts/common/SafeCast.sol#13-16) is never used and should be removed\n", - "markdown": "[SafeCast.encodeUInt64(uint256)](contracts/common/SafeCast.sol#L13-L16) is never used and should be removed\n", - "first_markdown_element": "contracts/common/SafeCast.sol#L13-L16", - "id": "ebd8b022714f3eebffda1b7936fb5da63463b8820bcbf797e1764dfbb1bea33f", + "description": "ERC721ACustom._setExtraDataAt(uint256,uint24) (contracts/nexus/ERC721ACustom.sol#1045-1055) is never used and should be removed\n", + "markdown": "[ERC721ACustom._setExtraDataAt(uint256,uint24)](contracts/nexus/ERC721ACustom.sol#L1045-L1055) is never used and should be removed\n", + "first_markdown_element": "contracts/nexus/ERC721ACustom.sol#L1045-L1055", + "id": "a4d6b9e0037c1f60136e688957a504c1db8d1e0db3c46e710c027a427299e5b0", "check": "dead-code", "impact": "Informational", "confidence": "Medium" @@ -56080,45 +53797,132 @@ "elements": [ { "type": "function", - "name": "encodeUInt80", + "name": "_totalBurned", "source_mapping": { - "start": 541, - "length": 183, - "filename_relative": "contracts/common/SafeCast.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/common/SafeCast.sol", - "filename_short": "contracts/common/SafeCast.sol", + "start": 7103, + "length": 100, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, - "lines": [18, 19, 20, 21], + "lines": [197, 198, 199], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "SafeCast", + "name": "ERC721ACustom", "source_mapping": { - "start": 103, - "length": 1008, - "filename_relative": "contracts/common/SafeCast.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/common/SafeCast.sol", - "filename_short": "contracts/common/SafeCast.sol", + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32 + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, + 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, + 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, + 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, + 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, + 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, + 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, + 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, + 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, + 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, + 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, + 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, + 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, + 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, + 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, + 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, + 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, + 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, + 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, + 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, + 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, + 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, + 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, + 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, + 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, + 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, + 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, + 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, + 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, + 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, + 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, + 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, + 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, + 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, + 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, + 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, + 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, + 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, + 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, + 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, + 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, + 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, + 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, + 1150, 1151, 1152, 1153, 1154, 1155 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "encodeUInt80(uint256)" + "signature": "_totalBurned()" } } ], - "description": "SafeCast.encodeUInt80(uint256) (contracts/common/SafeCast.sol#18-21) is never used and should be removed\n", - "markdown": "[SafeCast.encodeUInt80(uint256)](contracts/common/SafeCast.sol#L18-L21) is never used and should be removed\n", - "first_markdown_element": "contracts/common/SafeCast.sol#L18-L21", - "id": "3222dc12c52f3b7b9b527d9d8effe1f1563500f8768872ec07c4ba8cb2174f30", + "description": "ERC721ACustom._totalBurned() (contracts/nexus/ERC721ACustom.sol#197-199) is never used and should be removed\n", + "markdown": "[ERC721ACustom._totalBurned()](contracts/nexus/ERC721ACustom.sol#L197-L199) is never used and should be removed\n", + "first_markdown_element": "contracts/nexus/ERC721ACustom.sol#L197-L199", + "id": "51f8f0a152b78ee5899d4f053a9216791d4dd47976b77956950da15067d89905", "check": "dead-code", "impact": "Informational", "confidence": "Medium" @@ -56127,45 +53931,132 @@ "elements": [ { "type": "function", - "name": "encodeUInt96", + "name": "_unpackedOwnership", "source_mapping": { - "start": 730, - "length": 183, - "filename_relative": "contracts/common/SafeCast.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/common/SafeCast.sol", - "filename_short": "contracts/common/SafeCast.sol", + "start": 15410, + "length": 361, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, - "lines": [23, 24, 25, 26], + "lines": [398, 399, 400, 401, 402, 403], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", - "name": "SafeCast", + "name": "ERC721ACustom", "source_mapping": { - "start": 103, - "length": 1008, - "filename_relative": "contracts/common/SafeCast.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/common/SafeCast.sol", - "filename_short": "contracts/common/SafeCast.sol", + "start": 1312, + "length": 42709, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", "is_dependency": false, "lines": [ - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32 + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, + 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, + 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, + 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, + 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, + 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, + 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, + 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, + 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, + 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, + 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, + 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, + 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, + 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, + 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, + 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, + 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, + 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, + 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, + 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, + 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, + 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, + 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, + 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, + 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, + 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, + 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, + 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, + 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, + 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, + 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, + 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, + 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, + 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, + 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, + 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, + 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, + 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, + 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, + 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, + 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, + 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, + 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, + 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, + 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, + 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, + 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, + 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, + 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, + 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, + 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, + 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, + 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, + 1150, 1151, 1152, 1153, 1154, 1155 ], "starting_column": 1, - "ending_column": 2 + "ending_column": 0 } }, - "signature": "encodeUInt96(uint256)" + "signature": "_unpackedOwnership(uint256)" } } ], - "description": "SafeCast.encodeUInt96(uint256) (contracts/common/SafeCast.sol#23-26) is never used and should be removed\n", - "markdown": "[SafeCast.encodeUInt96(uint256)](contracts/common/SafeCast.sol#L23-L26) is never used and should be removed\n", - "first_markdown_element": "contracts/common/SafeCast.sol#L23-L26", - "id": "f79733cd6b71482b4bec178005f67c6fcf98cb51d65e61c39e7f30aa2e1a14c4", + "description": "ERC721ACustom._unpackedOwnership(uint256) (contracts/nexus/ERC721ACustom.sol#398-403) is never used and should be removed\n", + "markdown": "[ERC721ACustom._unpackedOwnership(uint256)](contracts/nexus/ERC721ACustom.sol#L398-L403) is never used and should be removed\n", + "first_markdown_element": "contracts/nexus/ERC721ACustom.sol#L398-L403", + "id": "1d2bd95e93b751c7b68fb2d00c41b75dccb1b2fb9dfc82f806e7850af64f37c5", "check": "dead-code", "impact": "Informational", "confidence": "Medium" @@ -56179,7 +54070,7 @@ "start": 0, "length": 24, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [1], @@ -56217,60 +54108,6 @@ "impact": "Informational", "confidence": "High" }, - { - "elements": [ - { - "type": "pragma", - "name": "^0.8.4", - "source_mapping": { - "start": 46, - "length": 23, - "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", - "is_dependency": false, - "lines": [2], - "starting_column": 1, - "ending_column": 24 - }, - "type_specific_fields": { "directive": ["solidity", "^", "0.8", ".4"] } - } - ], - "description": "Pragma version^0.8.4 (contracts/admin/TempleTeamPaymentsFactory.sol#2) allows old versions\n", - "markdown": "Pragma version[^0.8.4](contracts/admin/TempleTeamPaymentsFactory.sol#L2) allows old versions\n", - "first_markdown_element": "contracts/admin/TempleTeamPaymentsFactory.sol#L2", - "id": "8738b24a90c6b95c0974988e97b56e053beaa173ac6f6652f0bb8445da6c9fb0", - "check": "solc-version", - "impact": "Informational", - "confidence": "High" - }, - { - "elements": [ - { - "type": "pragma", - "name": "^0.8.4", - "source_mapping": { - "start": 45, - "length": 23, - "filename_relative": "contracts/admin/TempleTeamPaymentsV2.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPaymentsV2.sol", - "filename_short": "contracts/admin/TempleTeamPaymentsV2.sol", - "is_dependency": false, - "lines": [2], - "starting_column": 1, - "ending_column": 24 - }, - "type_specific_fields": { "directive": ["solidity", "^", "0.8", ".4"] } - } - ], - "description": "Pragma version^0.8.4 (contracts/admin/TempleTeamPaymentsV2.sol#2) allows old versions\n", - "markdown": "Pragma version[^0.8.4](contracts/admin/TempleTeamPaymentsV2.sol#L2) allows old versions\n", - "first_markdown_element": "contracts/admin/TempleTeamPaymentsV2.sol#L2", - "id": "68d37bf3d8ba335ec55c660823ae20e421300c1dca3fe0d9a25352189eaa5ab3", - "check": "solc-version", - "impact": "Informational", - "confidence": "High" - }, { "elements": [ { @@ -56280,7 +54117,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/amo/AuraStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/AuraStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/AuraStaking.sol", "filename_short": "contracts/amo/AuraStaking.sol", "is_dependency": false, "lines": [1], @@ -56307,7 +54144,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/amo/Ramos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/Ramos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/Ramos.sol", "filename_short": "contracts/amo/Ramos.sol", "is_dependency": false, "lines": [1], @@ -56334,7 +54171,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/amo/helpers/AMOCommon.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/helpers/AMOCommon.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/helpers/AMOCommon.sol", "filename_short": "contracts/amo/helpers/AMOCommon.sol", "is_dependency": false, "lines": [1], @@ -56361,7 +54198,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/amo/helpers/BalancerPoolHelper.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amo/helpers/BalancerPoolHelper.sol", "filename_short": "contracts/amo/helpers/BalancerPoolHelper.sol", "is_dependency": false, "lines": [1], @@ -56388,7 +54225,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/common/CommonEventsAndErrors.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/common/CommonEventsAndErrors.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/common/CommonEventsAndErrors.sol", "filename_short": "contracts/common/CommonEventsAndErrors.sol", "is_dependency": false, "lines": [1], @@ -56415,7 +54252,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/common/SafeCast.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/common/SafeCast.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/common/SafeCast.sol", "filename_short": "contracts/common/SafeCast.sol", "is_dependency": false, "lines": [1], @@ -56437,25 +54274,25 @@ "elements": [ { "type": "pragma", - "name": "^0.8.4", + "name": "0.8.19", "source_mapping": { "start": 0, "length": 23, - "filename_relative": "contracts/core/TempleERC20Token.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TempleERC20Token.sol", - "filename_short": "contracts/core/TempleERC20Token.sol", + "filename_relative": "contracts/core/OtcOffer.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OtcOffer.sol", + "filename_short": "contracts/core/OtcOffer.sol", "is_dependency": false, "lines": [1], "starting_column": 1, "ending_column": 24 }, - "type_specific_fields": { "directive": ["solidity", "^", "0.8", ".4"] } + "type_specific_fields": { "directive": ["solidity", "0.8", ".19"] } } ], - "description": "Pragma version^0.8.4 (contracts/core/TempleERC20Token.sol#1) allows old versions\n", - "markdown": "Pragma version[^0.8.4](contracts/core/TempleERC20Token.sol#L1) allows old versions\n", - "first_markdown_element": "contracts/core/TempleERC20Token.sol#L1", - "id": "6c18ec5d6b9335415d21a601676b09c02352342bfa6559fb0ce873354fb81687", + "description": "Pragma version0.8.19 (contracts/core/OtcOffer.sol#1) necessitates a version too recent to be trusted. Consider deploying with 0.8.18.\n", + "markdown": "Pragma version[0.8.19](contracts/core/OtcOffer.sol#L1) necessitates a version too recent to be trusted. Consider deploying with 0.8.18.\n", + "first_markdown_element": "contracts/core/OtcOffer.sol#L1", + "id": "2940a3848f7667cc3706f80c2537856ed07e8563cbff86311c852b3f61815e74", "check": "solc-version", "impact": "Informational", "confidence": "High" @@ -56469,7 +54306,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/interfaces/amo/IAuraStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/amo/IAuraStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/amo/IAuraStaking.sol", "filename_short": "contracts/interfaces/amo/IAuraStaking.sol", "is_dependency": false, "lines": [1], @@ -56496,7 +54333,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/interfaces/amo/IRamos.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/amo/IRamos.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/amo/IRamos.sol", "filename_short": "contracts/interfaces/amo/IRamos.sol", "is_dependency": false, "lines": [1], @@ -56523,7 +54360,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/interfaces/amo/helpers/IBalancerPoolHelper.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/amo/helpers/IBalancerPoolHelper.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/amo/helpers/IBalancerPoolHelper.sol", "filename_short": "contracts/interfaces/amo/helpers/IBalancerPoolHelper.sol", "is_dependency": false, "lines": [1], @@ -56550,7 +54387,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/interfaces/amo/helpers/IRamosTokenVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/amo/helpers/IRamosTokenVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/amo/helpers/IRamosTokenVault.sol", "filename_short": "contracts/interfaces/amo/helpers/IRamosTokenVault.sol", "is_dependency": false, "lines": [1], @@ -56577,7 +54414,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/interfaces/core/ITempleERC20Token.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/core/ITempleERC20Token.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/core/ITempleERC20Token.sol", "filename_short": "contracts/interfaces/core/ITempleERC20Token.sol", "is_dependency": false, "lines": [1], @@ -56604,7 +54441,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/interfaces/external/aura/IAuraBaseRewardPool.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/external/aura/IAuraBaseRewardPool.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/external/aura/IAuraBaseRewardPool.sol", "filename_short": "contracts/interfaces/external/aura/IAuraBaseRewardPool.sol", "is_dependency": false, "lines": [1], @@ -56631,7 +54468,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/interfaces/external/aura/IAuraBooster.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/external/aura/IAuraBooster.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/external/aura/IAuraBooster.sol", "filename_short": "contracts/interfaces/external/aura/IAuraBooster.sol", "is_dependency": false, "lines": [1], @@ -56658,7 +54495,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/interfaces/external/balancer/IBalancerBptToken.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/external/balancer/IBalancerBptToken.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/external/balancer/IBalancerBptToken.sol", "filename_short": "contracts/interfaces/external/balancer/IBalancerBptToken.sol", "is_dependency": false, "lines": [1], @@ -56685,7 +54522,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/interfaces/external/balancer/IBalancerHelpers.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/external/balancer/IBalancerHelpers.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/external/balancer/IBalancerHelpers.sol", "filename_short": "contracts/interfaces/external/balancer/IBalancerHelpers.sol", "is_dependency": false, "lines": [1], @@ -56712,7 +54549,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/interfaces/external/balancer/IBalancerVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/external/balancer/IBalancerVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/external/balancer/IBalancerVault.sol", "filename_short": "contracts/interfaces/external/balancer/IBalancerVault.sol", "is_dependency": false, "lines": [1], @@ -56739,7 +54576,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/interfaces/external/makerDao/IMakerDaoDaiJoinLike.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/external/makerDao/IMakerDaoDaiJoinLike.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/external/makerDao/IMakerDaoDaiJoinLike.sol", "filename_short": "contracts/interfaces/external/makerDao/IMakerDaoDaiJoinLike.sol", "is_dependency": false, "lines": [1], @@ -56766,7 +54603,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/interfaces/external/makerDao/IMakerDaoPotLike.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/external/makerDao/IMakerDaoPotLike.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/external/makerDao/IMakerDaoPotLike.sol", "filename_short": "contracts/interfaces/external/makerDao/IMakerDaoPotLike.sol", "is_dependency": false, "lines": [1], @@ -56793,7 +54630,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/interfaces/external/makerDao/IMakerDaoVatLike.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/external/makerDao/IMakerDaoVatLike.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/external/makerDao/IMakerDaoVatLike.sol", "filename_short": "contracts/interfaces/external/makerDao/IMakerDaoVatLike.sol", "is_dependency": false, "lines": [1], @@ -56811,6 +54648,195 @@ "impact": "Informational", "confidence": "High" }, + { + "elements": [ + { + "type": "pragma", + "name": "0.8.19", + "source_mapping": { + "start": 0, + "length": 23, + "filename_relative": "contracts/interfaces/nexus/IBaseSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/nexus/IBaseSacrifice.sol", + "filename_short": "contracts/interfaces/nexus/IBaseSacrifice.sol", + "is_dependency": false, + "lines": [1], + "starting_column": 1, + "ending_column": 24 + }, + "type_specific_fields": { "directive": ["solidity", "0.8", ".19"] } + } + ], + "description": "Pragma version0.8.19 (contracts/interfaces/nexus/IBaseSacrifice.sol#1) necessitates a version too recent to be trusted. Consider deploying with 0.8.18.\n", + "markdown": "Pragma version[0.8.19](contracts/interfaces/nexus/IBaseSacrifice.sol#L1) necessitates a version too recent to be trusted. Consider deploying with 0.8.18.\n", + "first_markdown_element": "contracts/interfaces/nexus/IBaseSacrifice.sol#L1", + "id": "4ebd55a5542ba7bc681f1891433100c14419c9021a500894cf9e0f120872e6da", + "check": "solc-version", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "pragma", + "name": "0.8.19", + "source_mapping": { + "start": 84, + "length": 23, + "filename_relative": "contracts/interfaces/nexus/IERC721A.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/nexus/IERC721A.sol", + "filename_short": "contracts/interfaces/nexus/IERC721A.sol", + "is_dependency": false, + "lines": [5], + "starting_column": 1, + "ending_column": 24 + }, + "type_specific_fields": { "directive": ["solidity", "0.8", ".19"] } + } + ], + "description": "Pragma version0.8.19 (contracts/interfaces/nexus/IERC721A.sol#5) necessitates a version too recent to be trusted. Consider deploying with 0.8.18.\n", + "markdown": "Pragma version[0.8.19](contracts/interfaces/nexus/IERC721A.sol#L5) necessitates a version too recent to be trusted. Consider deploying with 0.8.18.\n", + "first_markdown_element": "contracts/interfaces/nexus/IERC721A.sol#L5", + "id": "1d4f801b731184be5359ff8f2fef5652aa41960db4eba42a8acfa2adfcd91d6e", + "check": "solc-version", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "pragma", + "name": "0.8.19", + "source_mapping": { + "start": 0, + "length": 23, + "filename_relative": "contracts/interfaces/nexus/INexusCommon.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/nexus/INexusCommon.sol", + "filename_short": "contracts/interfaces/nexus/INexusCommon.sol", + "is_dependency": false, + "lines": [1], + "starting_column": 1, + "ending_column": 24 + }, + "type_specific_fields": { "directive": ["solidity", "0.8", ".19"] } + } + ], + "description": "Pragma version0.8.19 (contracts/interfaces/nexus/INexusCommon.sol#1) necessitates a version too recent to be trusted. Consider deploying with 0.8.18.\n", + "markdown": "Pragma version[0.8.19](contracts/interfaces/nexus/INexusCommon.sol#L1) necessitates a version too recent to be trusted. Consider deploying with 0.8.18.\n", + "first_markdown_element": "contracts/interfaces/nexus/INexusCommon.sol#L1", + "id": "1aa0a6a81d37531ced0b46e0309a1e30359b8af79ffca98ff56cdc7b71b0bfdc", + "check": "solc-version", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "pragma", + "name": "0.8.19", + "source_mapping": { + "start": 0, + "length": 23, + "filename_relative": "contracts/interfaces/nexus/IRelic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/nexus/IRelic.sol", + "filename_short": "contracts/interfaces/nexus/IRelic.sol", + "is_dependency": false, + "lines": [1], + "starting_column": 1, + "ending_column": 24 + }, + "type_specific_fields": { "directive": ["solidity", "0.8", ".19"] } + } + ], + "description": "Pragma version0.8.19 (contracts/interfaces/nexus/IRelic.sol#1) necessitates a version too recent to be trusted. Consider deploying with 0.8.18.\n", + "markdown": "Pragma version[0.8.19](contracts/interfaces/nexus/IRelic.sol#L1) necessitates a version too recent to be trusted. Consider deploying with 0.8.18.\n", + "first_markdown_element": "contracts/interfaces/nexus/IRelic.sol#L1", + "id": "2afd816d05aa3c601d32491f231893ddc27db83c564f6c0cbfdcfe4a511e3ad4", + "check": "solc-version", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "pragma", + "name": "0.8.19", + "source_mapping": { + "start": 0, + "length": 23, + "filename_relative": "contracts/interfaces/nexus/IShard.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/nexus/IShard.sol", + "filename_short": "contracts/interfaces/nexus/IShard.sol", + "is_dependency": false, + "lines": [1], + "starting_column": 1, + "ending_column": 24 + }, + "type_specific_fields": { "directive": ["solidity", "0.8", ".19"] } + } + ], + "description": "Pragma version0.8.19 (contracts/interfaces/nexus/IShard.sol#1) necessitates a version too recent to be trusted. Consider deploying with 0.8.18.\n", + "markdown": "Pragma version[0.8.19](contracts/interfaces/nexus/IShard.sol#L1) necessitates a version too recent to be trusted. Consider deploying with 0.8.18.\n", + "first_markdown_element": "contracts/interfaces/nexus/IShard.sol#L1", + "id": "b998d1ce1f72a86858b3b7af728a7ee642a45b87d468c2ae5fd484ca907a506a", + "check": "solc-version", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "pragma", + "name": "0.8.19", + "source_mapping": { + "start": 0, + "length": 23, + "filename_relative": "contracts/interfaces/nexus/ITempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/nexus/ITempleSacrifice.sol", + "filename_short": "contracts/interfaces/nexus/ITempleSacrifice.sol", + "is_dependency": false, + "lines": [1], + "starting_column": 1, + "ending_column": 24 + }, + "type_specific_fields": { "directive": ["solidity", "0.8", ".19"] } + } + ], + "description": "Pragma version0.8.19 (contracts/interfaces/nexus/ITempleSacrifice.sol#1) necessitates a version too recent to be trusted. Consider deploying with 0.8.18.\n", + "markdown": "Pragma version[0.8.19](contracts/interfaces/nexus/ITempleSacrifice.sol#L1) necessitates a version too recent to be trusted. Consider deploying with 0.8.18.\n", + "first_markdown_element": "contracts/interfaces/nexus/ITempleSacrifice.sol#L1", + "id": "ebaf290cff6c1186220ca8b74a2a5a22b8fda7b3041629f10b201197a8359a3d", + "check": "solc-version", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "pragma", + "name": "0.8.19", + "source_mapping": { + "start": 0, + "length": 23, + "filename_relative": "contracts/interfaces/nexus/access/IElevatedAccess.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/nexus/access/IElevatedAccess.sol", + "filename_short": "contracts/interfaces/nexus/access/IElevatedAccess.sol", + "is_dependency": false, + "lines": [1], + "starting_column": 1, + "ending_column": 24 + }, + "type_specific_fields": { "directive": ["solidity", "0.8", ".19"] } + } + ], + "description": "Pragma version0.8.19 (contracts/interfaces/nexus/access/IElevatedAccess.sol#1) necessitates a version too recent to be trusted. Consider deploying with 0.8.18.\n", + "markdown": "Pragma version[0.8.19](contracts/interfaces/nexus/access/IElevatedAccess.sol#L1) necessitates a version too recent to be trusted. Consider deploying with 0.8.18.\n", + "first_markdown_element": "contracts/interfaces/nexus/access/IElevatedAccess.sol#L1", + "id": "8fef10ce5c0d0656d41e31808b049fb206213771da168f8b9b13606a18d614fb", + "check": "solc-version", + "impact": "Informational", + "confidence": "High" + }, { "elements": [ { @@ -56820,7 +54846,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/interfaces/v2/ITempleDebtToken.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/v2/ITempleDebtToken.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/v2/ITempleDebtToken.sol", "filename_short": "contracts/interfaces/v2/ITempleDebtToken.sol", "is_dependency": false, "lines": [1], @@ -56847,7 +54873,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/interfaces/v2/ITreasuryPriceIndexOracle.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/v2/ITreasuryPriceIndexOracle.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/v2/ITreasuryPriceIndexOracle.sol", "filename_short": "contracts/interfaces/v2/ITreasuryPriceIndexOracle.sol", "is_dependency": false, "lines": [1], @@ -56874,7 +54900,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/interfaces/v2/ITreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/v2/ITreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/v2/ITreasuryReservesVault.sol", "filename_short": "contracts/interfaces/v2/ITreasuryReservesVault.sol", "is_dependency": false, "lines": [1], @@ -56901,7 +54927,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/interfaces/v2/access/ITempleElevatedAccess.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/v2/access/ITempleElevatedAccess.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/v2/access/ITempleElevatedAccess.sol", "filename_short": "contracts/interfaces/v2/access/ITempleElevatedAccess.sol", "is_dependency": false, "lines": [1], @@ -56928,7 +54954,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/interfaces/v2/circuitBreaker/ITempleCircuitBreaker.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/v2/circuitBreaker/ITempleCircuitBreaker.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/v2/circuitBreaker/ITempleCircuitBreaker.sol", "filename_short": "contracts/interfaces/v2/circuitBreaker/ITempleCircuitBreaker.sol", "is_dependency": false, "lines": [1], @@ -56955,7 +54981,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/interfaces/v2/circuitBreaker/ITempleCircuitBreakerProxy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/v2/circuitBreaker/ITempleCircuitBreakerProxy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/v2/circuitBreaker/ITempleCircuitBreakerProxy.sol", "filename_short": "contracts/interfaces/v2/circuitBreaker/ITempleCircuitBreakerProxy.sol", "is_dependency": false, "lines": [1], @@ -56982,7 +55008,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/interfaces/v2/interestRate/IInterestRateModel.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/v2/interestRate/IInterestRateModel.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/v2/interestRate/IInterestRateModel.sol", "filename_short": "contracts/interfaces/v2/interestRate/IInterestRateModel.sol", "is_dependency": false, "lines": [1], @@ -57009,7 +55035,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/interfaces/v2/safeGuards/IThresholdSafeGuard.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/v2/safeGuards/IThresholdSafeGuard.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/v2/safeGuards/IThresholdSafeGuard.sol", "filename_short": "contracts/interfaces/v2/safeGuards/IThresholdSafeGuard.sol", "is_dependency": false, "lines": [1], @@ -57036,7 +55062,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/interfaces/v2/strategies/ITempleBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/v2/strategies/ITempleBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/v2/strategies/ITempleBaseStrategy.sol", "filename_short": "contracts/interfaces/v2/strategies/ITempleBaseStrategy.sol", "is_dependency": false, "lines": [1], @@ -57063,7 +55089,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/interfaces/v2/strategies/ITempleStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/v2/strategies/ITempleStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/v2/strategies/ITempleStrategy.sol", "filename_short": "contracts/interfaces/v2/strategies/ITempleStrategy.sol", "is_dependency": false, "lines": [1], @@ -57090,7 +55116,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/interfaces/v2/strategies/ITlcStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/v2/strategies/ITlcStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/v2/strategies/ITlcStrategy.sol", "filename_short": "contracts/interfaces/v2/strategies/ITlcStrategy.sol", "is_dependency": false, "lines": [1], @@ -57117,7 +55143,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/interfaces/v2/templeLineOfCredit/ITempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/v2/templeLineOfCredit/ITempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/v2/templeLineOfCredit/ITempleLineOfCredit.sol", "filename_short": "contracts/interfaces/v2/templeLineOfCredit/ITempleLineOfCredit.sol", "is_dependency": false, "lines": [1], @@ -57144,7 +55170,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/interfaces/v2/templeLineOfCredit/ITlcDataTypes.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/v2/templeLineOfCredit/ITlcDataTypes.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/v2/templeLineOfCredit/ITlcDataTypes.sol", "filename_short": "contracts/interfaces/v2/templeLineOfCredit/ITlcDataTypes.sol", "is_dependency": false, "lines": [1], @@ -57171,7 +55197,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/interfaces/v2/templeLineOfCredit/ITlcEventsAndErrors.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/v2/templeLineOfCredit/ITlcEventsAndErrors.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/v2/templeLineOfCredit/ITlcEventsAndErrors.sol", "filename_short": "contracts/interfaces/v2/templeLineOfCredit/ITlcEventsAndErrors.sol", "is_dependency": false, "lines": [1], @@ -57189,6 +55215,222 @@ "impact": "Informational", "confidence": "High" }, + { + "elements": [ + { + "type": "pragma", + "name": "0.8.19", + "source_mapping": { + "start": 0, + "length": 23, + "filename_relative": "contracts/nexus/BaseSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/BaseSacrifice.sol", + "filename_short": "contracts/nexus/BaseSacrifice.sol", + "is_dependency": false, + "lines": [1], + "starting_column": 1, + "ending_column": 24 + }, + "type_specific_fields": { "directive": ["solidity", "0.8", ".19"] } + } + ], + "description": "Pragma version0.8.19 (contracts/nexus/BaseSacrifice.sol#1) necessitates a version too recent to be trusted. Consider deploying with 0.8.18.\n", + "markdown": "Pragma version[0.8.19](contracts/nexus/BaseSacrifice.sol#L1) necessitates a version too recent to be trusted. Consider deploying with 0.8.18.\n", + "first_markdown_element": "contracts/nexus/BaseSacrifice.sol#L1", + "id": "c3889b29b2a590ed0f43a2bb89ae8b0b6ee887a71e2fdee0ccbc201fdc4d1d1e", + "check": "solc-version", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "pragma", + "name": "0.8.19", + "source_mapping": { + "start": 84, + "length": 23, + "filename_relative": "contracts/nexus/ERC721ACustom.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/ERC721ACustom.sol", + "filename_short": "contracts/nexus/ERC721ACustom.sol", + "is_dependency": false, + "lines": [5], + "starting_column": 1, + "ending_column": 24 + }, + "type_specific_fields": { "directive": ["solidity", "0.8", ".19"] } + } + ], + "description": "Pragma version0.8.19 (contracts/nexus/ERC721ACustom.sol#5) necessitates a version too recent to be trusted. Consider deploying with 0.8.18.\n", + "markdown": "Pragma version[0.8.19](contracts/nexus/ERC721ACustom.sol#L5) necessitates a version too recent to be trusted. Consider deploying with 0.8.18.\n", + "first_markdown_element": "contracts/nexus/ERC721ACustom.sol#L5", + "id": "2cc11ab0f2a02487b16f92c6c855b51ec6a9c309da6d8932a7b095c914560557", + "check": "solc-version", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "pragma", + "name": "0.8.19", + "source_mapping": { + "start": 0, + "length": 23, + "filename_relative": "contracts/nexus/NexusCommon.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/NexusCommon.sol", + "filename_short": "contracts/nexus/NexusCommon.sol", + "is_dependency": false, + "lines": [1], + "starting_column": 1, + "ending_column": 24 + }, + "type_specific_fields": { "directive": ["solidity", "0.8", ".19"] } + } + ], + "description": "Pragma version0.8.19 (contracts/nexus/NexusCommon.sol#1) necessitates a version too recent to be trusted. Consider deploying with 0.8.18.\n", + "markdown": "Pragma version[0.8.19](contracts/nexus/NexusCommon.sol#L1) necessitates a version too recent to be trusted. Consider deploying with 0.8.18.\n", + "first_markdown_element": "contracts/nexus/NexusCommon.sol#L1", + "id": "a2b6ea4df5ea7bca6fdba1a1e2f718fc2c1f1a9c22b2d99398f71d299b74cf45", + "check": "solc-version", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "pragma", + "name": "0.8.19", + "source_mapping": { + "start": 0, + "length": 23, + "filename_relative": "contracts/nexus/PartnerZeroSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/PartnerZeroSacrifice.sol", + "filename_short": "contracts/nexus/PartnerZeroSacrifice.sol", + "is_dependency": false, + "lines": [1], + "starting_column": 1, + "ending_column": 24 + }, + "type_specific_fields": { "directive": ["solidity", "0.8", ".19"] } + } + ], + "description": "Pragma version0.8.19 (contracts/nexus/PartnerZeroSacrifice.sol#1) necessitates a version too recent to be trusted. Consider deploying with 0.8.18.\n", + "markdown": "Pragma version[0.8.19](contracts/nexus/PartnerZeroSacrifice.sol#L1) necessitates a version too recent to be trusted. Consider deploying with 0.8.18.\n", + "first_markdown_element": "contracts/nexus/PartnerZeroSacrifice.sol#L1", + "id": "e296f27660efd4ac24f844268f8973fd9908dfff3088c46d7ea0d0d41a5e0828", + "check": "solc-version", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "pragma", + "name": "0.8.19", + "source_mapping": { + "start": 0, + "length": 23, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", + "is_dependency": false, + "lines": [1], + "starting_column": 1, + "ending_column": 24 + }, + "type_specific_fields": { "directive": ["solidity", "0.8", ".19"] } + } + ], + "description": "Pragma version0.8.19 (contracts/nexus/Relic.sol#1) necessitates a version too recent to be trusted. Consider deploying with 0.8.18.\n", + "markdown": "Pragma version[0.8.19](contracts/nexus/Relic.sol#L1) necessitates a version too recent to be trusted. Consider deploying with 0.8.18.\n", + "first_markdown_element": "contracts/nexus/Relic.sol#L1", + "id": "a22c0d7dac01e7ad6da1111e384da7c4f0363149a95bb0c59c83ae9b281557df", + "check": "solc-version", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "pragma", + "name": "0.8.19", + "source_mapping": { + "start": 0, + "length": 23, + "filename_relative": "contracts/nexus/Shard.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Shard.sol", + "filename_short": "contracts/nexus/Shard.sol", + "is_dependency": false, + "lines": [1], + "starting_column": 1, + "ending_column": 24 + }, + "type_specific_fields": { "directive": ["solidity", "0.8", ".19"] } + } + ], + "description": "Pragma version0.8.19 (contracts/nexus/Shard.sol#1) necessitates a version too recent to be trusted. Consider deploying with 0.8.18.\n", + "markdown": "Pragma version[0.8.19](contracts/nexus/Shard.sol#L1) necessitates a version too recent to be trusted. Consider deploying with 0.8.18.\n", + "first_markdown_element": "contracts/nexus/Shard.sol#L1", + "id": "e7feaa9f533afb3758c44102df8a8685c0fbacdbd8ba3111d579f18a16cfd624", + "check": "solc-version", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "pragma", + "name": "0.8.19", + "source_mapping": { + "start": 0, + "length": 23, + "filename_relative": "contracts/nexus/TempleSacrifice.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/TempleSacrifice.sol", + "filename_short": "contracts/nexus/TempleSacrifice.sol", + "is_dependency": false, + "lines": [1], + "starting_column": 1, + "ending_column": 24 + }, + "type_specific_fields": { "directive": ["solidity", "0.8", ".19"] } + } + ], + "description": "Pragma version0.8.19 (contracts/nexus/TempleSacrifice.sol#1) necessitates a version too recent to be trusted. Consider deploying with 0.8.18.\n", + "markdown": "Pragma version[0.8.19](contracts/nexus/TempleSacrifice.sol#L1) necessitates a version too recent to be trusted. Consider deploying with 0.8.18.\n", + "first_markdown_element": "contracts/nexus/TempleSacrifice.sol#L1", + "id": "2ea25730dd507276d57601b536b653da22a39532b84f22d0fab4260a78e034a4", + "check": "solc-version", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "pragma", + "name": "0.8.19", + "source_mapping": { + "start": 0, + "length": 23, + "filename_relative": "contracts/nexus/access/ElevatedAccess.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/access/ElevatedAccess.sol", + "filename_short": "contracts/nexus/access/ElevatedAccess.sol", + "is_dependency": false, + "lines": [1], + "starting_column": 1, + "ending_column": 24 + }, + "type_specific_fields": { "directive": ["solidity", "0.8", ".19"] } + } + ], + "description": "Pragma version0.8.19 (contracts/nexus/access/ElevatedAccess.sol#1) necessitates a version too recent to be trusted. Consider deploying with 0.8.18.\n", + "markdown": "Pragma version[0.8.19](contracts/nexus/access/ElevatedAccess.sol#L1) necessitates a version too recent to be trusted. Consider deploying with 0.8.18.\n", + "first_markdown_element": "contracts/nexus/access/ElevatedAccess.sol#L1", + "id": "07c24f17dfa1260f1fe9e34d64f9c6fc2edea7b56aee66db5e24c2e44cd5b52d", + "check": "solc-version", + "impact": "Informational", + "confidence": "High" + }, { "elements": [ { @@ -57198,7 +55440,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/v2/TempleDebtToken.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TempleDebtToken.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TempleDebtToken.sol", "filename_short": "contracts/v2/TempleDebtToken.sol", "is_dependency": false, "lines": [1], @@ -57225,7 +55467,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/v2/TreasuryPriceIndexOracle.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryPriceIndexOracle.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryPriceIndexOracle.sol", "filename_short": "contracts/v2/TreasuryPriceIndexOracle.sol", "is_dependency": false, "lines": [1], @@ -57252,7 +55494,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, "lines": [1], @@ -57279,7 +55521,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/v2/access/TempleElevatedAccess.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/access/TempleElevatedAccess.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/access/TempleElevatedAccess.sol", "filename_short": "contracts/v2/access/TempleElevatedAccess.sol", "is_dependency": false, "lines": [1], @@ -57306,7 +55548,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerAllUsersPerPeriod.sol", "is_dependency": false, "lines": [1], @@ -57333,7 +55575,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol", "filename_short": "contracts/v2/circuitBreaker/TempleCircuitBreakerProxy.sol", "is_dependency": false, "lines": [1], @@ -57360,7 +55602,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/v2/interestRate/BaseInterestRateModel.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/interestRate/BaseInterestRateModel.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/interestRate/BaseInterestRateModel.sol", "filename_short": "contracts/v2/interestRate/BaseInterestRateModel.sol", "is_dependency": false, "lines": [1], @@ -57387,7 +55629,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/v2/interestRate/CompoundedInterest.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/interestRate/CompoundedInterest.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/interestRate/CompoundedInterest.sol", "filename_short": "contracts/v2/interestRate/CompoundedInterest.sol", "is_dependency": false, "lines": [1], @@ -57414,7 +55656,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/v2/interestRate/LinearWithKinkInterestRateModel.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/interestRate/LinearWithKinkInterestRateModel.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/interestRate/LinearWithKinkInterestRateModel.sol", "filename_short": "contracts/v2/interestRate/LinearWithKinkInterestRateModel.sol", "is_dependency": false, "lines": [1], @@ -57441,7 +55683,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/v2/safeGuards/SafeForked.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/safeGuards/SafeForked.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/safeGuards/SafeForked.sol", "filename_short": "contracts/v2/safeGuards/SafeForked.sol", "is_dependency": false, "lines": [1], @@ -57468,7 +55710,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/v2/safeGuards/ThresholdSafeGuard.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/safeGuards/ThresholdSafeGuard.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/safeGuards/ThresholdSafeGuard.sol", "filename_short": "contracts/v2/safeGuards/ThresholdSafeGuard.sol", "is_dependency": false, "lines": [1], @@ -57495,7 +55737,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/v2/strategies/AbstractStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/AbstractStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/AbstractStrategy.sol", "filename_short": "contracts/v2/strategies/AbstractStrategy.sol", "is_dependency": false, "lines": [1], @@ -57522,7 +55764,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/v2/strategies/DsrBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/DsrBaseStrategy.sol", "filename_short": "contracts/v2/strategies/DsrBaseStrategy.sol", "is_dependency": false, "lines": [1], @@ -57549,7 +55791,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/v2/strategies/GnosisStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/GnosisStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/GnosisStrategy.sol", "filename_short": "contracts/v2/strategies/GnosisStrategy.sol", "is_dependency": false, "lines": [1], @@ -57576,7 +55818,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/v2/strategies/RamosStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/RamosStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/RamosStrategy.sol", "filename_short": "contracts/v2/strategies/RamosStrategy.sol", "is_dependency": false, "lines": [1], @@ -57603,7 +55845,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/v2/strategies/TempleTokenBaseStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/TempleTokenBaseStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/TempleTokenBaseStrategy.sol", "filename_short": "contracts/v2/strategies/TempleTokenBaseStrategy.sol", "is_dependency": false, "lines": [1], @@ -57630,7 +55872,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/v2/strategies/TlcStrategy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/strategies/TlcStrategy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/strategies/TlcStrategy.sol", "filename_short": "contracts/v2/strategies/TlcStrategy.sol", "is_dependency": false, "lines": [1], @@ -57657,7 +55899,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "filename_short": "contracts/v2/templeLineOfCredit/TempleLineOfCredit.sol", "is_dependency": false, "lines": [1], @@ -57694,7 +55936,7 @@ "start": 45, "length": 23, "filename_relative": "contracts/admin/TempleTeamPayments.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/admin/TempleTeamPayments.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPayments.sol", "filename_short": "contracts/admin/TempleTeamPayments.sol", "is_dependency": false, "lines": [2], @@ -57712,6 +55954,60 @@ "impact": "Informational", "confidence": "High" }, + { + "elements": [ + { + "type": "pragma", + "name": "^0.8.4", + "source_mapping": { + "start": 46, + "length": 23, + "filename_relative": "contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsFactory.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsFactory.sol", + "is_dependency": false, + "lines": [2], + "starting_column": 1, + "ending_column": 24 + }, + "type_specific_fields": { "directive": ["solidity", "^", "0.8", ".4"] } + } + ], + "description": "Pragma version^0.8.4 (contracts/admin/TempleTeamPaymentsFactory.sol#2) allows old versions\n", + "markdown": "Pragma version[^0.8.4](contracts/admin/TempleTeamPaymentsFactory.sol#L2) allows old versions\n", + "first_markdown_element": "contracts/admin/TempleTeamPaymentsFactory.sol#L2", + "id": "8738b24a90c6b95c0974988e97b56e053beaa173ac6f6652f0bb8445da6c9fb0", + "check": "solc-version", + "impact": "Informational", + "confidence": "High" + }, + { + "elements": [ + { + "type": "pragma", + "name": "^0.8.4", + "source_mapping": { + "start": 45, + "length": 23, + "filename_relative": "contracts/admin/TempleTeamPaymentsV2.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/admin/TempleTeamPaymentsV2.sol", + "filename_short": "contracts/admin/TempleTeamPaymentsV2.sol", + "is_dependency": false, + "lines": [2], + "starting_column": 1, + "ending_column": 24 + }, + "type_specific_fields": { "directive": ["solidity", "^", "0.8", ".4"] } + } + ], + "description": "Pragma version^0.8.4 (contracts/admin/TempleTeamPaymentsV2.sol#2) allows old versions\n", + "markdown": "Pragma version[^0.8.4](contracts/admin/TempleTeamPaymentsV2.sol#L2) allows old versions\n", + "first_markdown_element": "contracts/admin/TempleTeamPaymentsV2.sol#L2", + "id": "68d37bf3d8ba335ec55c660823ae20e421300c1dca3fe0d9a25352189eaa5ab3", + "check": "solc-version", + "impact": "Informational", + "confidence": "High" + }, { "elements": [ { @@ -57721,7 +56017,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, "lines": [1], @@ -57748,7 +56044,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/amm/TreasuryIV.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TreasuryIV.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TreasuryIV.sol", "filename_short": "contracts/amm/TreasuryIV.sol", "is_dependency": false, "lines": [1], @@ -57775,7 +56071,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/core/Exposure.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Exposure.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Exposure.sol", "filename_short": "contracts/core/Exposure.sol", "is_dependency": false, "lines": [1], @@ -57802,7 +56098,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/core/JoiningFee.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/JoiningFee.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/JoiningFee.sol", "filename_short": "contracts/core/JoiningFee.sol", "is_dependency": false, "lines": [1], @@ -57829,7 +56125,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, "lines": [1], @@ -57856,7 +56152,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/core/OpsManagerLib.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManagerLib.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManagerLib.sol", "filename_short": "contracts/core/OpsManagerLib.sol", "is_dependency": false, "lines": [1], @@ -57883,7 +56179,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/core/Rational.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Rational.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Rational.sol", "filename_short": "contracts/core/Rational.sol", "is_dependency": false, "lines": [1], @@ -57910,7 +56206,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/core/RebasingERC20.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/RebasingERC20.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/RebasingERC20.sol", "filename_short": "contracts/core/RebasingERC20.sol", "is_dependency": false, "lines": [1], @@ -57928,6 +56224,33 @@ "impact": "Informational", "confidence": "High" }, + { + "elements": [ + { + "type": "pragma", + "name": "^0.8.4", + "source_mapping": { + "start": 0, + "length": 23, + "filename_relative": "contracts/core/TempleERC20Token.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TempleERC20Token.sol", + "filename_short": "contracts/core/TempleERC20Token.sol", + "is_dependency": false, + "lines": [1], + "starting_column": 1, + "ending_column": 24 + }, + "type_specific_fields": { "directive": ["solidity", "^", "0.8", ".4"] } + } + ], + "description": "Pragma version^0.8.4 (contracts/core/TempleERC20Token.sol#1) allows old versions\n", + "markdown": "Pragma version[^0.8.4](contracts/core/TempleERC20Token.sol#L1) allows old versions\n", + "first_markdown_element": "contracts/core/TempleERC20Token.sol#L1", + "id": "6c18ec5d6b9335415d21a601676b09c02352342bfa6559fb0ce873354fb81687", + "check": "solc-version", + "impact": "Informational", + "confidence": "High" + }, { "elements": [ { @@ -57937,7 +56260,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/core/TreasuryFarmingRevenue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TreasuryFarmingRevenue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/TreasuryFarmingRevenue.sol", "filename_short": "contracts/core/TreasuryFarmingRevenue.sol", "is_dependency": false, "lines": [1], @@ -57964,7 +56287,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/core/Vault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Vault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Vault.sol", "filename_short": "contracts/core/Vault.sol", "is_dependency": false, "lines": [1], @@ -57991,7 +56314,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/core/VaultEarlyWithdraw.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultEarlyWithdraw.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultEarlyWithdraw.sol", "filename_short": "contracts/core/VaultEarlyWithdraw.sol", "is_dependency": false, "lines": [1], @@ -58018,7 +56341,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/core/VaultProxy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultProxy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultProxy.sol", "filename_short": "contracts/core/VaultProxy.sol", "is_dependency": false, "lines": [1], @@ -58045,7 +56368,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/core/VaultedTemple.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultedTemple.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultedTemple.sol", "filename_short": "contracts/core/VaultedTemple.sol", "is_dependency": false, "lines": [1], @@ -58072,7 +56395,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/deprecated/Faith.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/Faith.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/Faith.sol", "filename_short": "contracts/deprecated/Faith.sol", "is_dependency": false, "lines": [1], @@ -58099,7 +56422,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/deprecated/IExitQueue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/IExitQueue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/IExitQueue.sol", "filename_short": "contracts/deprecated/IExitQueue.sol", "is_dependency": false, "lines": [1], @@ -58126,7 +56449,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/deprecated/InstantExitQueue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/InstantExitQueue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/InstantExitQueue.sol", "filename_short": "contracts/deprecated/InstantExitQueue.sol", "is_dependency": false, "lines": [1], @@ -58153,7 +56476,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/deprecated/LockedOGTemple.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/LockedOGTemple.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/LockedOGTemple.sol", "filename_short": "contracts/deprecated/LockedOGTemple.sol", "is_dependency": false, "lines": [1], @@ -58180,7 +56503,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/deprecated/OGTemple.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/OGTemple.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/OGTemple.sol", "filename_short": "contracts/deprecated/OGTemple.sol", "is_dependency": false, "lines": [1], @@ -58207,7 +56530,7 @@ "start": 0, "length": 23, "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, "lines": [1], @@ -58234,7 +56557,7 @@ "start": 45, "length": 23, "filename_relative": "contracts/governance/ElderElection.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/governance/ElderElection.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/governance/ElderElection.sol", "filename_short": "contracts/governance/ElderElection.sol", "is_dependency": false, "lines": [2], @@ -58261,7 +56584,7 @@ "start": 45, "length": 23, "filename_relative": "contracts/governance/Templar.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/governance/Templar.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/governance/Templar.sol", "filename_short": "contracts/governance/Templar.sol", "is_dependency": false, "lines": [2], @@ -58288,7 +56611,7 @@ "start": 45, "length": 23, "filename_relative": "contracts/governance/TemplarMetadata.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/governance/TemplarMetadata.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/governance/TemplarMetadata.sol", "filename_short": "contracts/governance/TemplarMetadata.sol", "is_dependency": false, "lines": [2], @@ -58308,10 +56631,10 @@ }, { "elements": [], - "description": "solc-0.8.20 is not recommended for deployment\n", - "markdown": "solc-0.8.20 is not recommended for deployment\n", + "description": "solc-0.8.23 is not recommended for deployment\n", + "markdown": "solc-0.8.23 is not recommended for deployment\n", "first_markdown_element": "", - "id": "5994d07edbbb82fc2013b486f41a2fa69898d896bb171a7f7c8bd767eb5b6521", + "id": "d1abc390827f6842cbf42af670e86a70a0c613729513300116af8a7832b7043c", "check": "solc-version", "impact": "Informational", "confidence": "High" @@ -58325,7 +56648,7 @@ "start": 1892, "length": 284, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [49, 50, 51, 52], @@ -58340,7 +56663,7 @@ "start": 440, "length": 8733, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ @@ -58372,7 +56695,7 @@ "start": 1972, "length": 91, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [50], @@ -58387,7 +56710,7 @@ "start": 1892, "length": 284, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [49, 50, 51, 52], @@ -58402,7 +56725,7 @@ "start": 440, "length": 8733, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ @@ -58448,7 +56771,7 @@ "start": 8542, "length": 336, "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, "lines": [226, 227, 228, 229, 230, 231, 232, 233, 234], @@ -58463,7 +56786,7 @@ "start": 640, "length": 8240, "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, "lines": [ @@ -58498,7 +56821,7 @@ "start": 8711, "length": 50, "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, "lines": [229], @@ -58513,7 +56836,7 @@ "start": 8542, "length": 336, "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, "lines": [226, 227, 228, 229, 230, 231, 232, 233, 234], @@ -58528,7 +56851,7 @@ "start": 640, "length": 8240, "filename_relative": "contracts/amm/TempleStableAMMRouter.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleStableAMMRouter.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleStableAMMRouter.sol", "filename_short": "contracts/amm/TempleStableAMMRouter.sol", "is_dependency": false, "lines": [ @@ -58577,7 +56900,7 @@ "start": 5260, "length": 373, "filename_relative": "contracts/core/VaultProxy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultProxy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultProxy.sol", "filename_short": "contracts/core/VaultProxy.sol", "is_dependency": false, "lines": [125, 126, 127, 128, 129, 130, 131, 132, 133, 134], @@ -58592,7 +56915,7 @@ "start": 456, "length": 5179, "filename_relative": "contracts/core/VaultProxy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultProxy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultProxy.sol", "filename_short": "contracts/core/VaultProxy.sol", "is_dependency": false, "lines": [ @@ -58620,7 +56943,7 @@ "start": 5444, "length": 50, "filename_relative": "contracts/core/VaultProxy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultProxy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultProxy.sol", "filename_short": "contracts/core/VaultProxy.sol", "is_dependency": false, "lines": [129], @@ -58635,7 +56958,7 @@ "start": 5260, "length": 373, "filename_relative": "contracts/core/VaultProxy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultProxy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultProxy.sol", "filename_short": "contracts/core/VaultProxy.sol", "is_dependency": false, "lines": [125, 126, 127, 128, 129, 130, 131, 132, 133, 134], @@ -58650,7 +56973,7 @@ "start": 456, "length": 5179, "filename_relative": "contracts/core/VaultProxy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultProxy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultProxy.sol", "filename_short": "contracts/core/VaultProxy.sol", "is_dependency": false, "lines": [ @@ -58691,7 +57014,7 @@ "start": 1837, "length": 373, "filename_relative": "contracts/core/VaultedTemple.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultedTemple.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultedTemple.sol", "filename_short": "contracts/core/VaultedTemple.sol", "is_dependency": false, "lines": [52, 53, 54, 55, 56, 57, 58, 59, 60, 61], @@ -58706,7 +57029,7 @@ "start": 1207, "length": 1005, "filename_relative": "contracts/core/VaultedTemple.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultedTemple.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultedTemple.sol", "filename_short": "contracts/core/VaultedTemple.sol", "is_dependency": false, "lines": [ @@ -58727,7 +57050,7 @@ "start": 2021, "length": 50, "filename_relative": "contracts/core/VaultedTemple.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultedTemple.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultedTemple.sol", "filename_short": "contracts/core/VaultedTemple.sol", "is_dependency": false, "lines": [56], @@ -58742,7 +57065,7 @@ "start": 1837, "length": 373, "filename_relative": "contracts/core/VaultedTemple.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultedTemple.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultedTemple.sol", "filename_short": "contracts/core/VaultedTemple.sol", "is_dependency": false, "lines": [52, 53, 54, 55, 56, 57, 58, 59, 60, 61], @@ -58757,7 +57080,7 @@ "start": 1207, "length": 1005, "filename_relative": "contracts/core/VaultedTemple.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultedTemple.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultedTemple.sol", "filename_short": "contracts/core/VaultedTemple.sol", "is_dependency": false, "lines": [ @@ -58782,53 +57105,6 @@ "impact": "Informational", "confidence": "High" }, - { - "elements": [ - { - "type": "contract", - "name": "TempleERC20Token", - "source_mapping": { - "start": 428, - "length": 614, - "filename_relative": "contracts/core/TempleERC20Token.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/TempleERC20Token.sol", - "filename_short": "contracts/core/TempleERC20Token.sol", - "is_dependency": false, - "lines": [ - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31 - ], - "starting_column": 1, - "ending_column": 0 - } - }, - { - "type": "contract", - "name": "ITempleERC20Token", - "source_mapping": { - "start": 195, - "length": 611, - "filename_relative": "contracts/interfaces/core/ITempleERC20Token.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/core/ITempleERC20Token.sol", - "filename_short": "contracts/interfaces/core/ITempleERC20Token.sol", - "is_dependency": false, - "lines": [ - 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30 - ], - "starting_column": 1, - "ending_column": 0 - } - } - ], - "description": "TempleERC20Token (contracts/core/TempleERC20Token.sol#11-31) should inherit from ITempleERC20Token (contracts/interfaces/core/ITempleERC20Token.sol#7-30)\n", - "markdown": "[TempleERC20Token](contracts/core/TempleERC20Token.sol#L11-L31) should inherit from [ITempleERC20Token](contracts/interfaces/core/ITempleERC20Token.sol#L7-L30)\n", - "first_markdown_element": "contracts/core/TempleERC20Token.sol#L11-L31", - "id": "1012fc2683a6f016ab688afd7c9d40e0a123132cb6ea9676b420d4c39ed23cd9", - "check": "missing-inheritance", - "impact": "Informational", - "confidence": "High" - }, { "elements": [ { @@ -58838,7 +57114,7 @@ "start": 939, "length": 7, "filename_relative": "contracts/deprecated/InstantExitQueue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/InstantExitQueue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/InstantExitQueue.sol", "filename_short": "contracts/deprecated/InstantExitQueue.sol", "is_dependency": false, "lines": [28], @@ -58853,7 +57129,7 @@ "start": 769, "length": 278, "filename_relative": "contracts/deprecated/InstantExitQueue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/InstantExitQueue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/InstantExitQueue.sol", "filename_short": "contracts/deprecated/InstantExitQueue.sol", "is_dependency": false, "lines": [25, 26, 27, 28, 29, 30, 31], @@ -58868,7 +57144,7 @@ "start": 428, "length": 621, "filename_relative": "contracts/deprecated/InstantExitQueue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/InstantExitQueue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/InstantExitQueue.sol", "filename_short": "contracts/deprecated/InstantExitQueue.sol", "is_dependency": false, "lines": [ @@ -58891,7 +57167,7 @@ "start": 428, "length": 621, "filename_relative": "contracts/deprecated/InstantExitQueue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/InstantExitQueue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/InstantExitQueue.sol", "filename_short": "contracts/deprecated/InstantExitQueue.sol", "is_dependency": false, "lines": [ @@ -58920,7 +57196,7 @@ "start": 456, "length": 5179, "filename_relative": "contracts/core/VaultProxy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultProxy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultProxy.sol", "filename_short": "contracts/core/VaultProxy.sol", "is_dependency": false, "lines": [ @@ -58944,7 +57220,7 @@ "start": 456, "length": 5179, "filename_relative": "contracts/core/VaultProxy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultProxy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultProxy.sol", "filename_short": "contracts/core/VaultProxy.sol", "is_dependency": false, "lines": [ @@ -58972,7 +57248,7 @@ "start": 1175, "length": 69, "filename_relative": "contracts/core/VaultProxy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultProxy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultProxy.sol", "filename_short": "contracts/core/VaultProxy.sol", "is_dependency": false, "lines": [39], @@ -58987,7 +57263,7 @@ "start": 456, "length": 5179, "filename_relative": "contracts/core/VaultProxy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultProxy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultProxy.sol", "filename_short": "contracts/core/VaultProxy.sol", "is_dependency": false, "lines": [ @@ -59012,7 +57288,7 @@ "start": 456, "length": 5179, "filename_relative": "contracts/core/VaultProxy.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/VaultProxy.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/VaultProxy.sol", "filename_short": "contracts/core/VaultProxy.sol", "is_dependency": false, "lines": [ @@ -59044,6 +57320,136 @@ "impact": "Informational", "confidence": "Medium" }, + { + "elements": [ + { + "type": "contract", + "name": "Relic", + "source_mapping": { + "start": 1674, + "length": 24655, + "filename_relative": "contracts/nexus/Relic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/nexus/Relic.sol", + "filename_short": "contracts/nexus/Relic.sol", + "is_dependency": false, + "lines": [ + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, + 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, + 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, + 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, + 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, + 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, + 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, + 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, + 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, + 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, + 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, + 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, + 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, + 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, + 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, + 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, + 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, + 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, + 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, + 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, + 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, + 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, + 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, + 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, + 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, + 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + { + "type": "function", + "name": "rarityXPThresholds", + "source_mapping": { + "start": 9938, + "length": 70, + "filename_relative": "contracts/interfaces/nexus/IRelic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/nexus/IRelic.sol", + "filename_short": "contracts/interfaces/nexus/IRelic.sol", + "is_dependency": false, + "lines": [292], + "starting_column": 5, + "ending_column": 75 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "IRelic", + "source_mapping": { + "start": 155, + "length": 10136, + "filename_relative": "contracts/interfaces/nexus/IRelic.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/nexus/IRelic.sol", + "filename_short": "contracts/interfaces/nexus/IRelic.sol", + "is_dependency": false, + "lines": [ + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, + 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, + 298, 299, 300, 301, 302 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "rarityXPThresholds(IRelic.Rarity)" + } + } + ], + "description": "Relic (contracts/nexus/Relic.sol#28-655) does not implement functions:\n\t- IRelic.rarityXPThresholds(IRelic.Rarity) (contracts/interfaces/nexus/IRelic.sol#292)\n", + "markdown": "[Relic](contracts/nexus/Relic.sol#L28-L655) does not implement functions:\n\t- [IRelic.rarityXPThresholds(IRelic.Rarity)](contracts/interfaces/nexus/IRelic.sol#L292)\n", + "first_markdown_element": "contracts/nexus/Relic.sol#L28-L655", + "id": "f1de647b5a41e2e36f8599be2ee402219b2b340fb4d32d24cb5409b8731df5d4", + "check": "unimplemented-functions", + "impact": "Informational", + "confidence": "High" + }, { "elements": [ { @@ -59051,9 +57457,9 @@ "name": "TreasuryReservesVault", "source_mapping": { "start": 2150, - "length": 31934, + "length": 32023, "filename_relative": "contracts/v2/TreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/v2/TreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/v2/TreasuryReservesVault.sol", "filename_short": "contracts/v2/TreasuryReservesVault.sol", "is_dependency": false, "lines": [ @@ -59112,7 +57518,7 @@ 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, - 774, 775, 776 + 774, 775, 776, 777, 778, 779 ], "starting_column": 1, "ending_column": 0 @@ -59125,7 +57531,7 @@ "start": 6801, "length": 232, "filename_relative": "contracts/interfaces/v2/ITreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/v2/ITreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/v2/ITreasuryReservesVault.sol", "filename_short": "contracts/interfaces/v2/ITreasuryReservesVault.sol", "is_dependency": false, "lines": [165, 166, 167, 168, 169, 170], @@ -59140,7 +57546,7 @@ "start": 1896, "length": 12436, "filename_relative": "contracts/interfaces/v2/ITreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/v2/ITreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/v2/ITreasuryReservesVault.sol", "filename_short": "contracts/interfaces/v2/ITreasuryReservesVault.sol", "is_dependency": false, "lines": [ @@ -59183,7 +57589,7 @@ "start": 7440, "length": 94, "filename_relative": "contracts/interfaces/v2/ITreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/v2/ITreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/v2/ITreasuryReservesVault.sol", "filename_short": "contracts/interfaces/v2/ITreasuryReservesVault.sol", "is_dependency": false, "lines": [182], @@ -59198,7 +57604,7 @@ "start": 1896, "length": 12436, "filename_relative": "contracts/interfaces/v2/ITreasuryReservesVault.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/interfaces/v2/ITreasuryReservesVault.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/interfaces/v2/ITreasuryReservesVault.sol", "filename_short": "contracts/interfaces/v2/ITreasuryReservesVault.sol", "is_dependency": false, "lines": [ @@ -59235,9 +57641,9 @@ } } ], - "description": "TreasuryReservesVault (contracts/v2/TreasuryReservesVault.sol#46-776) does not implement functions:\n\t- ITreasuryReservesVault.borrowTokens(IERC20) (contracts/interfaces/v2/ITreasuryReservesVault.sol#165-170)\n\t- ITreasuryReservesVault.strategyTokenCredits(address,IERC20) (contracts/interfaces/v2/ITreasuryReservesVault.sol#182)\n", - "markdown": "[TreasuryReservesVault](contracts/v2/TreasuryReservesVault.sol#L46-L776) does not implement functions:\n\t- [ITreasuryReservesVault.borrowTokens(IERC20)](contracts/interfaces/v2/ITreasuryReservesVault.sol#L165-L170)\n\t- [ITreasuryReservesVault.strategyTokenCredits(address,IERC20)](contracts/interfaces/v2/ITreasuryReservesVault.sol#L182)\n", - "first_markdown_element": "contracts/v2/TreasuryReservesVault.sol#L46-L776", + "description": "TreasuryReservesVault (contracts/v2/TreasuryReservesVault.sol#46-779) does not implement functions:\n\t- ITreasuryReservesVault.borrowTokens(IERC20) (contracts/interfaces/v2/ITreasuryReservesVault.sol#165-170)\n\t- ITreasuryReservesVault.strategyTokenCredits(address,IERC20) (contracts/interfaces/v2/ITreasuryReservesVault.sol#182)\n", + "markdown": "[TreasuryReservesVault](contracts/v2/TreasuryReservesVault.sol#L46-L779) does not implement functions:\n\t- [ITreasuryReservesVault.borrowTokens(IERC20)](contracts/interfaces/v2/ITreasuryReservesVault.sol#L165-L170)\n\t- [ITreasuryReservesVault.strategyTokenCredits(address,IERC20)](contracts/interfaces/v2/ITreasuryReservesVault.sol#L182)\n", + "first_markdown_element": "contracts/v2/TreasuryReservesVault.sol#L46-L779", "id": "5ca38996b66ca642bbaf28ffb239e4c9ea40cee90fe7623ec08272ca68b3bfd3", "check": "unimplemented-functions", "impact": "Informational", @@ -59252,7 +57658,7 @@ "start": 1237, "length": 17, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [29], @@ -59267,7 +57673,7 @@ "start": 440, "length": 8733, "filename_relative": "contracts/amm/TempleUniswapV2Pair.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/amm/TempleUniswapV2Pair.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/amm/TempleUniswapV2Pair.sol", "filename_short": "contracts/amm/TempleUniswapV2Pair.sol", "is_dependency": false, "lines": [ @@ -59309,7 +57715,7 @@ "start": 1493, "length": 23, "filename_relative": "contracts/governance/ElderElection.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/governance/ElderElection.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/governance/ElderElection.sol", "filename_short": "contracts/governance/ElderElection.sol", "is_dependency": false, "lines": [42], @@ -59324,7 +57730,7 @@ "start": 908, "length": 5057, "filename_relative": "contracts/governance/ElderElection.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/governance/ElderElection.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/governance/ElderElection.sol", "filename_short": "contracts/governance/ElderElection.sol", "is_dependency": false, "lines": [ @@ -59365,7 +57771,7 @@ "start": 537, "length": 24, "filename_relative": "contracts/core/Exposure.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Exposure.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Exposure.sol", "filename_short": "contracts/core/Exposure.sol", "is_dependency": false, "lines": [18], @@ -59380,7 +57786,7 @@ "start": 362, "length": 3820, "filename_relative": "contracts/core/Exposure.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/Exposure.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/Exposure.sol", "filename_short": "contracts/core/Exposure.sol", "is_dependency": false, "lines": [ @@ -59418,7 +57824,7 @@ "start": 474, "length": 27, "filename_relative": "contracts/deprecated/InstantExitQueue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/InstantExitQueue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/InstantExitQueue.sol", "filename_short": "contracts/deprecated/InstantExitQueue.sol", "is_dependency": false, "lines": [14], @@ -59433,7 +57839,7 @@ "start": 428, "length": 621, "filename_relative": "contracts/deprecated/InstantExitQueue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/InstantExitQueue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/InstantExitQueue.sol", "filename_short": "contracts/deprecated/InstantExitQueue.sol", "is_dependency": false, "lines": [ @@ -59464,7 +57870,7 @@ "start": 507, "length": 18, "filename_relative": "contracts/deprecated/InstantExitQueue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/InstantExitQueue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/InstantExitQueue.sol", "filename_short": "contracts/deprecated/InstantExitQueue.sol", "is_dependency": false, "lines": [15], @@ -59479,7 +57885,7 @@ "start": 428, "length": 621, "filename_relative": "contracts/deprecated/InstantExitQueue.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/InstantExitQueue.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/InstantExitQueue.sol", "filename_short": "contracts/deprecated/InstantExitQueue.sol", "is_dependency": false, "lines": [ @@ -59510,7 +57916,7 @@ "start": 505, "length": 25, "filename_relative": "contracts/deprecated/LockedOGTemple.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/LockedOGTemple.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/LockedOGTemple.sol", "filename_short": "contracts/deprecated/LockedOGTemple.sol", "is_dependency": false, "lines": [21], @@ -59525,7 +57931,7 @@ "start": 213, "length": 2143, "filename_relative": "contracts/deprecated/LockedOGTemple.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/LockedOGTemple.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/LockedOGTemple.sol", "filename_short": "contracts/deprecated/LockedOGTemple.sol", "is_dependency": false, "lines": [ @@ -59559,7 +57965,7 @@ "start": 680, "length": 30, "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, "lines": [25], @@ -59574,7 +57980,7 @@ "start": 388, "length": 6435, "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, "lines": [ @@ -59615,7 +58021,7 @@ "start": 716, "length": 34, "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, "lines": [26], @@ -59630,7 +58036,7 @@ "start": 388, "length": 6435, "filename_relative": "contracts/core/OpsManager.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/core/OpsManager.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/core/OpsManager.sol", "filename_short": "contracts/core/OpsManager.sol", "is_dependency": false, "lines": [ @@ -59671,7 +58077,7 @@ "start": 501, "length": 23, "filename_relative": "contracts/governance/TemplarMetadata.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/governance/TemplarMetadata.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/governance/TemplarMetadata.sol", "filename_short": "contracts/governance/TemplarMetadata.sol", "is_dependency": false, "lines": [18], @@ -59686,7 +58092,7 @@ "start": 235, "length": 990, "filename_relative": "contracts/governance/TemplarMetadata.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/governance/TemplarMetadata.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/governance/TemplarMetadata.sol", "filename_short": "contracts/governance/TemplarMetadata.sol", "is_dependency": false, "lines": [ @@ -59717,7 +58123,7 @@ "start": 892, "length": 31, "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, "lines": [29], @@ -59732,7 +58138,7 @@ "start": 464, "length": 6184, "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, "lines": [ @@ -59772,7 +58178,7 @@ "start": 988, "length": 29, "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, "lines": [32], @@ -59787,7 +58193,7 @@ "start": 464, "length": 6184, "filename_relative": "contracts/deprecated/TempleStaking.sol", - "filename_absolute": "/Users/frontier/git/temple-3/protocol/contracts/deprecated/TempleStaking.sol", + "filename_absolute": "/Users/frontier/git/temple/protocol/contracts/deprecated/TempleStaking.sol", "filename_short": "contracts/deprecated/TempleStaking.sol", "is_dependency": false, "lines": [ diff --git a/protocol/test/forge/core/OtcOffer.t.sol b/protocol/test/forge/core/OtcOffer.t.sol index 8674ba2b2..789affd04 100644 --- a/protocol/test/forge/core/OtcOffer.t.sol +++ b/protocol/test/forge/core/OtcOffer.t.sol @@ -272,7 +272,7 @@ contract OtcOfferTestSwap is OtcOfferTestBase { // Alice sells 1 OHM { deal(address(ohmToken), alice, 1e9, true); - changePrank(alice); + vm.startPrank(alice); ohmToken.approve(address(otcOfferDaiOhm), 1e9); otcOfferDaiOhm.swap(1e9); } @@ -307,11 +307,11 @@ contract OtcOfferTestSwap is OtcOfferTestBase { vm.expectRevert("Dai/insufficient-allowance"); otcOfferDaiOhm.swap(sellAmount); - changePrank(fundsOwner); + vm.startPrank(fundsOwner); daiToken.approve(address(otcOfferDaiOhm), expectedBuyAmount); // Finally succeeds - changePrank(alice); + vm.startPrank(alice); otcOfferDaiOhm.swap(sellAmount); } diff --git a/protocol/test/forge/nexus/BaseSacrifice.t.sol b/protocol/test/forge/nexus/BaseSacrifice.t.sol new file mode 100644 index 000000000..17cd8cbd6 --- /dev/null +++ b/protocol/test/forge/nexus/BaseSacrifice.t.sol @@ -0,0 +1,209 @@ +pragma solidity 0.8.19; +// SPDX-License-Identifier: AGPL-3.0-or-later +// Temple (tests/forge/nexus/BaseSacrifice.t.sol) + +import { TempleTest } from "../TempleTest.sol"; +import { BaseSacrifice } from "../../../contracts/nexus/BaseSacrifice.sol"; +import { MockSacrifice } from "./MockSacrifice.t.sol"; +import { CommonEventsAndErrors } from "../../../contracts/common/CommonEventsAndErrors.sol"; + +contract BaseSacrificeTestBase is TempleTest { + MockSacrifice public mockSacrifice; + + uint256 internal constant MINIMUM_CUSTOM_PRICE = 30 ether; + uint256 internal constant ONE_ETHER = 1 ether; + uint256 internal constant PRICE_MAX_PERIOD = 365 days; + + event OriginTimeSet(uint64 originTime); + event CustomPriceSet(uint256 price); + event PriceParamsSet(BaseSacrifice.PriceParam params); + + function setUp() public { + mockSacrifice = new MockSacrifice(executor); + } + + function test_initialization() public { + assertEq(mockSacrifice.executor(), executor); + } + + function _getPriceParams() internal pure returns (BaseSacrifice.PriceParam memory params) { + params.minimumPrice = uint128(MINIMUM_CUSTOM_PRICE); + params.maximumPrice = uint128(200 * ONE_ETHER); + params.priceMaxPeriod = 365 days; + } +} + +contract BaseSacrificeAccessTest is BaseSacrificeTestBase { + + function test_access_setOriginTimeFail(address caller) public { + vm.assume(caller != executor); + vm.startPrank(caller); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); + mockSacrifice.setOriginTime(uint64(block.timestamp)); + } + + function test_access_setOriginTimeSuccess() public { + vm.startPrank(executor); + mockSacrifice.setOriginTime(uint64(block.timestamp)); + } + + function test_access_setPriceParamsFail(address caller) public { + vm.assume(caller != executor); + vm.startPrank(caller); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); + mockSacrifice.setPriceParams(_getPriceParams()); + } + + function test_access_setPriceParamsSuccess() public { + vm.startPrank(executor); + mockSacrifice.setPriceParams(_getPriceParams()); + } + + function test_access_setCustomPriceFail(address caller) public { + vm.assume(caller != executor); + vm.startPrank(caller); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); + mockSacrifice.setCustomPrice(10**18); + } + + function test_access_setCustomPriceSuccess() public { + vm.startPrank(executor); + mockSacrifice.setCustomPrice(20**18); + } +} + +contract BaseeSacrificeAccessTest is BaseSacrificeTestBase { + + function _calculatePrice( + BaseSacrifice.PriceParam memory params + ) private view returns (uint256 price) { + uint256 timeDifference = block.timestamp - mockSacrifice.originTime(); + price = (timeDifference * params.maximumPrice / params.priceMaxPeriod) + params.minimumPrice; + if (price > params.maximumPrice) { + price = params.maximumPrice; + } + } + + function test_setOriginTime() public { + vm.startPrank(executor); + uint64 originTime = uint64(block.timestamp - 1); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidParam.selector)); + mockSacrifice.setOriginTime(originTime); + + uint64 ts = uint64(block.timestamp); + vm.expectEmit(address(mockSacrifice)); + emit OriginTimeSet(ts); + mockSacrifice.setOriginTime(ts); + assertEq(mockSacrifice.originTime(), ts); + + vm.expectEmit(address(mockSacrifice)); + ts = uint64(block.timestamp + 10); + emit OriginTimeSet(ts); + mockSacrifice.setOriginTime(ts); + assertEq(mockSacrifice.originTime(), ts); + } + + function test_setPriceParams() public { + vm.startPrank(executor); + BaseSacrifice.PriceParam memory params; + params.minimumPrice = 2; + params.maximumPrice = 1; + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidParam.selector)); + mockSacrifice.setPriceParams(params); + + params.maximumPrice = uint128(MINIMUM_CUSTOM_PRICE + 1); + params.minimumPrice = uint128(MINIMUM_CUSTOM_PRICE - 1); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidParam.selector)); + mockSacrifice.setPriceParams(params); + + params.minimumPrice = uint128(MINIMUM_CUSTOM_PRICE); + params.maximumPrice = uint128(MINIMUM_CUSTOM_PRICE * 2); + // params.priceMaxPeriod = 0; + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidParam.selector)); + mockSacrifice.setPriceParams(params); + + params.priceMaxPeriod = 365 days; + vm.expectEmit(address(mockSacrifice)); + emit PriceParamsSet(params); + mockSacrifice.setPriceParams(params); + (uint64 maxPeriod, uint128 minPrice, uint128 maxPrice) = mockSacrifice.priceParams(); + assertEq(maxPeriod, params.priceMaxPeriod); + assertEq(minPrice, params.minimumPrice); + assertEq(maxPrice, params.maximumPrice); + } + + function test_setCustomPrice() public { + vm.startPrank(executor); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidParam.selector)); + mockSacrifice.setCustomPrice(MINIMUM_CUSTOM_PRICE - 1); + + uint256 customPrice = 500 * (10**18); + vm.expectEmit(address(mockSacrifice)); + emit CustomPriceSet(customPrice); + mockSacrifice.setCustomPrice(customPrice); + assertEq(mockSacrifice.customPrice(), customPrice); + + // reset + vm.expectEmit(address(mockSacrifice)); + emit CustomPriceSet(0); + mockSacrifice.setCustomPrice(0); + assertEq(mockSacrifice.customPrice(), 0); + } + + function test_getPrice_baseSacrifice() public { + vm.startPrank(executor); + // mockSacrifice.setOriginTime(uint64(block.timestamp)); + // set params + BaseSacrifice.PriceParam memory params = _getPriceParams(); + mockSacrifice.setPriceParams(params); + // origin time same as block.timestamp (set in constructor) + uint256 price = mockSacrifice.getPrice(); + assertApproxEqRel(price, MINIMUM_CUSTOM_PRICE, 0.01e18); + // set origin time + uint256 timestamp = block.timestamp; + mockSacrifice.setOriginTime(uint64(timestamp + 100 seconds)); + mockSacrifice.setCustomPrice(35 * 1 ether); + price = mockSacrifice.getPrice(); + assertEq(price, 35 * 1 ether); + mockSacrifice.setCustomPrice(49 * 1 ether); + price = mockSacrifice.getPrice(); + assertEq(price, 49 * 1 ether); + // can set very high custom price + mockSacrifice.setCustomPrice(120 * 1 ether); + price = mockSacrifice.getPrice(); + assertEq(price, 120 * 1 ether); + // reset custom price to 0 + mockSacrifice.setCustomPrice(0); + price = mockSacrifice.getPrice(); + assertEq(price, type(uint256).max); + + // timestamp warps + mockSacrifice.setOriginTime(uint64(block.timestamp + 100)); + vm.warp(block.timestamp + 99); + + // origin time same as block timestamp + vm.warp(block.timestamp + 1); + price = mockSacrifice.getPrice(); + assertApproxEqRel(price, MINIMUM_CUSTOM_PRICE, 0.01e18); + // 3 months + vm.warp(block.timestamp + 91.25 days); + price = mockSacrifice.getPrice(); + assertEq(price, _calculatePrice(params)); + // 9 months + vm.warp(block.timestamp + 182.5 days); + price = mockSacrifice.getPrice(); + assertEq(price, _calculatePrice(params)); + // 1 year + vm.warp(block.timestamp + 91.25 days); + price = mockSacrifice.getPrice(); + assertEq(price, _calculatePrice(params)); + // 1 year + 1 second + vm.warp(block.timestamp + 1); + price = mockSacrifice.getPrice(); + assertEq(price, _calculatePrice(params)); + // 2 years. price does not go over maximum set price + vm.warp(block.timestamp + 365 days); + price = mockSacrifice.getPrice(); + assertLe(price, params.maximumPrice); + } +} \ No newline at end of file diff --git a/protocol/test/forge/nexus/MockSacrifice.t.sol b/protocol/test/forge/nexus/MockSacrifice.t.sol new file mode 100644 index 000000000..3040d6085 --- /dev/null +++ b/protocol/test/forge/nexus/MockSacrifice.t.sol @@ -0,0 +1,21 @@ +pragma solidity 0.8.19; +// SPDX-License-Identifier: AGPL-3.0-or-later +// Temple (tests/forge/nexus/MockSacrifice.t.sol) + + +import { BaseSacrifice } from "../../../contracts/nexus/BaseSacrifice.sol"; +import { ElevatedAccess } from "../../../contracts/nexus/access/ElevatedAccess.sol"; +import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; + +contract MockSacrifice is BaseSacrifice { + + IERC20 public sacrificeToken; + constructor( + address _executor + ) ElevatedAccess(_executor) { + /// @dev caution so that origin time is never 0 and lesser than or equal to current block timestamp + originTime = uint64(block.timestamp); + } + + function sacrifice(uint256 enclaveId, address to) external virtual returns (uint256 relicId) {} +} \ No newline at end of file diff --git a/protocol/test/forge/nexus/Nexus.t.sol b/protocol/test/forge/nexus/Nexus.t.sol new file mode 100644 index 000000000..ebac93382 --- /dev/null +++ b/protocol/test/forge/nexus/Nexus.t.sol @@ -0,0 +1,103 @@ +pragma solidity 0.8.19; +// SPDX-License-Identifier: AGPL-3.0-or-later +// Temple (tests/forge/nexus/NexusTestBase.t.sol) + + +import { TempleTest } from "../TempleTest.sol"; +import { FakeERC20 } from "../../../contracts/fakes/FakeERC20.sol"; +import { IRelic } from "../../../contracts/interfaces/nexus/IRelic.sol"; + +contract NexusTestBase is TempleTest { + + FakeERC20 public temple = new FakeERC20("TEMPLE", "TEMPLE", address(0), 0); + FakeERC20 public dai = new FakeERC20("DAI", "DAI", address(0), 0); + + string internal constant NAME = "RELIC"; + string internal constant SYMBOL = "REL"; + string internal constant BASE_URI = "http://example.com/"; + + uint256 internal constant RARITIES_COUNT = 0x05; + uint256 internal constant ENCLAVES_COUNT = 0x05; + uint256 internal constant PER_MINT_QUANTITY = 0x01; + bytes internal constant ZERO_BYTES = ""; + + uint256 internal constant SHARD_1_ID = 0x01; + uint256 internal constant SHARD_2_ID = 0x02; + uint256 internal constant SHARD_3_ID = 0x03; + uint256 internal constant SHARD_4_ID = 0x04; + uint256 internal constant SHARD_5_ID = 0x05; + + uint256 internal constant MYSTERY_ID = 0x01; + uint256 internal constant CHAOS_ID = 0x02; + uint256 internal constant ORDER_ID = 0x03; + uint256 internal constant STRUCTURE_ID = 0x04; + uint256 internal constant LOGIC_ID = 0x05; + + uint256 internal constant RECIPE_1_ID = 0x01; // 1 + uint256 internal constant RECIPE_2_ID = 0x02; // 2 + uint256 internal constant RECIPE_3_ID = 0x03; // 3 + + uint256 internal constant RELIC_1_ID = 0x01; + + string internal constant SHARD_1_URI = "https://example1.com"; + string internal constant SHARD_2_URI = "https://example2.com"; + string internal constant SHARD_3_URI = "https://example3.com"; + string internal constant SHARD_4_URI = "https://example4.com"; + + string internal constant MYSTERY = "MYSTERY"; + string internal constant CHAOS = "CHAOS"; + string internal constant ORDER = "ORDER"; + string internal constant STRUCTURE = "STRUCTURE"; + string internal constant LOGIC = "LOGIC"; + + function _enableAllEnclavesForMinter(IRelic relic, address minter) internal { + uint256[] memory enclaveIds = new uint256[](5); + bool[] memory allow = new bool[](5); + enclaveIds[0] = MYSTERY_ID; + enclaveIds[1] = CHAOS_ID; + enclaveIds[2] = STRUCTURE_ID; + enclaveIds[3] = LOGIC_ID; + enclaveIds[4] = ORDER_ID; + allow[0] = allow[1] = allow[2] = allow[3] = allow[4] = true; + relic.setRelicMinterEnclaveIds(minter, enclaveIds, allow); + } + + function _toString(uint256 value) internal pure returns (string memory str) { + assembly { + // The maximum value of a uint256 contains 78 digits (1 byte per digit), but + // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned. + // We will need 1 word for the trailing zeros padding, 1 word for the length, + // and 3 words for a maximum of 78 digits. Total: 5 * 0x20 = 0xa0. + let m := add(mload(0x40), 0xa0) + // Update the free memory pointer to allocate. + mstore(0x40, m) + // Assign the `str` to the end. + str := sub(m, 0x20) + // Zeroize the slot after the string. + mstore(str, 0) + + // Cache the end of the memory to calculate the length later. + let end := str + + // We write the string from rightmost digit to leftmost digit. + // The following is essentially a do-while loop that also handles the zero case. + // prettier-ignore + for { let temp := value } 1 {} { + str := sub(str, 1) + // Write the character to the pointer. + // The ASCII index of the '0' character is 48. + mstore8(str, add(48, mod(temp, 10))) + // Keep dividing `temp` until zero. + temp := div(temp, 10) + // prettier-ignore + if iszero(temp) { break } + } + + let length := sub(end, str) + // Move the pointer 32 bytes leftwards to make room for the length. + str := sub(str, 0x20) + // Store the length. + mstore(str, length) + } + } +} \ No newline at end of file diff --git a/protocol/test/forge/nexus/NexusCommon.t.sol b/protocol/test/forge/nexus/NexusCommon.t.sol new file mode 100644 index 000000000..7d8d6c42a --- /dev/null +++ b/protocol/test/forge/nexus/NexusCommon.t.sol @@ -0,0 +1,191 @@ +pragma solidity 0.8.19; +// SPDX-License-Identifier: AGPL-3.0-or-later +// Temple (tests/forge/nexus/NexusCommon.t.sol) + +import { NexusTestBase } from "./Nexus.t.sol"; +import { NexusCommon } from "../../../contracts/nexus/NexusCommon.sol"; +import { CommonEventsAndErrors } from "../../../contracts/common/CommonEventsAndErrors.sol"; +import { Relic } from "../../../contracts/nexus/Relic.sol"; +import { Shard } from "../../../contracts/nexus/Shard.sol"; + +contract NexusCommonTestBase is NexusTestBase { + NexusCommon public nexusCommon; + Relic public relic; + Shard public shard; + + event ShardEnclaveSet(uint256 enclaveId, uint256 indexed shardId); + event EnclaveNameSet(uint256 id, string name); + event ShardSet(address indexed shard); + + + function setUp() public { + nexusCommon = new NexusCommon(executor); + relic = new Relic(NAME, SYMBOL, address(nexusCommon), executor); + shard = new Shard(address(relic), address(nexusCommon), executor, "http://example.com"); + + { + vm.startPrank(executor); + address[] memory minters = new address[](2); + minters[0] = executor; + minters[1] = operator; + shard.setNewMinterShards(minters); + nexusCommon.setEnclaveName(1, MYSTERY); + nexusCommon.setShard(address(shard)); + vm.stopPrank(); + } + } + + function _setEnclaveNames() internal { + nexusCommon.setEnclaveName(1, MYSTERY); + nexusCommon.setEnclaveName(2, CHAOS); + nexusCommon.setEnclaveName(3, ORDER); + } +} + +contract NexusCommonAccessTest is NexusCommonTestBase { + + function test_initialization() public { + assertEq(address(nexusCommon.shard()), address(shard)); + assertEq(nexusCommon.executor(), executor); + } + + function test_setEnclaveNameAccessFail(address caller) public { + vm.assume(caller != executor); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); + nexusCommon.setEnclaveName(1, LOGIC); + } + + function test_setShardEnclaveAccessFail(address caller) public { + vm.assume(caller != executor); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); + nexusCommon.setShardEnclave(1, 1); + } + + function test_setShardFail(address caller) public { + vm.assume(caller != executor); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); + nexusCommon.setShard(address(shard)); + } + + function test_setEnclaveNameAccessFail() public { + vm.startPrank(executor); + nexusCommon.setEnclaveName(1, LOGIC); + } + + function test_setShardEnclaveAccessSuccess() public { + vm.startPrank(executor); + nexusCommon.setShardEnclave(1, 1); + } + + function test_setShardSuccess() public { + vm.startPrank(executor); + nexusCommon.setShard(address(shard)); + } +} + +contract NexusCommonTest is NexusCommonTestBase { + + function test_setShard() public { + vm.startPrank(executor); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAddress.selector)); + nexusCommon.setShard(address(0)); + + vm.expectEmit(address(nexusCommon)); + emit ShardSet(address(shard)); + nexusCommon.setShard(address(shard)); + assertEq(address(nexusCommon.shard()), address(shard)); + } + + function test_setEnclaveName() public { + vm.startPrank(executor); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidParam.selector)); + nexusCommon.setEnclaveName(0, MYSTERY); + + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidParam.selector)); + nexusCommon.setEnclaveName(1, string(bytes(""))); + + vm.expectEmit(address(nexusCommon)); + emit EnclaveNameSet(1, MYSTERY); + nexusCommon.setEnclaveName(1, MYSTERY); + + assertEq(nexusCommon.enclaveNames(1), MYSTERY); + + vm.expectEmit(); + emit EnclaveNameSet(2, CHAOS); + nexusCommon.setEnclaveName(2, CHAOS); + vm.expectEmit(); + emit EnclaveNameSet(3, ORDER); + nexusCommon.setEnclaveName(3, ORDER); + + assertEq(nexusCommon.enclaveNames(2), CHAOS); + assertEq(nexusCommon.enclaveNames(3), ORDER); + + // update enclave name + vm.expectEmit(address(nexusCommon)); + emit EnclaveNameSet(2, STRUCTURE); + nexusCommon.setEnclaveName(2, STRUCTURE); + assertEq(nexusCommon.enclaveNames(2), STRUCTURE); + } + + function test_setShardEnclave() public { + vm.startPrank(executor); + _setEnclaveNames(); + + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidParam.selector)); + nexusCommon.setShardEnclave(0, 0); + // test invalid enclaveId + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidParam.selector)); + nexusCommon.setShardEnclave(10, 0); + + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidParam.selector)); + nexusCommon.setShardEnclave(1, 3); + + uint256[] memory enclaveOneShardsBefore = nexusCommon.getEnclaveShards(1); + + vm.expectEmit(address(nexusCommon)); + emit ShardEnclaveSet(1, 2); + nexusCommon.setShardEnclave(1, 2); + + uint256[] memory enclaveOneShards = nexusCommon.getEnclaveShards(1); + assertEq(enclaveOneShards.length, enclaveOneShardsBefore.length + 1); + assertEq(enclaveOneShards[0], 2); + + vm.expectEmit(address(nexusCommon)); + emit ShardEnclaveSet(1, 1); + nexusCommon.setShardEnclave(1, 1); + + enclaveOneShards = nexusCommon.getEnclaveShards(1); + assertEq(enclaveOneShards.length, 2); + assertEq(enclaveOneShards[1], 1); + assertEq(nexusCommon.shardToEnclave(1), 1); + assertEq(nexusCommon.shardToEnclave(2), 1); + + // add Shard Id 1 to another enclave and check + uint256[] memory enclaveTwoShards = nexusCommon.getEnclaveShards(2); + nexusCommon.setShardEnclave(2, 1); + enclaveOneShards = nexusCommon.getEnclaveShards(1); + enclaveTwoShards = nexusCommon.getEnclaveShards(2); + assertEq(enclaveOneShards.length, 1); + assertEq(enclaveTwoShards.length, 1); + assertEq(nexusCommon.shardToEnclave(1), 2); + } + + function test_getAllEnclaveIds() public { + vm.startPrank(executor); + _setEnclaveNames(); + uint256[] memory enclaveIds = nexusCommon.getAllEnclaveIds(); + assertEq(enclaveIds.length, 3); + assertEq(enclaveIds[0], 1); + assertEq(enclaveIds[1], 2); + assertEq(enclaveIds[2], 3); + } + + function test_isValidEnclaveId() public { + assertEq(nexusCommon.isValidEnclaveId(2), false); + assertEq(nexusCommon.isValidEnclaveId(3), false); + vm.startPrank(executor); + _setEnclaveNames(); + assertEq(nexusCommon.isValidEnclaveId(2), true); + assertEq(nexusCommon.isValidEnclaveId(3), true); + } +} \ No newline at end of file diff --git a/protocol/test/forge/nexus/PartnerZeroSacrifice.t.sol b/protocol/test/forge/nexus/PartnerZeroSacrifice.t.sol new file mode 100644 index 000000000..d14aa6459 --- /dev/null +++ b/protocol/test/forge/nexus/PartnerZeroSacrifice.t.sol @@ -0,0 +1,129 @@ +pragma solidity 0.8.19; +// SPDX-License-Identifier: AGPL-3.0-or-later +// Temple (tests/forge/nexus/PartnerZeroSacrifice.t.sol) + + +import { NexusTestBase } from "./Nexus.t.sol"; +import { Relic } from "../../../contracts/nexus/Relic.sol"; +import { NexusCommon } from "../../../contracts/nexus/NexusCommon.sol"; +import { CommonEventsAndErrors } from "../../../contracts/common/CommonEventsAndErrors.sol"; +import { PartnerZeroSacrifice } from "../../../contracts/nexus/PartnerZeroSacrifice.sol"; +import { IPartnerSacrifice, ISacrifice } from "../../../contracts/interfaces/nexus/IBaseSacrifice.sol"; +import { IElevatedAccess } from "../../../contracts/interfaces/nexus/access/IElevatedAccess.sol"; + +contract MockPartnerProxy { + IPartnerSacrifice public partnerSacrifice; + + uint256 internal constant NON_ENCLAVE_ID = 10; + constructor(address _partnerSacrifice) { + partnerSacrifice = IPartnerSacrifice(_partnerSacrifice); + } + + function execute(address to) external returns (uint256 relicId) { + relicId = partnerSacrifice.sacrifice(NON_ENCLAVE_ID, to); + } +} + +contract PartnerZeroSacrificeTestBase is NexusTestBase { + Relic public relic; + NexusCommon public nexusCommon; + PartnerZeroSacrifice public partnerSacrifice; + MockPartnerProxy public mockPartnerProxy; + + uint256 internal constant NON_ENCLAVE_ID = 10; + + event PartnerZeroSacrificed(address indexed to, uint256 relicId, uint256 enclaveId); + + function setUp() public { + nexusCommon = new NexusCommon(executor); + relic = new Relic(NAME, SYMBOL, address(nexusCommon), executor); + partnerSacrifice = new PartnerZeroSacrifice(address(relic), executor); + mockPartnerProxy = new MockPartnerProxy(address(partnerSacrifice)); + vm.startPrank(executor); + nexusCommon.setEnclaveName(NON_ENCLAVE_ID, "NON_ENCLAVE"); + uint256[] memory enclaveIds = new uint256[](1); + bool[] memory allow = new bool[](1); + enclaveIds[0] = NON_ENCLAVE_ID; + allow[0] = true; + relic.setRelicMinterEnclaveIds(address(partnerSacrifice), enclaveIds, allow); + // allow proxy sacrifice access + IElevatedAccess.ExplicitAccess[] memory accessArray = new IElevatedAccess.ExplicitAccess[](1); + IElevatedAccess.ExplicitAccess memory access; + access.fnSelector = bytes4(keccak256("sacrifice(uint256,address)")); + access.allowed = true; + accessArray[0] = access; + partnerSacrifice.setExplicitAccess(address(mockPartnerProxy), accessArray); + vm.stopPrank(); + } +} + +contract PartnerSacrificeAccessTest is PartnerZeroSacrificeTestBase { + function test_initialization() public { + assertEq(address(partnerSacrifice.relic()), address(relic)); + assertEq(partnerSacrifice.executor(), executor); + assertEq(relic.isRelicMinter(address(partnerSacrifice), NON_ENCLAVE_ID), true); + } + + function test_access_sacrificeFail(address caller) public { + vm.assume(caller != executor && caller != address(mockPartnerProxy)); + vm.startPrank(caller); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); + partnerSacrifice.sacrifice(NON_ENCLAVE_ID, alice); + } + + function test_access_sacrificeSuccess() public { + vm.startPrank(address(mockPartnerProxy)); + mockPartnerProxy.execute(alice); + } +} + +contract PartnerSacrificeTest is PartnerZeroSacrificeTestBase { + function test_getPrice() public { + assertEq(partnerSacrifice.getPrice(), 0); + } + + function test_sacrifice() public { + vm.startPrank(executor); + uint64 originTime = uint64(block.timestamp + 100); + partnerSacrifice.setOriginTime(originTime); + vm.expectRevert(abi.encodeWithSelector(ISacrifice.FutureOriginTime.selector, originTime)); + partnerSacrifice.sacrifice(NON_ENCLAVE_ID, alice); + + vm.warp(originTime); + + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAddress.selector)); + partnerSacrifice.sacrifice(NON_ENCLAVE_ID, address(0)); + + // mint cap is 0 + uint256 relicId = relic.nextTokenId(); + uint256 totalMinted = partnerSacrifice.totalMinted(); + vm.expectEmit(address(partnerSacrifice)); + emit PartnerZeroSacrificed(alice, relicId, NON_ENCLAVE_ID); + uint256 actualRelicId = mockPartnerProxy.execute(alice); + assertEq(actualRelicId, relicId); + assertEq(relic.ownerOf(relicId), alice); + assertEq(partnerSacrifice.totalMinted(), totalMinted+1); + + // mint cap > 0 + uint256 mintCap = 2; + partnerSacrifice.setMintCap(2); + relicId = relic.nextTokenId(); + totalMinted = partnerSacrifice.totalMinted(); + vm.expectEmit(address(partnerSacrifice)); + emit PartnerZeroSacrificed(alice, relicId, NON_ENCLAVE_ID); + mockPartnerProxy.execute(alice); + assertEq(partnerSacrifice.totalMinted(), totalMinted+1); + assertEq(relic.ownerOf(relicId), alice); + + vm.expectRevert(abi.encodeWithSelector(ISacrifice.MintCapExceeded.selector, mintCap+1)); + mockPartnerProxy.execute(alice); + + // update mintCap and mint + partnerSacrifice.setMintCap(3); + relicId = relic.nextTokenId(); + vm.expectEmit(address(partnerSacrifice)); + emit PartnerZeroSacrificed(alice, relicId, NON_ENCLAVE_ID); + mockPartnerProxy.execute(alice); + assertEq(partnerSacrifice.totalMinted(), totalMinted+2); + } +} \ No newline at end of file diff --git a/protocol/test/forge/nexus/Relic.t.sol b/protocol/test/forge/nexus/Relic.t.sol new file mode 100644 index 000000000..4acfa132b --- /dev/null +++ b/protocol/test/forge/nexus/Relic.t.sol @@ -0,0 +1,1256 @@ +pragma solidity 0.8.19; +// SPDX-License-Identifier: AGPL-3.0-or-later +// Temple (tests/forge/nexus/Relic.t.sol) + + +import { NexusTestBase } from "./Nexus.t.sol"; +import { Relic } from "../../../contracts/nexus/Relic.sol"; +import { NexusCommon } from "../../../contracts/nexus/NexusCommon.sol"; +import { IRelic } from "../../../contracts/interfaces/nexus/IRelic.sol"; +import { IERC721A } from "../../../contracts/interfaces/nexus/IERC721A.sol"; +import { Shard } from "../../../contracts/nexus/Shard.sol"; +import { EnumerableSet } from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; +import { CommonEventsAndErrors } from "../../../contracts/common/CommonEventsAndErrors.sol"; + +contract RelicTestBase is NexusTestBase { + using EnumerableSet for EnumerableSet.UintSet; + + Relic public relic; + Shard public shard; + NexusCommon public nexusCommon; + + Relic.Rarity public commRarity = IRelic.Rarity.Common; + Relic.Rarity public uncommonRarity = IRelic.Rarity.Uncommon; + Rarity public invalidRarity = Rarity.InvalidRarity; + + enum Enclave { + Chaos, + Mystery, + Logic, + Order, + Structure, + InvalidEnclave + } + + enum Rarity { + Common, + Uncommon, + Rare, + Epic, + Legendary, + InvalidRarity + } + + struct RelicInfo { + uint256 enclaveId; + Rarity rarity; + uint128 xp; + /// @notice shards equipped to this contract. can extract owner of relic from ownerOf(relicId) + mapping(uint256 => uint256) equippedShards; + /// @notice keep track of equipped shards as set + EnumerableSet.UintSet shards; + } + + struct RelicInfoView { + uint256 enclaveId; + Rarity rarity; + uint128 xp; + uint256[] shards; + } + + event RarityXPThresholdSet(Relic.Rarity rarity, uint256 threshold); + event RarityBaseUriSet(Relic.Rarity rarity, string uri); + event RelicMinted(address indexed to, uint256 relicId, uint256 enclaveId); + event ShardSet(address indexed shard); + event RelicXPSet(uint256 indexed relicId, uint256 xp); + event ShardsEquipped(address caller, uint256 relicId, uint256[] shardIds, uint256[] amounts); + event ShardsUnequipped(address indexed recipient, uint256 indexed relicId, uint256[] shardIds, uint256[] amounts); + event AccountBlacklistSet(address account, bool blacklist, uint256[] shardIds, uint256[] amounts); + event AccountBlacklisted(address indexed account, bool blacklist); + event ShardBlacklistUpdated(uint256 relicId, uint256 shardId, uint256 amount); + event NexusCommonSet(address indexed nexusCommon); + event RelicMinterEnclaveSet(address indexed minter, uint256 enclaveId, bool allowed); + event ApprovalForAll(address caller, address operator, bool approved); + + function setUp() public { + nexusCommon = new NexusCommon(executor); + relic = new Relic(NAME, SYMBOL, address(nexusCommon), executor); + shard = new Shard(address(relic), address(nexusCommon), executor, BASE_URI); + vm.startPrank(executor); + uint256[] memory enclaveIds = new uint256[](2); + bool[] memory allow = new bool[](2); + enclaveIds[0] = MYSTERY_ID; + enclaveIds[1] = CHAOS_ID; + allow[0] = allow[1] = true; + relic.setRelicMinterEnclaveIds(operator, enclaveIds, allow); + relic.setShard(address(shard)); + relic.setNexusCommon(address(nexusCommon)); + dai.mint(executor, 10 ether); + { + vm.startPrank(executor); + nexusCommon.setEnclaveName(MYSTERY_ID, MYSTERY); + nexusCommon.setEnclaveName(CHAOS_ID, CHAOS); + nexusCommon.setEnclaveName(LOGIC_ID, LOGIC); + nexusCommon.setEnclaveName(STRUCTURE_ID, STRUCTURE); + nexusCommon.setEnclaveName(ORDER_ID, ORDER); + } + + { + vm.startPrank(operator); + relic.mintRelic(bob, CHAOS_ID); + relic.mintRelic(bob, MYSTERY_ID); + } + + { + vm.startPrank(executor); + address[] memory newMinters = new address[](4); + newMinters[0] = newMinters[1] = newMinters[2] = newMinters[3] = operator; + shard.setNewMinterShards(newMinters); // Ids: 1,2,3,4 + uint256[] memory shardIds = new uint256[](1); + allow = new bool[](1); + allow[0] = true; + shardIds[0] = SHARD_1_ID; + shard.setMinterAllowedShardIds(bob, shardIds, allow); + + vm.startPrank(operator); + shardIds = new uint256[](2); + uint256[] memory amounts = new uint256[](2); + + shardIds[0] = SHARD_1_ID; + shardIds[1] = SHARD_2_ID; + amounts[0] = 5; + amounts[1] = 10; + shard.mintBatch(bob, shardIds, amounts); + } + + vm.stopPrank(); + } + + function _mintRelicNew(address to, uint256 enclaveId) internal returns (uint256) { + vm.startPrank(operator); + uint256 nextId = relic.nextTokenId(); + relic.mintRelic(to, enclaveId); + return nextId; + } + + function _equipShards( + uint256 relicId, + address account, + uint256[] memory shardIds, + uint256[] memory amounts + ) internal { + vm.startPrank(operator); + shard.mintBatch(account, shardIds, amounts); + vm.startPrank(account); + shard.setApprovalForAll(address(relic), true); + relic.batchEquipShards(relicId, shardIds, amounts); + } + + function _emptyUintArray(uint256 size) internal pure returns (uint256[] memory arr) { + arr = new uint256[](size); + } + + function _blacklistAccount( + bool blacklist, + bool newRelic, + uint256 relicId, + address account, + uint256[] memory shardIds, + uint256[] memory amounts + ) internal returns (uint256) { + if (newRelic) { + relicId = _mintRelicNew(account, CHAOS_ID); + } + // equip shards first + if (shardIds.length > 0) { + _equipShards(relicId, account, shardIds, amounts); + } + vm.startPrank(executor); + relic.setBlacklistAccount(account, relicId, blacklist); + if (shardIds.length > 0) { + relic.setBlacklistedShards(account, relicId, shardIds, amounts); + } + return relicId; + } + + function _setRarityThresholds() internal { + Relic.Rarity[] memory rarities = new Relic.Rarity[](4); + uint256[] memory thresholds = new uint256[](4); + rarities[0] = IRelic.Rarity.Uncommon; + rarities[1] = IRelic.Rarity.Rare; + rarities[2] = IRelic.Rarity.Epic; + rarities[3] = IRelic.Rarity.Legendary; + thresholds[0] = 10; + thresholds[1] = 30; + thresholds[2] = 60; + thresholds[3] = 100; + relic.setXPRarityThresholds(rarities, thresholds); + } +} + +contract RelicTestAccess is RelicTestBase { + + function test_initialization() public { + assertEq(relic.name(), NAME); + assertEq(relic.symbol(), SYMBOL); + assertEq(relic.executor(), executor); + assertEq(address(relic.shard()), address(shard)); + } + + // address internal constant relicAddress = address(relic); + function test_access_setShardFail(address caller) public { + /// use fuzzing + vm.assume(caller != executor); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); + vm.startPrank(caller); + relic.setShard(alice); + } + + function test_access_setShardSuccess() public { + vm.startPrank(executor); + relic.setShard(alice); + } + + function test_access_setNexusCommonFail(address caller) public { + /// use fuzzing + vm.assume(caller != executor); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); + vm.startPrank(caller); + relic.setNexusCommon(address(nexusCommon)); + } + + function test_access_setNexusCommonSuccess() public { + vm.startPrank(executor); + relic.setNexusCommon(address(nexusCommon)); + } + + function test_access_setRelicMinterEnclaveIdsFail(address caller) public { + vm.assume(caller != executor); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); + vm.startPrank(caller); + uint256[] memory enclaveIds = new uint256[](2); + bool[] memory allow = new bool[](2); + enclaveIds[0] = MYSTERY_ID; + enclaveIds[1] = CHAOS_ID; + allow[0] = allow[1] = true; + relic.setRelicMinterEnclaveIds(operator, enclaveIds, allow); + } + + function test_access_setRelicMinterEnclaveIdsSuccess() public { + vm.startPrank(executor); + uint256[] memory enclaveIds = new uint256[](2); + bool[] memory allow = new bool[](2); + enclaveIds[0] = MYSTERY_ID; + enclaveIds[1] = CHAOS_ID; + allow[0] = allow[1] = true; + relic.setRelicMinterEnclaveIds(operator, enclaveIds, allow); + } + + function test_access_setXPRarityThresholdsFail(address caller) public { + vm.assume(caller != executor); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); + Relic.Rarity[] memory rarities = new Relic.Rarity[](1); + rarities[0] = commRarity; + uint256[] memory thresholds = new uint256[](1); + thresholds[0] = 100; + vm.startPrank(caller); + relic.setXPRarityThresholds(rarities, thresholds); + } + + function test_access_setXPRarityThresholdsSuccess() public { + Relic.Rarity[] memory rarities = new Relic.Rarity[](1); + rarities[0] = commRarity; + uint256[] memory thresholds = new uint256[](1); + thresholds[0] = 100; + vm.startPrank(executor); + relic.setXPRarityThresholds(rarities, thresholds); + } + + function test_access_setBaseUriRarityFail(address caller) public { + vm.assume(caller != executor); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); + vm.startPrank(caller); + relic.setBaseUriRarity(commRarity, "some string"); + } + + function test_access_setBaseUriRaritySuccess() public { + vm.startPrank(executor); + relic.setBaseUriRarity(commRarity, "some string"); + } + + function test_access_setBlacklistAccountFail(address caller) public { + vm.assume(caller != executor); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); + vm.startPrank(caller); + relic.setBlacklistAccount(bob, RELIC_1_ID, true); + } + + function test_access_setBlacklistAccountSuccess() public { + vm.startPrank(executor); + relic.setBlacklistAccount(bob, RELIC_1_ID, true); + } + + function test_access_setBlacklistedShardsFail(address caller) public { + vm.assume(caller != executor); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); + vm.startPrank(caller); + uint256[] memory shardIds = new uint256[](1); + uint256[] memory amounts = new uint256[](1); + shardIds[0] = amounts[0] = 1; + relic.setBlacklistedShards(bob, RELIC_1_ID, shardIds, amounts); + } + + function test_access_setBlacklistedShardsSuccess() public { + uint256[] memory shardIds = new uint256[](1); + uint256[] memory amounts = new uint256[](1); + shardIds[0] = amounts[0] = 1; + _equipShards(RELIC_1_ID, bob, shardIds, amounts); + vm.startPrank(executor); + relic.setBlacklistedShards(bob, RELIC_1_ID, shardIds, amounts); + } + + function test_access_unsetBlacklistedShardsFail(address caller) public { + vm.assume(caller != executor); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); + vm.startPrank(caller); + uint256[] memory shardIds = new uint256[](1); + uint256[] memory amounts = new uint256[](1); + shardIds[0] = amounts[0] = 1; + relic.unsetBlacklistedShards(bob, RELIC_1_ID, shardIds, amounts); + } + + function test_access_unsetBlacklistedShardsSuccess() public { + uint256[] memory shardIds = new uint256[](1); + uint256[] memory amounts = new uint256[](1); + shardIds[0] = amounts[0] = 1; + _equipShards(RELIC_1_ID, bob, shardIds, amounts); + vm.startPrank(executor); + relic.setBlacklistedShards(bob, RELIC_1_ID, shardIds, amounts); + relic.unsetBlacklistedShards(bob, RELIC_1_ID, shardIds, amounts); + } + + function test_access_setRelicXPFail(address caller) public { + vm.assume(caller != executor && caller != operator); + vm.startPrank(caller); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); + relic.setRelicXP(1, 100); + } + + function test_access_setRelicXPSuccess() public { + vm.startPrank(executor); + relic.setRelicXP(1, 100); + } + + function test_recoverTokenFail(address caller) public { + vm.assume(caller != executor); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); + vm.startPrank(caller); + relic.recoverToken(address(dai), alice, 1 ether); + } + + function test_recoverTokenSuccess() public { + vm.startPrank(executor); + dai.transfer(address(relic), 1 ether); + relic.recoverToken(address(dai), alice, 1 ether); + } + + function test_burnBlacklistedRelicShardsFail(address caller) public { + vm.assume(caller != executor); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); + vm.startPrank(caller); + uint256[] memory shardIds = new uint256[](1); + uint256[] memory amounts = new uint256[](1); + shardIds[0] = amounts[0] = 1; + relic.burnBlacklistedRelicShards(bob, RELIC_1_ID, shardIds, amounts); + } + + function test_burnBlacklistedRelicShardsSuccess() public { + uint256[] memory shardIds = new uint256[](1); + uint256[] memory amounts = new uint256[](1); + shardIds[0] = amounts[0] = 1; + _equipShards(RELIC_1_ID, bob, shardIds, amounts); + vm.startPrank(executor); + relic.setBlacklistedShards(bob, RELIC_1_ID, shardIds, amounts); + relic.burnBlacklistedRelicShards(bob, RELIC_1_ID, shardIds, amounts); + } +} + +contract RelicSettersTest is RelicTestBase { + + function test_setShard() public { + address relicAddress = address(relic); + vm.startPrank(executor); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAddress.selector)); + relic.setShard(address(0)); + vm.expectEmit(relicAddress); + emit ShardSet(alice); + relic.setShard(alice); + assertEq(address(relic.shard()), alice); + } + + function test_setNexusCommon() public { + vm.startPrank(executor); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAddress.selector)); + relic.setNexusCommon(address(0)); + + vm.expectEmit(); + emit NexusCommonSet(address(nexusCommon)); + relic.setNexusCommon(address(nexusCommon)); + } + + function test_setRelicMinterEnclaveIds() public { + uint256[] memory enclaveIds = new uint256[](2); + bool[] memory allow = new bool[](1); + vm.startPrank(executor); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAddress.selector)); + relic.setRelicMinterEnclaveIds(address(0), enclaveIds, allow); + + allow[0] = true; + enclaveIds[0] = LOGIC_ID; + enclaveIds[1] = ORDER_ID; + vm.expectRevert(abi.encodeWithSelector(IRelic.InvalidParamLength.selector)); + relic.setRelicMinterEnclaveIds(alice, enclaveIds, allow); + + allow = new bool[](2); + allow[0] = allow[1] = true; + vm.expectEmit(address(relic)); + emit RelicMinterEnclaveSet(alice, enclaveIds[0], allow[0]); + vm.expectEmit(address(relic)); + emit RelicMinterEnclaveSet(alice, enclaveIds[1], allow[1]); + relic.setRelicMinterEnclaveIds(alice, enclaveIds, allow); + assertEq(relic.isRelicMinter(alice, enclaveIds[0]), allow[0]); + assertEq(relic.isRelicMinter(alice, enclaveIds[1]), allow[1]); + + allow[1] = false; + vm.expectEmit(address(relic)); + emit RelicMinterEnclaveSet(alice, enclaveIds[1], allow[1]); + relic.setRelicMinterEnclaveIds(alice, enclaveIds, allow); + assertEq(relic.isRelicMinter(alice, enclaveIds[1]), false); + } + + function test_setXPRarityThresholds() public { + vm.startPrank(executor); + Relic.Rarity[] memory rarities = new Relic.Rarity[](2); + uint256[] memory thresholds = new uint256[](3); + rarities[0] = commRarity; + rarities[1] = uncommonRarity; + thresholds[0] = 10; + thresholds[1] = 100; + thresholds[2] = 120; + vm.expectRevert(abi.encodeWithSelector(IRelic.InvalidParamLength.selector)); + relic.setXPRarityThresholds(rarities, thresholds); + thresholds = new uint256[](2); + thresholds[0] = 10; + thresholds[1] = 100; + vm.expectEmit(address(relic)); + emit RarityXPThresholdSet(rarities[0], thresholds[0]); + emit RarityXPThresholdSet(rarities[1], thresholds[1]); + relic.setXPRarityThresholds(rarities, thresholds); + assertEq(relic.rarityXPThresholds(rarities[0]), thresholds[0]); + assertEq(relic.rarityXPThresholds(rarities[1]), thresholds[1]); + } + + function test_setBaseUriRarity() public { + string memory uri = "http://example.com"; + vm.startPrank(executor); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidParam.selector)); + relic.setBaseUriRarity(commRarity, ""); + vm.expectEmit(address(relic)); + emit RarityBaseUriSet(commRarity, uri); + relic.setBaseUriRarity(commRarity, uri); + assertEq(relic.getRarityBaseUri(commRarity), uri); + } + + function test_setBlacklistAccount() public { + vm.startPrank(executor); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAddress.selector)); + relic.setBlacklistAccount(address(0), RELIC_1_ID, true); + + vm.expectRevert(abi.encodeWithSelector(IERC721A.URIQueryForNonexistentToken.selector)); + relic.setBlacklistAccount(bob, 100, true); + + // invalid owner + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidParam.selector)); + relic.setBlacklistAccount(alice, RELIC_1_ID, true); + + uint256[] memory shardIds = new uint256[](1); + uint256[] memory amounts = new uint256[](1); + shardIds[0] = SHARD_1_ID; + amounts[0] = 2; + vm.startPrank(operator); + shard.mintBatch(bob, shardIds, amounts); + vm.startPrank(bob); + shard.setApprovalForAll(address(relic), true); + relic.batchEquipShards(RELIC_1_ID, shardIds, amounts); + + vm.startPrank(executor); + // blacklist relic shards to trigger error + relic.setBlacklistedShards(bob, RELIC_1_ID, shardIds, amounts); + + vm.expectEmit(address(relic)); + emit AccountBlacklisted(bob, true); + relic.setBlacklistAccount(bob, RELIC_1_ID, true); + + assertEq(relic.blacklistedAccounts(bob), true); + + vm.expectRevert(abi.encodeWithSelector(IRelic.CannotWhitelist.selector, RELIC_1_ID)); + relic.setBlacklistAccount(bob, RELIC_1_ID, false); + // unset blacklisted shards + relic.unsetBlacklistedShards(bob, RELIC_1_ID, shardIds, amounts); + + vm.expectEmit(); + emit AccountBlacklisted(bob, false); + relic.setBlacklistAccount(bob, RELIC_1_ID, false); + assertEq(relic.blacklistedAccounts(bob), false); + } + + function test_setBlacklistedShards() public { + uint256[] memory shardIds = new uint256[](1); + uint256[] memory amounts = new uint256[](1); + shardIds[0] = SHARD_1_ID; + amounts[0] = 2; + + vm.startPrank(operator); + shard.mintBatch(bob, shardIds, amounts); + vm.startPrank(bob); + shard.setApprovalForAll(address(relic), true); + relic.batchEquipShards(RELIC_1_ID, shardIds, amounts); + + vm.startPrank(executor); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAddress.selector)); + relic.setBlacklistedShards(address(0), RELIC_1_ID, shardIds, amounts); + + vm.expectRevert(abi.encodeWithSelector(IERC721A.URIQueryForNonexistentToken.selector)); + relic.setBlacklistedShards(bob, 100, shardIds, amounts); + + // invalid owner + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidParam.selector)); + relic.setBlacklistedShards(alice, RELIC_1_ID, shardIds, amounts); + + amounts = new uint256[](2); + amounts[0] = amounts[1] = 2; + vm.expectRevert(abi.encodeWithSelector(IRelic.InvalidParamLength.selector)); + relic.setBlacklistedShards(bob, RELIC_1_ID, shardIds, amounts); + amounts = new uint256[](1); + amounts[0] = 3; + vm.expectRevert(abi.encodeWithSelector(IRelic.NotEnoughShardBalance.selector, 2, 3)); + relic.setBlacklistedShards(bob, RELIC_1_ID, shardIds, amounts); + + amounts[0] = 1; + vm.expectEmit(address(relic)); + emit ShardBlacklistUpdated(RELIC_1_ID, shardIds[0], amounts[0]); + relic.setBlacklistedShards(bob, RELIC_1_ID, shardIds, amounts); + + assertEq(relic.blacklistedAccounts(bob), true); + assertEq(relic.blacklistedRelicShards(RELIC_1_ID, shardIds[0]), 1); + assertEq(relic.blacklistedShardsCount(shardIds[0]), 1); + + vm.expectEmit(address(relic)); + emit ShardBlacklistUpdated(RELIC_1_ID, shardIds[0], amounts[0]); + relic.setBlacklistedShards(bob, RELIC_1_ID, shardIds, amounts); + + assertEq(relic.blacklistedAccounts(bob), true); + assertEq(relic.blacklistedRelicShards(RELIC_1_ID, shardIds[0]), 2); + assertEq(relic.blacklistedShardsCount(RELIC_1_ID), 2); + + // overlapping shards, edge cases + _enableAllEnclavesForMinter(relic, operator); + uint256 relicId = _mintRelicNew(alice, ORDER_ID); + // mint and equip shards + shardIds = new uint256[](6); + amounts = new uint256[](6); + shardIds[0] = SHARD_1_ID; + shardIds[1] = SHARD_2_ID; + shardIds[2] = SHARD_3_ID; + shardIds[3] = SHARD_3_ID; + shardIds[4] = SHARD_4_ID; + shardIds[5] = SHARD_5_ID; + amounts[0] = amounts[1] = amounts[2] = amounts[3] = amounts[4] = amounts[5] = 20; + vm.startPrank(executor); + address[] memory minters = new address[](1); + minters[0] = operator; + shard.setNewMinterShards(minters); + _equipShards(relicId, alice, shardIds, amounts); + vm.startPrank(executor); + // blacklist 6 of each shard Id + amounts = new uint256[](3); + shardIds = new uint256[](3); + shardIds[0] = SHARD_1_ID; + shardIds[1] = SHARD_2_ID; + shardIds[2] = SHARD_3_ID; + amounts[0] = amounts[1] = amounts[2] = 6; + relic.setBlacklistedShards(alice, relicId, shardIds, amounts); + assertEq(relic.blacklistedRelicShards(relicId, shardIds[0]), 6); + assertEq(relic.blacklistedRelicShards(relicId, shardIds[1]), 6); + assertEq(relic.blacklistedRelicShards(relicId, shardIds[2]), 6); + assertEq(relic.blacklistedShardsCount(relicId), 18); + // blacklist 10 more of different shard Ids. Id 3 is repeating + shardIds = new uint256[](3); + shardIds[0] = SHARD_3_ID; + shardIds[1] = SHARD_4_ID; + shardIds[2] = SHARD_5_ID; + amounts[0] = amounts[1] = amounts[2] = 10; + relic.setBlacklistedShards(alice, relicId, shardIds, amounts); + assertEq(relic.blacklistedRelicShards(relicId, shardIds[0]), 16); + assertEq(relic.blacklistedRelicShards(relicId, shardIds[1]), 10); + assertEq(relic.blacklistedRelicShards(relicId, shardIds[2]), 10); + assertEq(relic.blacklistedShardsCount(relicId), 48); + } + + function test_unsetBlacklistedShards() public { + uint256[] memory shardIds = new uint256[](1); + uint256[] memory amounts = new uint256[](1); + shardIds[0] = SHARD_1_ID; + amounts[0] = 2; + // setup mint, equipping and blacklisting + { + vm.startPrank(operator); + shard.mintBatch(bob, shardIds, amounts); + vm.startPrank(bob); + shard.setApprovalForAll(address(relic), true); + relic.batchEquipShards(RELIC_1_ID, shardIds, amounts); + + vm.startPrank(executor); + relic.setBlacklistedShards(bob, RELIC_1_ID, shardIds, amounts); + } + + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAddress.selector)); + relic.unsetBlacklistedShards(address(0), RELIC_1_ID, shardIds, amounts); + + vm.expectRevert(abi.encodeWithSelector(IERC721A.URIQueryForNonexistentToken.selector)); + relic.unsetBlacklistedShards(bob, 100, shardIds, amounts); + + // invalid owner + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidParam.selector)); + relic.unsetBlacklistedShards(alice, RELIC_1_ID, shardIds, amounts); + + amounts[0] = 3; + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidParam.selector)); + relic.unsetBlacklistedShards(bob, RELIC_1_ID, shardIds, amounts); + + amounts[0] = 1; + vm.expectEmit(address(relic)); + emit ShardBlacklistUpdated(RELIC_1_ID, shardIds[0], amounts[0]); + relic.unsetBlacklistedShards(bob, RELIC_1_ID, shardIds, amounts); + + assertEq(relic.blacklistedAccounts(bob), true); + assertEq(relic.blacklistedShardsCount(shardIds[0]), 1); + assertEq(relic.blacklistedRelicShards(RELIC_1_ID, shardIds[0]), 1); + + vm.expectEmit(address(relic)); + emit ShardBlacklistUpdated(RELIC_1_ID, shardIds[0], amounts[0]); + relic.unsetBlacklistedShards(bob, RELIC_1_ID, shardIds, amounts); + + assertEq(relic.blacklistedAccounts(bob), false); + assertEq(relic.blacklistedShardsCount(RELIC_1_ID), 0); + assertEq(relic.blacklistedRelicShards(RELIC_1_ID, shardIds[0]), 0); + + // multiple and overlapping cases + _enableAllEnclavesForMinter(relic, operator); + uint256 relicId = _mintRelicNew(alice, ORDER_ID); + // mint and equip shards + shardIds = new uint256[](6); + amounts = new uint256[](6); + shardIds[0] = SHARD_1_ID; + shardIds[1] = SHARD_2_ID; + shardIds[2] = SHARD_3_ID; + shardIds[3] = SHARD_3_ID; + shardIds[4] = SHARD_4_ID; + shardIds[5] = SHARD_5_ID; + amounts[0] = amounts[1] = amounts[2] = amounts[3] = amounts[4] = amounts[5] = 20; + vm.startPrank(executor); + address[] memory minters = new address[](1); + minters[0] = operator; + shard.setNewMinterShards(minters); + _equipShards(relicId, alice, shardIds, amounts); + vm.startPrank(executor); + // blacklist all shards, all amounts + relic.setBlacklistedShards(alice, relicId, shardIds, amounts); + // unset some + amounts[0] = amounts[3] = 3; + amounts[1] = amounts[5] = 0; + amounts[2] = amounts[4] = 5; + relic.unsetBlacklistedShards(alice, relicId, shardIds, amounts); + assertEq(relic.blacklistedAccounts(alice), true); + assertEq(relic.blacklistedShardsCount(relicId), 104); + assertEq(relic.blacklistedRelicShards(relicId, shardIds[0]), 17); + assertEq(relic.blacklistedRelicShards(relicId, shardIds[1]), 20); + assertEq(relic.blacklistedRelicShards(relicId, shardIds[2]), relic.blacklistedRelicShards(relicId, shardIds[3])); + assertEq(relic.blacklistedRelicShards(relicId, shardIds[3]), 32); + assertEq(relic.blacklistedRelicShards(relicId, shardIds[4]), 15); + assertEq(relic.blacklistedRelicShards(relicId, shardIds[5]), 20); + amounts[0] = amounts[3] = 5; + amounts[1] = amounts[5] = 10; + amounts[2] = amounts[4] = 5; + relic.unsetBlacklistedShards(alice, relicId, shardIds, amounts); + assertEq(relic.blacklistedAccounts(alice), true); + assertEq(relic.blacklistedShardsCount(relicId), 64); + assertEq(relic.blacklistedRelicShards(relicId, shardIds[0]), 12); + assertEq(relic.blacklistedRelicShards(relicId, shardIds[1]), 10); + assertEq(relic.blacklistedRelicShards(relicId, shardIds[2]), 22); + assertEq(relic.blacklistedRelicShards(relicId, shardIds[3]), relic.blacklistedRelicShards(relicId, shardIds[2])); + assertEq(relic.blacklistedRelicShards(relicId, shardIds[4]), 10); + assertEq(relic.blacklistedRelicShards(relicId, shardIds[5]), 10); + amounts[0] = 12; + amounts[1] = 10; + amounts[2] = 22; + amounts[3] = 0; + amounts[4] = 10; + amounts[5] = 10; + relic.unsetBlacklistedShards(alice, relicId, shardIds, amounts); + assertEq(relic.blacklistedAccounts(alice), false); + assertEq(relic.blacklistedShardsCount(relicId), 0); + assertEq(relic.blacklistedRelicShards(relicId, shardIds[0]), 0); + assertEq(relic.blacklistedRelicShards(relicId, shardIds[1]), 0); + assertEq(relic.blacklistedRelicShards(relicId, shardIds[2]), 0); + assertEq(relic.blacklistedRelicShards(relicId, shardIds[3]), 0); + assertEq(relic.blacklistedRelicShards(relicId, shardIds[4]), 0); + assertEq(relic.blacklistedRelicShards(relicId, shardIds[5]), 0); + } + + function test_setRelicXP() public { + uint256[] memory relicIds = relic.relicsOfOwner(bob); + uint256 invalidRelicId = 999; + uint256 xp = 100; + vm.startPrank(executor); + vm.expectRevert(abi.encodeWithSelector(IRelic.InvalidRelic.selector, invalidRelicId)); + relic.setRelicXP(invalidRelicId, xp); + uint256 relicId = relicIds[0]; + IRelic.RelicInfoView memory relicInfoView = relic.getRelicInfo(relicId); + _setRarityThresholds(); + assertEq(uint8(relicInfoView.rarity), uint8(IRelic.Rarity.Common)); + + vm.expectEmit(address(relic)); + emit RelicXPSet(relicId, xp); + relic.setRelicXP(relicId, xp); + + relicInfoView = relic.getRelicInfo(relicId); + assertEq(relicInfoView.xp, xp); + assertEq(uint8(relicInfoView.rarity), uint8(IRelic.Rarity.Legendary)); + } +} + +contract RelicViewTest is RelicTestBase { + function test_baseURI() public { + vm.startPrank(executor); + _enableAllEnclavesForMinter(relic, operator); + string memory commonBaseUri = string.concat(BASE_URI, "common/"); + string memory uncommonBaseUri = string.concat(BASE_URI, "uncommon/"); + relic.setBaseUriRarity(IRelic.Rarity.Common, commonBaseUri); + relic.setBaseUriRarity(IRelic.Rarity.Uncommon, uncommonBaseUri); + + assertEq(relic.getRarityBaseUri(IRelic.Rarity.Common), commonBaseUri); + assertEq(relic.getRarityBaseUri(IRelic.Rarity.Uncommon), uncommonBaseUri); + + vm.startPrank(operator); + uint256 relicId = relic.nextTokenId(); + relic.mintRelic(alice, STRUCTURE_ID); + vm.startPrank(executor); + relic.setBaseUriRarity(commRarity, BASE_URI); + + vm.expectRevert(abi.encodeWithSelector(IERC721A.URIQueryForNonexistentToken.selector)); + relic.tokenURI(100); + + string memory expectedUri = string( + abi.encodePacked( + BASE_URI, + _toString(STRUCTURE_ID) + ) + ); + assertEq(expectedUri, relic.tokenURI(relicId)); + // another enclave + relicId = relic.nextTokenId(); + vm.startPrank(operator); + relic.mintRelic(alice, MYSTERY_ID); + vm.startPrank(executor); + relic.setBaseUriRarity(commRarity, BASE_URI); + expectedUri = string( + abi.encodePacked( + BASE_URI, + _toString(MYSTERY_ID) + ) + ); + assertEq(expectedUri, relic.tokenURI(relicId)); + } + + function test_getEquippedShards() public { + uint256 invalidRelic = 100; + uint256[] memory shardIds = new uint256[](2); + uint256[] memory amounts = new uint256[](2); + shardIds[0] = SHARD_1_ID; + shardIds[1] = SHARD_2_ID; + vm.expectRevert(abi.encodeWithSelector(IRelic.InvalidRelic.selector, invalidRelic)); + relic.getEquippedShards(invalidRelic, shardIds); + + uint256 relicId = relic.nextTokenId() - 1; + uint256[] memory balancesBefore = relic.getEquippedShards(relicId, shardIds); + assertEq(balancesBefore[0], 0); + assertEq(balancesBefore[1], 0); + + // mint new relic + vm.startPrank(operator); + relic.mintRelic(alice, CHAOS_ID); + relicId += 1; + + uint256[] memory mintShardIds = new uint256[](3); + uint256[] memory mintAmounts = new uint256[](3); + mintShardIds[0] = SHARD_1_ID; + mintShardIds[1] = SHARD_2_ID; + mintShardIds[2] = SHARD_3_ID; + mintAmounts[0] = 10; + mintAmounts[1] = 15; + mintAmounts[2] = 20; + shard.mintBatch(alice, mintShardIds, mintAmounts); + amounts[0] = amounts[1] = 5; + vm.startPrank(alice); + shard.setApprovalForAll(address(relic), true); + relic.batchEquipShards(relicId, shardIds, amounts); + + uint256[] memory balancesAfter = relic.getEquippedShards(relicId, shardIds); + assertEq(balancesAfter[0], 5); + assertEq(balancesAfter[1], 5); + // equip again same amounts + relic.batchEquipShards(relicId, shardIds, amounts); + balancesAfter = relic.getEquippedShards(relicId, shardIds); + assertEq(balancesAfter[0], 10); + assertEq(balancesAfter[1], 10); + } + + function test_getEquippedShardIds() public { + uint256[] memory relicIds = relic.relicsOfOwner(bob); + uint256 relicId = relicIds[relicIds.length-1]; + uint256[] memory shardIds = new uint256[](2); + uint256[] memory amounts = new uint256[](2); + bool[] memory allow = new bool[](2); + amounts[0] = amounts[1] = 4; + shardIds[0] = SHARD_1_ID; + shardIds[1] = SHARD_2_ID; + allow[0] = allow[1] = true; + + vm.startPrank(executor); + shard.setMinterAllowedShardIds(operator, shardIds, allow); + vm.startPrank(operator); + shard.mintBatch(bob, shardIds, amounts); + vm.startPrank(bob); + shard.setApprovalForAll(address(relic), true); + relic.batchEquipShards(RELIC_1_ID, shardIds, amounts); + + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidParam.selector)); + relic.getEquippedShardIds(100); + + uint256[] memory equipped = relic.getEquippedShards(relicId, shardIds); + uint256[] memory ids = relic.getEquippedShardIds(relicId); + assertEq(equipped[0], amounts[0]); + assertEq(equipped[1], amounts[1]); + assertEq(ids[0], shardIds[0]); + assertEq(ids[1], shardIds[1]); + } + + function test_getRelicInfo() public { + /// @dev see test_checkpointRelicRarity, test_setRelicXP, test_mintRelic, test_burnBlacklistedRelicShardsFunc + } + + function test_nextTokenId() public { + uint256 _nextTokenId = relic.nextTokenId(); + vm.startPrank(operator); + relic.mintRelic(alice, CHAOS_ID); + assertEq(relic.nextTokenId(), _nextTokenId+1); + } + + function test_totalMinted() public { + uint256 totalMinted = relic.totalMinted(); + vm.startPrank(executor); + _enableAllEnclavesForMinter(relic, operator); + vm.startPrank(operator); + relic.mintRelic(alice, CHAOS_ID); + assertEq(relic.totalMinted(), totalMinted+1); + relic.mintRelic(bob, STRUCTURE_ID); + assertEq(relic.totalMinted(), totalMinted+2); + } + + function test_relicsOfOwner() public { + uint256[] memory aliceRelics = relic.relicsOfOwner(alice); + uint256 _length = aliceRelics.length; + vm.startPrank(operator); + uint256 relicId1 = relic.nextTokenId(); + relic.mintRelic(alice, CHAOS_ID); + assertEq((relic.relicsOfOwner(alice)).length, _length+1); + uint256 relicId2 = relic.nextTokenId(); + relic.mintRelic(alice, MYSTERY_ID); + aliceRelics = relic.relicsOfOwner(alice); + assertEq((relic.relicsOfOwner(alice)).length, _length+2); + assertEq(aliceRelics[_length], relicId1); + assertEq(aliceRelics[_length+1], relicId2); + } + + function test_tokenURI() public { + /// @dev see test_baseURI + } + + function test_isRelicMinter() public { + assertEq(relic.isRelicMinter(alice, MYSTERY_ID), false); + vm.startPrank(executor); + uint256[] memory enclaveIds = new uint256[](2); + bool[] memory allow = new bool[](2); + enclaveIds[0] = MYSTERY_ID; + enclaveIds[1] = CHAOS_ID; + allow[0] = allow[1] = true; + relic.setRelicMinterEnclaveIds(alice, enclaveIds, allow); + assertEq(relic.isRelicMinter(alice, enclaveIds[0]), true); + assertEq(relic.isRelicMinter(alice, enclaveIds[1]), true); + allow[1] = false; + relic.setRelicMinterEnclaveIds(alice, enclaveIds, allow); + assertEq(relic.isRelicMinter(alice, enclaveIds[1]), false); + } +} + +contract RelicTest is RelicTestBase { + + function test_mintRelic() public { + vm.startPrank(alice); + vm.expectRevert(abi.encodeWithSelector(IRelic.CallerCannotMint.selector, alice)); + relic.mintRelic(bob, MYSTERY_ID); + + // blacklist account + uint256[] memory shardIds = new uint256[](2); + uint256[] memory amounts = new uint256[](2); + shardIds[0] = SHARD_1_ID; + shardIds[1] = SHARD_2_ID; + amounts[0] = 10; + amounts[1] = 20; + vm.startPrank(executor); + _enableAllEnclavesForMinter(relic, operator); + uint256 relicId = _blacklistAccount(true, true, 0, alice, shardIds, amounts); + + // zero address test + vm.startPrank(operator); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAddress.selector)); + relic.mintRelic(address(0), STRUCTURE_ID); + + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.AccountBlacklisted.selector, alice)); + relic.mintRelic(alice, CHAOS_ID); + + // reset blacklist + vm.startPrank(executor); + relic.unsetBlacklistedShards(alice, relicId, shardIds, amounts); + _blacklistAccount(false, false, relicId, alice, _emptyUintArray(0), _emptyUintArray(0)); + + // invalid enclave id + vm.startPrank(operator); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidParam.selector)); + relic.mintRelic(alice, 100); + + vm.startPrank(executor); + uint256[] memory enclaveIds = new uint256[](1); + bool[] memory allow = new bool[](1); + allow[0] = false; + enclaveIds[0] = MYSTERY_ID; + relic.setRelicMinterEnclaveIds(operator, enclaveIds, allow); + vm.startPrank(operator); + vm.expectRevert(abi.encodeWithSelector(IRelic.CallerCannotMint.selector, operator)); + relic.mintRelic(alice, MYSTERY_ID); + + uint256[] memory relicsBefore = relic.relicsOfOwner(alice); + uint256 nextTokenId = relic.nextTokenId(); + vm.expectEmit(address(relic)); + emit RelicMinted(alice, nextTokenId, CHAOS_ID); + relic.mintRelic(alice, CHAOS_ID); + + uint256[] memory relicsAfter = relic.relicsOfOwner(alice); + IRelic.RelicInfoView memory relicInfoView = relic.getRelicInfo(relicsAfter[0]); + assertEq(relic.balanceOf(alice), 2); + assertEq(relic.ownerOf(relicsAfter[0]), alice); + assertEq(relicsAfter.length, relicsBefore.length + 1); + assertEq(relicsAfter[0], nextTokenId-1); + assertEq(relicsAfter[1], nextTokenId); + assertEq(relic.totalMinted(), nextTokenId + 1); + assertEq(relicInfoView.enclaveId, CHAOS_ID); + assertEq(uint(relicInfoView.rarity), uint(IRelic.Rarity.Common)); + assertEq(relicInfoView.xp, 0); + } + + function test_shardApproval() public { + uint256[] memory shardIds = new uint256[](2); + uint256[] memory amounts = new uint256[](2); + shardIds[0] = SHARD_1_ID; + shardIds[1] = SHARD_2_ID; + amounts[0] = amounts[1] = 1; + vm.startPrank(operator); + shard.mintBatch(alice, shardIds, amounts); + uint256 relicId = _mintRelicNew(alice, MYSTERY_ID); + vm.startPrank(alice); + // vm.expectRevert(abi.encodeWithSignature("ERC1155MissingApprovalForAll(address,address)", address(relic), alice)); + vm.expectRevert("ERC1155: caller is not token owner or approved"); + relic.batchEquipShards(relicId, shardIds, amounts); + + shard.setApprovalForAll(address(relic), true); + relic.batchEquipShards(relicId, shardIds, amounts); + } + + function test_batchEquipShards() public { + uint256[] memory relicIds = relic.relicsOfOwner(bob); + uint256 relicId = relicIds[relicIds.length-1]; + uint256[] memory shardIds = new uint256[](2); + uint256[] memory amounts = new uint256[](2); + uint256 shard1BalanceBefore = shard.balanceOf(bob, SHARD_1_ID); + uint256 shard2BalanceBefore = shard.balanceOf(bob, SHARD_2_ID); + amounts[0] = amounts[1] = 5; + + vm.startPrank(alice); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); + relic.batchEquipShards(relicId, shardIds, amounts); + + // test blacklist + shardIds[0] = SHARD_1_ID; + shardIds[1] = SHARD_2_ID; + _blacklistAccount(true, false, RELIC_1_ID, bob, shardIds, amounts); + vm.startPrank(bob); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.AccountBlacklisted.selector, bob)); + relic.batchEquipShards(relicId, shardIds, amounts); + // reset blacklist + vm.startPrank(executor); + relic.unsetBlacklistedShards(bob, relicId, shardIds, amounts); + _blacklistAccount(false, false, RELIC_1_ID, bob, _emptyUintArray(0), _emptyUintArray(0)); + assertEq(relic.blacklistedAccounts(bob), false); + + // invalid param length + vm.startPrank(bob); + amounts = new uint256[](3); + amounts[0] = amounts[1] = amounts[2] = 5; + vm.expectRevert(abi.encodeWithSelector(IRelic.InvalidParamLength.selector)); + relic.batchEquipShards(relicId, shardIds, amounts); + + amounts = new uint256[](2); + amounts[0] = amounts[1] = 5; + shard.setApprovalForAll(address(relic), true); + relic.batchEquipShards(relicId, shardIds, amounts); + + assertEq(shard.balanceOf(bob, SHARD_1_ID), shard1BalanceBefore-amounts[0]); + assertEq(shard.balanceOf(bob, SHARD_2_ID), shard2BalanceBefore-amounts[1]); + } + + function test_batchUnequipShards() public { + uint256[] memory relicIds = relic.relicsOfOwner(bob); + uint256 relicId = relicIds[relicIds.length-1]; + uint256[] memory shardIds = new uint256[](2); + uint256[] memory amounts = new uint256[](2); + uint256 shard1BalanceBefore = shard.balanceOf(bob, SHARD_1_ID); + uint256 shard2BalanceBefore = shard.balanceOf(bob, SHARD_2_ID); + amounts[0] = amounts[1] = 5; + + vm.startPrank(alice); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); + relic.batchUnequipShards(relicId, shardIds, amounts); + + // test blacklist + { + shardIds[0] = SHARD_1_ID; + shardIds[1] = SHARD_2_ID; + _blacklistAccount(true, false, RELIC_1_ID, bob, shardIds, amounts); + vm.startPrank(bob); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.AccountBlacklisted.selector, bob)); + relic.batchUnequipShards(relicId, shardIds, amounts); + // reset blacklist + vm.startPrank(executor); + relic.unsetBlacklistedShards(bob, RELIC_1_ID, shardIds, amounts); + relic.setBlacklistAccount(bob, RELIC_1_ID, false); + assertEq(relic.blacklistedAccounts(bob), false); + } + // invalid param length + { + vm.startPrank(bob); + amounts = new uint256[](3); + amounts[0] = amounts[1] = amounts[2] = 5; + vm.expectRevert(abi.encodeWithSelector(IRelic.InvalidParamLength.selector)); + relic.batchUnequipShards(relicId, shardIds, amounts); + } + // insufficient shard balance + uint256[] memory equippedAmount1; + uint256[] memory equippedAmount2; + uint256 amount = 5; + amounts = new uint256[](2); + shard.setApprovalForAll(address(relic), true); + uint256[] memory amountsOne = new uint256[](1); + uint256[] memory shardsOne = new uint256[](1); + { + // relic.equipShard(relicId, SHARD_1_ID, amount); + amountsOne[0] = 5; + shardsOne[0] = SHARD_1_ID; + relic.batchEquipShards(relicId, shardsOne, amountsOne); + equippedAmount1 = relic.getEquippedShards(relicId, shardsOne); + assertEq(equippedAmount1[0], amount + 5); + + shardsOne[0] = SHARD_2_ID; + relic.batchEquipShards(relicId, shardsOne, amountsOne); + equippedAmount2 = relic.getEquippedShards(relicId, shardsOne); + assertEq(equippedAmount2[0], amount + 5); + amounts[0] = 5; + amounts[1] = equippedAmount2[0] + 1; + vm.expectRevert(abi.encodeWithSelector(IRelic.InsufficientShardBalance.selector, equippedAmount2[0], amounts[1])); + relic.batchUnequipShards(relicId, shardIds, amounts); + } + amounts[1] = equippedAmount2[0]; + // shards are already equipped in relicId + shard1BalanceBefore = shard.balanceOf(bob, SHARD_1_ID); + shard2BalanceBefore = shard.balanceOf(bob, SHARD_2_ID); + + vm.expectEmit(); + emit ShardsUnequipped(bob, relicId, shardIds, amounts); + relic.batchUnequipShards(relicId, shardIds, amounts); + + assertEq(shard.balanceOf(bob, SHARD_1_ID), shard1BalanceBefore + amounts[0]); + assertEq(shard.balanceOf(bob, SHARD_2_ID), shard2BalanceBefore + amounts[1]); + + } + + function test_relicRecoverToken() public { + uint256 amount = 100 ether; + deal(address(dai), address(relic), amount, true); + + vm.startPrank(executor); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAddress.selector)); + relic.recoverToken(address(dai), address(0), amount); + + vm.expectEmit(); + emit CommonEventsAndErrors.TokenRecovered(alice, address(dai), amount); + relic.recoverToken(address(dai), alice, amount); + assertEq(dai.balanceOf(alice), amount); + assertEq(dai.balanceOf(address(relic)), 0); + } + + // burning adds no incentive per supply/demand + function test_burnBlacklistedRelicShardsFunc() public { + vm.startPrank(executor); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAddress.selector)); + relic.setBlacklistAccount(address(0), RELIC_1_ID, true); + + vm.expectRevert(abi.encodeWithSelector(IERC721A.URIQueryForNonexistentToken.selector)); + relic.setBlacklistAccount(bob, 100, true); + + // invalid owner + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidParam.selector)); + relic.setBlacklistAccount(alice, RELIC_1_ID, true); + + uint256[] memory shardIds = new uint256[](2); + uint256[] memory amounts = new uint256[](1); + + // zero shard Ids + vm.expectRevert(abi.encodeWithSelector(IRelic.InvalidParamLength.selector)); + relic.burnBlacklistedRelicShards(bob, RELIC_1_ID, shardIds, amounts); + + shardIds[0] = SHARD_1_ID; + shardIds[1] = SHARD_2_ID; + amounts[0] = 1; + // unequal lengths + vm.expectRevert(abi.encodeWithSelector(IRelic.InvalidParamLength.selector)); + relic.burnBlacklistedRelicShards(bob, RELIC_1_ID, shardIds, amounts); + + // equip shards and blacklist an account + amounts = new uint256[](2); + amounts[0] = 2; + amounts[1] = 3; + uint256 relicId = _blacklistAccount(true, true, 0, alice, shardIds, amounts); + uint256[] memory equipped = relic.getEquippedShards(relicId, shardIds); + assertEq(equipped[0], amounts[0]); + assertEq(equipped[1], amounts[1]); + // invalid owner. bob is owner of relic Id 0 + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidParam.selector)); + relic.burnBlacklistedRelicShards(bob, relicId, shardIds, amounts); + + uint256 relicShard1AmountBefore = shard.balanceOf(address(relic), shardIds[0]); + uint256 relicShard2AmountBefore = shard.balanceOf(address(relic), shardIds[1]); + uint256 relicShard3AmountBefore = shard.balanceOf(address(relic), SHARD_3_ID); + assertEq(relic.blacklistedAccounts(alice), true); + assertEq(relic.blacklistedRelicShards(relicId, shardIds[0]), amounts[0]); + assertEq(relic.blacklistedRelicShards(relicId, shardIds[1]), amounts[1]); + assertEq(relic.blacklistedShardsCount(relicId), amounts[0] + amounts[1]); + + vm.startPrank(executor); + relic.burnBlacklistedRelicShards(alice, relicId, shardIds, amounts); + assertEq(relic.blacklistedAccounts(alice), false); + assertEq(relic.blacklistedRelicShards(relicId, shardIds[0]), 0); + assertEq(relic.blacklistedRelicShards(relicId, shardIds[1]), 0); + equipped = relic.getEquippedShards(relicId, shardIds); + assertEq(equipped[0], 0); + assertEq(equipped[1], 0); + assertEq(shard.balanceOf(address(relic), shardIds[0]), relicShard1AmountBefore - amounts[0]); + assertEq(shard.balanceOf(address(relic), shardIds[1]), relicShard2AmountBefore - amounts[1]); + assertEq(shard.balanceOf(address(relic), SHARD_3_ID), relicShard3AmountBefore); + assertEq(relic.blacklistedShardsCount(relicId), 0); + IRelic.RelicInfoView memory relicInfoView = relic.getRelicInfo(relicId); + assertEq(relicInfoView.shards.length, 0); + } + + function test_beforeTokenTransfersBlacklisted() public { + // blacklist account + uint256[] memory shardIds = new uint256[](2); + uint256[] memory amounts = new uint256[](2); + shardIds[0] = SHARD_2_ID; + shardIds[1] = SHARD_2_ID; + amounts[0] = 10; + amounts[1] = 20; + vm.startPrank(executor); + _enableAllEnclavesForMinter(relic, operator); + vm.startPrank(operator); + relic.mintRelic(alice, STRUCTURE_ID); + relic.mintRelic(alice, CHAOS_ID); + uint256[] memory aliceRelics = relic.relicsOfOwner(alice); + uint256[] memory bobRelics = relic.relicsOfOwner(bob); + // mint new relic for alice, equip shards and blacklist + uint256 aliceRelicId = _blacklistAccount(true, true, 0, alice, shardIds, amounts); + + // sending from and to alice should fail + vm.startPrank(alice); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.AccountBlacklisted.selector, alice)); + relic.safeTransferFrom(alice, bob, aliceRelics[1]); + vm.startPrank(bob); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.AccountBlacklisted.selector, alice)); + relic.safeTransferFrom(bob, alice, bobRelics[0]); + + + // check new owner + vm.startPrank(executor); + relic.unsetBlacklistedShards(alice, aliceRelicId, shardIds, amounts); + _blacklistAccount(false, false, aliceRelicId, alice, _emptyUintArray(0), _emptyUintArray(0)); + vm.startPrank(bob); + relic.safeTransferFrom(bob, alice, bobRelics[0]); + assertEq(relic.ownerOf(bobRelics[0]), alice); + } + + function test_checkpointRelicRarity() public { + vm.startPrank(executor); + vm.expectRevert(abi.encodeWithSelector(IRelic.InvalidRelic.selector, 100)); + relic.checkpointRelicRarity(100); + uint256 relicId = relic.nextTokenId() - 1; + relic.checkpointRelicRarity(relicId); + IRelic.RelicInfoView memory relicInfoView = relic.getRelicInfo(relicId); + assertEq(relicInfoView.xp, 0); + _setRarityThresholds(); + relic.setRelicXP(relicId, 10); + relic.checkpointRelicRarity(relicId); + relicInfoView = relic.getRelicInfo(relicId); + assertEq(relicInfoView.xp, 10); + assertEq(uint8(relicInfoView.rarity), uint8(IRelic.Rarity.Uncommon)); + relic.setRelicXP(relicId, 31); + // no checkpoint + assertEq(uint8(relicInfoView.rarity), uint8(IRelic.Rarity.Uncommon)); + relic.checkpointRelicRarity(relicId); + relicInfoView = relic.getRelicInfo(relicId); + assertEq(uint8(relicInfoView.rarity), uint8(IRelic.Rarity.Rare)); + relic.setRelicXP(relicId, 78); + // no checkpoint + relicInfoView = relic.getRelicInfo(relicId); + assertEq(uint8(relicInfoView.rarity), uint8(IRelic.Rarity.Epic)); + relic.setRelicXP(relicId, 101); + relicInfoView = relic.getRelicInfo(relicId); + assertEq(uint8(relicInfoView.rarity), uint8(IRelic.Rarity.Legendary)); + } + + function test_supportsInterface() public { + assertEq(relic.supportsInterface(0x01ffc9a7), true); // ERC165 interface ID for ERC165. + assertEq(relic.supportsInterface(0x80ac58cd), true); // ERC165 interface ID for ERC721. + assertEq(relic.supportsInterface(0x5b5e139f), true); // ERC165 interface ID for ERC721Metadata. + + assertEq(relic.supportsInterface(0x5b5d128e), false); + } +} \ No newline at end of file diff --git a/protocol/test/forge/nexus/Shard.t.sol b/protocol/test/forge/nexus/Shard.t.sol new file mode 100644 index 000000000..272fe85fe --- /dev/null +++ b/protocol/test/forge/nexus/Shard.t.sol @@ -0,0 +1,720 @@ +pragma solidity 0.8.19; +// SPDX-License-Identifier: AGPL-3.0-or-later +// Temple (tests/forge/nexus/Shard.t.sol) + + +import { NexusTestBase } from "./Nexus.t.sol"; +import { Relic } from "../../../contracts/nexus/Relic.sol"; +import { Shard } from "../../../contracts/nexus/Shard.sol"; +import { IShard } from "../../../contracts/interfaces/nexus/IShard.sol"; +import { NexusCommon } from "../../../contracts/nexus/NexusCommon.sol"; +import { CommonEventsAndErrors } from "../../../contracts/common/CommonEventsAndErrors.sol"; + + +contract ShardTestBase is NexusTestBase { + Relic public relic; + Shard public shard; + NexusCommon public nexusCommon; + + enum Rarity { + Common, + Uncommon, + Rare, + Epic, + Legendary, + InvalidRarity + } + + struct Recipe { + uint256[] inputShardIds; + uint256[] inputShardAmounts; + uint256[] outputShardIds; + uint256[] outputShardAmounts; + } + + event Transmuted(address indexed caller, uint256 recipeId); + event ShardMinted(); + event ShardUriSet(uint256 indexed shardId, string uri); + event RecipeSet(uint256 recipeId, Shard.Recipe recipe); + event RecipeDeleted(uint256 recipeId); + event PartnerAllowedShardIdSet(address partner, uint256 shardId, bool allow); + event TransferSingle(address operator, address from, address to, uint256 id, uint256 value); + event ShardEnclaveSet(uint256 enclaveId, uint256 shardId); + event RegularShardIdSet(uint256 shardId, bool allow); + event MinterAllowedShardIdSet(address indexed minter, uint256 indexed shardId, bool allow); + event MinterAllowedShardCapSet(address indexed minter, uint256 indexed shardId, uint256 cap); + event ShardIdSet(uint256 shardId, bool allow); + event NexusCommonSet(address nexusCommon); + + function setUp() public { + nexusCommon = new NexusCommon(executor); + relic = new Relic(NAME, SYMBOL, address(nexusCommon), executor); + shard = new Shard(address(relic), address(nexusCommon), executor, "http://example.com"); + + vm.startPrank(executor); + { + nexusCommon.setEnclaveName(MYSTERY_ID, MYSTERY); + nexusCommon.setEnclaveName(CHAOS_ID, CHAOS); + nexusCommon.setEnclaveName(LOGIC_ID, LOGIC); + nexusCommon.setEnclaveName(STRUCTURE_ID, STRUCTURE); + nexusCommon.setEnclaveName(ORDER_ID, ORDER); + } + // relic setup + { + _enableAllEnclavesForMinter(relic, operator); + relic.setShard(address(shard)); + vm.startPrank(operator); + relic.mintRelic(bob, LOGIC_ID); + relic.mintRelic(bob, MYSTERY_ID); + } + // shard setup + { + vm.startPrank(executor); + address[] memory minters = new address[](4); + minters[0] = minters[1] = minters[2] = minters[3] = operator; + shard.setNewMinterShards(minters); + uint256[] memory shardIds = new uint256[](1); + bool[] memory allow = new bool[](1); + shardIds[0] = SHARD_1_ID; + allow[0] = true; + shard.setMinterAllowedShardIds(bob, shardIds, allow); + shard.setShardUri(SHARD_1_ID, SHARD_1_URI); + shard.setShardUri(SHARD_2_ID, SHARD_2_URI); + shard.setShardUri(SHARD_3_ID, SHARD_3_URI); + shard.setShardUri(SHARD_4_ID, SHARD_4_URI); + + vm.startPrank(operator); + shardIds = new uint256[](2); + uint256[] memory amounts = new uint256[](2); + shardIds[0] = SHARD_1_ID; + shardIds[1] = SHARD_2_ID; + amounts[0] = 5; + amounts[1] = 10; + shard.mintBatch(bob, shardIds, amounts); + } + vm.stopPrank(); + } + + function _setRecipe1() internal { + Shard.Recipe memory recipe = _getRecipe1(); + vm.startPrank(executor); + shard.addRecipe(recipe); + } + + function _getRecipe1() internal pure returns (Shard.Recipe memory recipe) { + uint256[] memory inputShardIds = new uint256[](2); + inputShardIds[0] = SHARD_1_ID; + inputShardIds[1] = SHARD_2_ID; + uint256[] memory inputShardAmounts = new uint256[](2); + inputShardAmounts[0] = 2; + inputShardAmounts[1] = 1; + uint256[] memory outputShardIds = new uint256[](1); + outputShardIds[0] = SHARD_3_ID; + uint256[] memory outputShardAmounts = new uint256[](1); + outputShardAmounts[0] = 1; + + recipe.inputShardIds = inputShardIds; + recipe.inputShardAmounts = inputShardAmounts; + recipe.outputShardIds = outputShardIds; + recipe.outputShardAmounts = outputShardAmounts; + } + + function _getInvalidRecipe() internal pure returns (Shard.Recipe memory recipe) { + uint256[] memory inputShardIds = new uint256[](1); + recipe.inputShardIds = inputShardIds; + } + + function _unsetMinterShards(address minter) internal { + uint256[] memory shardIds = new uint256[](4); + bool[] memory allow = new bool[](4); + allow[0] = allow[1] = allow[2] = allow[3] = false; + shardIds[0] = SHARD_1_ID; + shardIds[1] = SHARD_2_ID; + shardIds[2] = SHARD_2_ID; + shardIds[3] = SHARD_3_ID; + shard.setMinterAllowedShardIds(minter, shardIds, allow); + } +} + +contract ShardTestView is ShardTestBase { + function test_initialization() public { + assertEq(address(shard.relic()), address(relic)); + assertEq(shard.executor(), executor); + assertEq(shard.uri(SHARD_1_ID), SHARD_1_URI); + assertEq(shard.uri(SHARD_2_ID), SHARD_2_URI); + assertEq(shard.uri(SHARD_3_ID), SHARD_3_URI); + assertEq(shard.uri(SHARD_4_ID), SHARD_4_URI); + assertEq(shard.nextTokenId(), 5); + assertEq(shard.nextRecipeId(), 1); + } + + function test_nextTokenId() public { + uint256 currentId = shard.nextTokenId() - 1; + vm.startPrank(executor); + address[] memory minters = new address[](1); + minters[0] = alice; + shard.setNewMinterShards(minters); + assertEq(shard.nextTokenId(), currentId + 2); + shard.setNewMinterShards(minters); + assertEq(shard.nextTokenId(), currentId + 3); + } + + function test_getMinterAllowedShardIds() public { + vm.startPrank(executor); + _unsetMinterShards(bob); + uint256[] memory shards = shard.getMinterAllowedShardIds(bob); + assertEq(shards.length, 0); + + uint256[] memory shardIds = new uint256[](1); + bool[] memory allow = new bool[](1); + allow[0] = true; + shardIds[0] = SHARD_1_ID; + shard.setMinterAllowedShardIds(bob, shardIds, allow); + shards = shard.getMinterAllowedShardIds(bob); + assertEq(shards.length, 1); + assertEq(shards[0], SHARD_1_ID); + shardIds = new uint256[](1); + shardIds[0] = SHARD_3_ID; + shard.setMinterAllowedShardIds(bob, shardIds, allow); + shards = shard.getMinterAllowedShardIds(bob); + assertEq(shards.length, 2); + // no remove operation yet on UintSet, so safe index access + assertEq(shards[0], SHARD_1_ID); + assertEq(shards[1], SHARD_3_ID); + } + + function test_getMintInfo() public { + vm.startPrank(executor); + uint256[] memory shards = new uint256[](2); + bool[] memory allow = new bool[](2); + shards[0] = SHARD_4_ID; + shards[1] = SHARD_2_ID; + allow[0] = allow[1] = true; + shard.setMinterAllowedShardIds(alice, shards, allow); + vm.startPrank(alice); + Shard.MintInfo[] memory mintInfo = shard.getMintInfo(alice); + + assertEq(mintInfo.length, 2); + uint256 shard1BalanceBefore = mintInfo[0].balance; + uint256 shard1CapBefore = mintInfo[0].cap; + uint256 shard2BalanceBefore = mintInfo[1].balance; + uint256 shard2CapBefore = mintInfo[1].cap; + + uint256[] memory amounts = new uint256[](2); + amounts[0] = 5; + amounts[1] = 10; + shard.mintBatch(bob, shards, amounts); + + mintInfo = shard.getMintInfo(alice); + assertEq(mintInfo.length, 2); + assertEq(mintInfo[0].balance, shard1BalanceBefore+5); + assertEq(mintInfo[1].balance, shard2BalanceBefore+10); + assertEq(mintInfo[0].cap, shard1CapBefore); + assertEq(mintInfo[1].cap, shard2CapBefore); + + vm.startPrank(executor); + uint256[] memory caps = new uint256[](2); + caps[0] = 1_000; + caps[1] = 10_000; + shard.setAllowedShardCaps(alice, shards, caps); + vm.startPrank(alice); + shard.mintBatch(bob, shards, amounts); + mintInfo = shard.getMintInfo(alice); + assertEq(mintInfo[0].balance, shard1BalanceBefore+10); + assertEq(mintInfo[1].balance, shard2BalanceBefore+20); + assertEq(mintInfo[0].cap, 1_000); + assertEq(mintInfo[1].cap, 10_000); + } + + function test_getRecipeInfo() public { + _setRecipe1(); + Shard.Recipe memory info = shard.getRecipeInfo(1); + assertEq(info.inputShardAmounts[0], 2); + assertEq(info.inputShardAmounts[1], 1); + assertEq(info.inputShardIds[0], SHARD_1_ID); + assertEq(info.inputShardIds[1], SHARD_2_ID); + assertEq(info.outputShardAmounts[0], 1); + assertEq(info.outputShardIds[0], SHARD_3_ID); + } + + function test_isShardId() public { + vm.startPrank(executor); + address[] memory minters = new address[](1); + minters[0] = operator; + uint256[] memory shards = shard.setNewMinterShards(minters); + assertEq(shard.isShardId(shards[0]), true); + assertEq(shard.isShardId(shards[0]+1), false); + + minters = new address[](2); + minters[0] = minters[1] = operator; + shards = shard.setNewMinterShards(minters); + assertEq(shard.isShardId(shards[0]), true); + assertEq(shard.isShardId(shards[1]), true); + assertEq(shard.isShardId(shards[1]+1), false); + assertEq(shard.nextTokenId(), shards[1] + 1); + } +} + + +contract ShardTestAccess is ShardTestBase { + + function test_access_setNexusCommonFail(address caller) public { + /// use fuzzing + vm.assume(caller != executor && caller != rescuer); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); + vm.startPrank(caller); + relic.setNexusCommon(address(nexusCommon)); + } + + function test_access_setNexusCommonSuccess() public { + vm.startPrank(executor); + relic.setNexusCommon(address(nexusCommon)); + } + + function test_access_setShardCapsFail(address caller) public { + uint256[] memory caps = new uint256[](2); + uint256[] memory shardIds = new uint256[](2); + caps[0] = caps[1] = 9999; + shardIds[0] = SHARD_1_ID; + shardIds[1] = SHARD_2_ID; + vm.assume(caller != executor && caller != rescuer); + vm.startPrank(caller); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); + shard.setAllowedShardCaps(alice, shardIds, caps); + } + + function test_access_addRecipeFail(address caller) public { + Shard.Recipe memory recipe = _getRecipe1(); + vm.assume(caller != executor && caller != rescuer); + vm.startPrank(caller); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); + shard.addRecipe(recipe); + } + + function test_access_deleteRecipeFail(address caller) public { + vm.assume(caller != executor && caller != rescuer); + vm.startPrank(caller); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); + shard.deleteRecipe(RECIPE_1_ID); + } + + function test_access_setShardUriFail(address caller) public { + vm.assume(caller != executor && caller != rescuer); + vm.startPrank(caller); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); + shard.setShardUri(SHARD_1_ID, SHARD_1_URI); + } + + function test_access_setMinterAllowedShardIdsFail(address caller) public { + vm.assume(caller != executor && caller != rescuer); + vm.startPrank(caller); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); + uint256[] memory shardIds = new uint256[](1); + bool[] memory allow = new bool[](1); + shardIds[0] = SHARD_1_ID; + allow[0] = true; + shard.setMinterAllowedShardIds(alice, shardIds, allow); + } + + function test_access_setNewMinterShardsFail(address caller) public { + vm.assume(caller != executor && caller != rescuer); + address[] memory minters = new address[](2); + minters[0] = bob; + minters[1] = alice; + vm.startPrank(caller); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); + shard.setNewMinterShards(minters); + } + + function test_access_setNewMinterShardsSuccess() public { + address[] memory minters = new address[](2); + minters[0] = bob; + minters[1] = alice; + vm.startPrank(executor); + shard.setNewMinterShards(minters); + } + + function test_access_setMinterAllowedShardIdsSuccess() public { + vm.startPrank(executor); + uint256[] memory shardIds = new uint256[](1); + bool[] memory allows = new bool[](1); + shardIds[0] = SHARD_1_ID; + allows[0] = true; + shard.setMinterAllowedShardIds(alice, shardIds, allows); + } + + function test_access_setShardCapsSuccess() public { + uint256[] memory caps = new uint256[](2); + uint256[] memory shardIds = new uint256[](2); + caps[0] = caps[1] = 9999; + shardIds[0] = SHARD_1_ID; + shardIds[1] = SHARD_2_ID; + vm.startPrank(executor); + shard.setAllowedShardCaps(operator, shardIds, caps); + } + + function test_access_addRecipeSuccess() public { + Shard.Recipe memory recipe = _getRecipe1(); + vm.startPrank(executor); + shard.addRecipe(recipe); + } + + function test_access_deleteRecipeSuccess() public { + Shard.Recipe memory recipe = _getRecipe1(); + vm.startPrank(executor); + shard.addRecipe(recipe); + shard.deleteRecipe(RECIPE_1_ID); + } + + function test_access_setShardUriSuccess() public { + vm.startPrank(executor); + shard.setShardUri(SHARD_1_ID, SHARD_1_URI); + } +} + +contract ShardTest is ShardTestBase { + + function test_setNexusCommon() public { + vm.startPrank(executor); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAddress.selector)); + shard.setNexusCommon(address(0)); + + vm.expectEmit(address(shard)); + emit NexusCommonSet(address(nexusCommon)); + shard.setNexusCommon(address(nexusCommon)); + } + + function test_setMinterAllowedShardIds() public { + vm.startPrank(executor); + _unsetMinterShards(operator); + uint256[] memory shardIds = new uint256[](3); + bool[] memory allows = new bool[](1); + // invalid length + vm.expectRevert(abi.encodeWithSelector(IShard.InvalidParamLength.selector)); + shard.setMinterAllowedShardIds(alice, shardIds, allows); + // zero address + allows = new bool[](3); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAddress.selector)); + shard.setMinterAllowedShardIds(address(0), shardIds, allows); + + // cannot mint + shardIds[0] = 100; // invalid + shardIds[1] = SHARD_3_ID; + shardIds[2] = SHARD_4_ID; + allows = new bool[](3); + allows[0] = allows[1] = allows[2] = true; + + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidParam.selector)); + shard.setMinterAllowedShardIds(alice, shardIds, allows); + + shardIds[0] = SHARD_2_ID; + vm.expectEmit(address(shard)); + emit MinterAllowedShardIdSet(alice, shardIds[0], allows[0]); + vm.expectEmit(address(shard)); + emit MinterAllowedShardIdSet(alice, shardIds[1], allows[1]); + vm.expectEmit(address(shard)); + emit MinterAllowedShardIdSet(alice, shardIds[2], allows[2]); + shard.setMinterAllowedShardIds(alice, shardIds, allows); + + uint256[] memory shards = shard.getMinterAllowedShardIds(alice); + assertEq(shards.length, 3); + assertEq(shards[0], SHARD_2_ID); + assertEq(shards[1], SHARD_3_ID); + assertEq(shards[2], SHARD_4_ID); + allows[1] = false; + shard.setMinterAllowedShardIds(alice, shardIds, allows); + shards = shard.getMinterAllowedShardIds(alice); + assertEq(shards.length, 2); + assertEq(shards[0], SHARD_2_ID); + assertEq(shards[1], SHARD_4_ID); + } + + function test_setNewMinterShards() public { + vm.startPrank(executor); + address[] memory minters = new address[](0); + vm.expectRevert(abi.encodeWithSelector(IShard.InvalidParamLength.selector)); + shard.setNewMinterShards(minters); + minters = new address[](2); + minters[0] = bob; + minters[1] = alice; + uint256 nextId = shard.nextTokenId(); + vm.expectEmit(address(shard)); + emit MinterAllowedShardIdSet(bob, nextId, true); + vm.expectEmit(address(shard)); + emit MinterAllowedShardIdSet(alice, nextId+1, true); + shard.setNewMinterShards(minters); + assertEq(shard.nextTokenId(), nextId+2); + assertEq(shard.isShardId(nextId), true); + assertEq(shard.isShardId(nextId+1), true); + assertEq(shard.isShardId(nextId+2), false); + uint256[] memory bobShards = shard.getMinterAllowedShardIds(bob); + uint256[] memory aliceShards = shard.getMinterAllowedShardIds(alice); + assertEq(bobShards[bobShards.length-1], nextId); + assertEq(aliceShards[aliceShards.length-1], nextId+1); + } + + function test_setShardCaps() public { + uint256[] memory caps = new uint256[](2); + uint256[] memory shardIds = new uint256[](2); + caps[0] = 9999; + caps[1] = 7777; + shardIds[0] = SHARD_1_ID; + shardIds[1] = SHARD_2_ID; + + vm.startPrank(executor); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAddress.selector)); + shard.setAllowedShardCaps(address(0), shardIds, caps); + + shardIds = new uint256[](3); + shardIds[0] = SHARD_1_ID; + shardIds[1] = SHARD_2_ID; + shardIds[2] = SHARD_3_ID; + vm.expectRevert(abi.encodeWithSelector(IShard.InvalidParamLength.selector)); + shard.setAllowedShardCaps(alice, shardIds, caps); + + shardIds = new uint256[](2); + shardIds[0] = SHARD_1_ID; + shardIds[1] = SHARD_2_ID; + // alice is not an allowed minter + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAddress.selector)); + shard.setAllowedShardCaps(alice, shardIds, caps); + vm.expectEmit(address(shard)); + emit MinterAllowedShardCapSet(operator, SHARD_1_ID, caps[0]); + vm.expectEmit(address(shard)); + emit MinterAllowedShardCapSet(operator, SHARD_2_ID, caps[1]); + shard.setAllowedShardCaps(operator, shardIds, caps); + assertEq(shard.allowedShardCaps(operator, shardIds[0]), caps[0]); + assertEq(shard.allowedShardCaps(operator, shardIds[1]), caps[1]); + } + + function test_addRecipe() public { + vm.startPrank(executor); + uint256 recipeId = RECIPE_1_ID; + Shard.Recipe memory recipe; + uint256[] memory inputShardIds = new uint256[](1); + inputShardIds[0] = SHARD_1_ID; + uint256[] memory inputShardAmounts = new uint256[](2); + inputShardAmounts[0] = 2; + inputShardAmounts[1] = 1; + recipe.inputShardAmounts = inputShardAmounts; + recipe.inputShardIds = inputShardIds; + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidParam.selector)); + shard.addRecipe(recipe); + inputShardIds = new uint256[](2); + inputShardIds[0] = SHARD_1_ID; + inputShardIds[1] = SHARD_2_ID; + recipe.inputShardIds = inputShardIds; + + uint256[] memory outputShardIds = new uint256[](1); + outputShardIds[0] = SHARD_3_ID; + uint256[] memory outputShardAmounts = new uint256[](2); + outputShardAmounts[0] = 1; + outputShardAmounts[1] = 2; + recipe.outputShardIds = outputShardIds; + recipe.outputShardAmounts = outputShardAmounts; + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidParam.selector)); + shard.addRecipe(recipe); + + outputShardAmounts = new uint256[](1); + outputShardAmounts[0] = 1; + recipe.outputShardAmounts = outputShardAmounts; + vm.expectEmit(address(shard)); + emit RecipeSet(recipeId, recipe); + shard.addRecipe(recipe); + Shard.Recipe memory _recipe = shard.getRecipeInfo(recipeId); + assertEq(_recipe.inputShardIds, recipe.inputShardIds); + assertEq(_recipe.inputShardAmounts, recipe.inputShardAmounts); + assertEq(_recipe.outputShardIds, recipe.outputShardIds); + assertEq(_recipe.outputShardAmounts, recipe.outputShardAmounts); + } + + function test_deleteRecipe() public { + vm.startPrank(executor); + uint256 recipeId = RECIPE_1_ID; + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidParam.selector)); + shard.deleteRecipe(recipeId); + + Shard.Recipe memory recipe = _getRecipe1(); + shard.addRecipe(recipe); + Shard.Recipe memory _recipe = shard.getRecipeInfo(recipeId); + assertEq(_recipe.inputShardIds, recipe.inputShardIds); + assertEq(_recipe.inputShardAmounts, recipe.inputShardAmounts); + assertEq(_recipe.outputShardIds, recipe.outputShardIds); + assertEq(_recipe.outputShardAmounts, recipe.outputShardAmounts); + + vm.expectEmit(address(shard)); + emit RecipeDeleted(recipeId); + shard.deleteRecipe(recipeId); + _recipe = shard.getRecipeInfo(recipeId); + uint256[] memory empty; + assertEq(_recipe.inputShardIds, empty); + assertEq(_recipe.inputShardAmounts, empty); + assertEq(_recipe.outputShardIds, empty); + assertEq(_recipe.outputShardAmounts, empty); + } + + function test_setShardUri() public { + vm.startPrank(executor); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidParam.selector)); + shard.setShardUri(SHARD_1_ID, ""); + + vm.expectEmit(address(shard)); + emit ShardUriSet(SHARD_1_ID, SHARD_1_URI); + shard.setShardUri(SHARD_1_ID, SHARD_1_URI); + assertEq(shard.uri(SHARD_1_ID), SHARD_1_URI); + shard.setShardUri(SHARD_2_ID, SHARD_2_URI); + assertEq(shard.uri(SHARD_2_ID), SHARD_2_URI); + } + + function test_transmute() public { + _setRecipe1(); + vm.startPrank(bob); + vm.expectRevert(abi.encodeWithSelector(IShard.InvalidRecipe.selector, RECIPE_2_ID)); + shard.transmute(RECIPE_2_ID); + + vm.startPrank(operator); + uint256[] memory shards = new uint256[](2); + uint256[] memory amounts = new uint256[](2); + shards[0] = SHARD_1_ID; + shards[1] = SHARD_2_ID; + amounts[0] = amounts[1] = 5; + shard.mintBatch(bob, shards, amounts); + + vm.startPrank(bob); + shard.setApprovalForAll(address(shard), true); + uint256 shard1BalanceBefore = shard.balanceOf(bob, SHARD_1_ID); + uint256 shard2BalanceBefore = shard.balanceOf(bob, SHARD_2_ID); + uint256 shard3BalanceBefore = shard.balanceOf(bob, SHARD_3_ID); + + vm.expectEmit(address(shard)); + emit Transmuted(bob, RECIPE_1_ID); + shard.transmute(RECIPE_1_ID); + assertEq(shard.balanceOf(bob, SHARD_1_ID), shard1BalanceBefore-2); + assertEq(shard.balanceOf(bob, SHARD_2_ID), shard2BalanceBefore-1); + assertEq(shard.balanceOf(bob, SHARD_3_ID), shard3BalanceBefore+1); + } + + function test_mintBatch() public { + uint256[] memory amounts = new uint256[](2); + uint256[] memory shardIds = new uint256[](2); + uint256[] memory caps = new uint256[](2); + + // blacklisting + { + vm.startPrank(operator); + uint256 relicId = relic.nextTokenId(); + relic.mintRelic(alice, CHAOS_ID); + vm.startPrank(executor); + relic.setBlacklistAccount(alice, relicId, true); + vm.startPrank(operator); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.AccountBlacklisted.selector, alice)); + shard.mintBatch(alice, shardIds, amounts); + vm.startPrank(executor); + relic.setBlacklistAccount(alice, relicId, false); + } + // param length + { + vm.startPrank(operator); + shardIds = new uint256[](1); + vm.expectRevert(abi.encodeWithSelector(IShard.InvalidParamLength.selector)); + shard.mintBatch(alice, shardIds, amounts); + } + shardIds = new uint256[](2); + shardIds[0] = SHARD_2_ID; + shardIds[1] = SHARD_3_ID; + amounts[0] = 2; + amounts[1] = 1; + vm.startPrank(executor); + address[] memory minters = new address[](1); + minters[0] = alice; + uint256[] memory newShardIds = shard.setNewMinterShards(minters); + // cannot mint + { + // shard id not set + shardIds[0] = newShardIds[0]; + vm.startPrank(operator); + vm.expectRevert(abi.encodeWithSelector(IShard.CannotMint.selector, shardIds[0])); + shard.mintBatch(alice, shardIds, amounts); + + } + // reset + vm.startPrank(executor); + bool[] memory allow = new bool[](2); + allow[0] = allow[1] = true; + shard.setMinterAllowedShardIds(operator, shardIds, allow); + // mint cap exceeded + { + caps[0] = caps[1] = 1; + shard.setAllowedShardCaps(operator, shardIds, caps); + vm.startPrank(operator); + vm.expectRevert(abi.encodeWithSelector(IShard.MintCapExceeded.selector, 1, 2)); + shard.mintBatch(alice, shardIds, amounts); + } + vm.startPrank(executor); + caps[0] = caps[1] = 100; + shard.setAllowedShardCaps(operator, shardIds, caps); + vm.startPrank(operator); + uint256 aliceShard2BalanceBefore = shard.balanceOf(alice, newShardIds[0]); + uint256 aliceShard3BalanceBefore = shard.balanceOf(alice, SHARD_3_ID); + uint256 shard2MintBalanceBefore = shard.mintBalances(operator, newShardIds[0]); + uint256 shard3MintBalanceBefore = shard.mintBalances(operator, SHARD_3_ID); + uint256 totalShard2MintsBefore = shard.totalShardMints(newShardIds[0]); + uint256 totalShard3MintsBefore = shard.totalShardMints(SHARD_3_ID); + shard.mintBatch(alice, shardIds, amounts); + assertEq(shard.balanceOf(alice, newShardIds[0]), aliceShard2BalanceBefore + 2); + assertEq(shard.balanceOf(alice, SHARD_3_ID), aliceShard3BalanceBefore + 1); + assertEq(shard.totalShardMints(newShardIds[0]), totalShard2MintsBefore + 2); + assertEq(shard.totalShardMints(SHARD_3_ID), totalShard3MintsBefore + 1); + assertEq(shard.mintBalances(operator, newShardIds[0]), shard2MintBalanceBefore + 2); + assertEq(shard.mintBalances(operator, SHARD_3_ID), shard3MintBalanceBefore + 1); + } + + function test_burnBatch() public { + // shard owners can burn shards + uint256[] memory amounts = new uint256[](2); + uint256[] memory shardIds = new uint256[](2); + amounts[0] = amounts[1] = 1; + shardIds[0] = SHARD_1_ID; + shardIds[1] = SHARD_2_ID; + uint256 bobShard1BalanceBefore = shard.balanceOf(bob, SHARD_1_ID); + uint256 bobShard2BalanceBefore = shard.balanceOf(bob, SHARD_2_ID); + vm.startPrank(alice); + vm.expectRevert(abi.encodeWithSelector(IShard.ERC1155MissingApprovalForAll.selector, alice, bob)); + shard.burnBatch(bob, shardIds, amounts); + vm.startPrank(bob); + shard.burn(bob, SHARD_1_ID, 1); + shard.burnBatch(bob, shardIds, amounts); + assertEq(shard.balanceOf(bob, SHARD_1_ID), bobShard1BalanceBefore-1-amounts[0]); + assertEq(shard.balanceOf(bob, SHARD_2_ID), bobShard2BalanceBefore-amounts[1]); + + // relic can only burn blacklisted account shards which are equipped + shard.setApprovalForAll(address(relic), true); + relic.batchEquipShards(RELIC_1_ID, shardIds, amounts); + uint256 relicShard1BalanceBefore = shard.balanceOf(address(relic), shardIds[0]); + uint256 relicShard2BalanceBefore = shard.balanceOf(address(relic), shardIds[1]); + vm.startPrank(executor); + relic.setBlacklistAccount(bob, RELIC_1_ID, true); + relic.setBlacklistedShards(bob, RELIC_1_ID, shardIds, amounts); + relic.burnBlacklistedRelicShards(bob, RELIC_1_ID, shardIds, amounts); + assertEq(shard.balanceOf(address(relic), shardIds[0]), relicShard1BalanceBefore-amounts[0]); + assertEq(shard.balanceOf(address(relic), shardIds[1]), relicShard2BalanceBefore-amounts[1]); + + // test burn by owner and approved + vm.startPrank(operator); + shardIds = new uint256[](1); + amounts = new uint256[](1); + amounts[0] = 2; + shardIds[0] = SHARD_2_ID; + shard.mintBatch(alice, shardIds, amounts); + // set approval for bob + vm.startPrank(alice); + shard.setApprovalForAll(bob, true); + uint256[] memory burnAmount = new uint256[](1); + burnAmount[0] = 1; + shard.burnBatch(alice, shardIds, burnAmount); + assertEq(shard.balanceOf(alice, shardIds[0]), 1); + vm.startPrank(bob); + shard.burnBatch(alice, shardIds, burnAmount); + assertEq(shard.balanceOf(alice, shardIds[0]), 0); + } +} \ No newline at end of file diff --git a/protocol/test/forge/nexus/TempleSacrifice.t.sol b/protocol/test/forge/nexus/TempleSacrifice.t.sol new file mode 100644 index 000000000..3000ab4bd --- /dev/null +++ b/protocol/test/forge/nexus/TempleSacrifice.t.sol @@ -0,0 +1,162 @@ +pragma solidity 0.8.19; +// SPDX-License-Identifier: AGPL-3.0-or-later +// Temple (tests/forge/nexus/TempleSacrifice.t.sol) + +import { NexusTestBase } from "./Nexus.t.sol"; +import { Relic } from "../../../contracts/nexus/Relic.sol"; +import { Shard } from "../../../contracts/nexus/Shard.sol"; +import { NexusCommon } from "../../../contracts/nexus/NexusCommon.sol"; +import { TempleSacrifice } from "../../../contracts/nexus/TempleSacrifice.sol"; +import { TempleERC20Token } from "../../../contracts/core/TempleERC20Token.sol"; +import { CommonEventsAndErrors } from "../../../contracts/common/CommonEventsAndErrors.sol"; +import { ISacrifice } from "../../../contracts/interfaces/nexus/IBaseSacrifice.sol"; + + +contract TempleSacrificeTestBase is NexusTestBase { + + Relic public relic; + Shard public shard; + NexusCommon public nexusCommon; + TempleSacrifice public templeSacrifice; + TempleERC20Token public sacrificeToken; + + uint256 internal constant MINIMUM_CUSTOM_PRICE = 30 ether; + uint256 internal constant ONE_ETHER = 1 ether; + uint256 internal constant PRICE_MAX_PERIOD = 365 days; + + event OriginTimeSet(uint64 originTime); + event CustomPriceSet(uint256 price); + event TokenSacrificed(address indexed fromAccount, address indexed token, uint256 amount); + event PriceParamsSet(TempleSacrifice.PriceParam params); + event TokenRecipientSet(address recipient); + + function setUp() public { + nexusCommon = new NexusCommon(executor); + relic = new Relic(NAME, SYMBOL, address(nexusCommon), executor); + shard = new Shard(address(relic), address(nexusCommon), executor, BASE_URI); + vm.startPrank(executor); + nexusCommon.setEnclaveName(CHAOS_ID, "CHAOS"); + sacrificeToken = new TempleERC20Token(); + sacrificeToken.addMinter(bob); + sacrificeToken.addMinter(alice); + templeSacrifice = new TempleSacrifice(address(relic), address(sacrificeToken), bob, executor); + uint256[] memory enclaveIds = new uint256[](5); + bool[] memory allow = new bool[](5); + enclaveIds[0] = MYSTERY_ID; + enclaveIds[1] = CHAOS_ID; + enclaveIds[2] = STRUCTURE_ID; + enclaveIds[3] = LOGIC_ID; + enclaveIds[4] = ORDER_ID; + allow[0] = allow[1] = allow[2] = allow[3] = allow[4] = true; + relic.setRelicMinterEnclaveIds(address(templeSacrifice), enclaveIds, allow); + vm.stopPrank(); + } + + function _mintTemple(address to, uint256 amount) internal { + sacrificeToken.mint(to, amount); + } + + function _getPriceParams() internal pure returns (TempleSacrifice.PriceParam memory params) { + params.minimumPrice = uint128(MINIMUM_CUSTOM_PRICE); + params.maximumPrice = uint128(200 * ONE_ETHER); + params.priceMaxPeriod = 365 days; + } +} + +contract TempleSacrificeAccessTest is TempleSacrificeTestBase { + function test_initialization() public { + assertEq(address(templeSacrifice.sacrificeToken()), address(sacrificeToken)); + assertEq(address(templeSacrifice.relic()), address(relic)); + assertEq(address(templeSacrifice.executor()), executor); + assertEq(templeSacrifice.sacrificedTokenRecipient(), bob); + assertEq(relic.isRelicMinter(address(templeSacrifice), MYSTERY_ID), true); + assertEq(relic.isRelicMinter(address(templeSacrifice), LOGIC_ID), true); + assertEq(relic.isRelicMinter(address(templeSacrifice), CHAOS_ID), true); + assertEq(relic.isRelicMinter(address(templeSacrifice), STRUCTURE_ID), true); + assertEq(relic.isRelicMinter(address(templeSacrifice), ORDER_ID), true); + } + + function test_access_setSacrificedTokenRecipientFail(address caller) public { + vm.assume(caller != executor); + vm.startPrank(caller); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); + templeSacrifice.setSacrificedTokenRecipient(alice); + } + + function test_access_setSacrificedTokenRecipientSuccess() public { + vm.startPrank(executor); + templeSacrifice.setSacrificedTokenRecipient(alice); + } +} + +contract TempleSacrificeTest is TempleSacrificeTestBase { + event RelicMinted(address indexed to, uint256 relicId, uint256 enclaveId); + + function _calculatePrice( + TempleSacrifice.PriceParam memory params + ) private view returns (uint256 price) { + uint256 timeDifference = block.timestamp - templeSacrifice.originTime(); + price = (timeDifference * params.maximumPrice / params.priceMaxPeriod) + params.minimumPrice; + if (price > params.maximumPrice) { + price = params.maximumPrice; + } + } + + function test_setSacrificedTokenRecipient() public { + vm.startPrank(executor); + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidParam.selector)); + templeSacrifice.setSacrificedTokenRecipient(address(0)); + vm.expectEmit(address(templeSacrifice)); + emit TokenRecipientSet(bob); + templeSacrifice.setSacrificedTokenRecipient(bob); + assertEq(templeSacrifice.sacrificedTokenRecipient(), bob); + } + + function test_sacrifice() public { + vm.startPrank(executor); + uint64 originTime = uint64(block.timestamp + 100); + templeSacrifice.setOriginTime(originTime); + address to = alice; + + vm.expectRevert(abi.encodeWithSelector(ISacrifice.FutureOriginTime.selector, originTime)); + templeSacrifice.sacrifice(CHAOS_ID, to); + + vm.warp(originTime - 1); + vm.expectRevert(abi.encodeWithSelector(ISacrifice.FutureOriginTime.selector, originTime)); + templeSacrifice.sacrifice(CHAOS_ID, to); + + vm.warp(originTime + 1); + TempleSacrifice.PriceParam memory params = _getPriceParams(); + templeSacrifice.setPriceParams(params); + + // address(0) + vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAddress.selector)); + templeSacrifice.sacrifice(CHAOS_ID, address(0)); + + // ERC20: insufficient allowance + vm.expectRevert("ERC20: insufficient allowance"); + templeSacrifice.sacrifice(CHAOS_ID, to); + vm.startPrank(bob); + _mintTemple(alice, 1_000 ether); + vm.startPrank(executor); + templeSacrifice.setSacrificedTokenRecipient(bob); + vm.startPrank(alice); + sacrificeToken.approve(address(templeSacrifice), 1_000 ether); + uint256 aliceTempleBalanceBefore = sacrificeToken.balanceOf(alice); + uint256 recipientBalanceBefore = sacrificeToken.balanceOf(bob); + + uint256 relicId = relic.nextTokenId(); + vm.warp(originTime); + uint256 price = templeSacrifice.getPrice(); + vm.expectEmit(address(relic)); + emit RelicMinted(to, relicId, CHAOS_ID); + vm.expectEmit(address(templeSacrifice)); + emit TokenSacrificed(alice, address(sacrificeToken), price); + uint256 actualRelicId = templeSacrifice.sacrifice(CHAOS_ID, to); + assertEq(actualRelicId, relicId); + assertEq(price, _calculatePrice(params)); + assertEq(sacrificeToken.balanceOf(alice), aliceTempleBalanceBefore - price); + assertEq(sacrificeToken.balanceOf(bob), recipientBalanceBefore + price); + assertEq(relic.ownerOf(relicId), to); + } +} \ No newline at end of file diff --git a/protocol/test/forge/v2/access/TempleElevatedAccess.t.sol b/protocol/test/forge/v2/access/TempleElevatedAccess.t.sol index 78cf5e700..dfd726a71 100644 --- a/protocol/test/forge/v2/access/TempleElevatedAccess.t.sol +++ b/protocol/test/forge/v2/access/TempleElevatedAccess.t.sol @@ -167,7 +167,7 @@ contract TempleElevatedAccessTestSetters is TempleElevatedAccessTestBase { emit NewRescuerProposed(rescuer, address(0), alice); mock.proposeNewRescuer(alice); - changePrank(alice); + vm.startPrank(alice); vm.expectEmit(address(mock)); emit NewRescuerAccepted(rescuer, alice); mock.acceptRescuer(); @@ -181,7 +181,7 @@ contract TempleElevatedAccessTestSetters is TempleElevatedAccessTestBase { emit NewRescuerProposed(rescuer, address(0), executor); mock.proposeNewRescuer(executor); - changePrank(executor); + vm.startPrank(executor); vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAddress.selector)); mock.acceptRescuer(); } @@ -196,7 +196,7 @@ contract TempleElevatedAccessTestSetters is TempleElevatedAccessTestBase { emit NewExecutorProposed(executor, address(0), alice); mock.proposeNewExecutor(alice); - changePrank(alice); + vm.startPrank(alice); vm.expectEmit(address(mock)); emit NewExecutorAccepted(executor, alice); mock.acceptExecutor(); @@ -210,7 +210,7 @@ contract TempleElevatedAccessTestSetters is TempleElevatedAccessTestBase { emit NewExecutorProposed(executor, address(0), rescuer); mock.proposeNewExecutor(rescuer); - changePrank(rescuer); + vm.startPrank(rescuer); vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAddress.selector)); mock.acceptExecutor(); } @@ -242,14 +242,14 @@ contract TempleElevatedAccessTestSetters is TempleElevatedAccessTestBase { vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); mock.wycpnbqcyf(); - changePrank(executor); + vm.startPrank(executor); bytes4 fnSig = bytes4(keccak256("wycpnbqcyf()")); vm.expectEmit(address(mock)); emit ExplicitAccessSet(alice, fnSig, true); setExplicitAccess(mock, alice, fnSig, true); // Now succeeds - changePrank(alice); + vm.startPrank(alice); mock.wycpnbqcyf(); } @@ -284,14 +284,14 @@ contract TempleElevatedAccessTestModifiers is TempleElevatedAccessTestBase { vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); mock.validateOnlyInRescueMode(); - changePrank(executor); + vm.startPrank(executor); vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); mock.validateOnlyInRescueMode(); } // No access for rescuer until they first set rescue mode. { - changePrank(rescuer); + vm.startPrank(rescuer); vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); mock.validateOnlyInRescueMode(); @@ -301,11 +301,11 @@ contract TempleElevatedAccessTestModifiers is TempleElevatedAccessTestBase { // Still no access for alice or executor { - changePrank(alice); + vm.startPrank(alice); vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); mock.validateOnlyInRescueMode(); - changePrank(executor); + vm.startPrank(executor); vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); mock.validateOnlyInRescueMode(); } @@ -319,17 +319,17 @@ contract TempleElevatedAccessTestModifiers is TempleElevatedAccessTestBase { vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); mock.validateOnlyElevatedAccess(); - changePrank(rescuer); + vm.startPrank(rescuer); vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); mock.validateOnlyElevatedAccess(); // The executor has access - changePrank(executor); + vm.startPrank(executor); mock.validateOnlyElevatedAccess(); // Set alice to now have explicit access too setExplicitAccess(mock, alice, Mock.validateOnlyElevatedAccess.selector, true); - changePrank(alice); + vm.startPrank(alice); mock.validateOnlyElevatedAccess(); } @@ -339,21 +339,21 @@ contract TempleElevatedAccessTestModifiers is TempleElevatedAccessTestBase { mock.setRescueMode(true); assertEq(mock.inRescueMode(), true); - changePrank(alice); + vm.startPrank(alice); vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); mock.validateOnlyElevatedAccess(); - changePrank(executor); + vm.startPrank(executor); vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); mock.validateOnlyElevatedAccess(); // The rescuer has access - changePrank(rescuer); + vm.startPrank(rescuer); mock.validateOnlyElevatedAccess(); // Set alice to now have explicit access too -- but still no access setExplicitAccess(mock, alice, Mock.validateOnlyElevatedAccess.selector, true); - changePrank(alice); + vm.startPrank(alice); vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); mock.validateOnlyElevatedAccess(); } @@ -369,24 +369,24 @@ contract TempleElevatedAccessTestModifiers is TempleElevatedAccessTestBase { vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); mock.checkSig(); - changePrank(executor); + vm.startPrank(executor); setExplicitAccess(mock, alice, Mock.checkSig.selector, true); - changePrank(alice); + vm.startPrank(alice); mock.checkSig(); } // When using `this.`, have to set it to the thing which calls that external function // ie the mock contract calling validateOnlyElevatedAccess() { - changePrank(alice); + vm.startPrank(alice); vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); mock.checkSigThis(); - changePrank(executor); + vm.startPrank(executor); setExplicitAccess(mock, address(mock), Mock.validateOnlyElevatedAccess.selector, true); - changePrank(alice); + vm.startPrank(alice); mock.checkSigThis(); } } diff --git a/protocol/test/forge/v2/safeGuards/ThresholdSafeGuard.t.sol b/protocol/test/forge/v2/safeGuards/ThresholdSafeGuard.t.sol index 640b1a8c9..b4df90aa6 100644 --- a/protocol/test/forge/v2/safeGuards/ThresholdSafeGuard.t.sol +++ b/protocol/test/forge/v2/safeGuards/ThresholdSafeGuard.t.sol @@ -462,7 +462,7 @@ contract ThresholdSafeGuardTestAccess is ThresholdSafeGuardTestBase { guard.setDisableGuardChecks(true); // Still not for the executor - changePrank(executor); + vm.startPrank(executor); vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); guard.setDisableGuardChecks(true); @@ -877,7 +877,7 @@ contract ThresholdSafeGuardTest is ThresholdSafeGuardTestBase { // Not enough signers - disabled, so passes { - changePrank(rescuer); + vm.startPrank(rescuer); guard.setRescueMode(true); guard.setDisableGuardChecks(true); @@ -892,7 +892,7 @@ contract ThresholdSafeGuardTest is ThresholdSafeGuardTestBase { // Re-enabled -- Not enough signers again { - changePrank(rescuer); + vm.startPrank(rescuer); guard.setDisableGuardChecks(false); guard.setRescueMode(false); @@ -922,7 +922,7 @@ contract ThresholdSafeGuardExecuteTest is ThresholdSafeGuardTestBase { function test_checkSafeExecute_withOverrideTresholdSet_ethTransfer() public { _setup(); - changePrank(executor); + vm.startPrank(executor); guard.setEthTransferThreshold(address(mock), 3); assertEq(address(mock).balance, 1e18); @@ -970,7 +970,7 @@ contract ThresholdSafeGuardExecuteTest is ThresholdSafeGuardTestBase { function test_checkSafeExecute_withOverrideTresholdSet_function() public { _setup(); - changePrank(executor); + vm.startPrank(executor); bytes4 fnSelector = mock.doThing2Args_Selector(); guard.setFunctionThreshold(address(mock), fnSelector, 3); @@ -1020,7 +1020,7 @@ contract ThresholdSafeGuardExecuteTest is ThresholdSafeGuardTestBase { function test_checkSafeExecute_withOverrideTresholdSet_withContractSig() public { _setup(); - changePrank(executor); + vm.startPrank(executor); bytes4 fnSelector = mock.doThing2Args_Selector(); guard.setFunctionThreshold(address(mock), fnSelector, 3); diff --git a/protocol/test/forge/v2/strategies/AbstractStrategy.t.sol b/protocol/test/forge/v2/strategies/AbstractStrategy.t.sol index 480045dc4..6b6dcfae4 100644 --- a/protocol/test/forge/v2/strategies/AbstractStrategy.t.sol +++ b/protocol/test/forge/v2/strategies/AbstractStrategy.t.sol @@ -137,7 +137,7 @@ contract AbstractStrategyTestAdmin is AbstractStrategyTestBase { dai.approve(address(strategy), 25); dai.mint(alice, 25); - changePrank(executor); + vm.startPrank(executor); dUSD.mint(address(strategy), 60); bytes memory params = abi.encode(2, 10, alice); diff --git a/protocol/test/forge/v2/strategies/DsrBaseStrategy.t.sol b/protocol/test/forge/v2/strategies/DsrBaseStrategy.t.sol index ed6984cbd..6e772b992 100644 --- a/protocol/test/forge/v2/strategies/DsrBaseStrategy.t.sol +++ b/protocol/test/forge/v2/strategies/DsrBaseStrategy.t.sol @@ -263,7 +263,7 @@ contract DsrBaseStrategyTestBorrowAndRepay is DsrBaseStrategyTestBase { trv.setStrategyDebtCeiling(address(strategy), dai, borrowAmount); deal(address(dai), address(trv), 100e18, true); - changePrank(executor); + vm.startPrank(executor); strategy.borrowAndDeposit(borrowAmount); ITempleStrategy.AssetBalance[] memory assetBalances1 = strategy.latestAssetBalances(); @@ -294,7 +294,7 @@ contract DsrBaseStrategyTestBorrowAndRepay is DsrBaseStrategyTestBase { trv.setStrategyDebtCeiling(address(strategy), dai, borrowAmount); deal(address(dai), address(trv), 100e18, true); - changePrank(executor); + vm.startPrank(executor); strategy.borrowAndDeposit(borrowAmount); // Move forward and check the increase. @@ -316,7 +316,7 @@ contract DsrBaseStrategyTestBorrowAndRepay is DsrBaseStrategyTestBase { // Executor initiates the shutdown. { - changePrank(executor); + vm.startPrank(executor); trv.setStrategyIsShuttingDown(address(strategy), true); (,, bool isShuttingDown,) = trv.strategies(address(strategy)); assertTrue(isShuttingDown); @@ -331,7 +331,7 @@ contract DsrBaseStrategyTestBorrowAndRepay is DsrBaseStrategyTestBase { // Do the shutdown { - changePrank(executor); + vm.startPrank(executor); vm.expectEmit(address(strategy)); emit DaiWithdrawn(borrowAmount-1); @@ -435,7 +435,7 @@ contract DsrBaseStrategyTestTrvWithdraw is DsrBaseStrategyTestBase { vm.startPrank(executor); strategy.borrowAndDeposit(borrowAmount); - changePrank(address(trv)); + vm.startPrank(address(trv)); vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.ExpectedNonZero.selector)); strategy.trvWithdraw(0); @@ -463,7 +463,7 @@ contract DsrBaseStrategyTestTrvWithdraw is DsrBaseStrategyTestBase { // Do a direct TRV withdraw, pranking the TRV. // Calling trvWithdraw directly doesn't burn the dUSD (this is done in the 'complex' test) - changePrank(address(trv)); + vm.startPrank(address(trv)); vm.expectEmit(address(strategy)); emit DaiWithdrawn(borrowAmount - 1); // DSR Rounding uint256 withdrawn = strategy.trvWithdraw(withdrawAmount); diff --git a/protocol/test/forge/v2/strategies/DsrBaseStrategyTestnet.t.sol b/protocol/test/forge/v2/strategies/DsrBaseStrategyTestnet.t.sol index bf8a1266f..04e942a2e 100644 --- a/protocol/test/forge/v2/strategies/DsrBaseStrategyTestnet.t.sol +++ b/protocol/test/forge/v2/strategies/DsrBaseStrategyTestnet.t.sol @@ -250,7 +250,7 @@ contract DsrBaseStrategyTestnetTestBorrowAndRepay is DsrBaseStrategyTestnetTestB trv.setStrategyDebtCeiling(address(strategy), dai, borrowAmount); deal(address(dai), address(trv), 100e18, true); - changePrank(executor); + vm.startPrank(executor); strategy.borrowAndDeposit(borrowAmount); ITempleStrategy.AssetBalance[] memory assetBalances1 = strategy.latestAssetBalances(); @@ -281,7 +281,7 @@ contract DsrBaseStrategyTestnetTestBorrowAndRepay is DsrBaseStrategyTestnetTestB trv.setStrategyDebtCeiling(address(strategy), dai, borrowAmount); deal(address(dai), address(trv), 100e18, true); - changePrank(executor); + vm.startPrank(executor); strategy.borrowAndDeposit(borrowAmount); // Move forward and check the increase. @@ -303,7 +303,7 @@ contract DsrBaseStrategyTestnetTestBorrowAndRepay is DsrBaseStrategyTestnetTestB // Executor initiates the shutdown. { - changePrank(executor); + vm.startPrank(executor); trv.setStrategyIsShuttingDown(address(strategy), true); (,, bool isShuttingDown,) = trv.strategies(address(strategy)); assertTrue(isShuttingDown); @@ -318,7 +318,7 @@ contract DsrBaseStrategyTestnetTestBorrowAndRepay is DsrBaseStrategyTestnetTestB // Do the shutdown { - changePrank(executor); + vm.startPrank(executor); vm.expectEmit(address(strategy)); emit DaiWithdrawn(borrowAmount); @@ -420,7 +420,7 @@ contract DsrBaseStrategyTestnetTestTrvWithdraw is DsrBaseStrategyTestnetTestBase vm.startPrank(executor); strategy.borrowAndDeposit(borrowAmount); - changePrank(address(trv)); + vm.startPrank(address(trv)); vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.ExpectedNonZero.selector)); strategy.trvWithdraw(0); @@ -448,7 +448,7 @@ contract DsrBaseStrategyTestnetTestTrvWithdraw is DsrBaseStrategyTestnetTestBase // Do a direct TRV withdraw, pranking the TRV. // Calling trvWithdraw directly doesn't burn the dUSD (this is done in the 'complex' test) - changePrank(address(trv)); + vm.startPrank(address(trv)); vm.expectEmit(address(strategy)); emit DaiWithdrawn(borrowAmount); uint256 withdrawn = strategy.trvWithdraw(withdrawAmount); diff --git a/protocol/test/forge/v2/strategies/GnosisStrategy.t.sol b/protocol/test/forge/v2/strategies/GnosisStrategy.t.sol index 75419dc89..1ad8f6b09 100644 --- a/protocol/test/forge/v2/strategies/GnosisStrategy.t.sol +++ b/protocol/test/forge/v2/strategies/GnosisStrategy.t.sol @@ -372,9 +372,9 @@ contract GnosisStrategyTestBorrowAndRepay is GnosisStrategyTestBase { strategy.repay(dai, repayAmount); // The safe needs to send dai to the strategy before repaying. - changePrank(gnosisSafeWallet); + vm.startPrank(gnosisSafeWallet); dai.transfer(address(strategy), repayAmount); - changePrank(executor); + vm.startPrank(executor); vm.expectEmit(); emit Repay(address(dai), repayAmount); @@ -407,9 +407,9 @@ contract GnosisStrategyTestBorrowAndRepay is GnosisStrategyTestBase { strategy.borrow(dai, borrowAmount); // The safe needs to send dai to the strategy before repaying. - changePrank(gnosisSafeWallet); + vm.startPrank(gnosisSafeWallet); dai.transfer(address(strategy), borrowAmount); - changePrank(executor); + vm.startPrank(executor); vm.expectEmit(); emit Repay(address(dai), borrowAmount); diff --git a/protocol/test/forge/v2/strategies/RamosStrategy.t.sol b/protocol/test/forge/v2/strategies/RamosStrategy.t.sol index aa1f08ad3..eb6bb8d2b 100644 --- a/protocol/test/forge/v2/strategies/RamosStrategy.t.sol +++ b/protocol/test/forge/v2/strategies/RamosStrategy.t.sol @@ -115,7 +115,7 @@ contract RamosStrategyTestBase is TempleTest { IAuraBaseRewardPool(auraRewardsToken).withdrawAllAndUnwrap(false); uint256 bptBalance = bptToken.balanceOf(MAINNET_AURA_STAKING); bptToken.transfer(address(ramos), bptBalance); - changePrank(executor); + vm.startPrank(executor); ramos.depositAndStakeBptTokens(bptBalance, true); } @@ -136,7 +136,7 @@ contract RamosStrategyTestBase is TempleTest { temple.addMinter(address(templeBaseStrategy)); } - changePrank(executor); + vm.startPrank(executor); dUSD.addMinter(executor); dUSD.addMinter(address(trv)); dTEMPLE.addMinter(address(trv)); @@ -452,7 +452,7 @@ contract RamosStrategyTestVaultFunctions is RamosStrategyTestBase { test_borrowProtocolToken(); // repay protocol(temple) ramos -> trv - changePrank(address(ramos)); + vm.startPrank(address(ramos)); vm.expectEmit(address(strategy)); emit RepayToken(address(temple), AMOUNT_BORROW_REPAY); @@ -474,7 +474,7 @@ contract RamosStrategyTestVaultFunctions is RamosStrategyTestBase { test_borrowQuoteToken(); // repay quote(dai/dUSD) ramos -> trv - changePrank(address(ramos)); + vm.startPrank(address(ramos)); vm.expectEmit(address(strategy)); emit RepayToken(address(dai), AMOUNT_BORROW_REPAY); diff --git a/protocol/test/forge/v2/strategies/TempleTokenBaseStrategy.t.sol b/protocol/test/forge/v2/strategies/TempleTokenBaseStrategy.t.sol index bd50d33f5..d35240691 100644 --- a/protocol/test/forge/v2/strategies/TempleTokenBaseStrategy.t.sol +++ b/protocol/test/forge/v2/strategies/TempleTokenBaseStrategy.t.sol @@ -218,7 +218,7 @@ contract TempleTokenBaseStrategyTrvWithdraw is TempleTokenBaseStrategyTestBase { vm.startPrank(executor); strategy.borrowAndDeposit(borrowAmount); - changePrank(address(trv)); + vm.startPrank(address(trv)); vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.ExpectedNonZero.selector)); strategy.trvWithdraw(0); @@ -246,7 +246,7 @@ contract TempleTokenBaseStrategyTrvWithdraw is TempleTokenBaseStrategyTestBase { // Do a direct TRV withdraw, pranking the TRV. // Calling trvWithdraw directly doesn't burn the dUSD (this is done in the 'complex' test) - changePrank(address(trv)); + vm.startPrank(address(trv)); vm.expectEmit(address(strategy)); emit TempleMinted(withdrawAmount); // Not limited by how much was deposited uint256 withdrawn = strategy.trvWithdraw(withdrawAmount); diff --git a/protocol/test/forge/v2/templeDebtToken/TempleDebtToken.BaseAndDebtorInterest.t.sol b/protocol/test/forge/v2/templeDebtToken/TempleDebtToken.BaseAndDebtorInterest.t.sol index e5c909d1f..9d6884a9e 100644 --- a/protocol/test/forge/v2/templeDebtToken/TempleDebtToken.BaseAndDebtorInterest.t.sol +++ b/protocol/test/forge/v2/templeDebtToken/TempleDebtToken.BaseAndDebtorInterest.t.sol @@ -394,7 +394,7 @@ contract TempleDebtTokenTestBaseAndDebtorInterest is TempleDebtTokenTestBase { checkDebtor(alice, aliceInterestRate, amount, aliceExpected.baseShares, 0, startBlockTs, aliceExpected.balanceOf); checkDebtor(bob, bobInterestRate, amount, bobExpected.baseShares, 0, startBlockTs + 1 days, bobExpected.balanceOf-1); // balanceOf rounded down - changePrank(executor); + vm.startPrank(executor); uint96 updatedRate = 0.1e18; dUSD.setRiskPremiumInterestRate(alice, updatedRate); @@ -481,7 +481,7 @@ contract TempleDebtTokenTestBaseAndDebtorInterest is TempleDebtTokenTestBase { checkDebtor(alice, aliceInterestRate, amount, aliceExpected.baseShares, 0, startBlockTs, aliceExpected.balanceOf); checkDebtor(bob, bobInterestRate, amount, bobExpected.baseShares, 0, startBlockTs + 1 days, bobExpected.balanceOf-1); // balanceOf rounded down - changePrank(executor); + vm.startPrank(executor); uint96 updatedRate = 0; dUSD.setRiskPremiumInterestRate(alice, updatedRate); @@ -543,7 +543,7 @@ contract TempleDebtTokenTestBaseAndDebtorInterest is TempleDebtTokenTestBase { dUSD.mint(bob, amount); vm.warp(block.timestamp + 364 days); - changePrank(executor); + vm.startPrank(executor); dUSD.setRiskPremiumInterestRate(alice, 0.1e18); vm.warp(block.timestamp + 365 days); @@ -558,7 +558,7 @@ contract TempleDebtTokenTestBaseAndDebtorInterest is TempleDebtTokenTestBase { amount ); - changePrank(executor); + vm.startPrank(executor); dUSD.burnAll(alice); checkBaseInterest(DEFAULT_BASE_INTEREST, bobExpectedShares-1, compoundedBobBase-1, block.timestamp, compoundedBobBase-1, amount, 0); checkDebtor(alice, 0.1e18, 0, 0, 0, block.timestamp, 0); @@ -643,7 +643,7 @@ contract TempleDebtTokenTestBaseAndDebtorInterest is TempleDebtTokenTestBase { dUSD.mint(bob, amount); vm.warp(block.timestamp + 364 days); - changePrank(executor); + vm.startPrank(executor); dUSD.setRiskPremiumInterestRate(alice, 0.1e18); vm.warp(block.timestamp + 365 days); @@ -678,7 +678,7 @@ contract TempleDebtTokenTestBaseAndDebtorInterest is TempleDebtTokenTestBase { dUSD.mint(bob, amount); vm.warp(block.timestamp + 364 days); - changePrank(executor); + vm.startPrank(executor); dUSD.setRiskPremiumInterestRate(alice, 0.1e18); vm.warp(block.timestamp + 365 days); @@ -715,7 +715,7 @@ contract TempleDebtTokenTestBaseAndDebtorInterest is TempleDebtTokenTestBase { vm.startPrank(executor); dUSD.setRiskPremiumInterestRate(account, aliceInterestRate); - changePrank(executor); + vm.startPrank(executor); dUSD.mint(account, amount); diff --git a/protocol/test/forge/v2/templeDebtToken/TempleDebtTokenTest.BaseInterestOnly.t.sol b/protocol/test/forge/v2/templeDebtToken/TempleDebtTokenTest.BaseInterestOnly.t.sol index 507d1c1cb..aff1996e6 100644 --- a/protocol/test/forge/v2/templeDebtToken/TempleDebtTokenTest.BaseInterestOnly.t.sol +++ b/protocol/test/forge/v2/templeDebtToken/TempleDebtTokenTest.BaseInterestOnly.t.sol @@ -354,7 +354,7 @@ contract TempleDebtTokenTestBaseInterestOnly is TempleDebtTokenTestBase { uint256 bobBal = ONE_PCT_364DAY; checkDebtor(bob, 0, amount, bobExpectedShares, 0, startBlockTs + 1 days, bobBal); - changePrank(executor); + vm.startPrank(executor); uint96 updatedBaseRate = 0.05e18; dUSD.setBaseInterestRate(updatedBaseRate); @@ -398,14 +398,14 @@ contract TempleDebtTokenTestBaseInterestOnly is TempleDebtTokenTestBase { dUSD.mint(bob, amount); vm.warp(block.timestamp + 364 days); - changePrank(executor); + vm.startPrank(executor); dUSD.setBaseInterestRate(0.05e18); vm.warp(block.timestamp + 365 days); uint256 bobExpectedShares = SECOND_DAY_SHARES; uint256 bobBal = 106180745553163435826; - changePrank(executor); + vm.startPrank(executor); dUSD.burnAll(alice); checkBaseInterest(0.05e18, bobExpectedShares-1, bobBal-1, block.timestamp, bobBal-1, amount, 0); checkDebtor(alice, 0, 0, 0, 0, block.timestamp, 0); @@ -426,7 +426,7 @@ contract TempleDebtTokenTestBaseInterestOnly is TempleDebtTokenTestBase { dUSD.mint(bob, amount); vm.warp(block.timestamp + 364 days); - changePrank(executor); + vm.startPrank(executor); dUSD.setBaseInterestRate(0.05e18); vm.warp(block.timestamp + 365 days); @@ -450,7 +450,7 @@ contract TempleDebtTokenTestBaseInterestOnly is TempleDebtTokenTestBase { dUSD.mint(bob, amount); vm.warp(block.timestamp + 364 days); - changePrank(executor); + vm.startPrank(executor); dUSD.setBaseInterestRate(0.05e18); vm.warp(block.timestamp + 365 days); diff --git a/protocol/test/forge/v2/templeDebtToken/TempleDebtTokenTest.DebtorInterestOnly.t.sol b/protocol/test/forge/v2/templeDebtToken/TempleDebtTokenTest.DebtorInterestOnly.t.sol index 9d691adfb..c64aa5f5e 100644 --- a/protocol/test/forge/v2/templeDebtToken/TempleDebtTokenTest.DebtorInterestOnly.t.sol +++ b/protocol/test/forge/v2/templeDebtToken/TempleDebtTokenTest.DebtorInterestOnly.t.sol @@ -270,7 +270,7 @@ contract TempleDebtTokenTestDebtorInterestOnly is TempleDebtTokenTestBase { checkDebtor(alice, aliceInterestRate, amount, amount, 0, startBlockTs, aliceBal); checkDebtor(bob, bobInterestRate, amount, amount, 0, startBlockTs + 1 days, bobBal); - changePrank(executor); + vm.startPrank(executor); uint96 updatedRate = 0.1e18; dUSD.setRiskPremiumInterestRate(alice, updatedRate); @@ -309,7 +309,7 @@ contract TempleDebtTokenTestDebtorInterestOnly is TempleDebtTokenTestBase { checkDebtor(alice, aliceInterestRate, amount, amount, 0, startBlockTs, aliceBal); checkDebtor(bob, bobInterestRate, amount, amount, 0, startBlockTs + 1 days, bobBal); - changePrank(executor); + vm.startPrank(executor); uint96 updatedRate = 0; dUSD.setRiskPremiumInterestRate(alice, updatedRate); @@ -341,13 +341,13 @@ contract TempleDebtTokenTestDebtorInterestOnly is TempleDebtTokenTestBase { dUSD.mint(bob, amount); vm.warp(block.timestamp + 364 days); - changePrank(executor); + vm.startPrank(executor); dUSD.setRiskPremiumInterestRate(alice, 0.1e18); vm.warp(block.timestamp + 365 days); uint256 bobBal = FIVE_PCT_729DAY; - changePrank(executor); + vm.startPrank(executor); dUSD.burnAll(alice); checkBaseInterest(0, amount, amount, block.timestamp, amount, amount, 0); checkDebtor(alice, 0.1e18, 0, 0, 0, block.timestamp, 0); @@ -393,7 +393,7 @@ contract TempleDebtTokenTestDebtorInterestOnly is TempleDebtTokenTestBase { dUSD.mint(bob, amount); vm.warp(block.timestamp + 364 days); - changePrank(executor); + vm.startPrank(executor); dUSD.setRiskPremiumInterestRate(alice, 0.1e18); vm.warp(block.timestamp + 365 days); diff --git a/protocol/test/forge/v2/templeLineOfCredit/TlcBorrow.t.sol b/protocol/test/forge/v2/templeLineOfCredit/TlcBorrow.t.sol index d3474336f..c46bcdde8 100644 --- a/protocol/test/forge/v2/templeLineOfCredit/TlcBorrow.t.sol +++ b/protocol/test/forge/v2/templeLineOfCredit/TlcBorrow.t.sol @@ -40,7 +40,7 @@ contract TempleLineOfCreditTestBorrow is TlcBaseTest { tlc.setMaxLtvRatio(0.5e18); // Now alice can't execute on the borrow - changePrank(alice); + vm.startPrank(alice); vm.expectRevert(abi.encodeWithSelector(ExceededMaxLtv.selector, collateralAmount, collateralValue(collateralAmount), borrowAmount)); tlc.borrow(borrowAmount, alice); @@ -142,16 +142,16 @@ contract TempleLineOfCreditTestBorrow is TlcBaseTest { tlc.setBorrowPaused(true); uint128 borrowAmount = 50_000e18; - changePrank(alice); + vm.startPrank(alice); vm.expectRevert(abi.encodeWithSelector(Paused.selector)); tlc.borrow(borrowAmount, alice); // Unpause - changePrank(executor); + vm.startPrank(executor); tlc.setBorrowPaused(false); - changePrank(alice); + vm.startPrank(alice); tlc.borrow(borrowAmount, alice); } @@ -164,14 +164,14 @@ contract TempleLineOfCreditTestBorrow is TlcBaseTest { vm.startPrank(rescuer); tlc.setRescueMode(true); - changePrank(alice); + vm.startPrank(alice); vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); tlc.borrow(borrowAmount, alice); - changePrank(rescuer); + vm.startPrank(rescuer); tlc.setRescueMode(false); - changePrank(alice); + vm.startPrank(alice); tlc.borrow(borrowAmount, alice); } } @@ -183,7 +183,7 @@ contract TempleLineOfCreditTestBorrow is TlcBaseTest { vm.startPrank(executor); daiCircuitBreaker.updateCap(10_000e18); - changePrank(alice); + vm.startPrank(alice); tlc.borrow(10_000e18, alice); // Circuit breaker breached diff --git a/protocol/test/forge/v2/templeLineOfCredit/TlcCollateral.t.sol b/protocol/test/forge/v2/templeLineOfCredit/TlcCollateral.t.sol index 14ab59867..ba6aab5e4 100644 --- a/protocol/test/forge/v2/templeLineOfCredit/TlcCollateral.t.sol +++ b/protocol/test/forge/v2/templeLineOfCredit/TlcCollateral.t.sol @@ -115,7 +115,7 @@ contract TempleLineOfCreditTest_Collateral is TlcBaseTest { assertEq(position.loanToValueRatio, 0.595e18); // Now alice can't execute on the remove collateral - changePrank(alice); + vm.startPrank(alice); vm.expectRevert(abi.encodeWithSelector(ExceededMaxLtv.selector, collateralAmount-1, collateralValue(collateralAmount-1), borrowAmount)); tlc.removeCollateral(1, alice); @@ -190,32 +190,32 @@ contract TempleLineOfCreditTest_Collateral is TlcBaseTest { templeToken.approve(address(tlc), 2*collateralAmount); { - changePrank(rescuer); + vm.startPrank(rescuer); tlc.setRescueMode(true); - changePrank(alice); + vm.startPrank(alice); vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); tlc.addCollateral(collateralAmount, alice); - changePrank(rescuer); + vm.startPrank(rescuer); tlc.setRescueMode(false); - changePrank(alice); + vm.startPrank(alice); tlc.addCollateral(collateralAmount, alice); } { - changePrank(rescuer); + vm.startPrank(rescuer); tlc.setRescueMode(true); - changePrank(alice); + vm.startPrank(alice); vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); tlc.removeCollateral(50, alice); - changePrank(rescuer); + vm.startPrank(rescuer); tlc.setRescueMode(false); - changePrank(alice); + vm.startPrank(alice); tlc.removeCollateral(50, alice); } } @@ -227,7 +227,7 @@ contract TempleLineOfCreditTest_Collateral is TlcBaseTest { vm.startPrank(executor); templeCircuitBreaker.updateCap(100_000e18); - changePrank(alice); + vm.startPrank(alice); tlc.removeCollateral(100_000e18, alice); // Circuit breaker breached diff --git a/protocol/test/forge/v2/templeLineOfCredit/TlcLiquidations.t.sol b/protocol/test/forge/v2/templeLineOfCredit/TlcLiquidations.t.sol index 76e20cafd..4a57ae4be 100644 --- a/protocol/test/forge/v2/templeLineOfCredit/TlcLiquidations.t.sol +++ b/protocol/test/forge/v2/templeLineOfCredit/TlcLiquidations.t.sol @@ -53,7 +53,7 @@ contract TempleLineOfCreditTestCheckLiquidity is TlcBaseTest { vm.startPrank(executor); tlc.setMaxLtvRatio(0.8e18); - changePrank(alice); + vm.startPrank(alice); daiToken.approve(address(tlc), daiBorrowAmount); tlc.repayAll(alice); @@ -127,14 +127,14 @@ contract TempleLineOfCreditTestBatchLiquidate is TlcBaseTest { // Rescue mode is turned off tlc.setRescueMode(false); - changePrank(executor); + vm.startPrank(executor); // Still can't liquidate Alice since liquidations are still paused vm.expectRevert(abi.encodeWithSelector(Paused.selector)); tlc.batchLiquidate(accounts); // Time is given to alice to unwind - she does - changePrank(alice); + vm.startPrank(alice); daiToken.approve(address(tlc), 1_000e18); tlc.repay(1_000e18, alice); @@ -143,7 +143,7 @@ contract TempleLineOfCreditTestBatchLiquidate is TlcBaseTest { assertEq(status[0].hasExceededMaxLtv, false); // Liquidations are now unpaused - changePrank(executor); + vm.startPrank(executor); tlc.setLiquidationsPaused(false); // Liquidations now run - but nothing was liquidated diff --git a/protocol/test/forge/v2/templeLineOfCredit/TlcRepay.t.sol b/protocol/test/forge/v2/templeLineOfCredit/TlcRepay.t.sol index 5b73f2823..d303edafc 100644 --- a/protocol/test/forge/v2/templeLineOfCredit/TlcRepay.t.sol +++ b/protocol/test/forge/v2/templeLineOfCredit/TlcRepay.t.sol @@ -315,7 +315,7 @@ contract TempleLineOfCreditTestRepay is TlcBaseTest { vm.startPrank(rescuer); tlc.setRescueMode(true); - changePrank(alice); + vm.startPrank(alice); daiToken.approve(address(tlc), borrowDaiAmount); { vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InvalidAccess.selector)); @@ -325,11 +325,11 @@ contract TempleLineOfCreditTestRepay is TlcBaseTest { tlc.repayAll(alice); } - changePrank(rescuer); + vm.startPrank(rescuer); tlc.setRescueMode(false); { - changePrank(alice); + vm.startPrank(alice); tlc.repay(1, alice); tlc.repayAll(alice); } diff --git a/protocol/test/forge/v2/treasuryReservesVault/TrvBase.t.sol b/protocol/test/forge/v2/treasuryReservesVault/TrvBase.t.sol index 74ffc6527..4fa4522de 100644 --- a/protocol/test/forge/v2/treasuryReservesVault/TrvBase.t.sol +++ b/protocol/test/forge/v2/treasuryReservesVault/TrvBase.t.sol @@ -116,7 +116,7 @@ contract TreasuryReservesVaultTestAccess is TreasuryReservesVaultTestBase { vm.expectRevert(abi.encodeWithSelector(ITreasuryReservesVault.StrategyNotEnabled.selector)); trv.shutdown(address(strategy)); - changePrank(address(strategy)); + vm.startPrank(address(strategy)); vm.expectRevert(abi.encodeWithSelector(ITreasuryReservesVault.StrategyNotEnabled.selector)); trv.shutdown(address(strategy)); } diff --git a/protocol/test/forge/v2/treasuryReservesVault/TrvBorrow.t.sol b/protocol/test/forge/v2/treasuryReservesVault/TrvBorrow.t.sol index 9eba2b391..03bce52ae 100644 --- a/protocol/test/forge/v2/treasuryReservesVault/TrvBorrow.t.sol +++ b/protocol/test/forge/v2/treasuryReservesVault/TrvBorrow.t.sol @@ -29,17 +29,17 @@ contract TreasuryReservesVaultTestBorrow is TreasuryReservesVaultTestBase { vm.expectRevert(abi.encodeWithSelector(ITreasuryReservesVault.BorrowTokenNotEnabled.selector)); trv.borrow(dai, 123, alice); - changePrank(executor); + vm.startPrank(executor); trv.setBorrowToken(dai, address(0), 100, 101, address(dUSD)); } // Strategy needs to exist { - changePrank(address(strategy)); + vm.startPrank(address(strategy)); vm.expectRevert(abi.encodeWithSelector(ITreasuryReservesVault.StrategyNotEnabled.selector)); trv.borrow(dai, 123, alice); - changePrank(executor); + vm.startPrank(executor); ITempleStrategy.AssetBalance[] memory debtCeiling = new ITempleStrategy.AssetBalance[](1); debtCeiling[0] = ITempleStrategy.AssetBalance(address(dai), 5e18); trv.addStrategy(address(strategy), 100, debtCeiling); @@ -49,7 +49,7 @@ contract TreasuryReservesVaultTestBorrow is TreasuryReservesVaultTestBase { // Too much { - changePrank(address(strategy)); + vm.startPrank(address(strategy)); vm.expectRevert(abi.encodeWithSelector(ITreasuryReservesVault.DebtCeilingBreached.selector, 5e18, 5.01e18)); trv.borrow(dai, 5.01e18, alice); } @@ -62,14 +62,14 @@ contract TreasuryReservesVaultTestBorrow is TreasuryReservesVaultTestBase { // Global paused { - changePrank(executor); + vm.startPrank(executor); trv.setGlobalPaused(true, false); - changePrank(address(strategy)); + vm.startPrank(address(strategy)); vm.expectRevert(abi.encodeWithSelector(ITreasuryReservesVault.BorrowPaused.selector)); trv.borrow(dai, 5.0e18, alice); - changePrank(executor); + vm.startPrank(executor); trv.setGlobalPaused(false, false); } @@ -77,11 +77,11 @@ contract TreasuryReservesVaultTestBorrow is TreasuryReservesVaultTestBase { { trv.setStrategyPaused(address(strategy), true, false); - changePrank(address(strategy)); + vm.startPrank(address(strategy)); vm.expectRevert(abi.encodeWithSelector(ITreasuryReservesVault.BorrowPaused.selector)); trv.borrow(dai, 5.0e18, alice); - changePrank(executor); + vm.startPrank(executor); trv.setStrategyPaused(address(strategy), false, false); } @@ -89,17 +89,17 @@ contract TreasuryReservesVaultTestBorrow is TreasuryReservesVaultTestBase { { trv.setStrategyIsShuttingDown(address(strategy), true); - changePrank(address(strategy)); + vm.startPrank(address(strategy)); vm.expectRevert(abi.encodeWithSelector(ITreasuryReservesVault.StrategyIsShutdown.selector)); trv.borrow(dai, 5.0e18, alice); - changePrank(executor); + vm.startPrank(executor); trv.setStrategyIsShuttingDown(address(strategy), false); } // TRV not funded with DAI { - changePrank(address(strategy)); + vm.startPrank(address(strategy)); vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.InsufficientBalance.selector, address(dai), 5.0e18, 0)); trv.borrow(dai, 5.0e18, alice); @@ -118,16 +118,16 @@ contract TreasuryReservesVaultTestBorrow is TreasuryReservesVaultTestBase { // disable the borrow token and it should now revert { - changePrank(executor); + vm.startPrank(executor); IERC20[] memory disableBorrowTokens = new IERC20[](1); disableBorrowTokens[0] = dai; trv.updateStrategyEnabledBorrowTokens(address(strategy), new IERC20[](0), disableBorrowTokens); - changePrank(address(strategy)); + vm.startPrank(address(strategy)); vm.expectRevert(abi.encodeWithSelector(ITreasuryReservesVault.BorrowTokenNotEnabled.selector)); trv.borrow(dai, 5e18, alice); - changePrank(address(strategy)); + vm.startPrank(address(strategy)); vm.expectRevert(abi.encodeWithSelector(ITreasuryReservesVault.BorrowTokenNotEnabled.selector)); trv.borrowMax(dai, alice); } @@ -148,7 +148,7 @@ contract TreasuryReservesVaultTestBorrow is TreasuryReservesVaultTestBase { // Do a repay such that there's a credit balance. { deal(address(dai), address(alice), 3e18, true); - changePrank(alice); + vm.startPrank(alice); dai.approve(address(trv), 3e18); vm.expectEmit(address(trv)); @@ -164,7 +164,7 @@ contract TreasuryReservesVaultTestBorrow is TreasuryReservesVaultTestBase { // Taken from credits (still some left) { - changePrank(address(strategy)); + vm.startPrank(address(strategy)); vm.expectEmit(address(trv)); emit Borrow(address(strategy), address(dai), alice, 2e18); @@ -181,7 +181,7 @@ contract TreasuryReservesVaultTestBorrow is TreasuryReservesVaultTestBase { // Taken from credits and issue debt { - changePrank(address(strategy)); + vm.startPrank(address(strategy)); vm.expectEmit(address(trv)); emit Borrow(address(strategy), address(dai), alice, 5e18); @@ -216,7 +216,7 @@ contract TreasuryReservesVaultTestBorrow is TreasuryReservesVaultTestBase { // If done as the strategy then it just pulls straight from TRV // (doesn't pull from itself again) { - changePrank(address(baseStrategy)); + vm.startPrank(address(baseStrategy)); vm.expectEmit(address(trv)); emit Borrow(address(baseStrategy), address(dai), alice, 5e18); @@ -246,7 +246,7 @@ contract TreasuryReservesVaultTestBorrow is TreasuryReservesVaultTestBase { // Pulled straight from the TRV as there's no base strategy set { - changePrank(address(strategy)); + vm.startPrank(address(strategy)); vm.expectEmit(address(trv)); emit Borrow(address(strategy), address(dai), alice, 5e18); @@ -291,7 +291,7 @@ contract TreasuryReservesVaultTestBorrow is TreasuryReservesVaultTestBase { } { - changePrank(address(strategy)); + vm.startPrank(address(strategy)); vm.expectEmit(address(trv)); emit Borrow(address(strategy), address(dai), alice, 5e18); @@ -342,7 +342,7 @@ contract TreasuryReservesVaultTestBorrow is TreasuryReservesVaultTestBase { } { - changePrank(address(strategy)); + vm.startPrank(address(strategy)); vm.expectEmit(address(trv)); emit Borrow(address(strategy), address(dai), alice, 5e18); @@ -398,7 +398,7 @@ contract TreasuryReservesVaultTestBorrow is TreasuryReservesVaultTestBase { } { - changePrank(address(strategy)); + vm.startPrank(address(strategy)); vm.expectEmit(address(trv)); emit Borrow(address(strategy), address(dai), alice, 5e18); @@ -441,24 +441,24 @@ contract TreasuryReservesVaultTestBorrow is TreasuryReservesVaultTestBase { vm.expectRevert(abi.encodeWithSelector(ITreasuryReservesVault.BorrowTokenNotEnabled.selector)); trv.borrowMax(dai, alice); - changePrank(executor); + vm.startPrank(executor); trv.setBorrowToken(dai, address(0), 0, 0, address(dUSD)); deal(address(dai), address(trv), 120e18, true); } { - changePrank(address(strategy)); + vm.startPrank(address(strategy)); vm.expectRevert(abi.encodeWithSelector(ITreasuryReservesVault.StrategyNotEnabled.selector)); trv.borrowMax(dai, alice); - changePrank(executor); + vm.startPrank(executor); ITempleStrategy.AssetBalance[] memory debtCeiling = new ITempleStrategy.AssetBalance[](1); debtCeiling[0] = ITempleStrategy.AssetBalance(address(dai), 50e18); trv.addStrategy(address(strategy), -123, debtCeiling); } { - changePrank(address(strategy)); + vm.startPrank(address(strategy)); vm.expectEmit(address(trv)); emit Borrow(address(strategy), address(dai), alice, 50e18); diff --git a/protocol/test/forge/v2/treasuryReservesVault/TrvRepay.t.sol b/protocol/test/forge/v2/treasuryReservesVault/TrvRepay.t.sol index 5f2996216..aeef50901 100644 --- a/protocol/test/forge/v2/treasuryReservesVault/TrvRepay.t.sol +++ b/protocol/test/forge/v2/treasuryReservesVault/TrvRepay.t.sol @@ -26,7 +26,7 @@ contract TreasuryReservesVaultTestRepay is TreasuryReservesVaultTestBase { vm.expectRevert(abi.encodeWithSelector(ITreasuryReservesVault.BorrowTokenNotEnabled.selector)); trv.repay(dai, 123, address(strategy)); - changePrank(executor); + vm.startPrank(executor); trv.setBorrowToken(dai, address(0), 100, 101, address(dUSD)); } @@ -38,24 +38,24 @@ contract TreasuryReservesVaultTestRepay is TreasuryReservesVaultTestBase { // Global paused { - changePrank(executor); + vm.startPrank(executor); trv.setGlobalPaused(false, true); - changePrank(address(strategy)); + vm.startPrank(address(strategy)); vm.expectRevert(abi.encodeWithSelector(ITreasuryReservesVault.RepaysPaused.selector)); trv.repay(dai, 5.0e18, address(strategy)); - changePrank(executor); + vm.startPrank(executor); trv.setGlobalPaused(false, false); } // Strategy needs to exist { - changePrank(address(strategy)); + vm.startPrank(address(strategy)); vm.expectRevert(abi.encodeWithSelector(ITreasuryReservesVault.StrategyNotEnabled.selector)); trv.repay(dai, 5e18, address(strategy)); - changePrank(executor); + vm.startPrank(executor); ITempleStrategy.AssetBalance[] memory debtCeiling = new ITempleStrategy.AssetBalance[](1); debtCeiling[0] = ITempleStrategy.AssetBalance(address(dai), 5e18); trv.addStrategy(address(strategy), 100, debtCeiling); @@ -65,11 +65,11 @@ contract TreasuryReservesVaultTestRepay is TreasuryReservesVaultTestBase { { trv.setStrategyPaused(address(strategy), false, true); - changePrank(address(strategy)); + vm.startPrank(address(strategy)); vm.expectRevert(abi.encodeWithSelector(ITreasuryReservesVault.RepaysPaused.selector)); trv.repay(dai, 5e18, address(strategy)); - changePrank(executor); + vm.startPrank(executor); trv.setStrategyPaused(address(strategy), false, false); } @@ -77,14 +77,14 @@ contract TreasuryReservesVaultTestRepay is TreasuryReservesVaultTestBase { // Too much { - changePrank(address(strategy)); + vm.startPrank(address(strategy)); vm.expectRevert(abi.encodeWithSelector(ITreasuryReservesVault.DebtCeilingBreached.selector, 5e18, 5.01e18)); trv.borrow(dai, 5.01e18, alice); } // Payee not funded with DAI { - changePrank(address(strategy)); + vm.startPrank(address(strategy)); vm.expectRevert("ERC20: transfer amount exceeds balance"); trv.repay(dai, 5e18, address(strategy)); @@ -98,15 +98,15 @@ contract TreasuryReservesVaultTestRepay is TreasuryReservesVaultTestBase { // Is shutting down is ok for repays { - changePrank(executor); + vm.startPrank(executor); trv.setStrategyIsShuttingDown(address(strategy), true); - changePrank(address(strategy)); + vm.startPrank(address(strategy)); vm.expectEmit(address(trv)); emit Repay(address(strategy), address(dai), address(strategy), 2e18); trv.repay(dai, 2e18, address(strategy)); - changePrank(executor); + vm.startPrank(executor); trv.setStrategyIsShuttingDown(address(strategy), false); } @@ -119,19 +119,19 @@ contract TreasuryReservesVaultTestRepay is TreasuryReservesVaultTestBase { // disable the borrow token and it should now revert { deal(address(dai), address(trv), 10e18, true); - changePrank(address(strategy)); + vm.startPrank(address(strategy)); trv.borrow(dai, 10e18, alice); - changePrank(executor); + vm.startPrank(executor); IERC20[] memory disableBorrowTokens = new IERC20[](1); disableBorrowTokens[0] = dai; trv.updateStrategyEnabledBorrowTokens(address(strategy), new IERC20[](0), disableBorrowTokens); - changePrank(address(strategy)); + vm.startPrank(address(strategy)); vm.expectRevert(abi.encodeWithSelector(ITreasuryReservesVault.BorrowTokenNotEnabled.selector)); trv.repay(dai, 2e18, address(strategy)); - changePrank(address(strategy)); + vm.startPrank(address(strategy)); vm.expectRevert(abi.encodeWithSelector(ITreasuryReservesVault.BorrowTokenNotEnabled.selector)); trv.repayAll(dai, address(strategy)); } @@ -151,14 +151,14 @@ contract TreasuryReservesVaultTestRepay is TreasuryReservesVaultTestBase { // Borrow some so there's a debt { - changePrank(address(strategy)); + vm.startPrank(address(strategy)); trv.borrow(dai, 5e18, address(strategy)); } // Fund alice so she can repay on behalf of the strategy { deal(address(dai), alice, 50e18, true); - changePrank(address(alice)); + vm.startPrank(address(alice)); dai.approve(address(trv), 50e18); } @@ -194,14 +194,14 @@ contract TreasuryReservesVaultTestRepay is TreasuryReservesVaultTestBase { // Borrow some so there's a debt { - changePrank(address(strategy)); + vm.startPrank(address(strategy)); trv.borrow(dai, 5e18, address(strategy)); } // Fund alice so she can repay on behalf of the strategy { deal(address(dai), alice, 50e18, true); - changePrank(address(alice)); + vm.startPrank(address(alice)); dai.approve(address(trv), 50e18); } @@ -243,7 +243,7 @@ contract TreasuryReservesVaultTestRepay is TreasuryReservesVaultTestBase { // If done as the strategy then it just sends straight from TRV // (doesn't deposit back to itself) { - changePrank(address(baseStrategy)); + vm.startPrank(address(baseStrategy)); vm.expectEmit(address(trv)); emit Repay(address(baseStrategy), address(dai), address(baseStrategy), 7e18); @@ -283,14 +283,14 @@ contract TreasuryReservesVaultTestRepay is TreasuryReservesVaultTestBase { // Fund alice so she can repay on behalf of the strategy { deal(address(dai), alice, 50e18, true); - changePrank(address(alice)); + vm.startPrank(address(alice)); dai.approve(address(trv), 50e18); } // Sent back to the TRV. Under the balance threshold so it remains in the TRV - not sent to // the base strategy { - changePrank(address(alice)); + vm.startPrank(address(alice)); vm.expectEmit(address(trv)); emit Repay(address(strategy), address(dai), alice, 7e18); @@ -334,14 +334,14 @@ contract TreasuryReservesVaultTestRepay is TreasuryReservesVaultTestBase { // Fund alice so she can repay on behalf of the strategy { deal(address(dai), alice, 50e18, true); - changePrank(address(alice)); + vm.startPrank(address(alice)); dai.approve(address(trv), 50e18); } // Sent back to the TRV. Under the balance threshold so it remains in the TRV - not sent to // the base strategy { - changePrank(address(alice)); + vm.startPrank(address(alice)); vm.expectEmit(address(trv)); emit Repay(address(strategy), address(dai), alice, 15e18); @@ -386,13 +386,13 @@ contract TreasuryReservesVaultTestRepay is TreasuryReservesVaultTestBase { // Fund alice so she can repay on behalf of the strategy { deal(address(dai), alice, 50e18, true); - changePrank(address(alice)); + vm.startPrank(address(alice)); dai.approve(address(trv), 50e18); } // Sent back to the TRV. Over the balance threshold so the base strategy is topped up. { - changePrank(address(alice)); + vm.startPrank(address(alice)); vm.expectEmit(address(trv)); emit Repay(address(strategy), address(dai), alice, 40e18); @@ -465,7 +465,7 @@ contract TreasuryReservesVaultTestRepay is TreasuryReservesVaultTestBase { vm.expectRevert(abi.encodeWithSelector(ITreasuryReservesVault.BorrowTokenNotEnabled.selector)); trv.repayAll(dai, address(strategy)); - changePrank(executor); + vm.startPrank(executor); trv.setBorrowToken(dai, address(0), 0, 0, address(dUSD)); deal(address(dai), address(trv), 120e18, true); } @@ -479,7 +479,7 @@ contract TreasuryReservesVaultTestRepay is TreasuryReservesVaultTestBase { // 0 amount { - changePrank(address(strategy)); + vm.startPrank(address(strategy)); vm.expectRevert(abi.encodeWithSelector(CommonEventsAndErrors.ExpectedNonZero.selector)); trv.repayAll(dai, address(strategy)); @@ -487,7 +487,7 @@ contract TreasuryReservesVaultTestRepay is TreasuryReservesVaultTestBase { } { - changePrank(address(alice)); + vm.startPrank(address(alice)); dai.approve(address(trv), 5e18); vm.expectEmit(address(trv));