From 905e09697293032926f67b731683e9ca894975e1 Mon Sep 17 00:00:00 2001 From: princetonbishop Date: Sat, 24 Aug 2024 00:04:41 +0200 Subject: [PATCH] deploy script, anvil, cleanup --- .../interfaces/templegold/IAuctionBase.sol | 8 +- .../interfaces/templegold/ITempleGold.sol | 1 - protocol/contracts/templegold/TempleGold.sol | 13 - .../deploys/arbitrumOne/contract-addresses.ts | 27 + .../localhost/templegold/01-localhost.ts | 134 + .../localhost/templegold/999-localhost.ts | 81 + .../localhost/templegold/deploy-anvil.sh | 5 + protocol/slither.db.json | 7391 +++++++++++++++++ .../forge/templegold/TempleGoldAdmin.t.sol | 1 - 9 files changed, 7642 insertions(+), 19 deletions(-) create mode 100644 protocol/scripts/deploys/localhost/templegold/01-localhost.ts create mode 100644 protocol/scripts/deploys/localhost/templegold/999-localhost.ts create mode 100755 protocol/scripts/deploys/localhost/templegold/deploy-anvil.sh diff --git a/protocol/contracts/interfaces/templegold/IAuctionBase.sol b/protocol/contracts/interfaces/templegold/IAuctionBase.sol index 403ee9585..39413ae5e 100644 --- a/protocol/contracts/interfaces/templegold/IAuctionBase.sol +++ b/protocol/contracts/interfaces/templegold/IAuctionBase.sol @@ -30,13 +30,13 @@ interface IAuctionBase { } /// @notice Keep track of epochs details - function getEpochInfo(uint256 epochId) external returns (EpochInfo memory); + function getEpochInfo(uint256 epochId) external view returns (EpochInfo memory); /// @notice Keep track of depositors for each epoch - function depositors(address depositor, uint256 epochId) external returns (uint256); + function depositors(address depositor, uint256 epochId) external view returns (uint256); /// @notice Keep track of claimed accounts per epoch - function claimed(address depositor, uint256 epochId) external returns (bool); + function claimed(address depositor, uint256 epochId) external view returns (bool); /// @notice claimed amounts - function claimedAmount(address depositor, uint256 epochId) external returns (uint256); + function claimedAmount(address depositor, uint256 epochId) external view returns (uint256); /** * @notice Deposit bid token for current running epoch auction diff --git a/protocol/contracts/interfaces/templegold/ITempleGold.sol b/protocol/contracts/interfaces/templegold/ITempleGold.sol index 1417c52ce..c42c68efc 100644 --- a/protocol/contracts/interfaces/templegold/ITempleGold.sol +++ b/protocol/contracts/interfaces/templegold/ITempleGold.sol @@ -42,7 +42,6 @@ interface ITempleGold is IOFT, IOAppCore, IOAppOptionsType3, IERC20 { event DaiGoldAuctionSet(address daiGoldAuction); event TeamGnosisSet(address gnosis); event CirculatingSupplyUpdated(address indexed sender, uint256 amount, uint256 circulatingSuppply, uint256 totalBurned); - event NotifierSet(address indexed notifier); error InvalidTotalShare(); error MissingParameter(); diff --git a/protocol/contracts/templegold/TempleGold.sol b/protocol/contracts/templegold/TempleGold.sol index e3cadca35..0db32f7b0 100644 --- a/protocol/contracts/templegold/TempleGold.sol +++ b/protocol/contracts/templegold/TempleGold.sol @@ -37,8 +37,6 @@ import { TempleMath } from "contracts/common/TempleMath.sol"; /// @notice Multisig gnosis address address public override teamGnosis; - address public notifier; - /// @notice Last block timestamp Temple Gold was minted uint32 public override lastMintTimestamp; @@ -138,12 +136,6 @@ import { TempleMath } from "contracts/common/TempleMath.sol"; else { mint(); } emit VestingFactorSet(_factor.value, _factor.weekMultiplier); } - - function setNotifier(address _notifier) external onlyOwner { - if (_notifier == address(0)) { revert CommonEventsAndErrors.InvalidAddress(); } - notifier = _notifier; - emit NotifierSet(_notifier); - } /** * @notice Mint new tokens to be distributed. Open to call from any address @@ -394,9 +386,4 @@ import { TempleMath } from "contracts/common/TempleMath.sol"; if (block.chainid != _mintChainId) { revert WrongChain(); } _; } - - modifier onlyNotifier() { - if (msg.sender != notifier) { revert CommonEventsAndErrors.InvalidAccess(); } - _; - } } \ No newline at end of file diff --git a/protocol/scripts/deploys/arbitrumOne/contract-addresses.ts b/protocol/scripts/deploys/arbitrumOne/contract-addresses.ts index a92eed02b..ab763b431 100644 --- a/protocol/scripts/deploys/arbitrumOne/contract-addresses.ts +++ b/protocol/scripts/deploys/arbitrumOne/contract-addresses.ts @@ -68,6 +68,33 @@ const TEMPLEGOLD_DEPLOYED_CONTRACTS: {[key: string]: ContractAddresses} = { } }, }, + localhost: { + TEMPLE_GOLD: { + AUCTION_AUTOMATION_EOA: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + STAKING_AUTOMATION_EOA: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + SPICE_AUCTION_OPERATOR: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + TEMPLE_GOLD: "0xf3800C1f5374d9104ab20A48F1F83485BD9a37da", + TEMPLE_GOLD_ADMIN: "0x0222F49C69567eB50f425AF01E2F9FCc451e807B", + TEMPLE_GOLD_STAKING: "0xa7390dA200fcB4ce8C1032Cc024779F488B0D03a", + TEMPLE_TELEPORTER: "0x876d471068e723279Fe52Eb10A6A587cA1a26CA4", + SPICE_AUCTION: "string", + SPICE_AUCTION_FACTORY: "string", + DAI_GOLD_AUCTION: "0xA3174691290D9F0D8Fe3E98D8222441e117d1c46", + EXECUTOR_MSIG: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + RESCUER_MSIG: "0x70997970C51812dc3A010C7d01b50e0d17dc79C8", + }, + CORE: { + TEMPLE_TOKEN: "0x7816d99063dfEc136d2139681D3fbD92375Ec14c", + }, + EXTERNAL: { + LAYER_ZERO: { + ENDPOINT: '0x1a44076050125825900e736c501f859c50fE728c', + }, + MAKER_DAO: { + DAI_TOKEN: "0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1", + } + }, + } } export function getDeployedTempleGoldContracts(): ContractAddresses { diff --git a/protocol/scripts/deploys/localhost/templegold/01-localhost.ts b/protocol/scripts/deploys/localhost/templegold/01-localhost.ts new file mode 100644 index 000000000..39efa9a09 --- /dev/null +++ b/protocol/scripts/deploys/localhost/templegold/01-localhost.ts @@ -0,0 +1,134 @@ +import '@nomiclabs/hardhat-ethers'; +import { ethers } from 'hardhat'; +import { TempleGold__factory, TempleGoldAdmin__factory, + TempleGoldStaking__factory, TempleTeleporter__factory, + DaiGoldAuction__factory, FakeERC20__factory } from '../../../../typechain'; +import { + deployAndMine, + ensureExpectedEnvvars, + toAtto, +} from '../../helpers'; +import { getDeployedContracts } from '../../mainnet/v2/contract-addresses'; +import { getDeployedTempleGoldContracts } from '../../arbitrumOne/contract-addresses'; +import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; +import { ContractAddresses } from '@balancer-labs/sdk'; + +async function main() { + ensureExpectedEnvvars(); + const [owner, rescuer] = await ethers.getSigners(); + + await _deployTempleToken(owner); + await _deployTempleGold(owner); + await _deployTempleGoldAdmin(owner, rescuer); + + await _deployTempleGoldStaking(owner, rescuer); + await _deployTempleTeleporter(owner); + + await _deployDaiGoldAuction(owner, rescuer); +} + +async function _deployTempleToken(owner: SignerWithAddress) { + const factory = new FakeERC20__factory(owner); + await deployAndMine( + 'TEMPLE_TOKEN', + factory, + factory.deploy, + "Temple", + "TEMPLE", + await owner.getAddress(), + toAtto(1000) + ); +} + +async function _deployTempleGold(owner: SignerWithAddress) { + const TEMPLEGOLD_ADDRESSES = getDeployedTempleGoldContracts(); + const ARBITRUM_ONE_CHAIN_ID = 42161; + const ARBITRUM_ONE_LZ_EID = 30110; + const _initArgs = { + // Changed in transfer ownership to TempleAdmin + executor: await owner.getAddress(), // executor is also used as delegate in LayerZero Endpoint. + layerZeroEndpoint: TEMPLEGOLD_ADDRESSES.EXTERNAL.LAYER_ZERO.ENDPOINT, // local endpoint address + mintChainId: ARBITRUM_ONE_CHAIN_ID, + mintChainLzEid: ARBITRUM_ONE_LZ_EID, + name: "TEMPLE GOLD", + symbol: "TGLD" + }; + const factory = new TempleGold__factory(owner); + await deployAndMine( + 'TEMPLE_GOLD', + factory, + factory.deploy, + _initArgs + ); +} + +async function _deployTempleGoldAdmin(owner: SignerWithAddress, rescuer: SignerWithAddress) { + const factory = new TempleGoldAdmin__factory(owner); + const TEMPLEGOLD_ADDRESSES = getDeployedTempleGoldContracts(); + await deployAndMine( + 'TEMPLE_GOLD_ADMIN', + factory, + factory.deploy, + await rescuer.getAddress(), + await owner.getAddress(), + TEMPLEGOLD_ADDRESSES.TEMPLE_GOLD.TEMPLE_GOLD + ); +} + +async function _deployTempleGoldStaking(owner: SignerWithAddress, rescuer: SignerWithAddress) { + const TEMPLEGOLD_ADDRESSES = getDeployedTempleGoldContracts(); + const CORE_ADDRESSES = getDeployedContracts(); + + + const factory = new TempleGoldStaking__factory(owner); + await deployAndMine( + 'TEMPLE_GOLD_STAKING', + factory, + factory.deploy, + await rescuer.getAddress(), + await owner.getAddress(), + CORE_ADDRESSES.CORE.TEMPLE_TOKEN, + TEMPLEGOLD_ADDRESSES.TEMPLE_GOLD.TEMPLE_GOLD + ); +} + +async function _deployTempleTeleporter(owner: SignerWithAddress) { + const TEMPLEGOLD_ADDRESSES = getDeployedTempleGoldContracts(); + const CORE_ADDRESSES = getDeployedContracts(); + + const factory = new TempleTeleporter__factory(owner); + await deployAndMine( + 'TEMPLE_TELEPORTER', + factory, + factory.deploy, + await owner.getAddress(), + CORE_ADDRESSES.CORE.TEMPLE_TOKEN, + TEMPLEGOLD_ADDRESSES.EXTERNAL.LAYER_ZERO.ENDPOINT + ); +} + +async function _deployDaiGoldAuction(owner: SignerWithAddress, rescuer: SignerWithAddress): Promise { + const TEMPLEGOLD_ADDRESSES = getDeployedTempleGoldContracts(); + const arbDaiToken = "0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1"; + const factory = new DaiGoldAuction__factory(owner); + await deployAndMine( + 'DAI_GOLD_AUCTION', + factory, + factory.deploy, + TEMPLEGOLD_ADDRESSES.TEMPLE_GOLD.TEMPLE_GOLD, + arbDaiToken, + await owner.getAddress(), // treasury + await rescuer.getAddress(), + await owner.getAddress(), + TEMPLEGOLD_ADDRESSES.TEMPLE_GOLD.AUCTION_AUTOMATION_EOA + ); +} + +// 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/localhost/templegold/999-localhost.ts b/protocol/scripts/deploys/localhost/templegold/999-localhost.ts new file mode 100644 index 000000000..65324ac34 --- /dev/null +++ b/protocol/scripts/deploys/localhost/templegold/999-localhost.ts @@ -0,0 +1,81 @@ +import { ethers, network } from 'hardhat'; +import { + ensureExpectedEnvvars, + mine, +} from '../../helpers'; +import { connectToContracts, getDeployedTempleGoldContracts } from '../../arbitrumOne/contract-addresses'; +import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; +import { TempleGold__factory, TempleGoldStaking__factory, DaiGoldAuction__factory } from '../../../../typechain'; + + +async function main() { + ensureExpectedEnvvars(); + const [owner] = await ethers.getSigners(); + const TEMPLE_GOLD_ADDRESSES = getDeployedTempleGoldContracts(); + const TEMPLE_GOLD_INSTANCES = connectToContracts(owner); + // signer 0 + const teamGnosis = '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266'; + console.log(`OWNER ${await TEMPLE_GOLD_INSTANCES.TEMPLE_GOLD.TEMPLE_GOLD.owner()}`); + console.log(`OWNER ${await TEMPLE_GOLD_INSTANCES.TEMPLE_GOLD.TEMPLE_GOLD_STAKING.executor()}`); + const distributionParams = { + staking: ethers.utils.parseEther("20"), + daiGoldAuction: ethers.utils.parseEther("70"), + gnosis: ethers.utils.parseEther("10") + } + const vestingFactor = { + value: 35, + weekMultiplier: 3600 * 24 * 7 // 1 week + } + ///// TEMPLE GOLD + const templeGold = TempleGold__factory.connect(TEMPLE_GOLD_ADDRESSES.TEMPLE_GOLD.TEMPLE_GOLD, owner); + const staking = TempleGoldStaking__factory.connect(TEMPLE_GOLD_ADDRESSES.TEMPLE_GOLD.TEMPLE_GOLD_STAKING, owner); + const daiGoldAuction = DaiGoldAuction__factory.connect(TEMPLE_GOLD_ADDRESSES.TEMPLE_GOLD.DAI_GOLD_AUCTION, owner); + console.log(`TempleGOld: ${await daiGoldAuction.templeGold()}`); + // // Set and whitelist contracts + await mine(templeGold.setTeamGnosis(teamGnosis)); + await mine(templeGold.setDaiGoldAuction(TEMPLE_GOLD_ADDRESSES.TEMPLE_GOLD.DAI_GOLD_AUCTION)); + await mine(templeGold.setStaking(TEMPLE_GOLD_ADDRESSES.TEMPLE_GOLD.TEMPLE_GOLD_STAKING)); + await mine(templeGold.setVestingFactor(vestingFactor)); + await mine(templeGold.setDistributionParams(distributionParams)); + // // authorize contracts + await mine(templeGold.authorizeContract(TEMPLE_GOLD_ADDRESSES.TEMPLE_GOLD.DAI_GOLD_AUCTION, true)); + await mine(templeGold.authorizeContract(TEMPLE_GOLD_ADDRESSES.TEMPLE_GOLD.TEMPLE_GOLD_STAKING, true)); + await mine(templeGold.authorizeContract(teamGnosis, true)); + + // ///// Staking + const duration = 24 * 3600 * 7; + const unstakeCooldown = duration * 2; // 2 weeks + const rewardsDistributionCooldown = 3600; // 1 hour + // reward duration + await mine(staking.setRewardDuration(duration)); + // distribution starter + await mine(staking.setDistributionStarter(teamGnosis)); + // rewards distribution cool down + await mine(staking.setRewardDistributionCoolDown(rewardsDistributionCooldown)); + // unstake cool down + await mine(staking.setUnstakeCooldown(unstakeCooldown)); + + ////// DAI GOLD AUCTION + const auctionsTimeDiff = 60; + const auctionConfig = { + /// Time diff between two auctions. Usually 2 weeks + auctionsTimeDiff: auctionsTimeDiff, + /// Cooldown after auction start is triggered, to allow deposits + auctionStartCooldown: 60, + /// Minimum Gold distributed to enable auction start + auctionMinimumDistributedGold: ethers.utils.parseEther("0.01"), + }; + // auction starter + await mine(daiGoldAuction.setAuctionStarter(teamGnosis)); + // auction config + await mine(daiGoldAuction.setAuctionConfig(auctionConfig)); +} + +// 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/localhost/templegold/deploy-anvil.sh b/protocol/scripts/deploys/localhost/templegold/deploy-anvil.sh new file mode 100755 index 000000000..b6efac7bb --- /dev/null +++ b/protocol/scripts/deploys/localhost/templegold/deploy-anvil.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +anvil --fork-url $ARBITRUM_ONE_RPC_URL + +npx hardhat --network localhost run scripts/deploys/localhost/templegold/01-localhost.ts diff --git a/protocol/slither.db.json b/protocol/slither.db.json index 6f0914d34..4d6608e85 100644 --- a/protocol/slither.db.json +++ b/protocol/slither.db.json @@ -1,4 +1,7395 @@ [ + { + "elements": [ + { + "type": "function", + "name": "_getMintAmount", + "source_mapping": { + "start": 11557, + "length": 895, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.sol", + "is_dependency": false, + "lines": [ + 259, + 260, + 261, + 262, + 263, + 264, + 265, + 266, + 267, + 268, + 269, + 270, + 271, + 272, + 273, + 274 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleGold", + "source_mapping": { + "start": 1881, + "length": 16298, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.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 + ], + "starting_column": 2, + "ending_column": 0 + } + }, + "signature": "_getMintAmount(ITempleGold.VestingFactor)" + } + }, + { + "type": "node", + "name": "_lastMintTimestamp == 0", + "source_mapping": { + "start": 11845, + "length": 23, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.sol", + "is_dependency": false, + "lines": [ + 262 + ], + "starting_column": 13, + "ending_column": 36 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "_getMintAmount", + "source_mapping": { + "start": 11557, + "length": 895, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.sol", + "is_dependency": false, + "lines": [ + 259, + 260, + 261, + 262, + 263, + 264, + 265, + 266, + 267, + 268, + 269, + 270, + 271, + 272, + 273, + 274 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleGold", + "source_mapping": { + "start": 1881, + "length": 16298, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.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 + ], + "starting_column": 2, + "ending_column": 0 + } + }, + "signature": "_getMintAmount(ITempleGold.VestingFactor)" + } + } + } + } + ], + "description": "TempleGold._getMintAmount(ITempleGold.VestingFactor) (contracts/templegold/TempleGold.sol#259-274) uses a dangerous strict equality:\n\t- _lastMintTimestamp == 0 (contracts/templegold/TempleGold.sol#262)\n", + "markdown": "[TempleGold._getMintAmount(ITempleGold.VestingFactor)](contracts/templegold/TempleGold.sol#L259-L274) uses a dangerous strict equality:\n\t- [_lastMintTimestamp == 0](contracts/templegold/TempleGold.sol#L262)\n", + "first_markdown_element": "contracts/templegold/TempleGold.sol#L259-L274", + "id": "d39879cfcca7dc263f292466e610d26e7126070fbe93772bb38b9883e930d1d3", + "check": "incorrect-equality", + "impact": "Medium", + "confidence": "High" + }, + { + "elements": [ + { + "type": "function", + "name": "_distribute", + "source_mapping": { + "start": 10447, + "length": 1104, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.sol", + "is_dependency": false, + "lines": [ + 236, + 237, + 238, + 239, + 240, + 241, + 242, + 243, + 244, + 245, + 246, + 247, + 248, + 249, + 250, + 251, + 252, + 253, + 254, + 255, + 256, + 257 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleGold", + "source_mapping": { + "start": 1881, + "length": 16298, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.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 + ], + "starting_column": 2, + "ending_column": 0 + } + }, + "signature": "_distribute(ITempleGold.DistributionParams,uint256)" + } + }, + { + "type": "node", + "name": "staking.notifyDistribution(stakingAmount)", + "source_mapping": { + "start": 10743, + "length": 41, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.sol", + "is_dependency": false, + "lines": [ + 240 + ], + "starting_column": 13, + "ending_column": 54 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "_distribute", + "source_mapping": { + "start": 10447, + "length": 1104, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.sol", + "is_dependency": false, + "lines": [ + 236, + 237, + 238, + 239, + 240, + 241, + 242, + 243, + 244, + 245, + 246, + 247, + 248, + 249, + 250, + 251, + 252, + 253, + 254, + 255, + 256, + 257 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleGold", + "source_mapping": { + "start": 1881, + "length": 16298, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.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 + ], + "starting_column": 2, + "ending_column": 0 + } + }, + "signature": "_distribute(ITempleGold.DistributionParams,uint256)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "daiGoldAuction.notifyDistribution(daiGoldAuctionAmount)", + "source_mapping": { + "start": 11042, + "length": 55, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.sol", + "is_dependency": false, + "lines": [ + 246 + ], + "starting_column": 13, + "ending_column": 68 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "_distribute", + "source_mapping": { + "start": 10447, + "length": 1104, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.sol", + "is_dependency": false, + "lines": [ + 236, + 237, + 238, + 239, + 240, + 241, + 242, + 243, + 244, + 245, + 246, + 247, + 248, + 249, + 250, + 251, + 252, + 253, + 254, + 255, + 256, + 257 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleGold", + "source_mapping": { + "start": 1881, + "length": 16298, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.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 + ], + "starting_column": 2, + "ending_column": 0 + } + }, + "signature": "_distribute(ITempleGold.DistributionParams,uint256)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "staking.notifyDistribution(stakingAmount)", + "source_mapping": { + "start": 10743, + "length": 41, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.sol", + "is_dependency": false, + "lines": [ + 240 + ], + "starting_column": 13, + "ending_column": 54 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "_distribute", + "source_mapping": { + "start": 10447, + "length": 1104, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.sol", + "is_dependency": false, + "lines": [ + 236, + 237, + 238, + 239, + 240, + 241, + 242, + 243, + 244, + 245, + 246, + 247, + 248, + 249, + 250, + 251, + 252, + 253, + 254, + 255, + 256, + 257 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleGold", + "source_mapping": { + "start": 1881, + "length": 16298, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.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 + ], + "starting_column": 2, + "ending_column": 0 + } + }, + "signature": "_distribute(ITempleGold.DistributionParams,uint256)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "daiGoldAuction.notifyDistribution(daiGoldAuctionAmount)", + "source_mapping": { + "start": 11042, + "length": 55, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.sol", + "is_dependency": false, + "lines": [ + 246 + ], + "starting_column": 13, + "ending_column": 68 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "_distribute", + "source_mapping": { + "start": 10447, + "length": 1104, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.sol", + "is_dependency": false, + "lines": [ + 236, + 237, + 238, + 239, + 240, + 241, + 242, + 243, + 244, + 245, + 246, + 247, + 248, + 249, + 250, + 251, + 252, + 253, + 254, + 255, + 256, + 257 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleGold", + "source_mapping": { + "start": 1881, + "length": 16298, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.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 + ], + "starting_column": 2, + "ending_column": 0 + } + }, + "signature": "_distribute(ITempleGold.DistributionParams,uint256)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "_circulatingSupply += mintAmount", + "source_mapping": { + "start": 11418, + "length": 32, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.sol", + "is_dependency": false, + "lines": [ + 255 + ], + "starting_column": 9, + "ending_column": 41 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "_distribute", + "source_mapping": { + "start": 10447, + "length": 1104, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.sol", + "is_dependency": false, + "lines": [ + 236, + 237, + 238, + 239, + 240, + 241, + 242, + 243, + 244, + 245, + 246, + 247, + 248, + 249, + 250, + 251, + 252, + 253, + 254, + 255, + 256, + 257 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleGold", + "source_mapping": { + "start": 1881, + "length": 16298, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.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 + ], + "starting_column": 2, + "ending_column": 0 + } + }, + "signature": "_distribute(ITempleGold.DistributionParams,uint256)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "_circulatingSupply" + } + }, + { + "type": "node", + "name": "_totalDistributed += mintAmount", + "source_mapping": { + "start": 11377, + "length": 31, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.sol", + "is_dependency": false, + "lines": [ + 254 + ], + "starting_column": 9, + "ending_column": 40 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "_distribute", + "source_mapping": { + "start": 10447, + "length": 1104, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.sol", + "is_dependency": false, + "lines": [ + 236, + 237, + 238, + 239, + 240, + 241, + 242, + 243, + 244, + 245, + 246, + 247, + 248, + 249, + 250, + 251, + 252, + 253, + 254, + 255, + 256, + 257 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleGold", + "source_mapping": { + "start": 1881, + "length": 16298, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.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 + ], + "starting_column": 2, + "ending_column": 0 + } + }, + "signature": "_distribute(ITempleGold.DistributionParams,uint256)" + } + } + }, + "additional_fields": { + "underlying_type": "variables_written", + "variable_name": "_totalDistributed" + } + } + ], + "description": "Reentrancy in TempleGold._distribute(ITempleGold.DistributionParams,uint256) (contracts/templegold/TempleGold.sol#236-257):\n\tExternal calls:\n\t- staking.notifyDistribution(stakingAmount) (contracts/templegold/TempleGold.sol#240)\n\t- daiGoldAuction.notifyDistribution(daiGoldAuctionAmount) (contracts/templegold/TempleGold.sol#246)\n\tState variables written after the call(s):\n\t- _circulatingSupply += mintAmount (contracts/templegold/TempleGold.sol#255)\n\t- _totalDistributed += mintAmount (contracts/templegold/TempleGold.sol#254)\n", + "markdown": "Reentrancy in [TempleGold._distribute(ITempleGold.DistributionParams,uint256)](contracts/templegold/TempleGold.sol#L236-L257):\n\tExternal calls:\n\t- [staking.notifyDistribution(stakingAmount)](contracts/templegold/TempleGold.sol#L240)\n\t- [daiGoldAuction.notifyDistribution(daiGoldAuctionAmount)](contracts/templegold/TempleGold.sol#L246)\n\tState variables written after the call(s):\n\t- [_circulatingSupply += mintAmount](contracts/templegold/TempleGold.sol#L255)\n\t- [_totalDistributed += mintAmount](contracts/templegold/TempleGold.sol#L254)\n", + "first_markdown_element": "contracts/templegold/TempleGold.sol#L236-L257", + "id": "979d6f840c4ae4abbc7f10c18f093de7e7a12c7524129a5eacc289cc76ddd5a3", + "check": "reentrancy-benign", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "setVestingFactor", + "source_mapping": { + "start": 6202, + "length": 449, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.sol", + "is_dependency": false, + "lines": [ + 131, + 132, + 133, + 134, + 135, + 136, + 137, + 138 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleGold", + "source_mapping": { + "start": 1881, + "length": 16298, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.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 + ], + "starting_column": 2, + "ending_column": 0 + } + }, + "signature": "setVestingFactor(ITempleGold.VestingFactor)" + } + }, + { + "type": "node", + "name": "mint()", + "source_mapping": { + "start": 6566, + "length": 6, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.sol", + "is_dependency": false, + "lines": [ + 136 + ], + "starting_column": 16, + "ending_column": 22 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "setVestingFactor", + "source_mapping": { + "start": 6202, + "length": 449, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.sol", + "is_dependency": false, + "lines": [ + 131, + 132, + 133, + 134, + 135, + 136, + 137, + 138 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleGold", + "source_mapping": { + "start": 1881, + "length": 16298, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.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 + ], + "starting_column": 2, + "ending_column": 0 + } + }, + "signature": "setVestingFactor(ITempleGold.VestingFactor)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls" + } + }, + { + "type": "node", + "name": "staking.notifyDistribution(stakingAmount)", + "source_mapping": { + "start": 10743, + "length": 41, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.sol", + "is_dependency": false, + "lines": [ + 240 + ], + "starting_column": 13, + "ending_column": 54 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "_distribute", + "source_mapping": { + "start": 10447, + "length": 1104, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.sol", + "is_dependency": false, + "lines": [ + 236, + 237, + 238, + 239, + 240, + 241, + 242, + 243, + 244, + 245, + 246, + 247, + 248, + 249, + 250, + 251, + 252, + 253, + 254, + 255, + 256, + 257 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleGold", + "source_mapping": { + "start": 1881, + "length": 16298, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.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 + ], + "starting_column": 2, + "ending_column": 0 + } + }, + "signature": "_distribute(ITempleGold.DistributionParams,uint256)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "daiGoldAuction.notifyDistribution(daiGoldAuctionAmount)", + "source_mapping": { + "start": 11042, + "length": 55, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.sol", + "is_dependency": false, + "lines": [ + 246 + ], + "starting_column": 13, + "ending_column": 68 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "_distribute", + "source_mapping": { + "start": 10447, + "length": 1104, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.sol", + "is_dependency": false, + "lines": [ + 236, + 237, + 238, + 239, + 240, + 241, + 242, + 243, + 244, + 245, + 246, + 247, + 248, + 249, + 250, + 251, + 252, + 253, + 254, + 255, + 256, + 257 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleGold", + "source_mapping": { + "start": 1881, + "length": 16298, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.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 + ], + "starting_column": 2, + "ending_column": 0 + } + }, + "signature": "_distribute(ITempleGold.DistributionParams,uint256)" + } + } + }, + "additional_fields": { + "underlying_type": "external_calls_sending_eth" + } + }, + { + "type": "node", + "name": "VestingFactorSet(_factor.value,_factor.weekMultiplier)", + "source_mapping": { + "start": 6584, + "length": 60, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.sol", + "is_dependency": false, + "lines": [ + 137 + ], + "starting_column": 9, + "ending_column": 69 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "setVestingFactor", + "source_mapping": { + "start": 6202, + "length": 449, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.sol", + "is_dependency": false, + "lines": [ + 131, + 132, + 133, + 134, + 135, + 136, + 137, + 138 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleGold", + "source_mapping": { + "start": 1881, + "length": 16298, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.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 + ], + "starting_column": 2, + "ending_column": 0 + } + }, + "signature": "setVestingFactor(ITempleGold.VestingFactor)" + } + } + }, + "additional_fields": { + "underlying_type": "event" + } + } + ], + "description": "Reentrancy in TempleGold.setVestingFactor(ITempleGold.VestingFactor) (contracts/templegold/TempleGold.sol#131-138):\n\tExternal calls:\n\t- mint() (contracts/templegold/TempleGold.sol#136)\n\t\t- staking.notifyDistribution(stakingAmount) (contracts/templegold/TempleGold.sol#240)\n\t\t- daiGoldAuction.notifyDistribution(daiGoldAuctionAmount) (contracts/templegold/TempleGold.sol#246)\n\tEvent emitted after the call(s):\n\t- VestingFactorSet(_factor.value,_factor.weekMultiplier) (contracts/templegold/TempleGold.sol#137)\n", + "markdown": "Reentrancy in [TempleGold.setVestingFactor(ITempleGold.VestingFactor)](contracts/templegold/TempleGold.sol#L131-L138):\n\tExternal calls:\n\t- [mint()](contracts/templegold/TempleGold.sol#L136)\n\t\t- [staking.notifyDistribution(stakingAmount)](contracts/templegold/TempleGold.sol#L240)\n\t\t- [daiGoldAuction.notifyDistribution(daiGoldAuctionAmount)](contracts/templegold/TempleGold.sol#L246)\n\tEvent emitted after the call(s):\n\t- [VestingFactorSet(_factor.value,_factor.weekMultiplier)](contracts/templegold/TempleGold.sol#L137)\n", + "first_markdown_element": "contracts/templegold/TempleGold.sol#L131-L138", + "id": "9783b27ff1afeb46e1f9e6c4e1717426aeb3e8d064ce8d4924e5933f5326d20d", + "check": "reentrancy-events", + "impact": "Low", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "_getMintAmount", + "source_mapping": { + "start": 11557, + "length": 895, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.sol", + "is_dependency": false, + "lines": [ + 259, + 260, + 261, + 262, + 263, + 264, + 265, + 266, + 267, + 268, + 269, + 270, + 271, + 272, + 273, + 274 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleGold", + "source_mapping": { + "start": 1881, + "length": 16298, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.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 + ], + "starting_column": 2, + "ending_column": 0 + } + }, + "signature": "_getMintAmount(ITempleGold.VestingFactor)" + } + }, + { + "type": "node", + "name": "_lastMintTimestamp == 0", + "source_mapping": { + "start": 11845, + "length": 23, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.sol", + "is_dependency": false, + "lines": [ + 262 + ], + "starting_column": 13, + "ending_column": 36 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "_getMintAmount", + "source_mapping": { + "start": 11557, + "length": 895, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.sol", + "is_dependency": false, + "lines": [ + 259, + 260, + 261, + 262, + 263, + 264, + 265, + 266, + 267, + 268, + 269, + 270, + 271, + 272, + 273, + 274 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleGold", + "source_mapping": { + "start": 1881, + "length": 16298, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.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 + ], + "starting_column": 2, + "ending_column": 0 + } + }, + "signature": "_getMintAmount(ITempleGold.VestingFactor)" + } + } + } + }, + { + "type": "node", + "name": "circulatingSupplyCache + mintAmount > MAX_CIRCULATING_SUPPLY", + "source_mapping": { + "start": 12257, + "length": 60, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.sol", + "is_dependency": false, + "lines": [ + 269 + ], + "starting_column": 13, + "ending_column": 73 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "_getMintAmount", + "source_mapping": { + "start": 11557, + "length": 895, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.sol", + "is_dependency": false, + "lines": [ + 259, + 260, + 261, + 262, + 263, + 264, + 265, + 266, + 267, + 268, + 269, + 270, + 271, + 272, + 273, + 274 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "TempleGold", + "source_mapping": { + "start": 1881, + "length": 16298, + "filename_relative": "contracts/templegold/TempleGold.sol", + "filename_absolute": "/Users/pb/code/delete_later/hawks_fix/temple/protocol/contracts/templegold/TempleGold.sol", + "filename_short": "contracts/templegold/TempleGold.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 + ], + "starting_column": 2, + "ending_column": 0 + } + }, + "signature": "_getMintAmount(ITempleGold.VestingFactor)" + } + } + } + } + ], + "description": "TempleGold._getMintAmount(ITempleGold.VestingFactor) (contracts/templegold/TempleGold.sol#259-274) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- _lastMintTimestamp == 0 (contracts/templegold/TempleGold.sol#262)\n\t- circulatingSupplyCache + mintAmount > MAX_CIRCULATING_SUPPLY (contracts/templegold/TempleGold.sol#269)\n", + "markdown": "[TempleGold._getMintAmount(ITempleGold.VestingFactor)](contracts/templegold/TempleGold.sol#L259-L274) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [_lastMintTimestamp == 0](contracts/templegold/TempleGold.sol#L262)\n\t- [circulatingSupplyCache + mintAmount > MAX_CIRCULATING_SUPPLY](contracts/templegold/TempleGold.sol#L269)\n", + "first_markdown_element": "contracts/templegold/TempleGold.sol#L259-L274", + "id": "48aa8084dbb411d6e790f65366cf669856bd3c50453587995695cf1abcaac5ca", + "check": "timestamp", + "impact": "Low", + "confidence": "Medium" + }, { "elements": [ { diff --git a/protocol/test/forge/templegold/TempleGoldAdmin.t.sol b/protocol/test/forge/templegold/TempleGoldAdmin.t.sol index 132be9188..25f74f016 100644 --- a/protocol/test/forge/templegold/TempleGoldAdmin.t.sol +++ b/protocol/test/forge/templegold/TempleGoldAdmin.t.sol @@ -3,7 +3,6 @@ pragma solidity 0.8.20; // (tests/forge/templegold/TempleGoldAdmin.t.sol) -import { TempleGoldCommon } from "./TempleGoldCommon.t.sol"; import { TempleGoldCommon } from "./TempleGoldCommon.t.sol"; import { DaiGoldAuction } from "contracts/templegold/DaiGoldAuction.sol"; import { TempleGold } from "contracts/templegold/TempleGold.sol";